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
!-------------------------------------------------------------------------------
23
subroutine cs_coal_physprop &
24
!==========================
28
dt , rtp , rtpa , propce , propfa , propfb , &
31
!===============================================================================
34
! ROUTINE PHYSIQUE PARTICULIERE : COMBUSTION CHARBON PULVERISE
35
! Calcul de RHO du melange
38
!__________________.____._____.________________________________________________.
39
! name !type!mode ! role !
40
!__________________!____!_____!________________________________________________!
41
! nvar ! i ! <-- ! total number of variables !
42
! nscal ! i ! <-- ! total number of scalars !
43
! ibrom ! te ! <-- ! indicateur de remplissage de romb !
44
! izfppp(nfabor) ! te ! <-- ! numero de zone de la face de bord !
45
! ! ! ! pour le module phys. part. !
46
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
47
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
48
! (ncelet, *) ! ! ! (at current and previous time steps) !
49
! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
50
! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
51
! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
52
! coefa, coefb ! ra ! <-- ! boundary conditions !
54
!__________________!____!_____!________________________________________________!
56
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
57
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
58
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
59
! --- tableau de travail
60
!===============================================================================
62
!===============================================================================
64
!===============================================================================
82
!===============================================================================
91
integer izfppp(nfabor)
93
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
94
double precision propce(ncelet,*)
95
double precision propfa(nfac,*), propfb(nfabor,*)
96
double precision coefa(nfabor,*), coefb(nfabor,*)
100
integer iel, icha, icla, ipcrom, ipcro2
102
integer ipbrom, ipcx2c, iromf , ioxy , nbclip1,nbclip2
104
double precision x1sro1, x2sro2, srrom1, uns1pw
105
double precision x2tot, wmolme, unsro1
106
double precision ff3min,ff3max,fvp2max,valmin,valmax
112
integer iok1,iok2,iok3
113
double precision , dimension ( : ) , allocatable :: f1m,f2m,f3m,f4m,f5m
114
double precision , dimension ( : ) , allocatable :: f6m,f7m,f8m,f9m
115
double precision , dimension ( : ) , allocatable :: enth1 , x2 ,fvp2m
116
double precision , dimension ( : ) , allocatable :: xoxyd,enthox
118
!===============================================================================
120
!===============================================================================
121
! 0. ON COMPTE LES PASSAGES
122
!===============================================================================
126
!===============================================================================
127
! 1. INITIALISATIONS A CONSERVER
128
!===============================================================================
130
!===============================================================================
131
! Deallocation dynamic arrays
133
allocate(f1m(1:ncelet), f2m(1:ncelet), f3m(1:ncelet), STAT=iok1)
134
allocate(f4m(1:ncelet), f5m(1:ncelet), STAT=iok1)
135
allocate(f6m(1:ncelet), f7m(1:ncelet), f8m(1:ncelet), f9m(1:ncelet), STAT=iok2)
136
allocate(enth1(1:ncel), x2(1:ncel) , fvp2m(1:ncel), STAT=iok3)
138
if ( iok1 > 0 .or. iok2 > 0 .or. iok3 > 0) THEN
139
write(nfecra,*) ' Memory allocation error inside: '
140
write(nfecra,*) ' cs_coal_physprop '
143
if ( ieqnox .eq. 1 ) then
145
allocate(xoxyd(1:ncelet),enthox(1:ncelet),STAT=iok1)
148
write(nfecra,*) ' Memory allocation error inside: '
149
write(nfecra,*) ' cs_coal_physprop for xoxyd and enthox '
152
!===============================================================================
153
! Pointeur sur masse volumique du gaz aux cellules
154
iromf = ipproc(irom1)
156
!===============================================================================
157
! 2. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
160
! FRACTION MASSIQUE DE SOLIDE
163
!===============================================================================
165
call cs_coal_physprop2 ( ncelet , ncel , rtp , propce )
166
!=====================
168
!===============================================================================
169
! 3. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
174
! CONCENTRATIONS DES ESPECES GAZEUSES
175
!===============================================================================
177
! --- Calcul de l'enthalpie du gaz enth1
180
! de F3M dans W3=1-F1M-F2M-F4M-F5M-F6M-F7M-F8M-F9M
189
! Initialisation des fm et de x2 a 0
202
ipcx2c = ipproc(ix2(icla))
204
x2(iel) = x2(iel) + propce(iel,ipcx2c)
210
f1m(iel) = f1m(iel) + rtp(iel,isca(if1m(icha)))
211
f2m(iel) = f2m(iel) + rtp(iel,isca(if2m(icha)))
215
if ( ieqnox .eq. 1 ) then
217
xoxyd(iel)= (1.d0-x2(iel))-f1m(iel)-f2m(iel)
228
uns1pw = 1.d0/(1.d0-x2(iel))
229
if ( noxyd .ge. 2 ) then
230
f4m(iel) = rtp(iel,isca(if4m))
231
if ( noxyd .eq. 3 ) then
232
f5m(iel) = rtp(iel,isca(if5m))
236
if ( ippmod(iccoal) .ge. 1 ) then
237
f6m(iel) = rtp(iel,isca(if6m))
240
f7m(iel) = rtp(iel,isca(if7m))
242
if ( ihtco2 .eq. 1 ) then
243
f8m(iel) = rtp(iel,isca(if8m))
246
if ( ihth2o .eq. 1 ) then
247
f9m(iel) = rtp(iel,isca(if9m))
250
fvp2m(iel) = rtp(iel,isca(ifvp2m))
252
f1m(iel) = f1m(iel) *uns1pw
253
f2m(iel) = f2m(iel) *uns1pw
254
f4m(iel) = f4m(iel) *uns1pw
255
f5m(iel) = f5m(iel) *uns1pw
256
f6m(iel) = f6m(iel) *uns1pw
257
f7m(iel) = f7m(iel) *uns1pw
258
f8m(iel) = f8m(iel) *uns1pw
259
f9m(iel) = f9m(iel) *uns1pw
261
! fvp2m(iel)= fvp2m(iel) *uns1pw
263
! correction variance : uniquement phase 1
265
fvp2m(iel)= fvp2m(iel)*uns1pw - x2(iel)*((f1m(iel)+f2m(iel))**2.d0)
266
if ( fvp2m(iel) .lt. 0.d0 ) then
267
nbclip1 = nbclip1 + 1
268
valmin = min(valmin,fvp2m(iel))
271
fvp2max =(f1m(iel)+f2m(iel))*(1.d0-(f1m(iel)+f2m(iel)))
272
if ( fvp2m(iel) .gt. fvp2max ) then
273
nbclip2 = nbclip2 + 1
274
valmax = max(valmax,fvp2m(iel))
281
-( f1m(iel)+f2m(iel)+f4m(iel)+f5m(iel) &
282
+f6m(iel)+f7m(iel)+f8m(iel)+f9m(iel) )
284
ff3max = max(ff3max,f3m(iel))
285
ff3min = min(ff3min,f3m(iel))
287
if ( ieqnox .eq. 1 ) then
288
enthox(iel) = rtp(iel,isca(ihox))/xoxyd(iel)
293
if ( irangp .ge. 0 ) then
303
WRITE(NFECRA,*) ' Values of F3 min and max: ',FF3MIN,FF3MAX
304
if ( nbclip1 .gt. 0 ) then
305
write(nfecra,*) ' Clipping phase gas variance in min :',nbclip1,valmin
307
if ( nbclip2 .gt. 0 ) then
308
write(nfecra,*) ' Clipping phase gas variance in max :',nbclip2,valmax
311
! ---- Enthalpie du gaz H1
315
enth1(iel) = enth1(iel) + rtp(iel,isca(ih2(icla)))
319
enth1(iel) = (rtp(iel,isca(ihm))-enth1(iel))/ ( 1.d0-x2(iel) )
322
call cs_coal_physprop1 &
323
!=====================
325
f1m , f2m , f3m , f4m , f5m , &
326
f6m , f7m , f8m , f9m , fvp2m , &
328
rtp , propce , propce(1,iromf) )
330
!===============================================================================
331
! 4. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
335
!===============================================================================
339
call cs_coal_thfieldconv2 ( ncelet , ncel , rtp , propce )
340
!=========================
342
!===============================================================================
343
! 5. CALCUL DES PROPRIETES PHYSIQUES DU MELANGE
347
!===============================================================================
348
! --- Calcul de Rho du melange : 1/Rho = X1/Rho1 + Somme(X2/Rho2)
349
! On sous relaxe quand on a un rho n a disposition, ie
350
! a partir du deuxieme passage ou
351
! a partir du premier passage si on est en suite de calcul et
352
! qu'on a relu la masse volumique dans le fichier suite.
354
ipcrom = ipproc(irom)
356
if (ipass.gt.1.or.(isuite.eq.1.and.initro.eq.1)) then
365
ipcro2 = ipproc(irom2(icla))
366
ipcx2c = ipproc(ix2(icla))
367
x2sro2 = x2sro2 + propce(iel,ipcx2c) / propce(iel,ipcro2)
369
x1sro1 = (1.d0-x2(iel)) / propce(iel,iromf)
370
! ---- Sous relaxation eventuelle a donner dans ppini1.F
371
propce(iel,ipcrom) = srrom1*propce(iel,ipcrom) &
372
+ (1.d0-srrom1)/(x1sro1+x2sro2)
376
!===============================================================================
377
! 6. CALCUL DE RHO DU MELANGE
380
!===============================================================================
383
ipbrom = ipprob(irom)
384
ipcrom = ipproc(irom)
386
! ---> Masse volumique au bord pour toutes les facettes
387
! Les facettes d'entree seront recalculees.
391
propfb(ifac,ipbrom) = propce(iel,ipcrom)
394
! ---> Masse volumique au bord pour les facettes d'entree UNIQUEMENT
395
! Le test sur IZONE sert pour les reprises de calcul
397
if ( ipass.gt.1 .or. isuite.eq.1 ) then
402
if ( ientat(izone).eq.1 .or. ientcp(izone).eq.1 ) then
406
x2sro2 = x2sro2 + x20(izone,icla)/rho20(icla)
407
x2tot = x2tot + x20(izone,icla)
411
wmolme =( oxyo2(ioxy)+oxyn2(ioxy) &
412
+oxyh2o(ioxy)+oxyco2(ioxy)) &
413
/( wmole(io2) *oxyo2(ioxy) &
414
+wmole(in2) *oxyn2(ioxy) &
415
+wmole(ih2o)*oxyh2o(ioxy) &
416
+wmole(ico2)*oxyco2(ioxy) )
418
unsro1 = (wmolme*rr*timpat(izone)) / p0
419
x1sro1 = (1.d0-x2tot) * unsro1
420
propfb(ifac,ipbrom) = 1.d0 / (x1sro1+x2sro2)
431
!===============================================================================
432
! Deallocation dynamic arrays
434
deallocate(f1m,f2m,f3m,f4m,f5m,STAT=iok1)
435
deallocate(f6m,f7m,f8m,f9m, STAT=iok2)
436
deallocate(enth1,x2,fvp2m, STAT=iok3)
438
IF ( iok1 > 0 .or. iok2 > 0 .or. iok3 > 0 ) THEN
439
write(nfecra,*) ' Memory deallocation error inside: '
440
write(nfecra,*) ' cs_coal_physprop '
443
if ( ieqnox .eq. 1 ) then
445
deallocate(xoxyd,enthox)
448
write(nfecra,*) ' Memory deallocation error inside: '
449
write(nfecra,*) ' cs_coal_physprop for xoxyd and enthox '
453
!===============================================================================