1
!-------------------------------------------------------------------------------
3
! This file is part of the Code_Saturne Kernel, element of the
4
! Code_Saturne CFD tool.
6
! Copyright (C) 1998-2008 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
26
!-------------------------------------------------------------------------------
32
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
33
nnod , lndfac , lndfbr , ncelbr , &
34
nvar , nscal , nphas , &
35
nideve , nrdeve , nituse , nrtuse , &
36
ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
37
ischcp , isstpp , inc , imrgra , iccocg , iifbru , &
39
blencp , epsrgp , climgp , extrap , &
40
ifacel , ifabor , ifmfbr , ifmcel , iprfml , ifrusb , &
41
ipnfac , nodfac , ipnfbr , nodfbr , &
42
idevel , ituser , ia , &
43
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
44
pvar , coefap , coefbp , cofafp , cofbfp , &
45
flumas , flumab , viscf , viscb , &
47
dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
48
rdevel , rtuser , ra )
50
!===============================================================================
54
! CALCUL DU BILAN EXPLICITE DE LA VARIABLE PVAR (VITESSE,SCALAIRES)
57
! SMBRP = SMBRP - \ m PVAR +Visc ( grad PVAR ) . n
61
! ATTENTION : SMBRP DEJA INITIALISE AVANT L'APPEL A BILSCA
62
! IL CONTIENT LES TERMES SOURCES EXPLICITES, ETC....
64
! BLENCP = 1 : PAS D'UPWIND EN DEHORS DU TEST DE PENTE
67
! ISCHCP = 0 : SECOND ORDER
69
!-------------------------------------------------------------------------------
71
!__________________.____._____.________________________________________________.
72
! nom !type!mode ! role !
73
!__________________!____!_____!________________________________________________!
74
! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
75
! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
76
! ndim ! e ! <-- ! dimension de l'espace !
77
! ncelet ! e ! <-- ! nombre d'elements halo compris !
78
! ncel ! e ! <-- ! nombre d'elements actifs !
79
! nfac ! e ! <-- ! nombre de faces internes !
80
! nfabor ! e ! <-- ! nombre de faces de bord !
81
! nfml ! e ! <-- ! nombre de familles d entites !
82
! nprfml ! e ! <-- ! nombre de proprietese des familles !
83
! nnod ! e ! <-- ! nombre de sommets !
84
! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
85
! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
86
! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
87
! ! ! ! face de bord !
88
! nvar ! e ! <-- ! nombre total de variables !
89
! nscal ! e ! <-- ! nombre total de scalaires !
90
! nphas ! e ! <-- ! nombre de phases !
91
! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
92
! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
93
! ivar ! e ! <-- ! numero de la variable !
94
! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
95
! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
96
! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
97
! ! ! ! des gradients !
98
! imligp ! e ! <-- ! methode de limitation du gradient !
99
! ! ! ! < 0 pas de limitation !
100
! ! ! ! = 0 a partir des gradients voisins !
101
! ! ! ! = 1 a partir du gradient moyen !
102
! ircflp ! e ! <-- ! indicateur = 1 rec flux, 0 sinon !
103
! ischcp ! e ! <-- ! indicateur = 1 centre , 0 2nd order !
104
! isstpp ! e ! <-- ! indicateur = 1 sans test de pente !
105
! ! ! ! = 0 avec test de pente !
106
! inc ! e ! <-- ! indicateur = 0 resol sur increment !
108
! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
109
! ! e ! <-- ! = 1 gradmc 99 !
110
! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
112
! iifbru ! e ! <-- ! pointeur flux de bord rusanov !
113
! ipp ! e ! <-- ! numero de variable pour post !
114
! iwarnp ! e ! <-- ! niveau d'impression !
115
! blencp ! r ! <-- ! 1 - proportion d'upwind !
116
! epsrgp ! r ! <-- ! precision relative pour la !
117
! ! ! ! reconstruction des gradients 97 !
118
! climgp ! r ! <-- ! coef gradient*distance/ecart !
119
! extrap ! r ! <-- ! coef extrap gradient !
120
! ifacel ! te ! <-- ! elements voisins d'une face interne !
122
! ifabor ! te ! <-- ! element voisin d'une face de bord !
124
! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
126
! ifmcel ! te ! <-- ! numero de famille d'une cellule !
128
! iprfml ! te ! <-- ! proprietes d'une famille !
129
! nfml ,nprfml ! ! ! !
130
! ifrusb(nfabor ! te ! <-- ! indicateur flux de rusanov !
131
! ipnfac ! te ! <-- ! position du premier noeud de chaque !
132
! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
133
! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
134
! (nfac+1) ! ! ! (optionnel) !
135
! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
136
! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
137
! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
138
! (nfabor+1) ! ! ! (optionnel) !
139
! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
140
! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
141
! ia(*) ! te ! --- ! macro tableau entier !
142
! xyzcen ! tr ! <-- ! point associes aux volumes de control !
143
! (ndim,ncelet ! ! ! !
144
! surfac ! tr ! <-- ! vecteur surface des faces internes !
145
! (ndim,nfac) ! ! ! !
146
! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
147
! (ndim,nfabor) ! ! ! !
148
! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
149
! (ndim,nfac) ! ! ! !
150
! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
151
! (ndim,nfabor) ! ! ! !
152
! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
153
! (ndim,nnod) ! ! ! !
154
! volume ! tr ! <-- ! volume d'un des ncelet elements !
156
! pvar (ncelet ! tr ! <-- ! variable resolue (instant precedent) !
157
! coefap, b ! tr ! <-- ! tableaux des cond lim pour p !
158
! (nfabor) ! ! ! sur la normale a la face de bord !
159
! cofafp, b ! tr ! <-- ! tableaux des cond lim pour le flux de !
160
! (nfabor) ! ! ! diffusion de p !
161
! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
162
! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
163
! viscf (nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
164
! ! ! ! pour second membre !
165
! viscb (nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
166
! ! ! ! pour second membre !
167
! smbrp(ncelet ! tr ! <-- ! bilan au second membre !
168
! dpdx,y,z ! tr ! --- ! tableau de travail pour le grad de p !
170
! dpdxa,ya,za ! tr ! --- ! tableau de travail pour le grad de p !
171
! (ncelet) ! ! ! avec decentrement amont !
172
! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
173
! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
174
! ra(*) ! tr ! --- ! macro tableau reel !
175
!__________________!____!_____!________________________________________________!
177
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
178
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
179
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
180
! --- tableau de travail
181
!===============================================================================
185
!===============================================================================
187
!===============================================================================
196
!===============================================================================
200
integer idbia0 , idbra0
201
integer ndim , ncelet , ncel , nfac , nfabor
202
integer nfml , nprfml
203
integer nnod , lndfac , lndfbr , ncelbr
204
integer nvar , nscal , nphas
205
integer nideve , nrdeve , nituse , nrtuse
206
integer ivar , iconvp , idiffp , nswrgp , imligp
207
integer ircflp , ischcp , isstpp
208
integer inc , imrgra , iccocg , iifbru
210
double precision blencp , epsrgp , climgp, extrap
212
integer ifacel(2,nfac) , ifabor(nfabor)
213
integer ifmfbr(nfabor) , ifmcel(ncelet)
214
integer iprfml(nfml,nprfml)
215
integer ifrusb(nfabor)
216
integer ipnfac(nfac+1), nodfac(lndfac)
217
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
218
integer idevel(nideve), ituser(nituse)
221
double precision xyzcen(ndim,ncelet)
222
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
223
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
224
double precision xyznod(ndim,nnod), volume(ncelet)
225
double precision pvar (ncelet), coefap(nfabor), coefbp(nfabor)
226
double precision cofafp(nfabor), cofbfp(nfabor)
227
double precision flumas(nfac), flumab(nfabor)
228
double precision viscf (nfac), viscb (nfabor)
229
double precision smbrp(ncelet)
230
double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
231
double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
232
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
238
integer idebia, idebra
239
integer ifac,ii,jj,infac,iel,iupwin, iij, iii, iok
240
integer itenso, idimte, iphydp
241
integer iiu(nphsmx),iiv(nphsmx),iiw(nphsmx)
242
integer iitytu(nphsmx)
243
integer iir11(nphsmx),iir22(nphsmx),iir33(nphsmx)
244
integer iir12(nphsmx),iir13(nphsmx),iir23(nphsmx)
245
double precision pfac,pfacd,pip,pjp,flui,fluj,flux
246
double precision difx,dify,difz,djfx,djfy,djfz,pif,pjf
247
double precision testi,testj,testij
248
double precision dpxf,dpyf,dpzf
249
double precision dcc, ddi, ddj, tesqck
250
double precision dijpfx, dijpfy, dijpfz
251
double precision diipfx, diipfy, diipfz
252
double precision djjpfx, djjpfy, djjpfz
253
double precision diipbx, diipby, diipbz
254
double precision pond, dist, surfan
255
double precision pfac1, pfac2, pfac3, unsvol
257
!===============================================================================
259
!===============================================================================
261
!===============================================================================
270
if (ischcp.eq.1) then
271
WRITE(NFECRA,1000)CNOM,' CENTRE ', &
274
WRITE(NFECRA,1000)CNOM,' 2ND ORDER ', &
280
if(blencp.eq.0.d0) iupwin = 1
282
!===============================================================================
283
! 2. CALCUL DU BILAN AVEC TECHNIQUE DE RECONSTRUCTION
284
!===============================================================================
286
! ======================================================================
287
! ---> CALCUL DU GRADIENT DE P
288
! ======================================================================
289
! DPDX sert a la fois pour la reconstruction des flux et pour le test
290
! de pente. On doit donc le calculer :
291
! - quand on a de la diffusion et qu'on reconstruit les flux
292
! - quand on a de la convection SOLU
293
! - quand on a de la convection, qu'on n'est pas en upwind pur
294
! et qu'on reconstruit les flux
295
! - quand on a de la convection, qu'on n'est pas en upwind pur
296
! et qu'on n'a pas shunte le test de pente
298
if( (idiffp.ne.0 .and. ircflp.eq.1) .or. &
299
(iconvp.ne.0 .and. iupwin.eq.0 .and. &
300
(ischcp.eq.0 .or. ircflp.eq.1 .or. isstpp.eq.0)) ) then
305
( idebia , idebra , &
306
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
307
nnod , lndfac , lndfbr , ncelbr , nphas , &
308
nideve , nrdeve , nituse , nrtuse , &
309
ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
310
iwarnp , nfecra , epsrgp , climgp , extrap , &
311
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
312
ipnfac , nodfac , ipnfbr , nodfbr , &
313
idevel , ituser , ia , &
314
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
315
dpdxa , dpdxa , dpdxa , &
316
pvar , coefap , coefbp , &
317
dpdx , dpdy , dpdz , &
318
! ------ ------ ------
319
dpdxa , dpdya , dpdza , &
320
rdevel , rtuser , ra )
331
! ======================================================================
332
! ---> CALCUL DU GRADIENT DECENTRE DPDXA, DPDYA, DPDZA POUR TST DE PENTE
333
! ======================================================================
341
if( iconvp.gt.0.and.iupwin.eq.0.and.isstpp.eq.0 ) then
343
if (ivecti.eq.1) then
351
difx = cdgfac(1,ifac) - xyzcen(1,ii)
352
dify = cdgfac(2,ifac) - xyzcen(2,ii)
353
difz = cdgfac(3,ifac) - xyzcen(3,ii)
354
djfx = cdgfac(1,ifac) - xyzcen(1,jj)
355
djfy = cdgfac(2,ifac) - xyzcen(2,jj)
356
djfz = cdgfac(3,ifac) - xyzcen(3,jj)
358
pif = pvar(ii) +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
359
pjf = pvar(jj) +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
362
if( flumas(ifac ).gt.0.d0 ) pfac = pif
364
pfac1 = pfac*surfac(1,ifac )
365
pfac2 = pfac*surfac(2,ifac )
366
pfac3 = pfac*surfac(3,ifac )
368
dpdxa(ii) = dpdxa(ii) +pfac1
369
dpdya(ii) = dpdya(ii) +pfac2
370
dpdza(ii) = dpdza(ii) +pfac3
372
dpdxa(jj) = dpdxa(jj) -pfac1
373
dpdya(jj) = dpdya(jj) -pfac2
374
dpdza(jj) = dpdza(jj) -pfac3
380
! VECTORISATION NON FORCEE
386
difx = cdgfac(1,ifac) - xyzcen(1,ii)
387
dify = cdgfac(2,ifac) - xyzcen(2,ii)
388
difz = cdgfac(3,ifac) - xyzcen(3,ii)
389
djfx = cdgfac(1,ifac) - xyzcen(1,jj)
390
djfy = cdgfac(2,ifac) - xyzcen(2,jj)
391
djfz = cdgfac(3,ifac) - xyzcen(3,jj)
393
pif = pvar(ii) +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
394
pjf = pvar(jj) +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
397
if( flumas(ifac ).gt.0.d0 ) pfac = pif
399
pfac1 = pfac*surfac(1,ifac )
400
pfac2 = pfac*surfac(2,ifac )
401
pfac3 = pfac*surfac(3,ifac )
403
dpdxa(ii) = dpdxa(ii) +pfac1
404
dpdya(ii) = dpdya(ii) +pfac2
405
dpdza(ii) = dpdza(ii) +pfac3
407
dpdxa(jj) = dpdxa(jj) -pfac1
408
dpdya(jj) = dpdya(jj) -pfac2
409
dpdza(jj) = dpdza(jj) -pfac3
415
if (ivectb.eq.1) then
420
iii = idiipb-1+3*(ifac-1)
424
pfac = inc*coefap(ifac ) &
425
+coefbp(ifac )*(pvar(ii)+diipbx*dpdx(ii) &
426
+diipby*dpdy(ii)+diipbz*dpdz(ii) )
427
dpdxa(ii) = dpdxa(ii) +pfac*surfbo(1,ifac )
428
dpdya(ii) = dpdya(ii) +pfac*surfbo(2,ifac )
429
dpdza(ii) = dpdza(ii) +pfac*surfbo(3,ifac )
434
! VECTORISATION NON FORCEE
437
iii = idiipb-1+3*(ifac-1)
441
pfac = inc*coefap(ifac ) &
442
+coefbp(ifac )*(pvar(ii)+diipbx*dpdx(ii) &
443
+diipby*dpdy(ii)+diipbz*dpdz(ii) )
444
dpdxa(ii) = dpdxa(ii) +pfac*surfbo(1,ifac )
445
dpdya(ii) = dpdya(ii) +pfac*surfbo(2,ifac )
446
dpdza(ii) = dpdza(ii) +pfac*surfbo(3,ifac )
452
unsvol = 1.d0/volume(iel)
453
dpdxa(iel) = dpdxa(iel)*unsvol
454
dpdya(iel) = dpdya(iel)*unsvol
455
dpdza(iel) = dpdza(iel)*unsvol
458
! TRAITEMENT DU PARALLELISME
469
! TRAITEMENT DE LA PERIODICITE
471
! On echange pour la translation
472
! pour la rotation, on prend le gradient simple (pas de temps precedent)
477
! avec la vitesse et les tensions de Reynolds,
478
! on utilise la valeur du gradient simple (PERING) a defaut de mieux.
479
! Dans les autres cas, on echange DPDXA
481
! On recupere d'abord certains COMMON necessaires a PERING
488
iir11 , iir22 , iir33 , iir12 , iir13 , iir23 )
493
idimte , itenso , iperot , iguper , igrper , &
494
iiu , iiv , iiw , iitytu , &
495
iir11 , iir22 , iir33 , iir12 , iir13 , iir23 , &
496
dpdxa , dpdya , dpdza , &
497
ra(idudxy) , ra(idrdxy) )
501
( idimte , itenso , &
502
dpdxa , dpdxa , dpdxa , &
503
dpdya , dpdya , dpdya , &
504
dpdza , dpdza , dpdza )
510
! ======================================================================
511
! ---> ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
512
! ======================================================================
516
if(ncelet.gt.ncel) then
517
do iel = ncel+1, ncelet
523
! --> FLUX UPWIND PUR
524
! =====================
528
if (ivecti.eq.1) then
536
iij = idijpf-1+3*(ifac-1)
541
pond = ra(ipond-1+ifac)
543
! ON RECALCULE A CE NIVEAU II' ET JJ'
545
diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
546
(1.d0-pond) * dijpfx)
547
diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
548
(1.d0-pond) * dijpfy)
549
diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
550
(1.d0-pond) * dijpfz)
551
djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
553
djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
555
djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
558
dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
559
dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
560
dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
562
! reconstruction uniquement si IRCFLP = 1
564
+ ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
566
+ ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
568
flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
569
fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
575
flux = iconvp*( flui*pif +fluj*pjf ) &
576
+ idiffp*viscf(ifac)*( pip -pjp )
578
smbrp(ii) = smbrp(ii) -flux
579
smbrp(jj) = smbrp(jj) +flux
585
! VECTORISATION NON FORCEE
591
iij = idijpf-1+3*(ifac-1)
596
pond = ra(ipond-1+ifac)
598
! ON RECALCULE A CE NIVEAU II' ET JJ'
600
diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
601
(1.d0-pond) * dijpfx)
602
diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
603
(1.d0-pond) * dijpfy)
604
diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
605
(1.d0-pond) * dijpfz)
606
djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
608
djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
610
djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
613
dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
614
dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
615
dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
618
+ ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
620
+ ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
622
flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
623
fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
629
flux = iconvp*( flui*pif +fluj*pjf ) &
630
+ idiffp*viscf(ifac)*( pip -pjp )
632
smbrp(ii) = smbrp(ii) -flux
633
smbrp(jj) = smbrp(jj) +flux
640
! --> FLUX SANS TEST DE PENTE
641
! ============================
643
elseif(isstpp.eq.1) then
645
if (ivecti.eq.1) then
654
iij = idijpf-1+3*(ifac-1)
660
pond = ra(ipond-1+ifac)
662
! ON RECALCULE A CE NIVEAU II' ET JJ'
665
diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
666
(1.d0-pond) * dijpfx)
667
diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
668
(1.d0-pond) * dijpfy)
669
diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
670
(1.d0-pond) * dijpfz)
671
djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
673
djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
675
djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
678
dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
679
dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
680
dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
684
+ ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
686
+ ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
688
flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
689
fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
695
if (ischcp.eq.1) then
697
pif = pond*pip +(1.d0-pond)*pjp
704
elseif(ischcp.eq.0) then
706
difx = cdgfac(1,ifac) - xyzcen(1,ii)
707
dify = cdgfac(2,ifac) - xyzcen(2,ii)
708
difz = cdgfac(3,ifac) - xyzcen(3,ii)
709
djfx = cdgfac(1,ifac) - xyzcen(1,jj)
710
djfy = cdgfac(2,ifac) - xyzcen(2,jj)
711
djfz = cdgfac(3,ifac) - xyzcen(3,jj)
713
! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
714
! sinon cela revient a faire de l'upwind
716
+difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
718
+djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
721
write(nfecra,9000)ischcp
729
pif = blencp*pif+(1.d0-blencp)*pvar(ii)
730
pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
736
flux = iconvp*( flui*pif +fluj*pjf ) &
737
+ idiffp*viscf(ifac)*( pip -pjp )
743
smbrp(ii) = smbrp(ii) -flux
744
smbrp(jj) = smbrp(jj) +flux
747
! Le call csexit ne doit pas etre dans la boucle, sinon
748
! le VPP la devectorise.
756
! VECTORISATION NON FORCEE
762
iij = idijpf-1+3*(ifac-1)
768
pond = ra(ipond-1+ifac)
770
! ON RECALCULE II' ET JJ'
772
diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
773
(1.d0-pond) * dijpfx)
774
diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
775
(1.d0-pond) * dijpfy)
776
diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
777
(1.d0-pond) * dijpfz)
778
djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
780
djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
782
djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
785
dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
786
dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
787
dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
790
+ ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
792
+ ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
794
flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
795
fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
801
if (ischcp.eq.1) then
803
pif = pond*pip +(1.d0-pond)*pjp
810
elseif(ischcp.eq.0) then
812
difx = cdgfac(1,ifac) - xyzcen(1,ii)
813
dify = cdgfac(2,ifac) - xyzcen(2,ii)
814
difz = cdgfac(3,ifac) - xyzcen(3,ii)
815
djfx = cdgfac(1,ifac) - xyzcen(1,jj)
816
djfy = cdgfac(2,ifac) - xyzcen(2,jj)
817
djfz = cdgfac(3,ifac) - xyzcen(3,jj)
819
! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
820
! sinon cela revient a faire de l'upwind
822
+difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
824
+djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
827
write(nfecra,9000)ischcp
835
pif = blencp*pif+(1.d0-blencp)*pvar(ii)
836
pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
842
flux = iconvp*( flui*pif +fluj*pjf ) &
843
+ idiffp*viscf(ifac)*( pip -pjp )
849
smbrp(ii) = smbrp(ii) -flux
850
smbrp(jj) = smbrp(jj) +flux
853
! Le call csexit ne doit pas etre dans la boucle, sinon
854
! le VPP la devectorise (pour la boucle non vectorisee forcee,
855
! ce n'est pas grave, c'est juste pour recopier exactement
866
! --> FLUX AVEC TEST DE PENTE (separe pour vectorisation)
867
! =============================
871
if (ivecti.eq.1) then
880
iij = idijpf-1+3*(ifac-1)
886
pond = ra(ipond-1+ifac)
887
dist = ra(idist-1+ifac)
888
surfan = ra(isrfan-1+ifac)
890
! ON RECALCULE II' ET JJ'
892
diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
893
(1.d0-pond) * dijpfx)
894
diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
895
(1.d0-pond) * dijpfy)
896
diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
897
(1.d0-pond) * dijpfz)
898
djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
900
djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
902
djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
905
dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
906
dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
907
dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
910
+ ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
912
+ ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
914
flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
915
fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
921
testi = dpdxa(ii)*surfac(1,ifac) +dpdya(ii)*surfac(2,ifac) &
922
+ dpdza(ii)*surfac(3,ifac)
923
testj = dpdxa(jj)*surfac(1,ifac) +dpdya(jj)*surfac(2,ifac) &
924
+ dpdza(jj)*surfac(3,ifac)
925
testij= dpdxa(ii)*dpdxa(jj) +dpdya(ii)*dpdya(jj) &
926
+ dpdza(ii)*dpdza(jj)
928
if( flumas(ifac).gt.0.d0) then
929
dcc = dpdx(ii)*surfac(1,ifac) +dpdy(ii)*surfac(2,ifac) &
930
+ dpdz(ii)*surfac(3,ifac)
932
ddj = ( pvar(jj)-pvar(ii) )/dist *surfan
934
dcc = dpdx(jj)*surfac(1,ifac) +dpdy(jj)*surfac(2,ifac) &
935
+ dpdz(jj)*surfac(3,ifac)
936
ddi = ( pvar(jj)-pvar(ii) )/dist *surfan
939
tesqck = dcc**2 -(ddi-ddj)**2
945
!MO IF( (TESTI*TESTJ).LE.0.D0 .OR. TESTIJ.LE.0.D0 ) THEN
946
if( tesqck.le.0.d0 .or. testij.le.0.d0 ) then
958
if (ischcp.eq.1) then
960
pif = pond*pip +(1.d0-pond)*pjp
967
elseif(ischcp.eq.0) then
969
difx = cdgfac(1,ifac) - xyzcen(1,ii)
970
dify = cdgfac(2,ifac) - xyzcen(2,ii)
971
difz = cdgfac(3,ifac) - xyzcen(3,ii)
972
djfx = cdgfac(1,ifac) - xyzcen(1,jj)
973
djfy = cdgfac(2,ifac) - xyzcen(2,jj)
974
djfz = cdgfac(3,ifac) - xyzcen(3,jj)
976
! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
977
! sinon cela revient a faire de l'upwind
979
+ difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
981
+ djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
984
write(nfecra,9000)ischcp
994
pif = blencp*pif+(1.d0-blencp)*pvar(ii)
995
pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
1001
flux = iconvp*( flui*pif +fluj*pjf ) &
1002
+ idiffp*viscf(ifac)*( pip -pjp )
1008
smbrp(ii) = smbrp(ii) -flux
1009
smbrp(jj) = smbrp(jj) +flux
1012
! Le call csexit ne doit pas etre dans la boucle, sinon
1013
! le VPP la devectorise.
1021
! VECTORISATION NON FORCEE
1027
iij = idijpf-1+3*(ifac-1)
1033
pond = ra(ipond-1+ifac)
1034
dist = ra(idist-1+ifac)
1035
surfan = ra(isrfan-1+ifac)
1037
! ON RECALCULE II' ET JJ'
1039
diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
1040
(1.d0-pond) * dijpfx)
1041
diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
1042
(1.d0-pond) * dijpfy)
1043
diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
1044
(1.d0-pond) * dijpfz)
1045
djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
1047
djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
1049
djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
1052
dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
1053
dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
1054
dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
1057
+ ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
1059
+ ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
1061
flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
1062
fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
1068
testi = dpdxa(ii)*surfac(1,ifac) +dpdya(ii)*surfac(2,ifac) &
1069
+ dpdza(ii)*surfac(3,ifac)
1070
testj = dpdxa(jj)*surfac(1,ifac) +dpdya(jj)*surfac(2,ifac) &
1071
+ dpdza(jj)*surfac(3,ifac)
1072
testij= dpdxa(ii)*dpdxa(jj) +dpdya(ii)*dpdya(jj) &
1073
+ dpdza(ii)*dpdza(jj)
1075
if( flumas(ifac).gt.0.d0) then
1076
dcc = dpdx(ii)*surfac(1,ifac) +dpdy(ii)*surfac(2,ifac) &
1077
+ dpdz(ii)*surfac(3,ifac)
1079
ddj = ( pvar(jj)-pvar(ii) )/dist *surfan
1081
dcc = dpdx(jj)*surfac(1,ifac) +dpdy(jj)*surfac(2,ifac) &
1082
+ dpdz(jj)*surfac(3,ifac)
1083
ddi = ( pvar(jj)-pvar(ii) )/dist *surfan
1086
tesqck = dcc**2 -(ddi-ddj)**2
1092
!MO IF( (TESTI*TESTJ).LE.0.D0 .OR. TESTIJ.LE.0.D0 ) THEN
1093
if( tesqck.le.0.d0 .or. testij.le.0.d0 ) then
1105
if (ischcp.eq.1) then
1107
pif = pond*pip +(1.d0-pond)*pjp
1114
elseif(ischcp.eq.0) then
1116
difx = cdgfac(1,ifac) - xyzcen(1,ii)
1117
dify = cdgfac(2,ifac) - xyzcen(2,ii)
1118
difz = cdgfac(3,ifac) - xyzcen(3,ii)
1119
djfx = cdgfac(1,ifac) - xyzcen(1,jj)
1120
djfy = cdgfac(2,ifac) - xyzcen(2,jj)
1121
djfz = cdgfac(3,ifac) - xyzcen(3,jj)
1123
! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
1124
! sinon cela revient a faire de l'upwind
1126
+ difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
1128
+ djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
1131
write(nfecra,9000)ischcp
1141
pif = blencp*pif+(1.d0-blencp)*pvar(ii)
1142
pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
1148
flux = iconvp*( flui*pif +fluj*pjf ) &
1149
+ idiffp*viscf(ifac)*( pip -pjp )
1155
smbrp(ii) = smbrp(ii) -flux
1156
smbrp(jj) = smbrp(jj) +flux
1159
! Le call csexit ne doit pas etre dans la boucle, sinon
1160
! le VPP la devectorise (pour la boucle non vectorisee forcee,
1161
! ce n'est pas grave, c'est juste pour recopier exactement
1173
if(iwarnp.ge.2) then
1174
write(nfecra,1100)cnom,infac,nfac
1178
! ======================================================================
1179
! ---> ASSEMBLAGE A PARTIR DES FACETTES DE BORD
1180
! ======================================================================
1182
! Lorsque IIFBRU.GT.0, on ne prend pas en compte le flux convectif
1183
! sur les faces pour lesquelles on dispose par ailleurs d'un
1186
! Lorsque IIFBRU.LE.0, on adopte le sch�ma standard (i.e. on prend
1187
! en compte le flux convectitf).
1189
! Dans les deux cas, si on prend en compte le flux convectif, il
1190
! pourrait etre utile de vraiment utiliser la condition imposee
1191
! a la limite, i.e. de ne pas utiliser un sch�ma upwind (sinon,
1192
! on ne verra pas certaines C.L.). Actuellement, avec les conditions
1193
! aux limites propos�es, il n'y a que 3 cas pour lesquels on
1194
! prend en compte le flux convectif ici : paroi, symetrie et
1195
! sortie supersonique. Dans les deux premiers, le flux est nul.
1196
! Pour le dernier, un traitement upwind correspond a utiliser
1197
! effectivement la valeur de bord. On peut donc conserver
1200
! On n'impose pas le flux convectif sur les faces pour lesquelles
1201
! il sera impos� par les C.L.
1202
if(iifbru.gt.0) then
1204
if (ivectb.eq.1) then
1211
iii = idiipb-1+3*(ifac-1)
1216
flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
1217
fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
1220
+ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
1222
pfac = inc*coefap(ifac) +coefbp(ifac)*pip
1223
pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
1225
! FLUX = ICONVP*( FLUI*PVAR(II) +FLUJ*PFAC )
1226
! & + IDIFFP*VISCB(IFAC)*( PIP -PFACD )
1227
flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
1228
*dble(1-ifrusb(ifac)) &
1229
+ idiffp*viscb(ifac)*( pip -pfacd )
1230
smbrp(ii) = smbrp(ii) -flux
1240
iii = idiipb-1+3*(ifac-1)
1245
flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
1246
fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
1249
+ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
1251
pfac = inc*coefap(ifac) +coefbp(ifac)*pip
1252
pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
1254
! FLUX = ICONVP*( FLUI*PVAR(II) +FLUJ*PFAC )
1255
! & + IDIFFP*VISCB(IFAC)*( PIP -PFACD )
1256
flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
1257
*dble(1-ifrusb(ifac)) &
1258
+ idiffp*viscb(ifac)*( pip -pfacd )
1259
smbrp(ii) = smbrp(ii) -flux
1265
! On ne dispose pas de flux issu des C.L. : traitement std
1268
if (ivectb.eq.1) then
1275
iii = idiipb-1+3*(ifac-1)
1280
flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
1281
fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
1284
+ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
1286
pfac = inc*coefap(ifac) +coefbp(ifac)*pip
1287
pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
1289
flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
1290
+ idiffp*viscb(ifac)*( pip -pfacd )
1291
smbrp(ii) = smbrp(ii) -flux
1301
iii = idiipb-1+3*(ifac-1)
1306
flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
1307
fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
1310
+ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
1312
pfac = inc*coefap(ifac) +coefbp(ifac)*pip
1313
pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
1315
flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
1316
+ idiffp*viscb(ifac)*( pip -pfacd )
1317
smbrp(ii) = smbrp(ii) -flux
1329
1000 format(1X,A8,' : CONVECTION EN ',A11, &
1330
' BLENDING A ',F4.0,' % D''UPWIND')
1331
1100 format(1X,A8,' : ',I10,' FACES UPWIND SUR ', &
1332
I10,' FACES INTERNES ')
1335
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
1337
'@ @@ ATTENTION : ARRET DANS cfbsc2 ',/,&
1339
'@ APPEL DE cfbsc2 POUR ',A8 ,' AVEC ISCHCP = ',I10 ,/,&
1341
'@ Le calcul ne peut pas etre execute. ',/,&
1343
'@ Contacter l''assistance. ',/,&
1345
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&