1
!-------------------------------------------------------------------------------
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.
21
!-------------------------------------------------------------------------------
28
iflmb0 , init , inc , imrgra , iccocg , nswrgu , imligu , &
30
epsrgu , climgu , extrau , &
36
!===============================================================================
40
! INCREMENTATION DU FLUX DE MASSE A PARTIR DU CHAMP VECTORIEL ROM.U
42
! m = m +(rom* U ) . n
46
! Pour la reconstruction, grad(rho u) est calcule avec des
47
! conditions aux limites approchees :
48
! COEFA(rho u) = ROMB * COEFA(u)
49
! COEFB(rho u) = COEFB (u)
51
! et pour le flux de masse au bord on ecrit
52
! FLUMAB = [ROMB*COEFA(u) + ROMB*COEFB(u)*Ui
53
! + COEFB(u)*II'.grad(rho u) ].Sij
54
! ce qui utilise de petites approximations sur les
55
! non-orthogonalites (cf. notice)
57
!-------------------------------------------------------------------------------
59
!__________________.____._____.________________________________________________.
60
! name !type!mode ! role !
61
!__________________!____!_____!________________________________________________!
62
! nvar ! i ! <-- ! total number of variables !
63
! nscal ! i ! <-- ! total number of scalars !
64
! ivar ! e ! <-- ! variable !
65
! iflmb0 ! e ! <-- ! =1 : flux de masse annule sym-paroi !
66
! init ! e ! <-- ! > 0 : initialisation du flux de masse !
67
! inc ! e ! <-- ! indicateur = 0 resol sur increment !
69
! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
70
! ! e ! <-- ! = 1 gradmc 99 !
71
! nswrgu ! e ! <-- ! nombre de sweep pour reconstruction !
72
! ! ! ! des gradients !
73
! imligu ! e ! <-- ! methode de limitation du gradient !
74
! ! ! ! < 0 pas de limitation !
75
! ! ! ! = 0 a partir des gradients voisins !
76
! ! ! ! = 1 a partir du gradient moyen !
77
! iwarnu ! e ! <-- ! niveau d'impression !
78
! nfecra ! e ! <-- ! unite du fichier sortie std !
79
! epsrgu ! r ! <-- ! precision relative pour la !
80
! ! ! ! reconstruction des gradients 97 !
81
! climgu ! r ! <-- ! coef gradient*distance/ecart !
82
! extrau ! r ! <-- ! coef extrap gradient !
83
! isympa ! te ! <-- ! zero pour annuler le flux de masse !
84
! (nfabor ) ! ! !(symetries et parois avec cl couplees) !
86
! ia(*) ! ia ! --- ! main integer work array !
87
! rom(ncelet ! tr ! <-- ! masse volumique aux cellules !
88
! romb(nfabor) ! tr ! <-- ! masse volumique aux bords !
89
! vel(3,ncelet) ! tr ! <-- ! vitesse !
90
! coefav, b ! tr ! <-- ! tableaux des cond lim pour ux, uy, uz !
91
! (3,nfabor) ! ! ! sur la normale a la face de bord !
92
! coefbv, q ! tr ! <-- ! tableaux des cond lim pour ux, uy, uz !
93
! (3,3,nfabor) ! ! ! sur la normale a la face de bord !
94
! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
95
! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
96
!__________________!____!_____!________________________________________________!
98
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
99
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
100
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
101
! --- tableau de travail
102
!===============================================================================
104
!===============================================================================
106
!===============================================================================
109
use dimens, only: ndimfb
115
!===============================================================================
123
integer iflmb0 , init , inc , imrgra , iccocg
124
integer nswrgu , imligu
125
integer iwarnu , nfecra
126
double precision epsrgu , climgu , extrau
129
double precision rom(ncelet), romb(nfabor)
130
double precision vel(3,ncelet)
131
double precision coefav(3,ndimfb)
132
double precision coefbv(3,3,nfabor)
133
double precision flumas(nfac), flumab(nfabor)
137
integer ifac, ii, jj, iel
138
integer iappel, isou, jsou
139
double precision pfac, pip
140
double precision dofx,dofy,dofz,pnd
141
double precision diipbx, diipby, diipbz
144
double precision, dimension(:,:), allocatable :: qdm, coefaq
145
double precision, dimension(:,:,:), allocatable :: grdqdm
147
allocate(qdm(3,ncelet))
148
allocate(coefaq(3,ndimfb))
150
!===============================================================================
152
!===============================================================================
154
!===============================================================================
156
! ---> CALCUL DE LA QTE DE MOUVEMENT
167
elseif(init.ne.0) then
168
write(nfecra,1000) init
174
qdm(isou,iel) = rom(iel)*vel(isou,iel)
178
! ---> TRAITEMENT DU PARALLELISME ET DE LA PERIODICITE
180
if (irangp.ge.0.or.iperio.eq.1) then
187
coefaq(isou,ifac) = romb(ifac)*coefav(isou,ifac)
190
!===============================================================================
191
! 2. CALCUL DU FLUX DE MASSE SANS TECHNIQUE DE RECONSTRUCTION
192
!===============================================================================
194
if( nswrgu.le.1 ) then
196
! FLUX DE MASSE SUR LES FACETTES FLUIDES
204
flumas(ifac) = flumas(ifac) + &
205
(pnd*qdm(isou,ii)+(1.d0-pnd)*qdm(isou,jj)) *surfac(isou,ifac)
210
! FLUX DE MASSE SUR LES FACETTES DE BORD
216
pfac = inc*coefaq(isou,ifac)
220
pfac = pfac + romb(ifac)*coefbv(isou,jsou,ifac)*vel(jsou,ii)
223
flumab(ifac) = flumab(ifac) + pfac*surfbo(isou,ifac)
230
!===============================================================================
231
! 4. CALCUL DU FLUX DE MASSE AVEC TECHNIQUE DE RECONSTRUCTION
232
! SI LE MAILLAGE EST NON ORTHOGONAL
233
!===============================================================================
235
if( nswrgu.gt.1 ) then
237
allocate(grdqdm(3,3,ncelet))
240
! CALCUL DU GRADIENT SUIVANT de QDM
241
! =================================
242
! gradient vectoriel la periodicite est deja traitee
247
( ivar , imrgra , inc , iccocg , nswrgu , imligu , &
248
iwarnu , nfecra , epsrgu , climgu , extrau , &
250
qdm , coefaq , coefbv , &
254
! ---> FLUX DE MASSE SUR LES FACETTES FLUIDES
267
! Termes suivant U, V, W
269
flumas(ifac) = flumas(ifac) &
270
! Terme non reconstruit
271
+( pnd*qdm(isou,ii) +(1.d0-pnd)*qdm(isou,jj) &
274
! (Grad(rho U ) . OFij ) . Sij
275
+0.5d0*( grdqdm(isou,1,ii) +grdqdm(isou,1,jj) )*dofx &
276
+0.5d0*( grdqdm(isou,2,ii) +grdqdm(isou,2,jj) )*dofy &
277
+0.5d0*( grdqdm(isou,3,ii) +grdqdm(isou,3,jj) )*dofz &
283
! ---> FLUX DE MASSE SUR LES FACETTES DE BORD
287
diipbx = diipb(1,ifac)
288
diipby = diipb(2,ifac)
289
diipbz = diipb(3,ifac)
294
pfac = inc*coefaq(isou,ifac)
299
pip = romb(ifac)*vel(jsou,ii) &
300
+grdqdm(jsou,1,ii)*diipbx &
301
+grdqdm(jsou,2,ii)*diipby &
302
+grdqdm(jsou,3,ii)*diipbz
304
pfac = pfac +coefbv(isou,jsou,ifac)*pip
307
flumab(ifac) = flumab(ifac) +pfac*surfbo(isou,ifac)
314
deallocate(qdm, coefaq)
318
!===============================================================================
319
! 6. POUR S'ASSURER DE LA NULLITE DU FLUX DE MASSE AUX LIMITES
320
! SYMETRIES PAROIS COUPLEES
321
!===============================================================================
324
! FORCAGE DE FLUMAB a 0 pour la vitesse'
326
if(isympa(ifac).eq.0) then
336
#if defined(_CS_LANG_FR)
338
1000 format('INIMAV APPELE AVEC INIT =',I10)
342
1000 format('INIMAV CALLED WITH INIT =',I10)