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 ustsns &
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 , &
49
w1 , w2 , w3 , w4 , w5 , w6 , &
50
rdevel , rtuser , ra )
52
35
!===============================================================================
101
84
!__________________.____._____.________________________________________________.
102
85
! name !type!mode ! role !
103
86
!__________________!____!_____!________________________________________________!
104
! idbia0 ! i ! <-- ! number of first free position in ia !
105
! idbra0 ! i ! <-- ! number of first free position in ra !
106
! ndim ! i ! <-- ! spatial dimension !
107
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
108
! ncel ! i ! <-- ! number of cells !
109
! nfac ! i ! <-- ! number of interior faces !
110
! nfabor ! i ! <-- ! number of boundary faces !
111
! nfml ! i ! <-- ! number of families (group classes) !
112
! nprfml ! i ! <-- ! number of properties per family (group class) !
113
! nnod ! i ! <-- ! number of vertices !
114
! lndfac ! i ! <-- ! size of nodfac indexed array !
115
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
116
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
117
87
! nvar ! i ! <-- ! total number of variables !
118
88
! nscal ! i ! <-- ! total number of scalars !
119
! nphas ! i ! <-- ! number of phases !
120
89
! ncepdp ! i ! <-- ! number of cells with head loss terms !
121
90
! ncssmp ! i ! <-- ! number of cells with mass source terms !
122
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
123
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
124
91
! ivar ! i ! <-- ! index number of the current variable !
125
! iphas ! i ! <-- ! index number of the current phase !
126
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
127
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
128
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
129
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
130
! iprfml ! ia ! <-- ! property numbers per family !
131
! (nfml, nprfml) ! ! ! !
132
! maxelt ! i ! <-- ! max number of cells and faces (int/boundary) !
133
! lstelt(maxelt) ! ia ! --- ! work array !
134
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
135
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
136
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
137
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
138
92
! icepdc(ncepdp) ! ia ! <-- ! index number of cells with head loss terms !
139
93
! icetsm(ncesmp) ! ia ! <-- ! index number of cells with mass source terms !
140
94
! itypsm ! ia ! <-- ! type of mass source term for each variable !
141
95
! (ncesmp,nvar) ! ! ! (see ustsma) !
142
! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
143
! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
144
! ia(*) ! ia ! --- ! main integer work array !
145
! xyzcen ! ra ! <-- ! cell centers !
146
! (ndim, ncelet) ! ! ! !
147
! surfac ! ra ! <-- ! interior faces surface vectors !
148
! (ndim, nfac) ! ! ! !
149
! surfbo ! ra ! <-- ! boundary faces surface vectors !
150
! (ndim, nfavor) ! ! ! !
151
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
152
! (ndim, nfac) ! ! ! !
153
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
154
! (ndim, nfabor) ! ! ! !
155
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
156
! (ndim, nnod) ! ! ! !
157
! volume(ncelet) ! ra ! <-- ! cell volumes !
158
96
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
159
97
! rtpa ! ra ! <-- ! calculated variables at cell centers !
160
98
! (ncelet, *) ! ! ! (preceding time steps) !
168
106
! (ncesmp,nvar) ! ! ! source terms or mass rate (see ustsma) !
169
107
! crvexp ! ra ! --> ! explicit part of the source term !
170
108
! crvimp ! ra ! --> ! implicit part of the source term !
171
! dam(ncelet) ! ra ! --- ! work array !
172
! xam(nfac,2) ! ra ! --- ! work array !
173
! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
174
! (ncelet) ! ! ! (computation of pressure gradient) !
175
! rdevel(nrdeve) ! ra ! <-> ! real work array for temporary developpement !
176
! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
177
! ra(*) ! ra ! --- ! main real work array !
178
109
!__________________!____!_____!________________________________________________!
180
111
! Type: i (integer), r (real), s (string), a (array), l (logical),
182
113
! mode: <-- input, --> output, <-> modifies data, --- work array
183
114
!===============================================================================
116
!===============================================================================
118
!===============================================================================
129
!===============================================================================
187
!===============================================================================
189
!===============================================================================
200
!===============================================================================
204
integer idbia0 , idbra0
205
integer ndim , ncelet , ncel , nfac , nfabor
206
integer nfml , nprfml
207
integer nnod , lndfac , lndfbr , ncelbr
208
integer nvar , nscal , nphas
209
136
integer ncepdp , ncesmp
210
integer nideve , nrdeve , nituse , nrtuse
213
integer ifacel(2,nfac) , ifabor(nfabor)
214
integer ifmfbr(nfabor) , ifmcel(ncelet)
215
integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
216
integer ipnfac(nfac+1), nodfac(lndfac)
217
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
218
139
integer icepdc(ncepdp)
219
140
integer icetsm(ncesmp), itypsm(ncesmp,nvar)
220
integer idevel(nideve), ituser(nituse), ia(*)
222
double precision xyzcen(ndim,ncelet)
223
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
224
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
225
double precision xyznod(ndim,nnod), volume(ncelet)
226
142
double precision dt(ncelet), rtpa(ncelet,*)
227
143
double precision propce(ncelet,*)
228
144
double precision propfa(nfac,*), propfb(nfabor,*)
229
145
double precision coefa(nfabor,*), coefb(nfabor,*)
230
146
double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
231
147
double precision crvexp(ncelet), crvimp(ncelet)
232
double precision dam(ncelet ),xam(nfac ,2)
233
double precision w1(ncelet),w2(ncelet),w3(ncelet)
234
double precision w4(ncelet),w5(ncelet),w6(ncelet)
235
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
237
149
! Local variables
239
151
character*80 chaine
240
integer idebia, idebra
241
152
integer iel, ipcrom, ipp, iutile
242
153
double precision ckp, qdm
155
integer, allocatable, dimension(:) :: lstelt
244
157
!===============================================================================
246
159
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START