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
26
!-------------------------------------------------------------------------------
34
f1m , f3m , f4m , f1cl , f3cl , f4cl , &
35
f4m1 , f4m2 , d4cl , d4f4 , hrec , f4s3 , &
36
fuel1 , fuel3 , oxyd , prod1 , prod2 , &
39
!===============================================================================
45
! K1 exp(-E1/RT) (conversion HCN en NO)
46
! K2 exp(-E2/RT) (conversion HCN en N2)
47
! K3 exp(-E3/RT) (NO thermique)
53
!__________________.____._____.________________________________________________.
54
! name !type!mode ! role !
55
!__________________!____!_____!________________________________________________!
56
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
57
! ncel ! i ! <-- ! number of cells !
58
! rtp ! tr ! <-- ! variables de calcul au centre des !
59
! (ncelet,*) ! ! ! cellules (instant courant) !
60
! fvap ! tr ! <-- ! moyenne du traceur 1 mvl [fovm+co] !
61
! fhet ! tr ! -> ! moyenne du traceur 3 c h�terog�ne !
62
! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
63
! indpdf ! te ! <-- ! passage par les pdf !
64
! fuel1 ! tr ! <- ! fraction massique fovm !
65
! fuel3 ! tr ! <- ! fraction massique co !
66
! oxyd ! tr ! <- ! fraction massique o2 !
67
! prod1 ! tr ! <- ! fraction massique co2 !
68
! prod2 ! tr ! <- ! fraction massique h2o !
69
! xiner ! tr ! <- ! fraction massique n2 !
70
! xh2s ! tr ! <- ! fraction massique h2s !
71
! xso2 ! tr ! <- ! fraction massique so2 !
72
! f4m1 ! tr ! <-- ! borne minimum !
73
! f4m2 ! tr ! <-- ! borne max !
74
! d4cl ! tr ! <-- ! amplitude du pic de dirac en f4cl !
75
! d4f4 ! tr ! <-- ! amplitude du pic de dirac en 1 !
77
!__________________!____!_____!________________________________________________!
79
! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
80
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
81
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
82
! --- tableau de travail
83
!===============================================================================
87
!==============================================================================
89
!==============================================================================
107
!===============================================================================
111
integer ncelet , ncel
112
integer indpdf(ncelet)
114
double precision rtp(ncelet,*), propce(ncelet,*)
115
double precision f1m(ncelet) , f3m(ncelet) , f4m(ncelet)
116
double precision f1cl(ncelet), f3cl(ncelet) , f4cl(ncelet)
118
double precision f4m1(ncelet) , f4m2(ncelet) , d4cl(ncelet)
119
double precision d4f4(ncelet) , hrec(ncelet) , f4s3(ncel)
121
double precision fuel1(ncelet), fuel3(ncelet)
122
double precision oxyd(ncelet) , prod1(ncelet), prod2(ncelet)
123
double precision xiner(ncelet)
124
double precision xh2s(ncelet) , xso2(ncelet)
128
integer iel , icla , i
130
integer n1 , n2 , n3 , n4 , n5 , n6 , n7 , n8 , n9
133
integer ipdf1 , ipdf2 , ipdf3
134
integer iexp1 , iexp2 , iexp3
135
parameter (nbrint = 11)
136
integer inttmp(nbrint)
138
parameter (npart = 200 )
140
double precision wmo2
142
double precision ee1,ee2,ee3,kk1,kk2,kk3
143
double precision ts3 , ts3den , ts3num , u , t , ts3s , dirac
144
double precision q , r , s , lpa , lri , tmpgaz , tfuel , xmx2
145
double precision bb1 , bb2 , bb3 , bb4 , wmco , xo2 , bb
146
double precision gh1, gh2 ,gh3 ,gh4 ,gh5,gh6, gh7 , tg
147
double precision gh8, gh9 ,gh10,gh11
148
double precision dgs , rsf4 , rscl , bmoy , p , spdf
149
double precision val(npart+1),tt(npart+1) , gs(npart+1)
151
!===============================================================================
154
!===============================================================================
156
!===============================================================================
159
!===============================================================================
160
! 1. CALCULS PRELIMINAIRES
161
!===============================================================================
163
! --- Masses molaires
169
iexp1 = ipproc(ighcn1)
170
iexp2 = ipproc(ighcn2)
171
iexp3 = ipproc(ignoth)
173
! Parametres des lois d'Arrhenius
182
! Pour les termes, indicateur de calcul par PDF ou non
183
! = 1 --> passage par pdf
184
! = 0 --> on ne passe pas par les pdf
190
! ---- Initialisation
193
! PROPCE(IEL,IEXP1) = ZERO
194
! PROPCE(IEL,IEXP2) = ZERO
195
! PROPCE(IEL,IEXP3) = ZERO
198
!===============================================================================
199
! 3. CALCUL SANS LES PDF
200
!===============================================================================
204
tg = propce(iel,ipproc(itemp1))
205
propce(iel,iexp1) = kk1*exp(-ee1/tg)
211
tg = propce(iel,ipproc(itemp1))
212
xo2 = oxyd(iel)*propce(iel,ipproc(immel)) &
214
if ( xo2 .gt. 0.018d0 ) then
216
else if ( xo2 .lt. 0.0025d0 ) then
219
bb=(0.018d0-xo2)/(0.018d0-0.0025d0)
222
propce(iel,iexp2) = kk2*exp(-ee2/tg)*(xo2**bb)
228
tg = propce(iel,ipproc(itemp1))
229
xo2 = oxyd(iel)*propce(iel,ipproc(immel)) &
232
propce(iel,iexp3) = kk3*exp(-ee3/tg)*(xo2**0.5d0)
236
!===============================================================================
237
! 3. CALCUL AVEC LES PDF
238
!===============================================================================
240
if ( ipdf1 .eq. 1 .or. ipdf2 .eq. 1 .or. ipdf3 .eq. 1 ) then
244
if ( indpdf(iel).eq.1 ) then
246
! Calcul de Tfioul moyen
252
xmx2 = xmx2 + rtp(iel,isca(iyfol(icla)))
255
if ( xmx2 .gt. 0.d0 ) then
257
tfuel = tfuel + rtp(iel,isca(iyfol(icla))) &
258
*propce(iel,ipproc(itemp3(icla)))
262
tfuel = propce(iel,ipproc(itemp1))
265
! On recupere la valeur de TAIR
267
taire = rtp(iel,isca(itaire))
269
! On initialise par les temperatures Tair (en f4) et Tcl (TFUEL) aux extr��mit��s
271
dirac = d4cl(iel)*tfuel + d4f4(iel)*taire
273
!1 On recupere la valeur de la temperature moyenne
275
tmpgaz = propce(iel,ipproc(itemp1))
277
!1 Integration premier intervalle, entre CL et S3 (stoechio derni��re r��action)
279
!1 Parametres de la droite entre CL et S3
281
!1 Detection des bornes d'integration (celles de la pdf) du domaine pauvre
283
if(tfuel.gt.epsicp .and. tmpgaz.gt.epsicp) then
285
if(f4s3(iel).le.f4m1(iel)) then
286
p=((f4m1(iel)+f4m2(iel))/2.-f4s3(iel))/(1.-f4s3(iel))
287
ts3s=((tmpgaz-dirac)/hrec(iel) &
288
/(f4m2(iel)-f4m1(iel))-taire*p) &
290
else if(f4s3(iel).ge.f4m2(iel)) then
291
ts3s=((tmpgaz-dirac)/hrec(iel) &
292
/(f4m2(iel)-f4m1(iel))-tfuel) &
293
*(f4s3(iel)-f4cl(iel)) &
294
/((f4m1(iel)+f4m2(iel))/2.d0-f4cl(iel))+tfuel
296
ts3s=(2.*(tmpgaz-dirac)/hrec(iel) &
297
- tfuel*(f4s3(iel)-f4m1(iel))**2 &
298
/(f4s3(iel)-f4cl(iel)) &
299
- taire*(f4m2(iel)-f4s3(iel))**2 &
301
/((2.*f4m2(iel)-f4m1(iel)-f4s3(iel)) &
302
+(f4m1(iel)-f4cl(iel))*(f4s3(iel)-f4m1(iel)) &
303
/(f4s3(iel)-f4cl(iel)) &
304
-(f4m2(iel)-f4s3(iel))**2/(1.d0-f4s3(iel)))
307
bb1 = max( f4m1(iel) , f4cl(iel) )
308
bb2 = min( f4m2(iel) , f4s3(iel) )
309
bb3 = max( f4m1(iel) , f4s3(iel) )
310
bb4 = min( f4m2(iel) , 1.d0 )
312
! On definit quelques parametres intermediaires pour simplifier le code
314
if (bb2 .gt. bb1 ) then
319
if (bb4 .gt. bb3 ) then
325
p = f4s3(iel) - f4cl(iel)
334
! TS3=(TMPGAZ-DIRAC+TFUEL*(((LRI*Q)/(2.D0*P))-((LRI*F4S3*R)/P))
335
! & - TAIRE*( ((LPA*T)/(2.D0*S)) +(LPA*U) -((LPA*U)/S)))
337
! & (((LRI*Q)/(2.D0*P))+(LRI*R)-((LRI*F4S3*R)/P)-((LPA*T)
338
! & /(2.D0*S)) +((LPA*U)/S) )
340
gh1 = -lri*q/(p*2.d0)
341
gh2 = lri*r*f4s3(iel)/p
347
gh8 = f4s3(iel)*lri*r/p
350
gh11 = tmpgaz - dirac
352
ts3num = gh11 - tfuel*(gh1+gh2) - taire*(gh3+gh4-gh5)
353
ts3den = gh6 + gh7 -gh8 - gh9 + gh10
356
ts3 = ts3num / ts3den
357
if(abs(ts3-ts3s).gt.1.d0) then
358
WRITE(NFECRA,*) 'TS3 paul-TS3 sandro ', IEL,TS3,TS3S
362
spdf = hrec(iel) * (f4m2(iel) - f4m1(iel))
366
xo2 = oxyd(iel)*propce(iel,ipproc(immel)) &
370
gs(i) = f4m1(iel) + dble(i-1)/dble(npart) &
371
*(f4m2(iel)-f4m1(iel))
373
if( gs(i) .le. f4s3(iel) ) then
374
tt(i) = (ts3-tfuel)/(f4s3(iel)-f4cl(iel))* gs(i) &
375
+ ts3 - f4s3(iel)*(ts3 - tfuel) &
376
/ ( f4s3(iel) - f4cl(iel) )
379
tt(i) = (taire -ts3)/(1.d0-f4s3(iel))*gs(i) &
380
+ taire - (taire - ts3)/(1.d0-f4s3(iel))
385
if(xo2.gt.0.018d0) then
387
else if(xo2 .lt. 0.0025d0) then
390
bmoy=(0.018d0-xo2)/(0.018d0-0.0025d0)
393
! DGS est le pas d'integration
395
dgs = ( f4m2(iel) - f4m1(iel) ) / dble(npart)
397
! Calcul de K1*EXP(-E1/T)
399
if ( ipdf1 .eq. 1 ) then
401
rsf4 = kk1*exp(-ee1/taire)*d4f4(iel)
402
rscl = kk1*exp(-ee1/tfuel)*d4cl(iel)
405
val(i) = kk1 * exp(-ee1/tt(i)) * hrec(iel)
408
propce(iel,iexp1)= rsf4 + rscl
411
propce(iel,iexp1) = propce(iel,iexp1) &
412
+0.5d0*dgs*(val(i)+val(i+1))
417
! Calcul de K2*EXP(-E2/T)
419
if ( ipdf2 .eq. 1 ) then
421
if ( xo2 .gt. 0.d0 ) then
422
propce(iel,iexp2) = kk2*exp(-ee2/taire) &
423
*d4f4(iel)*xo2**bmoy &
424
+kk2*exp(-ee2/tfuel) &
428
val(i) = kk2*exp(-ee2/tt(i))*hrec(iel)
432
propce(iel,iexp2) = propce(iel,iexp2) &
433
+0.5d0*dgs*(val(i)+val(i+1)) &
437
propce(iel,iexp2) = 0.d0
442
! Calcul de K3*EXP(-E3/T)
444
if ( ipdf3 .eq. 1 ) then
446
if ( xo2 .gt. 0.d0 ) then
447
propce(iel,iexp3) = kk3*exp(-ee3/taire) &
448
*d4f4(iel)*xo2**(0.5d0) &
449
+kk3*exp(-ee3/tfuel) &
450
*d4cl(iel)*xo2**(0.5d0)
453
val(i) = kk3*exp(-ee3/tt(i))*hrec(iel)
457
propce(iel,iexp3)= propce(iel,iexp3) &
458
+ 0.5d0*dgs*(val(i)+val(i+1))*xo2**(0.5d0)
461
propce(iel,iexp3)= 0.d0