1
1
!-------------------------------------------------------------------------------
3
! This file is part of the Code_Saturne Kernel, element of the
4
! Code_Saturne CFD tool.
6
! Copyright (C) 1998-2009 EDF S.A., France
8
! contact: saturne-support@edf.fr
10
! The Code_Saturne Kernel is free software; you can redistribute it
11
! and/or modify it under the terms of the GNU General Public License
12
! as published by the Free Software Foundation; either version 2 of
13
! the License, or (at your option) any later version.
15
! The Code_Saturne Kernel is distributed in the hope that it will be
16
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
! GNU General Public License for more details.
20
! You should have received a copy of the GNU General Public License
21
! along with the Code_Saturne Kernel; if not, write to the
22
! Free Software Foundation, Inc.,
23
! 51 Franklin St, Fifth Floor,
24
! Boston, MA 02110-1301 USA
3
! This file is part of Code_Saturne, a general-purpose CFD tool.
5
! Copyright (C) 1998-2011 EDF S.A.
7
! This program is free software; you can redistribute it and/or modify it under
8
! the terms of the GNU General Public License as published by the Free Software
9
! Foundation; either version 2 of the License, or (at your option) any later
12
! This program is distributed in the hope that it will be useful, but WITHOUT
13
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
! You should have received a copy of the GNU General Public License along with
18
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
21
!-------------------------------------------------------------------------------
28
23
subroutine lagpoi &
32
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
33
nnod , lndnod , lndfac ,lndfbr , ncelbr , &
34
nvar , nscal , nphas , &
35
28
nbpmax , nvp , nvp1 , nvep , nivep , &
36
29
ntersl , nvlsta , nvisbr , &
37
nideve , nrdeve , nituse , nrtuse , &
38
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
39
ipnfac , nodfac , ipnfbr , nodfbr , &
40
30
icocel , itycel , ifrlag , itepa , &
41
idevel , ituser , ia , &
42
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
43
31
dt , rtpa , rtp , propce , propfa , propfb , &
45
ettp , tepa , statis , &
47
rdevel , rtuser , ra )
33
ettp , tepa , statis )
49
35
!===============================================================================
63
49
!__________________.____._____.________________________________________________.
64
50
! name !type!mode ! role !
65
51
!__________________!____!_____!________________________________________________!
66
! idbia0 ! i ! <-- ! number of first free position in ia !
67
! idbra0 ! i ! <-- ! number of first free position in ra !
68
! ndim ! i ! <-- ! spatial dimension !
69
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
70
! ncel ! i ! <-- ! number of cells !
71
! nfac ! i ! <-- ! number of interior faces !
72
! nfabor ! i ! <-- ! number of boundary faces !
73
! nfml ! i ! <-- ! number of families (group classes) !
74
! nprfml ! i ! <-- ! number of properties per family (group class) !
75
! nnod ! i ! <-- ! number of vertices !
76
52
! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
77
! lndfac ! i ! <-- ! size of nodfac indexed array !
78
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
79
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
80
53
! nvar ! i ! <-- ! total number of variables !
81
54
! nscal ! i ! <-- ! total number of scalars !
82
! nphas ! i ! <-- ! number of phases !
83
55
! nbpmax ! e ! <-- ! nombre max de particulies autorise !
84
56
! nvp ! e ! <-- ! nombre de variables particulaires !
85
57
! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
88
60
! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
89
61
! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
90
62
! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
91
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
92
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
93
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
94
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
95
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
96
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
97
! iprfml ! te ! <-- ! proprietes d'une famille !
98
! (nfml,nprfml ! ! ! !
99
! ipnfac ! te ! <-- ! position du premier noeud de chaque !
100
! (lndfac) ! ! ! face interne dans nodfac !
101
! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
103
! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
104
! (lndfbr) ! ! ! face de bord dans nodfbr !
105
! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
107
63
! icocel ! te ! --> ! connectivite cellules -> faces !
108
64
! (lndnod) ! ! ! face de bord si numero negatif !
109
65
! itycel ! te ! --> ! connectivite cellules -> faces !
142
82
! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
143
83
! statis ! tr ! <-- ! moyennes statistiques !
144
84
!(ncelet,nvlsta ! ! ! !
145
! w1...w3(ncel) ! tr ! --- ! tableau de travail !
146
! rdevel(nrdeve) ! ra ! <-> ! real work array for temporary development !
147
! rtuser(nrtuse) ! ra ! <-> ! user-reserved real work array !
148
! ra(*) ! ra ! --- ! main real work array !
149
85
!__________________!____!_____!________________________________________________!
151
87
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
152
88
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
153
89
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
154
90
! --- tableau de travail
91
!===============================================================================
93
!===============================================================================
95
!===============================================================================
156
110
!===============================================================================
160
!===============================================================================
162
!===============================================================================
176
!===============================================================================
180
integer idbia0 , idbra0
181
integer ndim , ncelet , ncel , nfac , nfabor
182
integer nfml , nprfml
183
integer nnod , lndnod , lndfac , lndfbr , ncelbr
184
integer nvar , nscal , nphas
185
118
integer nbpmax , nvp , nvp1 , nvep , nivep
186
119
integer ntersl , nvlsta , nvisbr
187
integer nideve , nrdeve , nituse , nrtuse
188
integer ifacel(2,nfac) , ifabor(nfabor)
189
integer ifmfbr(nfabor) , ifmcel(ncelet)
190
integer iprfml(nfml,nprfml)
191
integer ipnfac(nfac+1) , nodfac(lndfac)
192
integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
193
121
integer icocel(lndnod) , itycel(ncelet+1)
194
122
integer ifrlag(nfabor) , itepa(nbpmax,nivep)
195
integer idevel(nideve), ituser(nituse)
198
double precision xyzcen(ndim,ncelet)
199
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
200
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
201
double precision xyznod(ndim,nnod), volume(ncelet)
202
124
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
203
125
double precision propce(ncelet,*)
204
126
double precision propfa(nfac,*), propfb(nfabor,*)
205
127
double precision coefa(nfabor,*) , coefb(nfabor,*)
206
128
double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
207
129
double precision statis(ncelet,nvlsta)
208
double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
209
double precision rdevel(nrdeve), rtuser(nrtuse)
210
double precision ra(*)
212
131
! Local variables
214
integer idebia, idebra
215
integer ifinia, ifinra
216
133
integer npt , iel , ifac
217
integer iphila , iphil
218
integer iw1 , iw2 , iw3 , iw4 , iw5
219
integer iw6 , iw7 , iw8 , iw9
220
integer idtr , ifmala , ifmalb
221
integer iviscf , iviscb , idam , ixam
222
integer idrtp , ismbr , irovsd
223
integer icoefap , icoefbp
225
135
integer inc, iccocg
226
136
integer nswrgp , imligp , iwarnp
227
integer idimte , itenso , iphydp
228
138
double precision epsrgp , climgp , extrap
140
double precision, allocatable, dimension(:,:) :: grad
141
double precision, allocatable, dimension(:) :: phil
142
double precision, allocatable, dimension(:) :: coefap, coefbp
230
144
!===============================================================================
231
145
! 0. GESTION MEMOIRE
232
146
!===============================================================================
237
149
!===============================================================================
238
150
! 1. INITIALISATIONS
239
151
!===============================================================================
242
iviscf = idtr + ncelet
243
iviscb = iviscf + nfac
244
idam = iviscb + nfabor
246
idrtp = ixam + nfac*2
247
ismbr = idrtp + ncelet
248
irovsd = ismbr + ncelet
249
ifmala = irovsd + ncelet
250
ifmalb = ifmala + nfac
252
iphila = ifmalb + nfabor
253
iphil = iphila + ncelet
263
ifinra = iw9 + ncelet
264
CALL RASIZE('LAGPOI',IFINRA)
153
! Allocate a temporary array
154
allocate(phil(ncelet))
268
157
if ( statis(iel,ilpd) .gt. seuil ) then
269
statis(iel,ilvx) = statis(iel,ilvx) &
271
statis(iel,ilvy) = statis(iel,ilvy) &
273
statis(iel,ilvz) = statis(iel,ilvz) &
275
statis(iel,ilfv) = statis(iel,ilfv) &
276
/( dble(npst) * volume(iel) )
158
statis(iel,ilvx) = statis(iel,ilvx) / statis(iel,ilpd)
159
statis(iel,ilvy) = statis(iel,ilvy) / statis(iel,ilpd)
160
statis(iel,ilvz) = statis(iel,ilvz) / statis(iel,ilpd)
161
statis(iel,ilfv) = statis(iel,ilfv) / ( dble(npst) * volume(iel) )
278
163
statis(iel,ilvx) = 0.d0
279
164
statis(iel,ilvy) = 0.d0
287
( ifinia , ifinra , &
288
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
289
nnod , lndfac , lndfbr , ncelbr , &
290
nvar , nscal , nphas , &
291
nideve , nrdeve , nituse , nrtuse , &
292
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
293
ipnfac , nodfac , ipnfbr , nodfbr , &
294
idevel , ituser , ia , &
295
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
296
173
dt , propce , propfa , propfb , &
297
ra(iviscf) , ra(iviscb) , &
298
ra(idam) , ra(ixam) , &
299
ra(idrtp) , ra(ismbr) , ra(irovsd) , &
300
ra(ifmala) , ra(ifmalb) , &
301
statis(1,ilvx) , statis(1,ilvy) , statis(1,ilvz) , &
303
ra(iphila) , ra(iphil) , &
304
w1 , w2 , w3 , ra(iw1) , ra(iw2) , &
305
ra(iw3) , ra(iw4) , ra(iw5) , ra(iw6) , &
306
ra(iw7) , ra(iw8) , ra(iw9) , &
174
statis(1,ilvx) , statis(1,ilvy) , statis(1,ilvz) , &
310
178
! Calcul du gradient du Correcteur PHI
311
179
! ====================================
314
! On alloue localement 2 tableaux de NFABOR pour le calcul
315
! de COEFA et COEFB de W1,W2,W3
318
icoefbp = icoefap + nfabor
319
ifinra = icoefbp + nfabor
320
CALL RASIZE ('LAGEQP',IFINRA)
181
! Allocate temporary arrays
182
allocate(coefap(nfabor))
183
allocate(coefbp(nfabor))
323
185
do ifac = 1, nfabor
324
186
iel = ifabor(ifac)
325
ra(icoefap+ifac-1) = ra(iphil+iel-1)
326
ra(icoefbp+ifac-1) = zero
187
coefap(ifac) = phil(iel)
200
! Allocate a work array
201
allocate(grad(ncelet,3))
339
203
! En periodique et parallele, echange avant calcul du gradient
343
call parcom(ra(iphil))
353
( idimte , itenso , &
354
ra(iphil) , ra(iphil) , ra(iphil) , &
355
ra(iphil) , ra(iphil) , ra(iphil) , &
356
ra(iphil) , ra(iphil) , ra(iphil) )
204
if (irangp.ge.0.or.iperio.eq.1) then
359
209
! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
360
210
! n'est pas la vitesse ni Rij)
363
! Sans prise en compte de la pression hydrostatique
369
( ifinia , ifinra , &
370
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
371
nnod , lndfac , lndfbr , ncelbr , nphas , &
372
nideve , nrdeve , nituse , nrtuse , &
373
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
215
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
374
216
iwarnp , nfecra , epsrgp , climgp , extrap , &
375
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
376
ipnfac , nodfac , ipnfbr , nodfbr , &
377
idevel , ituser , ia , &
378
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
379
ra(iphil) , ra(iphil) , ra(iphil) , &
380
ra(iphil) , ra(icoefap) , ra(icoefbp) , &
382
ra(iw1) , ra(iw2) , ra(iw3) , &
383
rdevel , rtuser , ra )
217
phil , coefap , coefbp , &
222
deallocate(coefap, coefbp)
385
224
! CORRECTION DES VITESSES MOYENNES ET RETOUR AU CUMUL
388
227
if ( statis(iel,ilpd) .gt. seuil ) then
389
statis(iel,ilvx) = statis(iel,ilvx) - w1(iel)
390
statis(iel,ilvy) = statis(iel,ilvy) - w2(iel)
391
statis(iel,ilvz) = statis(iel,ilvz) - w3(iel)
228
statis(iel,ilvx) = statis(iel,ilvx) - grad(iel,1)
229
statis(iel,ilvy) = statis(iel,ilvy) - grad(iel,2)
230
statis(iel,ilvz) = statis(iel,ilvz) - grad(iel,3)