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
!-------------------------------------------------------------------------------
26
( nvar , nscal , ncepdp , ncesmp , &
27
icepdc , icetsm , itypsm , &
28
dt , rtp , rtpa , propce , propfa , propfb , &
29
tslagr , coefa , coefb , ckupdc , smacel )
31
!===============================================================================
35
! RESOLUTION DES EQUATIONS K-OMEGA SST 1 PHASE INCOMPRESSIBLE OU
36
! RHO VARIABLE SUR UN PAS DE TEMPS
38
!-------------------------------------------------------------------------------
40
!__________________.____._____.________________________________________________.
41
! name !type!mode ! role !
42
!__________________!____!_____!________________________________________________!
43
! nvar ! i ! <-- ! total number of variables !
44
! nscal ! i ! <-- ! total number of scalars !
45
! ncepdp ! i ! <-- ! number of cells with head loss !
46
! ncesmp ! i ! <-- ! number of cells with mass source term !
47
! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
48
! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
49
! itypsm ! te ! <-- ! type de source de masse pour les !
50
! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
51
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
52
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
53
! (ncelet, *) ! ! ! (at current and previous time steps) !
54
! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
55
! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
56
! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
57
! tslagr ! tr ! <-- ! terme de couplage retour du !
58
!(ncelet,*) ! ! ! lagrangien !
59
! coefa, coefb ! ra ! <-- ! boundary conditions !
61
! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
63
! smacel ! tr ! <-- ! valeur des variables associee a la !
64
! (ncesmp,* ) ! ! ! source de masse !
65
! ! ! ! pour ivar=ipr, smacel=flux de masse !
66
!__________________!____!_____!________________________________________________!
68
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
69
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
70
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
71
! --- tableau de travail
72
!===============================================================================
74
!===============================================================================
76
!===============================================================================
79
use dimens, only: ndimfb
86
use pointe, only: s2kw, divukw, ifapat, dispar
90
!===============================================================================
97
integer ncepdp , ncesmp
99
integer icepdc(ncepdp)
100
integer icetsm(ncesmp), itypsm(ncesmp,nvar)
102
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
103
double precision propce(ncelet,*)
104
double precision propfa(nfac,*), propfb(ndimfb,*)
105
double precision tslagr(ncelet,*)
106
double precision coefa(ndimfb,*), coefb(ndimfb,*)
107
double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
112
integer iel , ifac , init , inc , iccocg, ivar
113
integer ii, iivar , iiun , ifacpt
114
integer iclipk, iclipw, isqrt
115
integer nswrgp, imligp
116
integer iclikp, iclomg
117
integer iclvar, iclvaf
118
integer iconvp, idiffp, ndircp, ireslp
119
integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
120
integer imgrp , ncymxp, nitmfp
121
integer ipcrom, ipbrom, ipcvst, ipcvis, iflmas, iflmab
124
integer ipcroo, ipbroo, ipcvto, ipcvlo
126
double precision rnorm , d2s3, divp23, epz2
127
double precision deltk , deltw, a11, a12, a22, a21
128
double precision unsdet, romvsd
129
double precision prdtur, xk, xw, xeps, xnu
130
double precision visct , rom
131
double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
132
double precision thetp1, thetak, thetaw, thets, thetap, epsrsp
133
double precision tuexpk, tuexpw
134
double precision cdkw, xarg1, xxf1, xgamma, xbeta, sigma, produc
135
double precision var, vrmin, vrmax
137
double precision rvoid(1)
139
double precision, allocatable, dimension(:) :: viscf, viscb
140
double precision, allocatable, dimension(:) :: dam
141
double precision, allocatable, dimension(:) :: smbrk, smbrw, rovsdt
142
double precision, allocatable, dimension(:) :: tinstk, tinstw, xf1
143
double precision, allocatable, dimension(:,:) :: gradk, grado, grad
144
double precision, allocatable, dimension(:) :: w1, w2, w3
145
double precision, allocatable, dimension(:) :: w4, w5, w6
146
double precision, allocatable, dimension(:) :: w7, w8
148
!===============================================================================
150
!===============================================================================
152
!===============================================================================
154
! Allocate temporary arrays for the turbulence resolution
155
allocate(viscf(nfac), viscb(nfabor))
156
allocate(dam(ncelet))
157
allocate(smbrk(ncelet), smbrw(ncelet), rovsdt(ncelet))
158
allocate(tinstk(ncelet), tinstw(ncelet), xf1(ncelet))
160
! Allocate work arrays
161
allocate(w1(ncelet), w2(ncelet), w3(ncelet))
162
allocate(w4(ncelet), w5(ncelet), w6(ncelet))
163
allocate(w7(ncelet), w8(ncelet))
168
iclikp = iclrtp(ik ,icoef)
169
iclomg = iclrtp(iomg,icoef)
171
ipcrom = ipproc(irom )
172
ipcvst = ipproc(ivisct)
173
ipcvis = ipproc(iviscl)
174
iflmas = ipprof(ifluma(ik))
175
iflmab = ipprob(ifluma(ik))
176
ipbrom = ipprob(irom )
185
if (iroext.gt.0) then
186
ipcroo = ipproc(iroma)
187
ipbroo = ipprob(iroma)
190
ipcvto = ipproc(ivista)
191
ipcvlo = ipproc(ivisla)
196
iptsta = ipproc(itstua)
201
if(iwarni(ik).ge.1) then
206
!===============================================================================
207
! 2. CALCUL DE dk/dxj.dw/dxj
208
! Le terme est stocke dans W1
209
! En sortie de l'etape on conserve W1
210
!===============================================================================
212
! Allocate temporary arrays for gradients calculation
213
allocate(gradk(ncelet,3), grado(ncelet,3))
227
( ik , imrgra , inc , iccocg , nswrgp , imligp , &
228
iwarnp , nfecra , epsrgp , climgp , extrap , &
229
rtpa(1,ik) , coefa(1,iclikp) , coefb(1,iclikp) , &
232
nswrgp = nswrgr(iomg)
233
imligp = imligr(iomg)
234
iwarnp = iwarni(iomg)
235
epsrgp = epsrgr(iomg)
236
climgp = climgr(iomg)
237
extrap = extrag(iomg)
241
( iomg , imrgra , inc , iccocg , nswrgp , imligp , &
242
iwarnp , nfecra , epsrgp , climgp , extrap , &
243
rtpa(1,iomg) , coefa(1,iclomg) , coefb(1,iclomg) , &
247
w1(iel) = gradk(iel,1)*grado(iel,1) &
248
+ gradk(iel,2)*grado(iel,2) &
249
+ gradk(iel,3)*grado(iel,3)
253
deallocate(gradk, grado)
255
!====================================================
256
! 3. CALCUL DU COEFFICIENT DE PONDERATION F1
257
! Le terme est stocke dans XF1
258
! En sortie de l'etape on conserve W1,XF1
259
!====================================================
262
if(abs(icdpar).eq.2) then
265
w2(iel) = (cdgfbo(1,ifacpt)-xyzcen(1,iel))**2 &
266
+ (cdgfbo(2,ifacpt)-xyzcen(2,iel))**2 &
267
+ (cdgfbo(3,ifacpt)-xyzcen(3,iel))**2
268
w2(iel) = sqrt(w2(iel))
272
w2(iel) = max(dispar(iel),epzero)
276
! En cas d'ordre 2 on utilise les valeurs en n car le terme en (1-F1)*W1
277
! sera dans PROPCE. Du coup, on aura quand meme certaines "constantes"
278
! intervenant dans des termes en n+1/2 (ex sigma_k pour la diffusion) calcules
279
! a partir de F1 en n -> mais l'effet sur les "constantes" est faible
280
! -> a garder en tete si on fait vraiment de l'ordre 2 en temps en k-omega
282
rom = propce(iel,ipcroo)
283
xnu = propce(iel,ipcvlo)/rom
286
cdkw = 2*rom/ckwsw2/xw*w1(iel)
287
cdkw = max(cdkw,1.d-20)
288
xarg1 = max(sqrt(xk)/cmu/xw/w2(iel), 500.d0*xnu/xw/w2(iel)**2)
289
xarg1 = min(xarg1, 4.d0*rom*xk/ckwsw2/cdkw/w2(iel)**2)
290
xf1(iel) = tanh(xarg1**4)
293
!===============================================================================
294
! 4. CALCUL DU TERME DE PRODUCTION
295
! Les termes sont stockes dans TINSTK,TINSTW
296
! En sortie de l'etape on conserve W1,XF1,TINSTK,TINSTW
297
!===============================================================================
302
xeps = cmu*rtpa(iel,iomg)*xk
303
tinstk(iel) = s2kw(iel) - d2s3*divukw(iel)*divukw(iel)
304
tinstw(iel) = propce(iel,ipcvto)*tinstk(iel) &
305
-d2s3*propce(iel,ipcroo)*xk*divukw(iel)
306
tinstk(iel) = min(tinstw(iel),ckwc1*propce(iel,ipcroo)*xeps)
309
!===============================================================================
310
! 4. CALCUL DU TERME DE GRAVITE
311
! Les termes sont stockes dans TINSTK,TINSTW,W2
312
! En sortie de l'etape on conserve W1,W2,XF1,TINSTK,TINSTW
313
!===============================================================================
317
! Allocate a temporary array for the gradient calculation
318
allocate(grad(ncelet,3))
320
! --- Terme de gravite G = BETA*G*GRAD(SCA)/PRDTUR/RHO
321
! Ici on calcule G =-G*GRAD(RHO)/PRDTUR/RHO
326
! Le choix ci dessous a l'avantage d'etre simple
335
! Conditions aux limites sur ROM : Dirichlet ROMB
336
! On utilise VISCB pour stocker le COEFB relatif a ROM
337
! On impose en Dirichlet (COEFA) la valeur ROMB
347
( iivar , imrgra , inc , iccocg , nswrgp , imligp , &
348
iwarnp , nfecra , epsrgp , climgp , extrap , &
349
propce(1,ipcroo), propfb(1,ipbroo), viscb , &
353
! Production et terme de gravite
354
! TINSTK=MIN(P,C1*EPS)+G et TINSTW=P+(1-CE3)*G
355
! On conserve G dans W2 pour la phase de couplage des termes sources
357
if(iscalt.gt.0.and.nscal.ge.iscalt) then
358
prdtur = sigmas(iscalt)
364
w2(iel) = -(grad(iel,1)*gx + grad(iel,2)*gy + grad(iel,3)*gz) / &
365
(propce(iel,ipcroo)*prdtur)
366
tinstw(iel)=tinstw(iel)+propce(iel,ipcvto)*max(w2(iel),zero)
367
tinstk(iel)=tinstk(iel)+propce(iel,ipcvto)*w2(iel)
376
!===============================================================================
377
! 5. PRISE EN COMPTE DES TERMES SOURCES UTILISATEURS
378
! Les termes sont stockes dans SMBRK,SMBRW,DAM,W3
379
! En sortie de l'etape on conserve W1-3,XF1,TINSTK,TINSTW,SMBRK,SMBRW,DAM
380
!===============================================================================
391
( nvar , nscal , ncepdp , ncesmp , &
392
icepdc , icetsm , itypsm , &
393
dt , rtpa , propce , propfa , propfb , &
394
coefa , coefb , ckupdc , smacel , s2kw , divukw , &
396
smbrk , smbrw , dam , w3 )
397
! ------ ------ ------ ------
399
!===============================================================================
400
! 6. TERME D'ACCUMULATION DE MASSE -(dRO/dt)*Volume
402
! Le terme est stocke dans W4
403
! En sortie de l'etape on conserve W1-4,XF1,TINSTK,TINSTW,SMBRK,SMBRW,DAM
404
!===============================================================================
407
call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
408
ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w4)
410
!===============================================================================
411
! 7. ON FINALISE LE CALCUL DES TERMES SOURCES
413
! Les termes sont stockes dans SMBRK, SMBRW
414
! En sortie de l'etape on conserve SMBRK,SMBRW,DAM,W1-4
415
!===============================================================================
419
visct = propce(iel,ipcvto)
420
rom = propce(iel,ipcroo)
424
xgamma = xxf1*ckwgm1 + (1.d0-xxf1)*ckwgm2
425
xbeta = xxf1*ckwbt1 + (1.d0-xxf1)*ckwbt2
427
smbrk(iel) = smbrk(iel) + volume(iel)*( &
431
smbrw(iel) = smbrw(iel) + volume(iel)*( &
432
rom*xgamma/visct*tinstw(iel) &
434
+2.d0*rom/xw*(1.d0-xxf1)/ckwsw2*w1(iel) )
438
!===============================================================================
439
! 8. PRISE EN COMPTE DES TERMES D'ACCUMULATION DE MASSE ET
440
! DE LA DEUXIEME PARTIE DES TS UTILISATEURS (PARTIE EXPLICITE)
441
! STOCKAGE POUR EXTRAPOLATION EN TEMPS
442
! On utilise SMBRK,SMBRW
443
! En sortie de l'etape on conserve SMBRK,SMBRW,DAM,W2-4
445
! Remarque : l'extrapolation telle qu'elle est ecrite n'a pas grand
447
!===============================================================================
449
! Si on extrapole les T.S.
454
! Sauvegarde pour echange
455
tuexpk = propce(iel,iptsta)
456
! Pour la suite et le pas de temps suivant
457
propce(iel,iptsta) = smbrk(iel)
458
! Termes dependant de la variable resolue et theta PROPCE
459
smbrk(iel) = iconv(ik)*w4(iel)*rtpa(iel,ik) - thets*tuexpk
460
! On suppose -DAM > 0 : on implicite
461
! le terme utilisateur dependant de la variable resolue
462
smbrk(iel) = dam(iel)*rtpa(iel,ik) + smbrk(iel)
464
! Sauvegarde pour echange
465
tuexpw = propce(iel,iptsta+1)
466
! Pour la suite et le pas de temps suivant
467
propce(iel,iptsta+1) = smbrw(iel)
468
! Termes dependant de la variable resolue et theta PROPCE
469
smbrw(iel) = iconv(iomg)*w4(iel)*rtpa(iel,iomg) - thets*tuexpw
470
! On suppose -W3 > 0 : on implicite
471
! le terme utilisateur dependant de la variable resolue
472
smbrw(iel) = w3(iel)*rtpa(iel,iomg) + smbrw(iel)
476
! Si on n'extrapole pas les T.S.
479
smbrk(iel) = smbrk(iel) + dam(iel)*rtpa(iel,ik) &
480
+iconv(ik)*w4(iel)*rtpa(iel,ik)
481
smbrw(iel) = smbrw(iel) + w3 (iel)*rtpa(iel,iomg) &
482
+iconv(iomg)*w4(iel)*rtpa(iel,iomg)
486
!===============================================================================
487
! 8.1 PRISE EN COMPTE DES TERMES SOURCES LAGRANGIEN : PARTIE EXPLICITE
489
!===============================================================================
491
! Ordre 2 non pris en compte
492
if (iilagr.eq.2 .and. ltsdyn.eq.1) then
496
! Termes sources explicte et implicte sur k
498
smbrk(iel) = smbrk(iel) + tslagr(iel,itske)
500
! Termes sources explicte sur omega : on reprend la constante CE4 directement
501
! du k-eps sans justification ... a creuser si necessaire !
503
smbrw(iel) = smbrw(iel) &
504
+ ce4 *tslagr(iel,itske) * propce(iel,ipcroo) &
511
!===============================================================================
512
! 9. PRISE EN COMPTE DES TERMES DE CONV/DIFF DANS LE SECOND MEMBRE
514
! Tableaux de travail W7, W8, W1, TINSTK, TINSTW
515
! Les termes sont stockes dans W5 et W6, puis ajoutes a SMBRK, SMBRW
516
! En sortie de l'etape on conserve W2-6,SMBRK,SMBRW,DAM
517
!===============================================================================
519
! Ceci ne sert a rien si IKECOU n'est pas egal a 1
521
if (ikecou.eq.1) then
528
! ---> Traitement de k
534
iclvar = iclrtp(ivar,icoef )
535
iclvaf = iclrtp(ivar,icoeff)
538
if( idiff(ivar).ge. 1 ) then
542
sigma = xxf1*ckwsk1 + (1.d0-xxf1)*ckwsk2
543
w7(iel) = propce(iel,ipcvis) &
544
+ idifft(ivar)*propce(iel,ipcvst)/sigma
565
iconvp = iconv (ivar)
566
idiffp = idiff (ivar)
567
nswrgp = nswrgr(ivar)
568
imligp = imligr(ivar)
569
ircflp = ircflu(ivar)
570
ischcp = ischcv(ivar)
571
isstpp = isstpc(ivar)
572
iwarnp = iwarni(ivar)
573
blencp = blencv(ivar)
574
epsrgp = epsrgr(ivar)
575
climgp = climgr(ivar)
576
extrap = extrag(ivar)
577
relaxp = relaxv(ivar)
578
thetap = thetav(ivar)
583
idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
584
ischcp , isstpp , inc , imrgra , iccocg , &
586
blencp , epsrgp , climgp , extrap , relaxp , thetap , &
587
rtpa(1,ivar) , rtpa(1,ivar) , &
588
coefa(1,iclvar) , coefb(1,iclvar) , &
589
coefa(1,iclvaf) , coefb(1,iclvaf) , &
590
propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
594
if (iwarni(ivar).ge.2) then
596
call prodsc(ncelet,ncel,isqrt,smbrk,smbrk,rnorm)
597
write(nfecra,1100) chaine(1:8) ,rnorm
601
! ---> Traitement de omega
607
iclvar = iclrtp(ivar,icoef )
608
iclvaf = iclrtp(ivar,icoeff)
611
if( idiff(ivar).ge. 1 ) then
614
sigma = xxf1*ckwsw1 + (1.d0-xxf1)*ckwsw2
615
w7(iel) = propce(iel,ipcvis) &
616
+ idifft(ivar)*propce(iel,ipcvst)/sigma
637
iconvp = iconv (ivar)
638
idiffp = idiff (ivar)
639
nswrgp = nswrgr(ivar)
640
imligp = imligr(ivar)
641
ircflp = ircflu(ivar)
642
ischcp = ischcv(ivar)
643
isstpp = isstpc(ivar)
644
iwarnp = iwarni(ivar)
645
blencp = blencv(ivar)
646
epsrgp = epsrgr(ivar)
647
climgp = climgr(ivar)
648
extrap = extrag(ivar)
649
relaxp = relaxv(ivar)
650
thetap = thetav(ivar)
655
idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
656
ischcp , isstpp , inc , imrgra , iccocg , &
658
blencp , epsrgp , climgp , extrap , relaxp , thetap , &
659
rtpa(1,ivar) , rtpa(1,ivar) , &
660
coefa(1,iclvar) , coefb(1,iclvar) , &
661
coefa(1,iclvaf) , coefb(1,iclvaf) , &
662
propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
666
if (iwarni(ivar).ge.2) then
668
call prodsc(ncelet,ncel,isqrt,smbrw,smbrw,rnorm)
669
write(nfecra,1100) chaine(1:8) ,rnorm
673
smbrk(iel) = smbrk(iel) + w5(iel)
674
smbrw(iel) = smbrw(iel) + w6(iel)
679
!===============================================================================
680
! 10. AJOUT DES TERMES SOURCES DE MASSE EXPLICITES
682
! Les parties implicites eventuelles sont conservees dans W7 et W8
683
! et utilisees dans la phase d'implicitation cv/diff
685
! Les termes sont stockes dans SMBRK, SMBRW, W7, W8
686
! En sortie de l'etape on conserve W2-8,SMBRK,SMBRW,DAM
687
!===============================================================================
689
if (ncesmp.gt.0) then
696
! Entier egal a 1 (pour navsto : nb de sur-iter)
699
! On incremente SMBRS par -Gamma RTPA et ROVSDT par Gamma (*theta)
703
( ncelet , ncel , ncesmp , iiun , &
704
isto2t , thetav(ivar) , &
705
icetsm , itypsm(1,ivar) , &
706
volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipr) , &
707
smbrk , w7 , tinstk )
711
( ncelet , ncel , ncesmp , iiun , &
712
isto2t , thetav(ivar) , &
713
icetsm , itypsm(1,ivar) , &
714
volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipr) , &
715
smbrw , w8 , tinstw )
717
! Si on extrapole les TS on met Gamma Pinj dans PROPCE
720
propce(iel,iptsta ) = propce(iel,iptsta ) + tinstk(iel)
721
propce(iel,iptsta+1) = propce(iel,iptsta+1) + tinstw(iel)
723
! Sinon on le met directement dans SMBR
726
smbrk(iel) = smbrk(iel) + tinstk(iel)
727
smbrw(iel) = smbrw(iel) + tinstw(iel)
733
! Finalisation des termes sources
735
thetp1 = 1.d0 + thets
737
smbrk(iel) = smbrk(iel) + thetp1 * propce(iel,iptsta)
738
smbrw(iel) = smbrw(iel) + thetp1 * propce(iel,iptsta+1)
742
!===============================================================================
743
! 11. INCREMENTS DES TERMES SOURCES DANS LE SECOND MEMBRE
745
! Les termes sont stockes dans SMBRK, SMBRW
746
! En sortie de l'etape on conserve W3-8,SMBRK,SMBRW
747
!===============================================================================
749
! Ordre 2 non pris en compte
754
rom = propce(iel,ipcrom)
758
romvsd = 1.d0/(rom*volume(iel))
759
smbrk(iel) = smbrk(iel)*romvsd
760
smbrw(iel) = smbrw(iel)*romvsd
761
divp23 = d2s3*max(divukw(iel),zero)
762
produc = s2kw(iel)-d2s3*divukw(iel)**2+w2(iel)
766
xgamma = xxf1*ckwgm1 + (1.d0-xxf1)*ckwgm2
767
xbeta = xxf1*ckwbt1 + (1.d0-xxf1)*ckwbt2
770
- 1.d0/xw*min(produc,zero)+divp23+cmu*xw
773
a22 = 1.d0/dt(iel)+xgamma*divp23+2.d0*xbeta*xw
775
unsdet = 1.d0/(a11*a22 -a12*a21)
777
deltk = ( a22*smbrk(iel) -a12*smbrw(iel) )*unsdet
778
deltw = (-a21*smbrk(iel) +a11*smbrw(iel) )*unsdet
780
! NOUVEAU TERME SOURCE POUR CODITS
782
romvsd = rom*volume(iel)/dt(iel)
784
smbrk(iel) = romvsd*deltk
785
smbrw(iel) = romvsd*deltw
791
!===============================================================================
792
! 12. TERMES INSTATIONNAIRES
794
! Les termes sont stockes dans TINSTK, TINSTW
795
! En sortie de l'etape on conserve SMBRK, SMBRW, TINSTK, TINSTW
796
!===============================================================================
798
! --- PARTIE EXPLICITE
800
! on enleve la convection/diffusion au temps n a SMBRK et SMBRW
801
! s'ils ont ete calcules
802
if (ikecou.eq.1) then
804
smbrk(iel) = smbrk(iel) - w5(iel)
805
smbrw(iel) = smbrw(iel) - w6(iel)
810
! Extrapolation ou non, meme forme par coherence avec bilsc2
813
rom = propce(iel,ipcrom)
814
romvsd = rom*volume(iel)/dt(iel)
815
tinstk(iel) = istat(ik)*romvsd -iconv(ik)*w4(iel)*thetav(ik)
816
tinstw(iel) = istat(iomg)*romvsd -iconv(iomg)*w4(iel)*thetav(iomg)
819
! --- Source de masse (le theta est deja inclus par catsma)
820
if (ncesmp.gt.0) then
822
tinstk(iel) = tinstk(iel) + w7(iel)
823
tinstw(iel) = tinstw(iel) + w8(iel)
827
! --- Termes sources utilisateurs
830
thetaw = thetav(iomg)
832
tinstk(iel) = tinstk(iel) -dam(iel)*thetak
833
tinstw(iel) = tinstw(iel) -w3 (iel)*thetaw
837
tinstk(iel) = tinstk(iel) + max(-dam(iel),zero)
838
tinstw(iel) = tinstw(iel) + max(-w3 (iel),zero)
842
! --- PRISE EN COMPTE DES TERMES LAGRANGIEN : COUPLAGE RETOUR
844
! Ordre 2 non pris en compte
845
if (iilagr.eq.2 .and. ltsdyn.eq.1) then
849
! Termes sources implicite sur k
851
tinstk(iel) = tinstk(iel) + max(-tslagr(iel,itsli),zero)
853
! Termes sources implicte sur omega
855
tinstw(iel) = tinstw(iel) &
856
+ max( (-ce4*tslagr(iel,itske)/rtpa(iel,ik)) , zero)
862
! Si IKECOU=0, on implicite plus fortement k et omega
868
xbeta = xxf1*ckwbt1 + (1.d0-xxf1)*ckwbt2
869
rom = propce(iel,ipcrom)
870
tinstk(iel) = tinstk(iel) + &
871
volume(iel)*cmu*rom*xw
872
tinstw(iel) = tinstw(iel) + &
873
volume(iel)*xbeta*rom*xw
878
!===============================================================================
881
! On utilise SMBRK, SMBRW, TINSTK, TINSTW
882
!===============================================================================
884
! ---> Traitement de k
887
iclvar = iclrtp(ivar,icoef )
888
iclvaf = iclrtp(ivar,icoeff)
892
! "VITESSE" DE DIFFUSION FACETTE
894
if( idiff(ivar).ge. 1 ) then
898
sigma = xxf1*ckwsk1 + (1.d0-xxf1)*ckwsk2
899
w1(iel) = propce(iel,ipcvis) &
900
+ idifft(ivar)*propce(iel,ipcvst)/sigma
921
iconvp = iconv (ivar)
922
idiffp = idiff (ivar)
923
ireslp = iresol(ivar)
924
ndircp = ndircl(ivar)
925
nitmap = nitmax(ivar)
926
nswrsp = nswrsm(ivar)
927
nswrgp = nswrgr(ivar)
928
imligp = imligr(ivar)
929
ircflp = ircflu(ivar)
930
ischcp = ischcv(ivar)
931
isstpp = isstpc(ivar)
934
ncymxp = ncymax(ivar)
935
nitmfp = nitmgf(ivar)
937
iwarnp = iwarni(ivar)
938
blencp = blencv(ivar)
939
epsilp = epsilo(ivar)
940
epsrsp = epsrsm(ivar)
941
epsrgp = epsrgr(ivar)
942
climgp = climgr(ivar)
943
extrap = extrag(ivar)
944
relaxp = relaxv(ivar)
945
thetap = thetav(ivar)
950
idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
951
imrgra , nswrsp , nswrgp , imligp , ircflp , &
952
ischcp , isstpp , iescap , &
953
imgrp , ncymxp , nitmfp , ipp , iwarnp , &
954
blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
956
rtpa(1,ivar) , rtpa(1,ivar) , &
957
coefa(1,iclvar) , coefb(1,iclvar) , &
958
coefa(1,iclvaf) , coefb(1,iclvaf) , &
959
propfa(1,iflmas), propfb(1,iflmab), &
960
viscf , viscb , viscf , viscb , &
961
tinstk , smbrk , rtp(1,ivar) , &
965
! ---> Traitement de omega
968
iclvar = iclrtp(ivar,icoef )
969
iclvaf = iclrtp(ivar,icoeff)
974
! "VITESSE" DE DIFFUSION FACETTE
976
if( idiff(ivar).ge. 1 ) then
979
sigma = xxf1*ckwsw1 + (1.d0-xxf1)*ckwsw2
980
w1(iel) = propce(iel,ipcvis) &
981
+ idifft(ivar)*propce(iel,ipcvst)/sigma
1000
! RESOLUTION POUR OMEGA
1002
iconvp = iconv (ivar)
1003
idiffp = idiff (ivar)
1004
ireslp = iresol(ivar)
1005
ndircp = ndircl(ivar)
1006
nitmap = nitmax(ivar)
1007
nswrsp = nswrsm(ivar)
1008
nswrgp = nswrgr(ivar)
1009
imligp = imligr(ivar)
1010
ircflp = ircflu(ivar)
1011
ischcp = ischcv(ivar)
1012
isstpp = isstpc(ivar)
1015
ncymxp = ncymax(ivar)
1016
nitmfp = nitmgf(ivar)
1018
iwarnp = iwarni(ivar)
1019
blencp = blencv(ivar)
1020
epsilp = epsilo(ivar)
1021
epsrsp = epsrsm(ivar)
1022
epsrgp = epsrgr(ivar)
1023
climgp = climgr(ivar)
1024
extrap = extrag(ivar)
1025
relaxp = relaxv(ivar)
1026
thetap = thetav(ivar)
1031
idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
1032
imrgra , nswrsp , nswrgp , imligp , ircflp , &
1033
ischcp , isstpp , iescap , &
1034
imgrp , ncymxp , nitmfp , ipp , iwarnp , &
1035
blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
1037
rtpa(1,ivar) , rtpa(1,ivar) , &
1038
coefa(1,iclvar) , coefb(1,iclvar) , &
1039
coefa(1,iclvaf) , coefb(1,iclvaf) , &
1040
propfa(1,iflmas), propfb(1,iflmab), &
1041
viscf , viscb , viscf , viscb , &
1042
tinstw , smbrw , rtp(1,ivar) , &
1046
!===============================================================================
1048
!===============================================================================
1050
! Calcul des Min/Max avant clipping, pour affichage
1054
elseif(ii.eq.2) then
1063
vrmin = min(vrmin,var)
1064
vrmax = max(vrmax,var)
1066
if (irangp.ge.0) then
1077
! On clippe simplement k et omega par valeur absolue
1083
if (abs(xk).le.epz2) then
1085
rtp(iel,ik) = max(rtp(iel,ik),epz2)
1086
elseif(xk.le.0.d0) then
1090
if (abs(xw).le.epz2) then
1092
rtp(iel,iomg) = max(rtp(iel,iomg),epz2)
1093
elseif(xw.le.0.d0) then
1099
if (irangp.ge.0) then
1100
call parcpt (iclipk)
1102
call parcpt (iclipw)
1106
! --- Stockage nb de clippings pour listing
1108
iclpmn(ipprtp(ik )) = iclipk
1109
iclpmn(ipprtp(iomg)) = iclipw
1113
deallocate(viscf, viscb)
1115
deallocate(smbrk, smbrw, rovsdt)
1116
deallocate(tinstk, tinstw, xf1)
1117
deallocate(w1, w2, w3)
1118
deallocate(w4, w5, w6)
1125
#if defined(_CS_LANG_FR)
1128
' ** RESOLUTION DU K-OMEGA ',/,&
1129
' --------------------- ',/)
1130
1100 format(1X,A8,' : BILAN EXPLICITE = ',E14.5)
1135
' ** SOLVING K-OMEGA' ,/,&
1136
' ---------------' ,/)
1137
1100 format(1X,A8,' : EXPLICIT BALANCE = ',E14.5)