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 ustsv2 &
35
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
36
nnod , lndfac , lndfbr , ncelbr , &
37
nvar , nscal , nphas , ncepdp , ncesmp , &
38
nideve , nrdeve , nituse , nrtuse , &
40
ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
41
ipnfac , nodfac , ipnfbr , nodfbr , &
28
( nvar , nscal , ncepdp , ncesmp , &
42
30
icepdc , icetsm , itypsm , &
43
idevel , ituser , ia , &
44
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
45
31
dt , rtpa , propce , propfa , propfb , &
46
32
coefa , coefb , ckupdc , smacel , produc , gphigk , &
48
viscf , viscb , xam , &
49
w1 , w2 , w3 , w4 , w5 , w6 , &
50
w7 , w8 , w9 , w10 , w11 , &
51
rdevel , rtuser , ra )
53
35
!===============================================================================
117
99
!__________________.____._____.________________________________________________.
118
100
! name !type!mode ! role !
119
101
!__________________!____!_____!________________________________________________!
120
! idbia0 ! i ! <-- ! number of first free position in ia !
121
! idbra0 ! i ! <-- ! number of first free position in ra !
122
! ndim ! i ! <-- ! spatial dimension !
123
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
124
! ncel ! i ! <-- ! number of cells !
125
! nfac ! i ! <-- ! number of interior faces !
126
! nfabor ! i ! <-- ! number of boundary faces !
127
! nfml ! i ! <-- ! number of families (group classes) !
128
! nprfml ! i ! <-- ! number of properties per family (group class) !
129
! nnod ! i ! <-- ! number of vertices !
130
! lndfac ! i ! <-- ! size of nodfac indexed array !
131
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
132
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
133
102
! nvar ! i ! <-- ! total number of variables !
134
103
! nscal ! i ! <-- ! total number of scalars !
135
! nphas ! i ! <-- ! number of phases !
136
104
! ncepdp ! i ! <-- ! number of cells with head loss terms !
137
105
! ncssmp ! i ! <-- ! number of cells with mass source terms !
138
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
139
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
140
! iphas ! i ! <-- ! index number of the current phase !
141
106
! ivar ! i ! <-- ! index number of the current variable !
142
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
143
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
144
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
145
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
146
! iprfml ! ia ! <-- ! property numbers per family !
147
! (nfml, nprfml) ! ! ! !
148
! maxelt ! i ! <-- ! max number of cells and faces (int/boundary) !
149
! lstelt(maxelt) ! ia ! --- ! work array !
150
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
151
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
152
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
153
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
154
107
! icepdc(ncepdp) ! ia ! <-- ! index number of cells with head loss terms !
155
108
! icetsm(ncesmp) ! ia ! <-- ! index number of cells with mass source terms !
156
109
! itypsm ! ia ! <-- ! type of mass source term for each variable !
157
110
! (ncesmp,nvar) ! ! ! (see ustsma) !
158
! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
159
! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
160
! ia(*) ! ia ! --- ! main integer work array !
161
! xyzcen ! ra ! <-- ! cell centers !
162
! (ndim, ncelet) ! ! ! !
163
! surfac ! ra ! <-- ! interior faces surface vectors !
164
! (ndim, nfac) ! ! ! !
165
! surfbo ! ra ! <-- ! boundary faces surface vectors !
166
! (ndim, nfavor) ! ! ! !
167
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
168
! (ndim, nfac) ! ! ! !
169
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
170
! (ndim, nfabor) ! ! ! !
171
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
172
! (ndim, nnod) ! ! ! !
173
! volume(ncelet) ! ra ! <-- ! cell volumes !
174
111
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
175
112
! rtpa ! ra ! <-- ! calculated variables at cell centers !
176
113
! (ncelet, *) ! ! ! (preceding time steps) !
186
123
! gphigk(ncelet) ! ra ! <-- ! grad(phi).grad(k) !
187
124
! crvexp ! ra ! --> ! explicit part of the source term !
188
125
! crvimp ! ra ! --> ! implicit part of the source term !
189
! viscf(nfac) ! ra ! --- ! work array !
190
! viscb(nfabor) ! ra ! --- ! work array !
191
! xam(nfac,2) ! ra ! --- ! work array !
192
! w1 to w11(ncelet)! ra ! --- ! work arrays !
193
! rdevel(nrdeve) ! ra ! <-> ! real work array for temporary developpement !
194
! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
195
! ra(*) ! ra ! --- ! main real work array !
196
126
!__________________!____!_____!________________________________________________!
198
128
! Type: i (integer), r (real), s (string), a (array), l (logical),
200
130
! mode: <-- input, --> output, <-> modifies data, --- work array
201
131
!===============================================================================
133
!===============================================================================
135
!===============================================================================
146
!===============================================================================
205
!===============================================================================
207
!===============================================================================
218
!===============================================================================
222
integer idbia0 , idbra0
223
integer ndim , ncelet , ncel , nfac , nfabor
224
integer nfml , nprfml
225
integer nnod , lndfac , lndfbr , ncelbr
226
integer nvar , nscal , nphas
227
153
integer ncepdp , ncesmp
228
integer nideve , nrdeve , nituse , nrtuse
231
integer ifacel(2,nfac) , ifabor(nfabor)
232
integer ifmfbr(nfabor) , ifmcel(ncelet)
233
integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
234
integer ipnfac(nfac+1), nodfac(lndfac)
235
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
236
156
integer icepdc(ncepdp)
237
157
integer icetsm(ncesmp), itypsm(ncesmp,nvar)
238
integer idevel(nideve), ituser(nituse), ia(*)
240
double precision xyzcen(ndim,ncelet)
241
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
242
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
243
double precision xyznod(ndim,nnod), volume(ncelet)
244
159
double precision dt(ncelet), rtpa(ncelet,*)
245
160
double precision propce(ncelet,*)
246
161
double precision propfa(nfac,*), propfb(nfabor,*)
247
162
double precision coefa(nfabor,*), coefb(nfabor,*)
248
163
double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
249
164
double precision crvexp(ncelet), crvimp(ncelet)
250
double precision viscf(nfac), viscb(nfabor)
251
165
double precision produc(ncelet), gphigk(ncelet)
252
double precision xam(nfac,2)
253
double precision w1(ncelet), w2(ncelet), w3(ncelet)
254
double precision w4(ncelet), w5(ncelet), w6(ncelet)
255
double precision w7(ncelet), w8(ncelet), w9(ncelet)
256
double precision w10(ncelet), w11(ncelet)
257
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
259
167
! Local variables
261
integer idebia, idebra
262
integer iel, ifbiph, iphiph, ipcrom
263
170
double precision ff, tau, xx
172
integer, allocatable, dimension(:) :: lstelt
265
174
!===============================================================================
267
176
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START