* fichier : comb.dgibi ************************************************************************* * * NOM : comb.dgibi * * DESCRIPTION : We compute the AICC (Adiabatic Isochoric Complete * Combustion), the AIBCC, (Adiabatic IsoBaric Complete * Combustion), the CJ (Chapman - Jouguet) and VN (von * Neumann) states of a ZND detonation for several mixtures * at NIST-normal conditions involving H2 and air. * We check that some physical properties are satisfied. * Comparison of the results obtained using the DETO * operator and the ones given by the CREBCOM combustion * model (operators PRIM and FLAM). * * LANGAGE : GIBIANE-CAST3M * AUTEUR : Alberto BECCANTINI (CEA/DEN/DM2S/SFME/LTMF) * beccantini@cea.fr * DATE : 28/09/2006 ************************************************************************* * **************************************************************** ***** 1D mesh ***** **************************************************************** * * * A4 ---- A3 * | | * | COM | * | | * A1 ---- A2 * A1 = 0.0 0.0 ; A2 = 1.0 0.0 ; A1A2 = A1 'DROIT' 1 A2 ; DOM1 = A1A2 'TRANSLATION' 1 (0.0 1.0) ; * **** The table 'DOMAINE' * $DOM1 = 'MODELISER' DOM1 'EULER' ; QDOM1 = TDOM1 . 'QUAF' ; * ***** Initial conditions and gas properties. * * **** 0 from a numerical point of view * * 'NATU' 'DISCRET' ; 'NATU' 'DISCRET' ; 'NATU' 'DISCRET' ; * We suppose that the combustion is complete everywhere * ***** Gas properties * PGAZ = 'TABLE' ; * Polynomial degree of specific heats PGAZ . 'NORD' = 4 ; * Species explicitly treated in the Euler Equations * Species non explicitly treated PGAZ . 'ESPNEULE' = 'N2 '; * Single gases properties PGAZ . 'H2 ' = 'TABLE' ; PGAZ . 'H2O ' = 'TABLE' ; PGAZ . 'N2 ' = 'TABLE' ; PGAZ . 'O2 ' = 'TABLE' ; * R (J/Kg/K) mH2 = 2. '*' 1.00797E-3 ; mo2 = 2. '*' 15.9994E-3 ; mH2O = mh2 '+' (0.5 '*' mo2) ; mN2 = 2 '*' 14.0067E-3 ; RGAS = 8.31441 ; PGAZ . 'H2 ' . 'R' = RGAS '/' mh2 ; PGAZ . 'H2O ' . 'R' = RGAS '/' mh2o ; PGAZ . 'N2 ' . 'R' = RGAS '/' mn2 ; PGAZ . 'O2 ' . 'R' = RGAS '/' mo2 ; * Polynomials regressions coefficients -2.37281455E-07 1.84701105E-11 ; -1.82753232E-08 2.44485692E-12 ; 8.78233606E-09 -3.05514485E-13 ; 2.33636971E-08 -1.53304905E-12; * Formation enthalpies at 0K (J/Kg) * * h_i(0K) = h_i(T0) '-' \int_0^{T0} cp_i(x) dx * = h_i(T0) '-' (\int_0^{T0} cv_i(x) dx '+' R_i * T0) * PGAZ . 'H2 ' . 'H0K' = -4.195D6 ; PGAZ . 'H2O ' . 'H0K' = -1.395D7 ; PGAZ . 'N2 ' . 'H0K' = -2.953D5 ; PGAZ . 'O2 ' . 'H0K' = -2.634D5 ; * Passive scalars names * **** Initial conditions on molar fractions of hydrogen. * * Inside * VN conditions * AICC * AIBCC * CJ conditions * Released energy per mass unit * ************************************************************************ ************************************************************************ ***** LOOP to determine the initial conditions, AICC, AIBCC, CJ ***** ***** anv VN states ***** ************************************************************************ ************************************************************************ * **** Molar fractions (before combustion) * cell1 = (1. - cell) / (1. + (0.79/0.21)) ; 'NATU' 'DISCRET' ; 'NATURE' 'DISCRET' ; 'O2' cell1 'NATU' 'DISCRET' ; XN = XH21 'ET' XH2O1 'ET' XO21 ; XN = XN 'ET' XN21 ; * **** We compute the mass fractions * 'NATURE' 'DISCRET') 'ET' 'NATURE' 'DISCRET') 'ET' 'NATURE' 'DISCRET') 'ET' 'NATURE' 'DISCRET') ; YH21 = (XH21 '*' MH2) '/' MTOT ; YO21 = (XO21 '*' MO2) '/' MTOT ; YN21 = (XN21 '*' MN2) '/' MTOT ; YH2O1 = (XH2O1 '*' MH2O) '/' MTOT ; * **** Burnt gas * Here X refers to the mole producted per 1 mole of unburned gas * N.B. The number of moles changes after the combustion! * * H2MAG = 1 in the region where H2 is the majority species. * Conversely H2MAG = 0 O2MAG = CHUN '-' H2MAG ; XO22a = XO22a ; XH22a = XH22a ; XH22 = (XH22a '*' H2MAG) '+' (XH22b '*' O2MAG) ; XO22 = (XO22a '*' H2MAG) '+' (XO22b '*' O2MAG) ; XN22 = XN21 ; * **** mtot = weight of a mole of unburned gas * mtot2 = weight of a mole of unburned gas after the combustion * Of course mtot2 = mtot * MTOT2 = 'PSCAL' MMOL (XH22 '+' XO22 '+' XH2O2 '+' XN22) mtotcel = 'MAXIMUM' MTOT ; 'MESSAGE' 'Problem in the computation of the burnt gas (1).' ; 'ERREUR' 21 ; 'FINSI' ; * **** xtot2 = mole of burnt gas per mole of unburned gas * xtot2 = 'PSCAL' (xh22 '+' xo22 '+' xh2O2 '+' xn22) * **** X = real molar fractions * xh22 = xh22 '/' xtot2 ; xo22 = xo22 '/' xtot2 ; xh2o2 = xh2o2 '/' xtot2 ; xn22 = xn22 '/' xtot2 ; xtot3 = 'PSCAL' (xh22 '+' xo22 '+' xh2O2 '+' xn22) 'SI' ( ('MAXIMUM' (xtot3 '-' 1.0D0) 'ABS' ) '>' 'MESSAGE' 'Problem in the computation of the burnt gas (2).' ; 'ERREUR' 21 ; 'FINSI' ; * **** mtot2 = weight of 1 mole of burned gas * MTOT2 = 'PSCAL' MMOL (XH22 '+' XO22 '+' XH2O2 '+' XN22) * **** Mass fractions of burned gas after the complete combustion * YH22 = (XH22 '*' MH2) '/' MTOT2 ; YO22 = (XO22 '*' MO2) '/' MTOT2 ; YN22 = (XN22 '*' MN2) '/' MTOT2 ; YH2O2 = (XH2O2 '*' MH2O) '/' MTOT2 ; * **** The conservative variables * * Gas constant ; * Density RNINI = PINI '/' (RINI '*' TINI) ; RN = 'COPIER' RNINI ; * Internal energy Tfois = Tini ; 'REPETER' BL1 ((PGAZ . 'NORD') '+' 1) ; &BL1)) '+' &BL1)) '+' &BL1)) '+' &BL1)) ; eini = eini '+' (acel '*' (Tfois '/' &BL1)) ; Tfois = Tfois * tini ; 'FIN' BL1 ; RETNINI = RN '*' (eini '+' (0.5 '*' ('PSCAL' WINI WINI RETN = RETNINI ; GN = RN '*' WINI ; YN = YH21 '+' YO21 '+' YH2O1 ; RYN = RN '*' YN ; * **** K0/DX = chemical source term * * i.e. dcsi/dt = K0 '/' DX . {criterium function} * where * {criterium function} = 1.0 or 0.0 * * d(rho etot)/dt = -rho (dcsi/dt) (h_f '-' h_i) * * h_f reference enthalpy (0K) of the burned gas * h_i reference enthalpy (0K) of the unburned gas * **** Mass fraction of H2 before and after the combustion * * CSIMAX = 1.0 -> complete combustion * YININ = yh21 ; YFINN = YININ '+' ((yh22 '-' yh21) '*' csimax) ; * **** Passive scalars * * Test of prim PCEL = 'MAXIMUM' PINI ; TCEL = 'MAXIMUM' TINI ; 'SI' (('MAXIMUM' ((P '-' pini) '/' PCEL) 'ABS')> 1.0D-3) ; 'MESSAGE' 'Problem in the computation of the energy (1).' 'ERREUR' 21 ; 'FINSI' ; 'SI' (('MAXIMUM' ((T '-' Tini) '/' TCEL)) > 1.0D-3) ; 'MESSAGE' 'Problem in the computation of the energy (2).' 'ERREUR' 21 ; 'FINSI' ; * * VN state * * VN state via DETO operator (not really complete combustion...) * 'H2O' 0.0 * VVN via RH conditions VVN = DVN '*' (RNINI / RVN) ; VVN = DVN - VVN ; * Internal energy Tfois = TVN ; 'REPETER' BL1 ((PGAZ . 'NORD') '+' 1) ; &BL1)) '+' &BL1)) '+' &BL1)) '+' &BL1)) ; eVN = eVN '+' (acel '*' (Tfois '/' &BL1)) ; Tfois = Tfois * tVN ; 'FIN' BL1 ; RETNVN = RVN '*' (eVN '+' (0.5 '*' ('PSCAL' VVN VVN RETNVN (RVN * YN) RSN ; 'SI' (ERRO > 1.0d-3) ; MESS 'Problem in VN' ; ERREUR 21 ; FINS ; * * We check that the RH on the energy is satisfied * VVN = DVN '*' (RNINI / RVN) ; HVN = (EVN + (PVN / RVN)) + (0.5 * VVN * VVN) ; HINI = (EINI + (PINI / RNINI)) + (0.5 * DVN * DVN) ; 'SI' (ERRO > 1.0d-2) ; ERREUR 21 ; FINS ; * ***** Combustion via the operator FLAM * YN = RYN '/' RN ; * **** We want the complete combustion in DOM1. * We can use the operator 'FLAM', with epsilon=0 and * DELTAT >> DELTATC * where DELTATC is the characteristic time step linked to * the source term. * SN = RSN '/' RN ; DELTATC = 0.25 '*' ('MINIMUM' (DELTAXN '/' K0N)) ; DELTARE DELTARY = 'FLAM' 'CREBCOM2' $DOM1 PGAZ LMOT1 LCOEF RN YN YININ YFINN K0N DELTAXN 0.0 (1D4 '*' DELTATC) 0.3 ; 'SI' (ERRO > 1.0d-2) ; MESS 'Problem in Q' ; ERREUR 21 ; FINS ; RYN = RYN '+' DELTARY ; YN = RYN '/' RN ; RETN = RETN '+' DELTARE ; * * * * * AICC, CJ via DETO operator (not really complete combustion...) * 'H2O' 0.0 * ((RAICC1 - RAICC2) / RAICC1) ((TAICC1 - TAICC2) / TAICC1)) ; 'SI' (ERRO > 1.0d-2) ; MESS 'Problem in AICC' ; ERREUR 21 ; FINS ; * * CJ * Tfois = TCJ ; 'REPETER' BL1 ((PGAZ . 'NORD') '+' 1) ; &BL1)) '+' &BL1)) '+' &BL1)) '+' &BL1)) ; eCJ = eCJ '+' (acel '*' (Tfois '/' &BL1)) ; Tfois = Tfois * TCJ ; 'FIN' BL1 ; RETNCJ = RCJ '*' eCJ ; RWCJ = RCJ * VN * 0 ; V1CJ P1CJ T1CJ YNCJ SNCJ GAMMAN = 'PRIM' 'PERFTEMP' PGAZ RCJ RWCJ RETNCJ (RCJ * YN) (RCJ * SN) ; CCJ = (GAMMAN * (P1CJ / RCJ)) '**' 0.5 ; VCJ = DCJ * (RNINI / RCJ) ; * We check weather the speed in the shock reference is equal to the speed of * sound. 'SI' (erro > 2.0d-2) ; MESS 'Problem in CJ' ; ERREUR 21 ; FINS ; * * AIBCC * * Gas constant * YN2 = (-1 '*' ((YO2 + YH2 + YH2O) '-' 1)) ; R = ((PGAZ . 'H2O ' . 'R') '*' YH2O) '+' ((PGAZ . 'O2 ' . 'R') '*' YO2) '+' ((PGAZ . 'H2 ' . 'R') '*' YH2) '+' ((PGAZ . 'N2 ' . 'R') '*' YN2) ; T0 = 500 ; T1 = 3500 ; hfin = 'MAXIMUM' ((RETN '/' RN) '+' (PINI '/' RN)) ; * hfin = EINI '+' q '+' (PINI '/' RN) ; * * Regula falsi * 'REPETER' BLITER 100 ; T = (T0 '+' T1) '/' 2. ; eini = 0.0 ; Tfois = T ; 'REPETER' BL1 ((PGAZ . 'NORD') '+' 1) ; acel = (YH2O '*' ('EXTRAIRE' (PGAZ .'H2O ' . 'A') &BL1)) '+' (YN2 '*' ('EXTRAIRE' (PGAZ .'N2 ' . 'A') &BL1)) '+' (YO2 '*' ('EXTRAIRE' (PGAZ .'O2 ' . 'A') &BL1)) '+' (YH2 '*' ('EXTRAIRE' (PGAZ .'H2 ' . 'A') &BL1)) ; eini = eini '+' (acel '*' (Tfois '/' &BL1)) ; Tfois = Tfois * T ; 'FIN' BL1 ; hini = eini '+' (R * T) ; 'SI' (< ('ABS' (hini '-' hfin)) 1.0D-4) ; 'MESSAGE' OK ; 'QUITTER' BLITER ; 'SINON' ; 'SI' (hini > hfin) ; T1 = T ; 'SINON' ; T0 = T ; 'FINSI' ; 'FINSI' ; 'FIN' BLITER ; * TAIBC1=T; RNAIBCC = PINI '/' (R '*' T) ; eini = 0.0 ; Tfois = T ; 'REPETER' BL1 ((PGAZ . 'NORD') '+' 1) ; acel = (YH2O '*' ('EXTRAIRE' (PGAZ .'H2O ' . 'A') &BL1)) '+' (YN2 '*' ('EXTRAIRE' (PGAZ .'N2 ' . 'A') &BL1)) '+' (YO2 '*' ('EXTRAIRE' (PGAZ .'O2 ' . 'A') &BL1)) '+' (YH2 '*' ('EXTRAIRE' (PGAZ .'H2 ' . 'A') &BL1)) ; eini = eini '+' (acel '*' (Tfois '/' &BL1)) ; Tfois = Tfois * T ; 'FIN' BL1 ; RNAIBCC ; RYNAIBCC = RNAIBCC '*' YN ; VN2 P2 T2 Y2 S2 GAMN = 'PRIM' 'PERFTEMP' PGAZ RNAIBCC GN RETAIBCC RYNAIBCC RSN ; ((TAIBC1 - TAIBC2) / TAIBC1)) ; 'SI' (ERRO > 1.0d-2) ; MESS 'Problem in AIBCC' ; ERREUR 21 ; FINS ; * ************************************************************************* ************************************************************************* *********************** END OF THE LOOP ********************************* ************************************************************************* ************************************************************************* * FIN BLCALC ; * **** Some LaTex tables. * SI FAUX ; * 'FORMAT' '(E9.3)' P ' & ' 'FORMAT' '(E9.3)' T ' & ' 'FORMAT' '(E9.3)' C ' & ' 'FORMAT' '(E9.3)' RGAS ' & ' 'FORMAT' '(E9.3)' GAM ' & ' 'FORMAT' '(E9.3)' GAMA ' \\'; MESS AA ; * 'FORMAT' '(E9.3)' P ' & ' 'FORMAT' '(E9.3)' T ' & ' 'FORMAT' '(E9.3)' C ' & ' 'FORMAT' '(E9.3)' RGAS ' & ' 'FORMAT' '(E9.3)' GAM ' & ' 'FORMAT' '(E9.3)' GAMA ' \\'; MESS AA ; * 'FORMAT' '(E9.3)' P ' & ' 'FORMAT' '(E9.3)' T ' & ' 'FORMAT' '(E9.3)' C ' & ' 'FORMAT' '(E9.3)' RGAS ' & ' 'FORMAT' '(E9.3)' GAM ' & ' 'FORMAT' '(E9.3)' GAMA ' \\'; MESS AA ; * 'FORMAT' '(E9.3)' P ' & ' 'FORMAT' '(E9.3)' T ' & ' 'FORMAT' '(E9.3)' C ' & ' 'FORMAT' '(E9.3)' RGAS ' & ' 'FORMAT' '(E9.3)' GAM ' & ' 'FORMAT' '(E9.3)' GAMA ' \\'; MESS AA ; * 'FORMAT' '(E9.3)' P ' & ' 'FORMAT' '(E9.3)' T ' & ' 'FORMAT' '(E9.3)' C ' & ' 'FORMAT' '(E9.3)' RGAS ' & ' 'FORMAT' '(E9.3)' GAM ' & ' 'FORMAT' '(E9.3)' GAMA ' \\'; MESS AA ; FIN BLCALC ; * * AA = CHAI &blcalc ' & ' 'FORMAT' '(E9.3)' XH2 ' & ' * 'FORMAT' '(E9.3)' XO2 ' & ' 'FORMAT' '(E9.3)' XWA ' & ' * 'FORMAT' '(E9.3)' XN2 ' & ' 'FORMAT' '(E9.3)' YH2 ' & ' * 'FORMAT' '(E9.3)' YO2 ' & ' 'FORMAT' '(E9.3)' YWA ' & ' * 'FORMAT' '(E9.3)' YN2 ' \\'; 'FORMAT' '(E9.3)' XO2 ' & ' 'FORMAT' '(E9.3)' XWA ' & ' 'FORMAT' '(E9.3)' YH2 ' & ' 'FORMAT' '(E9.3)' YO2 ' & ' 'FORMAT' '(E9.3)' YWA ' & ' 'FORMAT' '(E9.3)' Q ' \\'; MESS AA ; MESS '\hline' ; FIN BLCALC ; FINSI ; FIN ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales