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 cfxtcl &
32
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
33
nnod , lndfac , lndfbr , ncelbr , &
34
nvar , nscal , nphas , &
35
nideve , nrdeve , nituse , nrtuse , &
36
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
37
ipnfac , nodfac , ipnfbr , nodfbr , &
38
27
icodcl , itrifb , itypfb , izfppp , &
39
idevel , ituser , ia , &
40
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
41
28
dt , rtp , rtpa , propce , propfa , propfb , &
42
coefa , coefb , rcodcl , &
43
w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
44
rdevel , rtuser , ra )
29
coefa , coefb , rcodcl )
46
31
!===============================================================================
57
42
!__________________.____._____.________________________________________________.
58
43
! name !type!mode ! role !
59
44
!__________________!____!_____!________________________________________________!
60
! idbia0 ! i ! <-- ! number of first free position in ia !
61
! idbra0 ! i ! <-- ! number of first free position in ra !
62
! ndim ! i ! <-- ! spatial dimension !
63
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
64
! ncel ! i ! <-- ! number of cells !
65
! nfac ! i ! <-- ! number of interior faces !
66
! nfabor ! i ! <-- ! number of boundary faces !
67
! nfml ! i ! <-- ! number of families (group classes) !
68
! nprfml ! i ! <-- ! number of properties per family (group class) !
69
! nnod ! i ! <-- ! number of vertices !
70
! lndfac ! i ! <-- ! size of nodfac indexed array !
71
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
72
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
73
45
! nvar ! i ! <-- ! total number of variables !
74
46
! nscal ! i ! <-- ! total number of scalars !
75
! nphas ! i ! <-- ! number of phases !
76
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
77
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
78
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
79
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
80
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
81
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
82
! iprfml ! ia ! <-- ! property numbers per family !
83
! (nfml, nprfml) ! ! ! !
84
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
85
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
86
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
87
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
88
47
! icodcl ! te ! --> ! code de condition limites aux faces !
89
48
! (nfabor,nvar ! ! ! de bord !
90
49
! ! ! ! = 1 -> dirichlet !
150
84
! --- tableau de travail
151
85
!===============================================================================
87
!===============================================================================
89
!===============================================================================
106
!===============================================================================
155
!===============================================================================
157
!===============================================================================
174
!===============================================================================
178
integer idbia0 , idbra0
179
integer ndim , ncelet , ncel , nfac , nfabor
180
integer nfml , nprfml
181
integer nnod , lndfac , lndfbr , ncelbr
182
integer nvar , nscal , nphas
183
integer nideve , nrdeve , nituse , nrtuse
185
integer ifacel(2,nfac) , ifabor(nfabor)
186
integer ifmfbr(nfabor) , ifmcel(ncelet)
187
integer iprfml(nfml,nprfml)
188
integer ipnfac(nfac+1), nodfac(lndfac)
189
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
190
114
integer icodcl(nfabor,nvar)
191
integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
115
integer itrifb(nfabor), itypfb(nfabor)
192
116
integer izfppp(nfabor)
193
integer idevel(nideve), ituser(nituse), ia(*)
195
double precision xyzcen(ndim,ncelet)
196
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
197
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
198
double precision xyznod(ndim,nnod), volume(ncelet)
199
118
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
200
119
double precision propce(ncelet,*)
201
120
double precision propfa(nfac,*), propfb(nfabor,*)
202
121
double precision coefa(nfabor,*), coefb(nfabor,*)
203
122
double precision rcodcl(nfabor,nvar,3)
204
double precision w1(ncelet),w2(ncelet),w3(ncelet)
205
double precision w4(ncelet),w5(ncelet),w6(ncelet)
206
double precision coefu(nfabor,ndim)
207
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
209
124
! Local variables
211
integer idebia, idebra
212
integer iphas , ivar , ifac , iel
126
integer ivar , ifac , iel
213
127
integer ii , iii , imodif, iccfth
214
128
integer icalep, icalgm
216
integer ipriph, iuiph , iviph , iwiph
217
integer irhiph, ieniph, itkiph
130
integer irh , ien , itk
218
131
integer iclp , iclr
219
132
integer iclu , iclv , iclw
226
139
double precision hint , gammag
141
double precision, allocatable, dimension(:) :: w1, w2, w3
142
double precision, allocatable, dimension(:) :: w4, w5, w6
143
double precision, allocatable, dimension(:) :: w7
228
145
!===============================================================================
229
146
!===============================================================================
230
147
! 1. INITIALISATIONS
231
148
!===============================================================================
243
irhiph = isca(irho (iphas))
244
ieniph = isca(ienerg(iphas))
245
itkiph = isca(itempk(iphas))
246
iclp = iclrtp(ipriph,icoef)
247
iclr = iclrtp(irhiph,icoef)
248
iclu = iclrtp(iuiph ,icoef)
249
iclv = iclrtp(iviph ,icoef)
250
iclw = iclrtp(iwiph ,icoef)
252
iflmab = ipprob(ifluma(ieniph))
150
! Allocate work arrays
151
allocate(w1(ncelet), w2(ncelet), w3(ncelet))
152
allocate(w4(ncelet), w5(ncelet), w6(ncelet))
154
! Allocate a work array on boundary faces (to be verified...)
162
iclp = iclrtp(ipr,icoef)
163
iclr = iclrtp(irh,icoef)
164
iclu = iclrtp(iu ,icoef)
165
iclv = iclrtp(iv ,icoef)
166
iclw = iclrtp(iw ,icoef)
168
iflmab = ipprob(ifluma(ien))
254
170
! Liste des variables compressible :
264
180
! Calcul de epsilon_sup = e - CvT
265
181
! On en a besoin si on a des parois a temperature imposee.
268
184
! n�cessaire de gagner de la m�moire, on pourra modifier
273
if(icodcl(ifac,itkiph).eq.5) then
282
( idebia , idebra , &
283
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
284
nnod , lndfac , lndfbr , ncelbr , &
285
nvar , nscal , nphas , &
286
iccfth , imodif , iphas , &
287
nideve , nrdeve , nituse , nrtuse , &
288
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
289
ipnfac , nodfac , ipnfbr , nodfbr , &
290
idevel , ituser , ia , &
291
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
292
dt , rtp , rtpa , propce , propfa , propfb , &
294
w5 , coefu(1,1) , w3 , w4 , &
296
rdevel , rtuser , ra )
189
if(icodcl(ifac,itk).eq.5) then
200
dt , rtp , rtpa , propce , propfa , propfb , &
300
206
! Calcul de gamma (constant ou variable ; pour le moment : cst)
301
207
! On en a besoin pour les entrees sorties avec rusanov
305
if ( ( itypfb(ifac,iphas).eq.iesicf ) .or. &
306
( itypfb(ifac,iphas).eq.isopcf ) .or. &
307
( itypfb(ifac,iphas).eq.ierucf ) .or. &
308
( itypfb(ifac,iphas).eq.ieqhcf ) ) then
317
( idebia , idebra , &
318
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
319
nnod , lndfac , lndfbr , ncelbr , &
320
nvar , nscal , nphas , &
321
iccfth , imodif , iphas , &
322
nideve , nrdeve , nituse , nrtuse , &
323
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
324
ipnfac , nodfac , ipnfbr , nodfbr , &
325
idevel , ituser , ia , &
326
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
327
dt , rtp , rtpa , propce , propfa , propfb , &
329
w1 , w2 , w6 , w4 , &
330
rdevel , rtuser , ra )
211
if ( ( itypfb(ifac).eq.iesicf ) .or. &
212
( itypfb(ifac).eq.isopcf ) .or. &
213
( itypfb(ifac).eq.ierucf ) .or. &
214
( itypfb(ifac).eq.ieqhcf ) ) then
225
dt , rtp , rtpa , propce , propfa , propfb , &
332
if(ieos(iphas).eq.1) then
335
232
! Gamma doit etre passe a cfrusb ; s'il est variable
336
233
! il est dans le tableau W6 et il faut ajouter
337
234
! GAMMAG = W6(IFABOR(IFAC)) selon IEOS
338
235
! dans la boucle sur les faces.
339
236
! En attendant que IEOS different de 1 soit code, on stoppe
348
245
! Boucle sur les faces
353
250
!===============================================================================
354
251
! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
355
252
! ON BOUCLE SUR TOUTES LES FACES DE PAROI
356
253
!===============================================================================
358
if ( itypfb(ifac,iphas).eq.iparoi) then
255
if ( itypfb(ifac).eq.iparoi) then
360
257
! Les RCODCL ont ete initialises a -RINFIN pour permettre de
361
258
! verifier ceux que l'utilisateur a modifies. On les remet a zero
362
259
! si l'utilisateur ne les a pas modifies.
363
260
! En paroi, on traite toutes les variables.
365
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
366
rcodcl(ifac,ivar,1) = 0.d0
262
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
263
rcodcl(ifac,ivar,1) = 0.d0
370
267
! Le flux de masse est nul
372
propfb(ifac,iflmab) = 0.d0
269
propfb(ifac,iflmab) = 0.d0
376
273
! Si la gravite est predominante : pression hydrostatique
377
274
! (approximatif et surtout explicite en rho)
379
if(icfgrp(iphas).eq.1) then
381
icodcl(ifac,ipriph) = 3
382
hint = dt(iel)/ra(idistb-1+ifac)
383
rcodcl(ifac,ipriph,3) = -hint &
384
* ( gx*(cdgfbo(1,ifac)-xyzcen(1,iel)) &
279
hint = dt(iel)/distb(ifac)
280
rcodcl(ifac,ipr,3) = -hint &
281
* ( gx*(cdgfbo(1,ifac)-xyzcen(1,iel)) &
385
282
+ gy*(cdgfbo(2,ifac)-xyzcen(2,iel)) &
386
283
+ gz*(cdgfbo(3,ifac)-xyzcen(3,iel)) ) &
391
288
! En g�n�ral : proportionnelle a la valeur interne
392
289
! (Pbord = COEFB*Pi)
393
290
! Si on d�tend trop : Dirichlet homogene
399
( idebia , idebra , &
400
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
401
nnod , lndfac , lndfbr , ncelbr , &
402
nvar , nscal , nphas , &
403
iccfth , ifac , iphas , &
404
nideve , nrdeve , nituse , nrtuse , &
405
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
406
ipnfac , nodfac , ipnfbr , nodfbr , &
407
idevel , ituser , ia , &
408
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
409
298
dt , rtp , rtpa , propce , propfa , propfb , &
410
299
coefa , coefb , &
411
w1 , w2 , w3 , w4 , &
412
rdevel , rtuser , ra )
414
302
! En outre, il faut appliquer une pre-correction pour compenser
415
303
! le traitement fait dans condli... Si on pouvait remplir COEFA
416
304
! et COEFB directement, on gagnerait en simplicite, mais cela
417
305
! demanderait un test sur IPPMOD dans condli : � voir)
419
icodcl(ifac,ipriph) = 1
420
if(coefb(ifac,iclp).lt.rinfin*0.5d0.and. &
308
if(coefb(ifac,iclp).lt.rinfin*0.5d0.and. &
421
309
coefb(ifac,iclp).gt.0.d0 ) then
422
hint = dt(iel)/ra(idistb-1+ifac)
423
rcodcl(ifac,ipriph,1) = 0.d0
424
rcodcl(ifac,ipriph,2) = &
425
hint*(1.d0/coefb(ifac,iclp)-1.d0)
427
rcodcl(ifac,ipriph,1) = 0.d0
310
hint = dt(iel)/distb(ifac)
311
rcodcl(ifac,ipr,1) = 0.d0
312
rcodcl(ifac,ipr,2) = hint*(1.d0/coefb(ifac,iclp)-1.d0)
314
rcodcl(ifac,ipr,1) = 0.d0
433
320
! La vitesse et la turbulence sont trait�es de mani�re standard,
464
351
! sachant que l'energie contient l'energie cinetique,
465
352
! ce qui rend le choix du profil d�licat.
467
icodcl(ifac,ieniph) = 5
468
if(icv(iphas).eq.0) then
469
rcodcl(ifac,ieniph,1) = &
470
cv0(iphas)*rcodcl(ifac,itkiph,1)
472
rcodcl(ifac,ieniph,1) = propce(iel,ipproc(icv(iphas))) &
473
*rcodcl(ifac,itkiph,1)
475
rcodcl(ifac,ieniph,1) = rcodcl(ifac,ieniph,1) &
476
+ 0.5d0*(rtp(iel,iuiph)**2+ &
477
rtp(iel,iviph)**2+rtp(iel,iwiph)**2) &
356
rcodcl(ifac,ien,1) = cv0*rcodcl(ifac,itk,1)
358
rcodcl(ifac,ien,1) = propce(iel,ipproc(icv)) &
361
rcodcl(ifac,ien,1) = rcodcl(ifac,ien,1) &
362
+ 0.5d0*(rtp(iel,iu)**2+rtp(iel,iv)**2+rtp(iel,iw)**2) &
479
364
! ^epsilon sup (cf USCFTH)
481
366
! Les flux en grad epsilon sup et �nergie cin�tique doivent
482
367
! �tre nuls puisque tout est pris par le terme de
483
368
! diffusion d'energie.
484
ia(iifbet+ifac-1+(iphas-1)*nfabor) = 1
486
371
! Flux nul pour la reconstruction �ventuelle de temp�rature
487
icodcl(ifac,itkiph) = 3
488
rcodcl(ifac,itkiph,3) = 0.d0
373
rcodcl(ifac,itk,3) = 0.d0
491
elseif(icodcl(ifac,itkiph).eq.3) then
376
elseif(icodcl(ifac,itk).eq.3) then
493
378
! On impose le flux sur l'energie
494
icodcl(ifac,ieniph) = 3
495
rcodcl(ifac,ieniph,3) = rcodcl(ifac,itkiph,3)
380
rcodcl(ifac,ien,3) = rcodcl(ifac,itk,3)
497
382
! Les flux en grad epsilon sup et �nergie cin�tique doivent
498
383
! �tre nuls puisque tout est pris par le terme de
499
384
! diffusion d'energie.
500
ia(iifbet+ifac-1+(iphas-1)*nfabor) = 1
502
387
! Flux nul pour la reconstruction �ventuelle de temp�rature
503
icodcl(ifac,itkiph) = 3
504
rcodcl(ifac,itkiph,3) = 0.d0
389
rcodcl(ifac,itk,3) = 0.d0
509
394
! Scalaires : flux nul (par defaut dans typecl pour iparoi)
514
399
! ON BOUCLE SUR TOUTES LES FACES DE SYMETRIE
515
400
!===============================================================================
517
elseif ( itypfb(ifac,iphas).eq.isymet ) then
402
elseif ( itypfb(ifac).eq.isymet ) then
519
404
! Les RCODCL ont ete initialises a -RINFIN pour permettre de
520
405
! verifier ceux que l'utilisateur a modifies. On les remet a zero
521
406
! si l'utilisateur ne les a pas modifies.
522
407
! En symetrie, on traite toutes les variables.
524
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
525
rcodcl(ifac,ivar,1) = 0.d0
409
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
410
rcodcl(ifac,ivar,1) = 0.d0
529
414
! Le flux de masse est nul
531
propfb(ifac,iflmab) = 0.d0
416
propfb(ifac,iflmab) = 0.d0
533
418
! Condition de Pression
539
( idebia , idebra , &
540
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
541
nnod , lndfac , lndfbr , ncelbr , &
542
nvar , nscal , nphas , &
543
iccfth , ifac , iphas , &
544
nideve , nrdeve , nituse , nrtuse , &
545
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
546
ipnfac , nodfac , ipnfbr , nodfbr , &
547
idevel , ituser , ia , &
548
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
549
426
dt , rtp , rtpa , propce , propfa , propfb , &
550
427
coefa , coefb , &
551
w1 , w2 , w3 , w4 , &
552
rdevel , rtuser , ra )
592
468
! On recherche la variable a initialiser
593
469
! (si on a donne une valeur nulle, c'est pas adapte : on supposera
594
470
! qu'on n'a pas initialise et on sort en erreur)
596
if(rcodcl(ifac,ipriph,1).gt.0.d0) iccfth = 2*iccfth
597
if(rcodcl(ifac,irhiph,1).gt.0.d0) iccfth = 3*iccfth
598
if(rcodcl(ifac,itkiph,1).gt.0.d0) iccfth = 5*iccfth
599
if(rcodcl(ifac,ieniph,1).gt.0.d0) iccfth = 7*iccfth
600
if((iccfth.le.70000.and.iccfth.ne.60000).or. &
472
if(rcodcl(ifac,ipr,1).gt.0.d0) iccfth = 2*iccfth
473
if(rcodcl(ifac,irh,1).gt.0.d0) iccfth = 3*iccfth
474
if(rcodcl(ifac,itk,1).gt.0.d0) iccfth = 5*iccfth
475
if(rcodcl(ifac,ien,1).gt.0.d0) iccfth = 7*iccfth
476
if((iccfth.le.70000.and.iccfth.ne.60000).or. &
601
477
(iccfth.eq.350000)) then
602
write(nfecra,1000)iccfth
605
iccfth = iccfth + 900
478
write(nfecra,1000)iccfth
481
iccfth = iccfth + 900
607
483
! Les RCODCL ont ete initialises a -RINFIN pour permettre de
608
484
! verifier ceux que l'utilisateur a modifies. On les remet a zero
609
485
! si l'utilisateur ne les a pas modifies.
610
486
! On traite d'abord les variables autres que la turbulence et les
611
487
! scalaires passifs : celles-ci sont traitees plus bas.
614
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
615
rcodcl(ifac,ivar,1) = 0.d0
490
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
491
rcodcl(ifac,ivar,1) = 0.d0
619
495
! On calcule les variables manquantes parmi P,rho,T,E
620
496
! COEFA sert de tableau de transfert dans USCFTH
623
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
499
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
628
( idebia , idebra , &
629
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
630
nnod , lndfac , lndfbr , ncelbr , &
631
nvar , nscal , nphas , &
632
iccfth , ifac , iphas , &
633
nideve , nrdeve , nituse , nrtuse , &
634
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
635
ipnfac , nodfac , ipnfbr , nodfbr , &
636
idevel , ituser , ia , &
637
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
638
506
dt , rtp , rtpa , propce , propfa , propfb , &
639
507
coefa , coefb , &
640
w1 , w2 , w3 , w4 , &
641
rdevel , rtuser , ra )
644
511
! Rusanov, flux de masse et type de conditions aux limites :
666
533
! si l'utilisateur ne les a pas modifies.
667
534
! On traite d'abord les variables autres que la turbulence et les
668
535
! scalaires passifs : celles-ci sont traitees plus bas.
671
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
672
rcodcl(ifac,ivar,1) = 0.d0
538
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
539
rcodcl(ifac,ivar,1) = 0.d0
676
543
! Valeurs de rho u E
677
rcodcl(ifac,irhiph,1) = rtp(iel,irhiph)
678
rcodcl(ifac,iuiph ,1) = rtp(iel,iuiph)
679
rcodcl(ifac,iviph ,1) = rtp(iel,iviph)
680
rcodcl(ifac,iwiph ,1) = rtp(iel,iwiph)
681
rcodcl(ifac,ieniph,1) = rtp(iel,ieniph)
544
rcodcl(ifac,irh,1) = rtp(iel,irh)
545
rcodcl(ifac,iu ,1) = rtp(iel,iu)
546
rcodcl(ifac,iv ,1) = rtp(iel,iv)
547
rcodcl(ifac,iw ,1) = rtp(iel,iw)
548
rcodcl(ifac,ien,1) = rtp(iel,ien)
683
550
! Valeurs de P et s d�duites
687
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
692
( idebia , idebra , &
693
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
694
nnod , lndfac , lndfbr , ncelbr , &
695
nvar , nscal , nphas , &
696
iccfth , ifac , iphas , &
697
nideve , nrdeve , nituse , nrtuse , &
698
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
699
ipnfac , nodfac , ipnfbr , nodfbr , &
700
idevel , ituser , ia , &
701
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
554
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
702
561
dt , rtp , rtpa , propce , propfa , propfb , &
703
562
coefa , coefb , &
704
w1 , w2 , w3 , w4 , &
705
rdevel , rtuser , ra )
707
565
! flux de masse et type de conditions aux limites :
726
584
! Si P n'est pas donn�, erreur ; on sort aussi en erreur si P
727
585
! n�gatif, m�me si c'est possible, dans la plupart des cas ce
728
586
! sera une erreur
729
if(rcodcl(ifac,ipriph,1).lt.-rinfin*0.5d0) then
587
if(rcodcl(ifac,ipr,1).lt.-rinfin*0.5d0) then
734
592
! Les RCODCL ont ete initialises a -RINFIN pour permettre de
735
593
! verifier ceux que l'utilisateur a modifies. On les remet a zero
736
594
! si l'utilisateur ne les a pas modifies.
737
595
! On traite d'abord les variables autres que la turbulence et les
738
596
! scalaires passifs : celles-ci sont traitees plus bas.
741
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
742
rcodcl(ifac,ivar,1) = 0.d0
599
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
600
rcodcl(ifac,ivar,1) = 0.d0
746
604
! Valeurs de rho, u, E, s
750
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
755
( idebia , idebra , &
756
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
757
nnod , lndfac , lndfbr , ncelbr , &
758
nvar , nscal , nphas , &
759
iccfth , ifac , iphas , &
760
nideve , nrdeve , nituse , nrtuse , &
761
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
762
ipnfac , nodfac , ipnfbr , nodfbr , &
763
idevel , ituser , ia , &
764
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
608
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
765
615
dt , rtp , rtpa , propce , propfa , propfb , &
766
616
coefa , coefb , &
767
w1 , w2 , w3 , w4 , &
768
rdevel , rtuser , ra )
770
619
! Rusanov, flux de masse et type de conditions aux limites :
786
635
! selon la thermo et on passe dans Rusanov ensuite pour lisser.
788
637
! Si rho et u ne sont pas donn�s, erreur
789
if(rcodcl(ifac,irhiph,1).lt.-rinfin*0.5d0.or. &
790
rcodcl(ifac,iuiph ,1).lt.-rinfin*0.5d0.or. &
791
rcodcl(ifac,iviph ,1).lt.-rinfin*0.5d0.or. &
792
rcodcl(ifac,iwiph ,1).lt.-rinfin*0.5d0) then
638
if(rcodcl(ifac,irh,1).lt.-rinfin*0.5d0.or. &
639
rcodcl(ifac,iu ,1).lt.-rinfin*0.5d0.or. &
640
rcodcl(ifac,iv ,1).lt.-rinfin*0.5d0.or. &
641
rcodcl(ifac,iw ,1).lt.-rinfin*0.5d0) then
797
646
! Les RCODCL ont ete initialises a -RINFIN pour permettre de
798
647
! verifier ceux que l'utilisateur a modifies. On les remet a zero
799
648
! si l'utilisateur ne les a pas modifies.
800
649
! On traite d'abord les variables autres que la turbulence et les
801
650
! scalaires passifs : celles-ci sont traitees plus bas.
804
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
805
rcodcl(ifac,ivar,1) = 0.d0
653
if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
654
rcodcl(ifac,ivar,1) = 0.d0
809
658
! Valeurs de P, E, s
813
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
818
( idebia , idebra , &
819
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
820
nnod , lndfac , lndfbr , ncelbr , &
821
nvar , nscal , nphas , &
822
iccfth , ifac , iphas , &
823
nideve , nrdeve , nituse , nrtuse , &
824
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
825
ipnfac , nodfac , ipnfbr , nodfbr , &
826
idevel , ituser , ia , &
827
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
662
coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
828
669
dt , rtp , rtpa , propce , propfa , propfb , &
829
670
coefa , coefb , &
830
w1 , w2 , w3 , w4 , &
831
rdevel , rtuser , ra )
833
673
! Rusanov, flux de masse et type de conditions aux limites :
909
749
!===============================================================================
911
751
! Sortie supersonique :
912
if ( itypfb(ifac,iphas).eq.isspcf ) then
752
if ( itypfb(ifac).eq.isspcf ) then
914
754
! Seul le flux de masse est calcule (on n'appelle pas Rusanov)
915
755
! (toutes les variables sont connues)
917
propfb(ifac,iflmab) = coefa(ifac,iclr)* &
918
( coefa(ifac,iclu)*surfbo(1,ifac) &
919
+ coefa(ifac,iclv)*surfbo(2,ifac) &
920
+ coefa(ifac,iclw)*surfbo(3,ifac) )
757
propfb(ifac,iflmab) = coefa(ifac,iclr)* &
758
( coefa(ifac,iclu)*surfbo(1,ifac) &
759
+ coefa(ifac,iclv)*surfbo(2,ifac) &
760
+ coefa(ifac,iclw)*surfbo(3,ifac) )
922
762
! Entree subsonique
924
else if ( itypfb(ifac,iphas).eq.ierucf ) then
764
else if ( itypfb(ifac).eq.ierucf ) then
926
766
! Seul le flux de masse est calcule (on n'appelle pas Rusanov)
928
propfb(ifac,iflmab) = coefa(ifac,iclr)* &
929
( coefa(ifac,iclu)*surfbo(1,ifac) &
930
+ coefa(ifac,iclv)*surfbo(2,ifac) &
931
+ coefa(ifac,iclw)*surfbo(3,ifac) )
768
propfb(ifac,iflmab) = coefa(ifac,iclr)* &
769
( coefa(ifac,iclu)*surfbo(1,ifac) &
770
+ coefa(ifac,iclv)*surfbo(2,ifac) &
771
+ coefa(ifac,iclw)*surfbo(3,ifac) )
935
775
! Autres entrees/sorties :
938
778
! On calcule des flux par Rusanov (PROPFB)
939
779
! (en particulier, le flux de masse est complete)
943
( idebia , idebra , &
944
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
945
nnod , lndfac , lndfbr , ncelbr , &
946
nvar , nscal , nphas , &
948
nideve , nrdeve , nituse , nrtuse , &
949
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
950
ipnfac , nodfac , ipnfbr , nodfbr , &
951
idevel , ituser , ia , &
953
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
954
786
dt , rtp , rtpa , propce , propfa , propfb , &
955
787
coefa , coefb , &
956
w1 , w2 , w3 , w4 , &
957
rdevel , rtuser , ra )
961
792
!===============================================================================
962
793
! 6.2 Recuperation de COEFA
963
794
!===============================================================================
965
796
! On r�tablit COEFA dans RCODCL
967
rcodcl(ifac,ivar,1) = coefa(ifac,iclrtp(ivar,icoef))
798
rcodcl(ifac,ivar,1) = coefa(ifac,iclrtp(ivar,icoef))
970
801
!===============================================================================
971
802
! 6.3 Types de C.L.
1026
857
! On choisit un Dirichlet si le flux de masse est entrant et
1027
858
! que l'utilisateur a donn� une valeur dans RCODCL
1029
if(propfb(ifac,iflmab).ge.0.d0) then
1030
if(itytur(iphas).eq.2) then
1031
icodcl(ifac,ik (iphas)) = 3
1032
icodcl(ifac,iep(iphas)) = 3
1033
elseif(itytur(iphas).eq.3) then
1034
icodcl(ifac,ir11(iphas)) = 3
1035
icodcl(ifac,ir22(iphas)) = 3
1036
icodcl(ifac,ir33(iphas)) = 3
1037
icodcl(ifac,ir12(iphas)) = 3
1038
icodcl(ifac,ir13(iphas)) = 3
1039
icodcl(ifac,ir23(iphas)) = 3
1040
icodcl(ifac,iep (iphas)) = 3
1041
elseif(iturb(iphas).eq.50) then
1042
icodcl(ifac,ik (iphas)) = 3
1043
icodcl(ifac,iep (iphas)) = 3
1044
icodcl(ifac,iphi(iphas)) = 3
1045
icodcl(ifac,ifb (iphas)) = 3
1046
elseif(iturb(iphas).eq.60) then
1047
icodcl(ifac,ik (iphas)) = 3
1048
icodcl(ifac,iomg(iphas)) = 3
1050
if(nscaus.gt.0) then
1052
icodcl(ifac,isca(ii)) = 3
1056
if(itytur(iphas).eq.2) then
1057
if(rcodcl(ifac,ik (iphas),1).gt.0.d0.and. &
1058
rcodcl(ifac,iep(iphas),1).gt.0.d0) then
1059
icodcl(ifac,ik (iphas)) = 1
1060
icodcl(ifac,iep(iphas)) = 1
1062
icodcl(ifac,ik (iphas)) = 3
1063
icodcl(ifac,iep(iphas)) = 3
1065
elseif(itytur(iphas).eq.3) then
1066
if(rcodcl(ifac,ir11(iphas),1).gt.0.d0.and. &
1067
rcodcl(ifac,ir22(iphas),1).gt.0.d0.and. &
1068
rcodcl(ifac,ir33(iphas),1).gt.0.d0.and. &
1069
rcodcl(ifac,ir12(iphas),1).gt.-rinfin*0.5d0.and. &
1070
rcodcl(ifac,ir13(iphas),1).gt.-rinfin*0.5d0.and. &
1071
rcodcl(ifac,ir23(iphas),1).gt.-rinfin*0.5d0.and. &
1072
rcodcl(ifac,iep (iphas),1).gt.0.d0) then
1073
icodcl(ifac,ir11(iphas)) = 1
1074
icodcl(ifac,ir22(iphas)) = 1
1075
icodcl(ifac,ir33(iphas)) = 1
1076
icodcl(ifac,ir12(iphas)) = 1
1077
icodcl(ifac,ir13(iphas)) = 1
1078
icodcl(ifac,ir23(iphas)) = 1
1079
icodcl(ifac,iep (iphas)) = 1
1081
icodcl(ifac,ir11(iphas)) = 3
1082
icodcl(ifac,ir22(iphas)) = 3
1083
icodcl(ifac,ir33(iphas)) = 3
1084
icodcl(ifac,ir12(iphas)) = 3
1085
icodcl(ifac,ir13(iphas)) = 3
1086
icodcl(ifac,ir23(iphas)) = 3
1087
icodcl(ifac,iep (iphas)) = 3
1089
elseif(iturb(iphas).eq.50) then
1090
if(rcodcl(ifac,ik (iphas),1).gt.0.d0.and. &
1091
rcodcl(ifac,iep (iphas),1).gt.0.d0.and. &
1092
rcodcl(ifac,iphi(iphas),1).gt.0.d0.and. &
1093
rcodcl(ifac,ifb (iphas),1).gt.-rinfin*0.5d0 ) then
1094
icodcl(ifac,ik (iphas)) = 1
1095
icodcl(ifac,iep (iphas)) = 1
1096
icodcl(ifac,iphi(iphas)) = 1
1097
icodcl(ifac,ifb (iphas)) = 1
1099
icodcl(ifac,ik (iphas)) = 3
1100
icodcl(ifac,iep (iphas)) = 3
1101
icodcl(ifac,iphi(iphas)) = 3
1102
icodcl(ifac,ifb (iphas)) = 3
1104
elseif(iturb(iphas).eq.60) then
1105
if(rcodcl(ifac,ik (iphas),1).gt.0.d0.and. &
1106
rcodcl(ifac,iomg(iphas),1).gt.0.d0 ) then
1107
icodcl(ifac,ik (iphas)) = 1
1108
icodcl(ifac,iomg(iphas)) = 1
1110
icodcl(ifac,ik (iphas)) = 3
1111
icodcl(ifac,iomg(iphas)) = 3
1114
if(nscaus.gt.0) then
1116
if(rcodcl(ifac,isca(ii),1).gt.-rinfin*0.5d0) then
1117
icodcl(ifac,isca(ii)) = 1
1119
icodcl(ifac,isca(ii)) = 3
860
if(propfb(ifac,iflmab).ge.0.d0) then
864
elseif(itytur.eq.3) then
865
icodcl(ifac,ir11) = 3
866
icodcl(ifac,ir22) = 3
867
icodcl(ifac,ir33) = 3
868
icodcl(ifac,ir12) = 3
869
icodcl(ifac,ir13) = 3
870
icodcl(ifac,ir23) = 3
871
icodcl(ifac,iep ) = 3
872
elseif(iturb.eq.50) then
874
icodcl(ifac,iep ) = 3
875
icodcl(ifac,iphi) = 3
876
icodcl(ifac,ifb ) = 3
877
elseif(iturb.eq.60) then
879
icodcl(ifac,iomg) = 3
880
elseif(iturb.eq.70) then
881
icodcl(ifac,inusa) = 3
885
icodcl(ifac,isca(ii)) = 3
890
if(rcodcl(ifac,ik ,1).gt.0.d0.and. &
891
rcodcl(ifac,iep,1).gt.0.d0) then
898
elseif(itytur.eq.3) then
899
if(rcodcl(ifac,ir11,1).gt.0.d0.and. &
900
rcodcl(ifac,ir22,1).gt.0.d0.and. &
901
rcodcl(ifac,ir33,1).gt.0.d0.and. &
902
rcodcl(ifac,ir12,1).gt.-rinfin*0.5d0.and. &
903
rcodcl(ifac,ir13,1).gt.-rinfin*0.5d0.and. &
904
rcodcl(ifac,ir23,1).gt.-rinfin*0.5d0.and. &
905
rcodcl(ifac,iep ,1).gt.0.d0) then
906
icodcl(ifac,ir11) = 1
907
icodcl(ifac,ir22) = 1
908
icodcl(ifac,ir33) = 1
909
icodcl(ifac,ir12) = 1
910
icodcl(ifac,ir13) = 1
911
icodcl(ifac,ir23) = 1
912
icodcl(ifac,iep ) = 1
914
icodcl(ifac,ir11) = 3
915
icodcl(ifac,ir22) = 3
916
icodcl(ifac,ir33) = 3
917
icodcl(ifac,ir12) = 3
918
icodcl(ifac,ir13) = 3
919
icodcl(ifac,ir23) = 3
920
icodcl(ifac,iep ) = 3
922
elseif(iturb.eq.50) then
923
if(rcodcl(ifac,ik ,1).gt.0.d0.and. &
924
rcodcl(ifac,iep ,1).gt.0.d0.and. &
925
rcodcl(ifac,iphi,1).gt.0.d0.and. &
926
rcodcl(ifac,ifb ,1).gt.-rinfin*0.5d0 ) then
928
icodcl(ifac,iep ) = 1
929
icodcl(ifac,iphi) = 1
930
icodcl(ifac,ifb ) = 1
933
icodcl(ifac,iep ) = 3
934
icodcl(ifac,iphi) = 3
935
icodcl(ifac,ifb ) = 3
937
elseif(iturb.eq.60) then
938
if(rcodcl(ifac,ik ,1).gt.0.d0.and. &
939
rcodcl(ifac,iomg,1).gt.0.d0 ) then
941
icodcl(ifac,iomg) = 1
944
icodcl(ifac,iomg) = 3
946
elseif(iturb.eq.70) then
947
if(rcodcl(ifac,inusa,1).gt.0.d0) then
948
icodcl(ifac,inusa) = 1
950
icodcl(ifac,inusa) = 3
955
if(rcodcl(ifac,isca(ii),1).gt.-rinfin*0.5d0) then
956
icodcl(ifac,isca(ii)) = 1
958
icodcl(ifac,isca(ii)) = 3
1126
965
! Les RCODCL ont ete initialises a -RINFIN pour permettre de