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
5
! This file is part of Code_Saturne, a general-purpose CFD tool.
7
! Copyright (C) 1998-2011 EDF S.A.
9
! This program is free software; you can redistribute it and/or modify it under
10
! the terms of the GNU General Public License as published by the Free Software
11
! Foundation; either version 2 of the License, or (at your option) any later
14
! This program is distributed in the hope that it will be useful, but WITHOUT
15
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19
! You should have received a copy of the GNU General Public License along with
20
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
21
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
23
!-------------------------------------------------------------------------------
31
25
subroutine usatcl &
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
29
icodcl , itrifb , itypfb , izfppp , &
42
idevel , ituser , ia , &
43
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
44
30
dt , rtp , rtpa , propce , propfa , propfb , &
45
coefa , coefb , rcodcl , &
46
w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
47
rdevel , rtuser , ra )
31
coefa , coefb , rcodcl )
49
33
!===============================================================================
81
65
!__________________.____._____.________________________________________________.
82
66
! name !type!mode ! role !
83
67
!__________________!____!_____!________________________________________________!
84
! idbia0 ! i ! <-- ! number of first free position in ia !
85
! idbra0 ! i ! <-- ! number of first free position in ra !
86
! ndim ! i ! <-- ! spatial dimension !
87
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
88
! ncel ! i ! <-- ! number of cells !
89
! nfac ! i ! <-- ! number of interior faces !
90
! nfabor ! i ! <-- ! number of boundary faces !
91
! nfml ! i ! <-- ! number of families (group classes) !
92
! nprfml ! i ! <-- ! number of properties per family (group class) !
93
! nnod ! i ! <-- ! number of vertices !
94
! lndfac ! i ! <-- ! size of nodfac indexed array !
95
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
96
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
97
68
! nvar ! i ! <-- ! total number of variables !
98
69
! nscal ! i ! <-- ! total number of scalars !
99
! nphas ! i ! <-- ! number of phases !
100
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
101
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
102
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
103
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
104
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
105
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
106
! iprfml ! ia ! <-- ! property numbers per family !
107
! (nfml, nprfml) ! ! ! !
108
! maxelt ! i ! <-- ! max number of cells and faces (int/boundary) !
109
! lstelt(maxelt) ! ia ! --- ! work array !
110
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
111
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
112
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
113
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
114
70
! icodcl ! ia ! --> ! boundary condition code !
115
71
! (nfabor, nvar) ! ! ! = 1 -> Dirichlet !
116
72
! ! ! ! = 2 -> flux density !
120
76
! ! ! ! = 9 -> free inlet/outlet (velocity) !
121
77
! ! ! ! inflowing possibly blocked !
122
78
! itrifb ! ia ! <-- ! indirection for boundary faces ordering !
123
! (nfabor, nphas) ! ! ! !
124
79
! itypfb ! ia ! --> ! boundary face types !
125
! (nfabor, nphas) ! ! ! !
126
80
! izfppp(nfabor) ! te ! --> ! boundary face zone number !
127
! idevel(nideve) ! ia ! <-> ! integer work array for temporary development !
128
! ituser(nituse) ! ia ! <-> ! user-reserved integer work array !
129
! ia(*) ! ia ! --- ! main integer work array !
130
! xyzcen ! ra ! <-- ! cell centers !
131
! (ndim, ncelet) ! ! ! !
132
! surfac ! ra ! <-- ! interior faces surface vectors !
133
! (ndim, nfac) ! ! ! !
134
! surfbo ! ra ! <-- ! boundary faces surface vectors !
135
! (ndim, nfabor) ! ! ! !
136
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
137
! (ndim, nfac) ! ! ! !
138
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
139
! (ndim, nfabor) ! ! ! !
140
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
141
! (ndim, nnod) ! ! ! !
142
! volume(ncelet) ! ra ! <-- ! cell volumes !
143
81
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
144
82
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
145
83
! (ncelet, *) ! ! ! (at current and previous time steps) !
158
96
! ! ! ! for velocities ( vistl+visct)*gradu !
159
97
! ! ! ! for pressure dt*gradp !
160
98
! ! ! ! for scalars cp*(viscls+visct/sigmas)*gradt !
161
! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
162
! (ncelet) ! ! ! (computation of pressure gradient) !
163
! coefu ! ra ! --- ! work array !
164
! (nfabor, 3) ! ! ! (computation of pressure gradient) !
165
! rdevel(nrdeve) ! ra ! <-> ! real work array for temporary development !
166
! rtuser(nrtuse) ! ra ! <-> ! user-reserved real work array !
167
! ra(*) ! ra ! --- ! main real work array !
168
99
!__________________!____!_____!________________________________________________!
170
101
! Type: i (integer), r (real), s (string), a (array), l (logical),
172
103
! mode: <-- input, --> output, <-> modifies data, --- work array
173
104
!===============================================================================
106
!===============================================================================
108
!===============================================================================
123
!===============================================================================
177
!===============================================================================
179
!===============================================================================
194
!===============================================================================
198
integer idbia0 , idbra0
199
integer ndim , ncelet , ncel , nfac , nfabor
200
integer nfml , nprfml
201
integer nnod , lndfac , lndfbr , ncelbr
202
integer nvar , nscal , nphas
203
integer nideve , nrdeve , nituse , nrtuse
205
integer ifacel(2,nfac) , ifabor(nfabor)
206
integer ifmfbr(nfabor) , ifmcel(ncelet)
207
integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
208
integer ipnfac(nfac+1), nodfac(lndfac)
209
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
210
131
integer icodcl(nfabor,nvar)
211
integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
132
integer itrifb(nfabor), itypfb(nfabor)
212
133
integer izfppp(nfabor)
213
integer idevel(nideve), ituser(nituse), ia(*)
215
double precision xyzcen(ndim,ncelet)
216
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
217
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
218
double precision xyznod(ndim,nnod), volume(ncelet)
219
135
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
220
136
double precision propce(ncelet,*)
221
137
double precision propfa(nfac,*), propfb(nfabor,*)
222
138
double precision coefa(nfabor,*), coefb(nfabor,*)
223
139
double precision rcodcl(nfabor,nvar,3)
224
double precision w1(ncelet),w2(ncelet),w3(ncelet)
225
double precision w4(ncelet),w5(ncelet),w6(ncelet)
226
double precision coefu(nfabor,ndim)
227
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
229
141
! Local variables
231
integer idebia, idebra
232
integer ifac, iel, ii, ivar, iphas
143
integer ifac, iel, ii, ivar
234
145
integer ilelt, nlelt
235
146
double precision uref2, d2s3
377
288
xkent=ustar**2/sqrt(cmu)
378
289
xeent=ustar**3/xkappa/(zent+rugd)
382
itypfb(ifac,iphas) = ientre
384
rcodcl(ifac,iu(iphas),1) = xuent
385
rcodcl(ifac,iv(iphas),1) = xvent
386
rcodcl(ifac,iw(iphas),1) = 0.d0
388
! itytur is a flag equal to iturb/10
389
if (itytur(iphas).eq.2) then
391
rcodcl(ifac,ik(iphas),1) = xkent
392
rcodcl(ifac,iep(iphas),1) = xeent
394
elseif(itytur(iphas).eq.3) then
396
rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
397
rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
398
rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
399
rcodcl(ifac,ir12(iphas),1) = 0.d0
400
rcodcl(ifac,ir13(iphas),1) = 0.d0
401
rcodcl(ifac,ir23(iphas),1) = 0.d0
402
rcodcl(ifac,iep(iphas),1) = xeent
404
elseif(iturb(iphas).eq.50) then
406
rcodcl(ifac,ik(iphas),1) = xkent
407
rcodcl(ifac,iep(iphas),1) = xeent
408
rcodcl(ifac,iphi(iphas),1) = d2s3
409
rcodcl(ifac,ifb(iphas),1) = 0.d0
411
elseif(iturb(iphas).eq.60) then
413
rcodcl(ifac,ik(iphas),1) = xkent
414
rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
291
itypfb(ifac) = ientre
293
rcodcl(ifac,iu,1) = xuent
294
rcodcl(ifac,iv,1) = xvent
295
rcodcl(ifac,iw,1) = 0.d0
297
! itytur is a flag equal to iturb/10
298
if (itytur.eq.2) then
300
rcodcl(ifac,ik,1) = xkent
301
rcodcl(ifac,iep,1) = xeent
303
elseif(itytur.eq.3) then
305
rcodcl(ifac,ir11,1) = d2s3*xkent
306
rcodcl(ifac,ir22,1) = d2s3*xkent
307
rcodcl(ifac,ir33,1) = d2s3*xkent
308
rcodcl(ifac,ir12,1) = 0.d0
309
rcodcl(ifac,ir13,1) = 0.d0
310
rcodcl(ifac,ir23,1) = 0.d0
311
rcodcl(ifac,iep,1) = xeent
313
elseif(iturb.eq.50) then
315
rcodcl(ifac,ik,1) = xkent
316
rcodcl(ifac,iep,1) = xeent
317
rcodcl(ifac,iphi,1) = d2s3
318
rcodcl(ifac,ifb,1) = 0.d0
320
elseif(iturb.eq.60) then
322
rcodcl(ifac,ik,1) = xkent
323
rcodcl(ifac,iomg,1) = xeent/cmu/xkent
325
elseif(iturb.eq.70) then
327
rcodcl(ifac,inusa,1) = cmu*xkent**2/xeent
461
370
! - Zone to which the zone belongs
462
371
izfppp(ifac) = izone
465
itypfb(ifac,iphas) = iparug
467
! Roughness for velocity: rugd
468
rcodcl(ifac,iu(iphas),3) = rugd
470
! Roughness for scalars (if required):
471
! rcodcl(ifac,iv(iphas),3) = rugd
474
if(iscalt(iphas).ne.-1) then
373
itypfb(ifac) = iparug
375
! Roughness for velocity: rugd
376
rcodcl(ifac,iu,3) = rugd
378
! Roughness for scalars (if required):
379
! rcodcl(ifac,iv,3) = rugd
382
if(iscalt.ne.-1) then
476
384
! If temperature prescribed to 20 with a rough wall law (scalar ii=1)
477
! (with thermal roughness specified in rcodcl(ifac,iv(iphas),3)) :
385
! (with thermal roughness specified in rcodcl(ifac,iv,3)) :
479
387
! icodcl(ifac, isca(ii)) = 6
480
388
! rcodcl(ifac, isca(ii),1) = 293.15d0