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 uscpiv &
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 )
29
dt , rtp , propce , propfa , propfb , coefa , coefb )
46
31
!===============================================================================
50
35
! Initialisation of transported variables for extended physics :
139
124
!__________________.____._____.________________________________________________.
140
125
! name !type!mode ! role !
141
126
!__________________!____!_____!________________________________________________!
142
! idbia0 ! i ! <-- ! number of first free position in ia !
143
! idbra0 ! i ! <-- ! number of first free position in ra !
144
! ndim ! i ! <-- ! spatial dimension !
145
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
146
! ncel ! i ! <-- ! number of cells !
147
! nfac ! i ! <-- ! number of interior faces !
148
! nfabor ! i ! <-- ! number of boundary faces !
149
! nfml ! i ! <-- ! number of families (group classes) !
150
! nprfml ! i ! <-- ! number of properties per family (group class) !
151
! nnod ! i ! <-- ! number of vertices !
152
! lndfac ! i ! <-- ! size of nodfac indexed array !
153
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
154
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
155
127
! nvar ! i ! <-- ! total number of variables !
156
128
! nscal ! i ! <-- ! total number of scalars !
157
! nphas ! i ! <-- ! number of phases !
158
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
159
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
160
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
161
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
162
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
163
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
164
! iprfml ! ia ! <-- ! property numbers per family !
165
! (nfml, nprfml) ! ! ! !
166
! maxelt ! e ! <-- ! max number of cells and faces (int/boundary) !
167
! lstelt(maxelt) ! ia ! --- ! work array !
168
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
169
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
170
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
171
! nodfac(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
172
129
! icodcl ! ia ! --> ! boundary condition code !
173
130
! (nfabor, nvar) ! ! ! = 1 -> Dirichlet !
174
131
! ! ! ! = 2 -> flux density !
178
135
! ! ! ! = 9 -> free inlet/outlet (velocity) !
179
136
! ! ! ! inflowing possibly blocked !
180
137
! itrifb(nfabor ! ia ! <-- ! indirection for boundary faces ordering) !
181
! (nfabor, nphas) ! ! ! !
182
138
! itypfb ! ia ! --> ! boundary face types !
183
! (nfabor, nphas) ! ! ! !
184
! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
185
! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
186
! ia(*) ! ia ! --- ! main integer work array !
187
! xyzcen ! ra ! <-- ! cell centers !
188
! (ndim, ncelet) ! ! ! !
189
! surfac ! ra ! <-- ! interior faces surface vectors !
190
! (ndim, nfac) ! ! ! !
191
! surfbo ! ra ! <-- ! boundary faces surface vectors !
192
! (ndim, nfavor) ! ! ! !
193
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
194
! (ndim, nfac) ! ! ! !
195
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
196
! (ndim, nfabor) ! ! ! !
197
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
198
! (ndim, nnod) ! ! ! !
199
! volume(ncelet) ! ra ! <-- ! cell volumes !
200
139
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
201
140
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
202
141
! (ncelet, *) ! ! ! (at current and preceding time steps) !
215
154
! ! ! ! for velocities ( vistl+visct)*gradu !
216
155
! ! ! ! for pressure dt*gradp !
217
156
! ! ! ! for scalars cp*(viscls+visct/sigmas)*gradt !
218
! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
219
! (ncelet) ! ! ! (computation of pressure gradient) !
220
! coefu ! ra ! --- ! tab de trav !
221
! (nfabor, 3) ! ! ! (computation of pressure gradient) !
222
! rdevel(nrdeve) ! ra ! <-> ! tab reel complementaire developemt !
223
! rdevel(nideve) ! ra ! <-- ! real work array for temporary developpement !
224
! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
225
! ra(*) ! ra ! --- ! main real work array !
226
157
!__________________!____!_____!________________________________________________!
228
159
! Type: i (integer), r (real), s (string), a (array), l (logical),
230
161
! mode: <-- input, --> output, <-> modifies data, --- work array
231
162
!===============================================================================
164
!===============================================================================
166
!===============================================================================
185
!===============================================================================
235
!===============================================================================
237
!===============================================================================
255
!===============================================================================
257
integer idbia0 , idbra0
258
integer ndim , ncelet , ncel , nfac , nfabor
259
integer nfml , nprfml
260
integer nnod , lndfac , lndfbr , ncelbr
261
integer nvar , nscal , nphas
262
integer nideve , nrdeve , nituse , nrtuse
264
integer ifacel(2,nfac) , ifabor(nfabor)
265
integer ifmfbr(nfabor) , ifmcel(ncelet)
266
integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
267
integer ipnfac(nfac+1), nodfac(lndfac)
268
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
269
integer idevel(nideve), ituser(nituse), ia(*)
271
double precision xyzcen(ndim,ncelet)
272
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
273
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
274
double precision xyznod(ndim,nnod), volume(ncelet)
275
191
double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
276
192
double precision propfa(nfac,*), propfb(nfabor,*)
277
193
double precision coefa(nfabor,*), coefb(nfabor,*)
278
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
281
195
! VARIABLES LOCALES
283
integer idebia, idebra
284
integer iel, ige, mode, icla, icha, iphas
197
integer iel, ige, mode, icla, icha
287
200
double precision t1init, h1init, coefe(ngazem)
333
247
! ---- TURBULENCE
335
if (itytur(iphas).eq.2) then
338
rtp(iel,ik(iphas)) = xkent
339
rtp(iel,iep(iphas)) = xeent
342
elseif (itytur(iphas).eq.3) then
345
rtp(iel,ir11(iphas)) = d2s3*xkent
346
rtp(iel,ir22(iphas)) = d2s3*xkent
347
rtp(iel,ir33(iphas)) = d2s3*xkent
348
rtp(iel,ir12(iphas)) = 0.d0
349
rtp(iel,ir13(iphas)) = 0.d0
350
rtp(iel,ir23(iphas)) = 0.d0
351
rtp(iel,iep(iphas)) = xeent
354
elseif (iturb(iphas).eq.50) then
357
rtp(iel,ik(iphas)) = xkent
358
rtp(iel,iep(iphas)) = xeent
359
rtp(iel,iphi(iphas)) = d2s3
360
rtp(iel,ifb(iphas)) = 0.d0
363
elseif (iturb(iphas).eq.60) then
366
rtp(iel,ik(iphas)) = xkent
367
rtp(iel,iomg(iphas)) = xeent/cmu/xkent
249
if (itytur.eq.2) then
256
elseif (itytur.eq.3) then
259
rtp(iel,ir11) = d2s3*xkent
260
rtp(iel,ir22) = d2s3*xkent
261
rtp(iel,ir33) = d2s3*xkent
268
elseif (iturb.eq.50) then
277
elseif (iturb.eq.60) then
281
rtp(iel,iomg) = xeent/cmu/xkent
284
elseif (iturb.eq.70) then
287
rtp(iel,inusa) = cmu*xkent**2/xeent