1
!-------------------------------------------------------------------------------
6
! This file is part of the Code_Saturne Kernel, element of the
7
! Code_Saturne CFD tool.
9
! Copyright (C) 1998-2009 EDF S.A., France
11
! contact: saturne-support@edf.fr
13
! The Code_Saturne Kernel is free software; you can redistribute it
14
! and/or modify it under the terms of the GNU General Public License
15
! as published by the Free Software Foundation; either version 2 of
16
! the License, or (at your option) any later version.
18
! The Code_Saturne Kernel is distributed in the hope that it will be
19
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
! GNU General Public License for more details.
23
! You should have received a copy of the GNU General Public License
24
! along with the Code_Saturne Kernel; if not, write to the
25
! Free Software Foundation, Inc.,
26
! 51 Franklin St, Fifth Floor,
27
! Boston, MA 02110-1301 USA
29
!-------------------------------------------------------------------------------
35
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
36
nnod , lndfac , lndfbr , ncelbr , &
37
nvar , nscal , nphas , &
38
nideve , nrdeve , nituse , nrtuse , &
39
ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
40
ipnfac , nodfac , ipnfbr , nodfbr , &
41
idevel , ituser , ia , &
42
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
43
dt , rtp , propce , propfa , propfb , coefa , coefb , &
44
rdevel , rtuser , ra )
46
!===============================================================================
50
! INITIALISATION OF TRANSPORTED VARIABLES
51
! EXTENDED PHYSICS : Heavy Fuel Oil Combustion
54
! This routine is called at the beginning of every computation
55
! (new or continuation) before the time loop
57
! This routine initialize or modify (if continuation)
58
! values of transported variables and of the time step
60
! The exemple is ... default value
63
! Physical properties are stored in PROPCE(cell center)
64
! PROPFA(inner face) and PROPFB(boundary face)
66
! PROPCE(IEL, IPPROC(IROM (IPHAS))) is ROM(IEL,IPHAS) mean density kg/m3
67
! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) is FLUMAS(IFAC,IVAR) convective flux
69
! PROPFB(...... .................................
71
! Physical properties (ROM, VISCL, CP ...) are computed in PPPHYV
72
! not to be modified here
75
! All cells can be identified by using the subroutine 'getcel'.
77
! getcel(string, nelts, eltlst) :
78
! - string is a user-supplied character string containing
80
! - nelts is set by the subroutine. It is an integer value
81
! corresponding to the number of boundary faces verifying the
83
! - lstelt is set by the subroutine. It is an integer array of
84
! size nelts containing the list of boundary faces verifying
85
! the selection criteria.
88
! - references to colors (ex.: 1, 8, 26, ...
89
! - references to groups (ex.: inlet, group1, ...)
90
! - geometric criteria (ex. x < 0.1, y >= 0.25, ...)
92
! These criteria may be combined using logical operators
93
! ('and', 'or') and parentheses.
94
! Example: '1 and (group2 or group3) and y < 1' will select boundary
95
! faces of color 1, belonging to groups 'group2' or 'group3' and
96
! with face center coordinate y less than 1.
98
! All boundary faces may be identified using the 'getfbr' subroutine.
100
! getfbr(string, nelts, eltlst) :
101
! - string is a user-supplied character string containing
102
! selection criteria;
103
! - nelts is set by the subroutine. It is an integer value
104
! corresponding to the number of boundary faces verifying the
105
! selection criteria;
106
! - lstelt is set by the subroutine. It is an integer array of
107
! size nelts containing the list of boundary faces verifying
108
! the selection criteria.
110
! string may contain:
111
! - references to colors (ex.: 1, 8, 26, ...
112
! - references to groups (ex.: inlet, group1, ...)
113
! - geometric criteria (ex. x < 0.1, y >= 0.25, ...)
115
! These criteria may be combined using logical operators
116
! ('and', 'or') and parentheses.
118
! All internam faces may be identified using the 'getfac' subroutine.
120
! getfac(string, nelts, eltlst) :
121
! - string is a user-supplied character string containing
122
! selection criteria;
123
! - nelts is set by the subroutine. It is an integer value
124
! corresponding to the number of boundary faces verifying the
125
! selection criteria;
126
! - lstelt is set by the subroutine. It is an integer array of
127
! size nelts containing the list of boundary faces verifying
128
! the selection criteria.
130
! string may contain:
131
! - references to colors (ex.: 1, 8, 26, ...
132
! - references to groups (ex.: inlet, group1, ...)
133
! - geometric criteria (ex. x < 0.1, y >= 0.25, ...)
135
! These criteria may be combined using logical operators
136
! ('and', 'or') and parentheses.
138
!-------------------------------------------------------------------------------
140
!__________________.____._____.________________________________________________.
141
! name !type!mode ! role !
142
!__________________!____!_____!________________________________________________!
143
! idbia0 ! i ! <-- ! number of first free position in ia !
144
! idbra0 ! i ! <-- ! number of first free position in ra !
145
! ndim ! i ! <-- ! spatial dimension !
146
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
147
! ncel ! i ! <-- ! number of cells !
148
! nfac ! i ! <-- ! number of interior faces !
149
! nfabor ! i ! <-- ! number of boundary faces !
150
! nfml ! i ! <-- ! number of families (group classes) !
151
! nprfml ! i ! <-- ! number of properties per family (group class) !
152
! nnod ! i ! <-- ! number of vertices !
153
! lndfac ! i ! <-- ! size of nodfac indexed array !
154
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
155
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
156
! nvar ! i ! <-- ! total number of variables !
157
! nscal ! i ! <-- ! total number of scalars !
158
! nphas ! i ! <-- ! number of phases !
159
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
160
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
161
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
162
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
163
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
164
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
165
! iprfml ! ia ! <-- ! property numbers per family !
166
! (nfml, nprfml) ! ! ! !
167
! maxelt ! e ! <-- ! max number of cells and faces (int/boundary) !
168
! lstelt(maxelt) ! ia ! --- ! work array !
169
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
170
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
171
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
172
! nodfac(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
173
! icodcl ! ia ! --> ! boundary condition code !
174
! (nfabor, nvar) ! ! ! = 1 -> Dirichlet !
175
! ! ! ! = 2 -> flux density !
176
! ! ! ! = 4 -> sliding wall and u.n=0 (velocity) !
177
! ! ! ! = 5 -> friction and u.n=0 (velocity) !
178
! ! ! ! = 6 -> roughness and u.n=0 (velocity) !
179
! ! ! ! = 9 -> free inlet/outlet (velocity) !
180
! ! ! ! inflowing possibly blocked !
181
! itrifb(nfabor ! ia ! <-- ! indirection for boundary faces ordering) !
182
! (nfabor, nphas) ! ! ! !
183
! itypfb ! ia ! --> ! boundary face types !
184
! (nfabor, nphas) ! ! ! !
185
! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
186
! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
187
! ia(*) ! ia ! --- ! main integer work array !
188
! xyzcen ! ra ! <-- ! cell centers !
189
! (ndim, ncelet) ! ! ! !
190
! surfac ! ra ! <-- ! interior faces surface vectors !
191
! (ndim, nfac) ! ! ! !
192
! surfbo ! ra ! <-- ! boundary faces surface vectors !
193
! (ndim, nfavor) ! ! ! !
194
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
195
! (ndim, nfac) ! ! ! !
196
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
197
! (ndim, nfabor) ! ! ! !
198
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
199
! (ndim, nnod) ! ! ! !
200
! volume(ncelet) ! ra ! <-- ! cell volumes !
201
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
202
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
203
! (ncelet, *) ! ! ! (at current and preceding time steps) !
204
! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
205
! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
206
! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
207
! coefa, coefb ! ra ! <-- ! boundary conditions !
208
! (nfabor, *) ! ! ! !
209
! rcodcl ! ra ! --> ! boundary condition values !
210
! ! ! ! rcodcl(1) = Dirichlet value !
211
! ! ! ! rcodcl(2) = exterior exchange coefficient !
212
! ! ! ! (infinite if no exchange) !
213
! ! ! ! rcodcl(3) = flux density value !
214
! ! ! ! (negative for gain) in w/m2 or !
215
! ! ! ! roughness height (m) if icodcl=6 !
216
! ! ! ! for velocities ( vistl+visct)*gradu !
217
! ! ! ! for pressure dt*gradp !
218
! ! ! ! for scalars cp*(viscls+visct/sigmas)*gradt !
219
! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
220
! (ncelet) ! ! ! (computation of pressure gradient) !
221
! coefu ! ra ! --- ! tab de trav !
222
! (nfabor, 3) ! ! ! (computation of pressure gradient) !
223
! rdevel(nrdeve) ! ra ! <-> ! tab reel complementaire developemt !
224
! rdevel(nideve) ! ra ! <-- ! real work array for temporary developpement !
225
! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
226
! ra(*) ! ra ! --- ! main real work array !
227
!__________________!____!_____!________________________________________________!
229
! Type: i (integer), r (real), s (string), a (array), l (logical),
230
! and composite types (ex: ra real array)
231
! mode: <-- input, --> output, <-> modifies data, --- work array
232
!===============================================================================
236
!===============================================================================
238
!===============================================================================
257
!===============================================================================
259
integer idbia0 , idbra0
260
integer ndim , ncelet , ncel , nfac , nfabor
261
integer nfml , nprfml
262
integer nnod , lndfac , lndfbr , ncelbr
263
integer nvar , nscal , nphas
264
integer nideve , nrdeve , nituse , nrtuse
266
integer ifacel(2,nfac) , ifabor(nfabor)
267
integer ifmfbr(nfabor) , ifmcel(ncelet)
268
integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
269
integer ipnfac(nfac+1), nodfac(lndfac)
270
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
271
integer idevel(nideve), ituser(nituse), ia(*)
273
double precision xyzcen(ndim,ncelet)
274
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
275
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
276
double precision xyznod(ndim,nnod), volume(ncelet)
277
double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
278
double precision propfa(nfac,*), propfb(nfabor,*)
279
double precision coefa(nfabor,*), coefb(nfabor,*)
280
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
285
integer idebia, idebra
286
integer iel, ige, mode, iphas, icla
288
double precision t1init, h1init, coefe(ngazem)
289
double precision t2init, h2init
290
double precision xkent, xeent, d2s3
292
!===============================================================================
295
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
296
!===============================================================================
300
!===============================================================================
301
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
303
!===============================================================================
305
!===============================================================================
309
!===============================================================================
310
! 1. LOCAL VARIABLES INITIALISATION
311
!===============================================================================
318
!===============================================================================
319
! 2. INITIALISATION OF TRANSPORTED VARIABLES
320
! RONLY IF THE COMPUTATION IS NOT A CONTINUATION
321
!===============================================================================
323
if ( isuite.eq.0 ) then
327
! --> Initialisation of k and epsilon (exemple)
334
if (itytur(iphas).eq.2) then
337
rtp(iel,ik(iphas)) = xkent
338
rtp(iel,iep(iphas)) = xeent
341
elseif (itytur(iphas).eq.3) then
344
rtp(iel,ir11(iphas)) = d2s3*xkent
345
rtp(iel,ir22(iphas)) = d2s3*xkent
346
rtp(iel,ir33(iphas)) = d2s3*xkent
347
rtp(iel,ir12(iphas)) = 0.d0
348
rtp(iel,ir13(iphas)) = 0.d0
349
rtp(iel,ir23(iphas)) = 0.d0
350
rtp(iel,iep(iphas)) = xeent
353
elseif (iturb(iphas).eq.50) then
356
rtp(iel,ik(iphas)) = xkent
357
rtp(iel,iep(iphas)) = xeent
358
rtp(iel,iphi(iphas)) = d2s3
359
rtp(iel,ifb(iphas)) = 0.d0
362
elseif (iturb(iphas).eq.60) then
365
rtp(iel,ik(iphas)) = xkent
366
rtp(iel,iomg(iphas)) = xeent/cmu/xkent
371
! --> All the computation domain is initialised with air at TINITK
372
! ================================================
374
! ---- Computation of H1INIT and H2INIT
379
! ------ Transported variables for droplets
381
h2init = h02fol + cp2fol*(t2init-trefth)
385
rtp(iel,isca(iyfol(icla))) = zero
386
rtp(iel,isca(ing(icla) )) = zero
387
rtp(iel,isca(ihlf(icla))) = h2init
391
! ------ Transported variables for the mix (droplets and carrying gases)
396
coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
397
coefe(in2) = 1.d0 - coefe(io2)
401
( mode , h1init , coefe , t1init )
404
rtp(iel,isca(ihm)) = h1init
407
! ------ Transported variables for gaseous mixture
408
! (passive scalars, variance, reactive species)
411
rtp(iel,isca(ifvap )) = zero
412
rtp(iel,isca(ifhtf )) = zero
413
rtp(iel,isca(if4p2m)) = zero
414
if ( ieqco2 .ge. 1 ) then
415
rtp(iel,isca(iyco2)) = zero
417
if ( ieqnox .eq. 1 ) then
418
rtp(iel,isca(iyhcn)) = zero
419
rtp(iel,isca(iyno )) = zero
420
rtp(iel,isca(itaire)) = 20.d0+tkelvi
433
' usfuiv : Variables Initialisation for FUel by the USer ',/,&