* fichier : tubedeto3d1.dgibi ************************************************************************ ************************************************************************ **************************************************************** ***** PROPAGATION D UNE DETONATION DANS UN TUBE ***** ***** MODELE CREBCOM ***** ***** A. BECCANTINI, SFME/LTMF, 15.01.02 ***** **************************************************************** * * The file is divided into 5 parts * * 1) mesh * 2) initial conditions and gas properties * 3) parameters used in the computation * 4) the main part (where the computation is realised) * 5) the post-treatment * 'TRAC' 'X' ; **************************************************************** ***** 1D mesh ***** **************************************************************** * * * A6 ---- A5 ------------------- A4 ----------------------- A8 * | | | | * | AR | ZONE1 | ZONE2 | * | | | | * A1 ---- A2 ------------------- A3 ----------------------- A7 * | | | | * | L1 | L2 | L3 | * |<---->|<--------------------->|<----------------------->| * * AR = activation region * ZONE1 * ZONE2 * RAF = 1 ; NL2SL1 = 49 ; NL3SL1 = 100 ; L1 = 0.4 ; L2 = NL2SL1 '*' L1 ; L3 = NL3SL1 '*' L1 ; * If NL2SL1 = 49 and NL3SL1 = 50, then L2 = 19.6, L3 = 20.0 ; N1 = RAF ; N2 = NL2SL1 '*' N1 ; N3 = NL3SL1 '*' N1 ; * For sake of simplicity, we will only consider one mesh in y-direction DX = L1 '/' N1 ; NY = 4 ; NZ = NY ; H1 = NY '*' DX ; A1 = 0.0 0.0 0.0 ; A2 = L1 0.0 0.0 ; A3 = (L1 '+' L2) 0.0 0.0 ; A4 = (L1 '+' L2) H1 0.0 ; A5 = L1 H1 0.0 ; A6 = 0.0 H1 0.0 ; A7 = (L1 '+' L2 '+' L3) 0.0 0.0 ; A8 = (L1 '+' L2 '+' L3) H1 0.0 ; 'OPTION' 'ELEM' 'SEG2' ; A1A2 = A1 'DROIT' N1 A2 ; A2A3 = A2 'DROIT' N2 A3 ; A3A4 = A3 'DROIT' NY A4 ; A4A5 = A4 'DROIT' N2 A5 ; A5A2 = A5 'DROIT' NY A2 ; A2A5 = 'INVERSE' A5A2 ; A5A6 = A5 'DROIT' N1 A6 ; A6A1 = A6 'DROIT' NY A1 ; A3A7 = A3 'DROIT' N3 A7 ; A7A8 = A7 'DROIT' NY A8 ; A8A4 = A8 'DROIT' N3 A4 ; A4A3 = 'INVERSE' A3A4 ; * **** 2D mesh * * DOM1 is the activation region * DOM2 is zone 1 * DOM3 is zone 2 'OPTION' 'ELEM' 'QUA4' ; DOM1P = 'TRANSLATION' A2A5 N1 ((-1.0 '*' L1) 0.0 0.0) ; DOM2P = 'TRANSLATION' A2A5 N2 (L2 0.0 0.0) ; DOM3P = 'TRANSLATION' A3A4 N3 (L3 0.0 0.0) ; * DOMTOT = total region DOMTOTP = DOM1P 'ET' DOM2P 'ET' DOM3P ; 'ELIMINATION' (1.0D-3 '/' RAF) DOMTOTP ; 'ELIMINATION' DOMTOTP (1.0D-3 '/' RAF) (A1A2 'ET' A2A3 'ET' A3A4 'ET' A4A5 'ET' A5A2 'ET' A5A6 'ET' A6A1 'ET' A3A7 'ET' A7A8 'ET' A8A4 'ET' A4A3) ; 'OPTION' 'ELEM' 'CUB8' ; DOM1 = 'VOLUME' DOM1P 'TRANSLATION' NZ (0.0 0.0 H1) ; DOM2 = 'VOLUME' DOM2P 'TRANSLATION' NZ (0.0 0.0 H1) ; DOM3 = 'VOLUME' DOM3P 'TRANSLATION' NZ (0.0 0.0 H1) ; DOMTOT = DOM1 'ET' DOM2 'ET' DOM3 ; 'ELIMINATION' (1.0D-3 '/' RAF) DOMTOT ; * **** The tables 'DOMAINE' * 'SI' VRAI ; * EULER model $DOMTOT = 'MODELISER' DOMTOT 'EULER' ; $DOM1 = 'MODELISER' DOM1 'EULER' ; $DOM2 = 'MODELISER' DOM2 'EULER' ; $DOM3 = 'MODELISER' DOM3 'EULER' ; QDOMTOT = TDOMTOT . 'QUAF' ; QDOM1 = TDOM1 . 'QUAF' ; QDOM2 = TDOM2 . 'QUAF' ; QDOM3 = TDOM3 . 'QUAF' ; 'ELIMINATION' QDOMTOT (0.001 '/' RAF) QDOM1 ; 'ELIMINATION' QDOMTOT (0.001 '/' RAF) QDOM2 ; 'ELIMINATION' QDOMTOT (0.001 '/' RAF) QDOM3 ; 'SINON' ; * NAVIER_STOKES model DOM1 = 'CHANGER' 'QUAF' DOM1 ; DOM2 = 'CHANGER' 'QUAF' DOM2 ; DOM3 = 'CHANGER' 'QUAF' DOM3 ; DOMTOT = DOM1 'ET' DOM2 'ET' DOM3 ; 'ELIMINATION' (1.0D-3 '/' RAF) DOMTOT ; $DOMTOT = 'MODELISER' DOMTOT 'NAVIER_STOKES' 'LINE' ; $DOM1 = 'MODELISER' DOM1 'NAVIER_STOKES' 'LINE' ; $DOM2 = 'MODELISER' DOM2 'NAVIER_STOKES' 'LINE' ; $DOM3 = 'MODELISER' DOM3 'NAVIER_STOKES' 'LINE' ; TDOMTOT . 'PRECONDI' = 1 ; 'FINSI' ; * **** MOD1 = model (created just to display the CHAMELEMs) * * **** Line for graphics * 'OPTION' 'ELEM' 'SEG2' ; P1 = (DX '/' 2) (DX '/' 2) (DX '/' 2) ; P2 = ((L1 '+' L2 '+' L3) '-' (DX '/' 2)) (DX '/' 2) (DX '/' 2) ; LIGEVO = (P1 'DROIT' (N1 '+' N2 '+' N3 '-' 1) P2) 'COULEUR' 'ROUG' ; * 'OPTION' 'SAUVER' ('CHAINE' 'mesh.sauv_raf' RAF) ; * 'SAUVER' RAF DOMTOT $DOMTOT $DOM1 $DOM2 $DOM3 LIGEVO MOD1 ; **************************************************************** **************************************************************** ***** Initial conditions and gas properties. ***** **************************************************************** **************************************************************** * **** 0 from a numerical point of view * * **** (Non-Uniform) initial conditions.(DOM1 et DOM2) * We compute the conservative variables. * * * Contact discontinuity between DOM2 and DOM3 (same pressure, * different temperature) * 'NATU' 'DISCRET') ; 'NATU' 'DISCRET') ; 'UZ' 0.0 ; * We suppose that the combustion is complete everywhere, i.e. the * progress variable is 1 after the detonation transition. * **** From initial conditions on molar fractions, we duduce * the data for the virtual mixture of burned/unburned * gases * **** Molar fractions (before combustion) * 'NATU' 'DISCRET') ; 'NATURE' 'DISCRET' ; 'NATU' 'DISCRET') ; XN = XH21 'ET' XH2O1 'ET' XO21 ; XN = XN 'ET' XN21 ; * ***** 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 * * 'OPTION' 'SAUVER' 'gas_properties.sauv' ; * 'SAUVER' PGAZ ; * **** 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 ; * **** Burned gas * Here x refers to the mole producted per 1 mole of unburned gas * N.B. 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' 'Probleme dan le calcul du gaz brule' ; 'ERREUR' 21 ; 'FINSI' ; * **** xtot2 = mole of burnet 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' 'Probleme dan le calcul du gaz brule' ; '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 * ; RN = PINI '/' (RINI '*' TINI) ; * Internal energy Tfois = Tini ; 'REPETER' BL1 ((PGAZ . 'NORD') '+' 1) ; &BL1)) '+' &BL1)) '+' &BL1)) '+' &BL1)) ; eini = eini '+' (acel '*' (Tfois '/' &BL1)) ; Tfois = Tfois * tini ; 'FIN' BL1 ; RETN = RN '*' (eini '+' (0.5 '*' ('PSCAL' WINI WINI 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 * 'SI' VRAI ; * Test PCEL = 'MAXIMUM' PINI ; TCEL = 'MAXIMUM' TINI ; 'SI' (('MAXIMUM' ((P '-' pini) '/' PCEL) 'ABS')> 1.0D-3) ; 'MESSAGE' 'Probleme calcul energie totale' ; 'ERREUR' 21 ; 'FINSI' ; 'SI' (('MAXIMUM' ((T '-' Tini) '/' TCEL)) > 1.0D-3) ; 'MESSAGE' 'Probleme calcul energie totale' ; 'ERREUR' 21 ; 'FINSI' ; 'FINSI' ; **************************************************************** **************************************************************** ***** Parameters for the computations ****** **************************************************************** **************************************************************** * Upwind scheme * METO = 'VLH' ; METO = 'SS' ; * Iterations * Final time * Safety Factor fot the time step * Second order reconstruction? NITER = 10000 ; TFINAL = 5.0D-3 ; SAFFAC = 0.7 ; LOGSO = VRAI ; * * EPS_CC linked to CREBCOM criterion * EPS_CC = 0.8 ; * 'OPTION' 'SAUVER' 'parameters.sauv' ; * 'SAUVER' METO NITER TFINAL SAFFAC EPS_CC LOGSO ; **************************************************************** **************************************************************** ***** The computation ****** **************************************************************** **************************************************************** * Mesh dimension (in 3D!) YN = RYN '/' RN ; * **** We impose we have combustion in the ignition region (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. * Since DELTAXN is constant, DELTATC does not change during the * computation. * SN = RSN '/' RN ; DELTATC = 0.25 '*' ('MINIMUM' (DELTAXN '/' K0N)) ; DELTARE DELTARY = 'FLAM' 'CREBCOM2' $DOM1 PGAZ LMOT1 LCOEF RYN = RYN '+' DELTARY ; YN = RYN '/' RN ; RETN = RETN '+' DELTARE ; RN0 = 'COPIER' RN ; GN0 = 'COPIER' GN ; RETN0 = 'COPIER' RETN ; RYN0 = 'COPIER' RYN ; RSN0 = 'COPIER' RSN ; * **** Parameter for the time loop * * Names of the residuum components LISTINCO = 'MOTS' 'RN' 'RUX' 'RUY' 'RUZ' 'RETN' 'H2' 'O2' 'H2O' 'H2IN' 'H2FI' 'K0' ; * **** Geometrical coefficient to compute gradients * GRADR CACCA COEFSCAL = 'PENT' $DOMTOT 'CENTRE' 'EULESCAL' 'NOLIMITE' GRADV CACCA COEFVECT = 'PENT' $DOMTOT 'CENTRE' 'EULEVECT' 'NOLIMITE' TPS = 0.0 ; * **** The chemistry time step * * DT_CHEM = SAFFAC '*' DELTATC ; * **** Temporal loop * 'MESSAGE' ; 'MESSAGE' ('CHAINE' 'Methode = ' METO) ; 'MESSAGE' ('CHAINE' 'SAFFAC = ' SAFFAC) ; 'MESSAGE' ; TNM1 = 'COPIER' TN ; 'TEMPS' 'ZERO' ; 'REPETER' BL1 NITER ; * **** Primitive variables * VN PN TN YN SN GAMMAN = 'PRIM' 'PERFTEMP' PGAZ RN GN RETN RYN RSN TNM1 ; TNM1 = 'COPIER' TN ; 'SI' LOGSO ; GRADR ALR = 'PENT' $DOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADP ALP = 'PENT' $DOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADV ALV = 'PENT' $DOMTOT 'CENTRE' 'EULEVECT' 'LIMITEUR' GRADY ALY = 'PENT' $DOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADS ALS = 'PENT' $DOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' $DOMTOT PGAZ RN GRADR ALR VN GRADV ALV PN GRADP ALP YN GRADY ALY SN GRADS ALS ; 'SINON' ; $DOMTOT PGAZ RN VN PN YN SN ; 'FINSI' ; $DOMTOT PGAZ LISTINCO ROF VITF PF YF SF ; DT_CON = SAFFAC '*' DELTAT ; * **** The time step linked to tps * * **** Total time step * * **** Increment of the variables (convection) * RESIDU = DTMIN '*' RESIDU ; 'UZ') ; TPS = TPS '+' DTMIN ; RN = RN '+' DRN ; GN = GN '+' DGN ; RETN = RETN '+' DRETN ; RYN = RYN '+' DRYN ; RSN = RSN '+' DRSN ; YN = RYN '/' RN ; SN = RSN '/' RN ; * **** Increment of the variables (chemical source) * DRETN DRYN = 'FLAM' 'CREBCOM2' $DOMTOT PGAZ LMOT1 LCOEF RN YN YININ YFINN K0N DELTAXN EPS_CC DTMIN 0.3 ; RYN = RYN '+' DRYN ; RETN = RETN '+' DRETN ; 'SI' (((&BL1 '/' 20) '*' 20) 'EGA' &BL1) ; 'MESSAGE' ('CHAINE' 'ITER =' &BL1 ' TPS =' TPS) ; 'FINSI' ; 'SI' (TPS > TFINAL) ; 'QUITTER' BL1 ; 'FINSI' ; 'FIN' BL1 ; 'TEMPS' ; * 'OPTION' 'SAUVER' ('CHAINE' 'result.sauv_' RAF 'tps_' TPS ) ; * 'SAUVER' ; **************************************************************** **************************************************************** ***** The post-treatment ****** **************************************************************** **************************************************************** * 'OPTI' 'REST' 'result.sauv_1tps_5' ; * 'REST' ; GRAPH = VRAI ; GRAPH = FAUX ; * **** The mesh * 'SI' GRAPH ; 'TRACER' DOMTOT 'TITR' ('CHAINE' 'Maillage: ' 'FINSI' ; * **** Initial conditions * 'SI' GRAPH ; VN PN TN YN SN GAMMAN = 'PRIM' 'PERFTEMP' PGAZ RN0 GN0 RETN0 RYN0 RSN0 ; 'TRAC' CHM_RN MOD1 'TRAC' CHM_VN MOD1 'TRAC' CHM_PN MOD1 'TRAC' CHM_TN MOD1 'TRAC' CHM_YN MOD1 'TRAC' CHM_SN MOD1 'FINSI' ; * **** Results * 'SI' GRAPH ; 'TRAC' CHM_RN MOD1 'TRAC' CHM_VN MOD1 'TRAC' CHM_PN MOD1 'TRAC' CHM_TN MOD1 'TRAC' CHM_YN MOD1 'TRAC' CHM_SN MOD1 'FINSI' ; * *** Evolution Objects * SS = 'COORDONNEE' 1 LIGEVO; x0 = 'MINIMUM' lxx; x1 = 'MAXIMUM' lxx ; titolo = 'CHAINE' ' at t = ' TPS ' Methode = ' METO ' SF = ' SAFFAC ; * rho tro = 'CHAINE' 'ro ' titolo ; * u tu = 'CHAINE' 'u ' titolo ; * yini tyini = 'CHAINE' 'yini ' titolo ; * yfin tyfin = 'CHAINE' 'yfin ' titolo ; * K0 tk0 = 'CHAINE' 'k0 ' titolo ; * csi (YFINN '-' YININ) ; tcsi = 'CHAINE' 'csi ' titolo ; * v tv = 'CHAINE' 'v ' titolo ; * p tp = 'CHAINE' 'p ' titolo ; * T tT = 'CHAINE' 'T ' titolo ; 'SI' GRAPH ; 'DESSIN' evro 'TITRE' tro 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evp 'TITRE' tp 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evu 'TITRE' tu 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evv 'TITRE' tv 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evT 'TITRE' tT 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evcsi 'TITRE' tcsi 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evk0 'TITRE' tk0 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evyini 'TITRE' tyini 'XBOR' x0 x1 'MIMA' ; 'DESSIN' evyfin 'TITRE' tyfin 'XBOR' x0 x1 'MIMA' ; 'FINSI' ; * Test PVN = 3.2E6 ; PCJ = 1.1E6 ; RHOVN = 3.7 ; RHOCJ = 1.6 ; PMAX = 'MAXIMUM' PN ; 'SI' ((PMAX '>' PVN) 'OU' (PMAX '<' PCJ)) ; 'MESSAGE' 'Pression = ???' ; 'ERREUR' 5 ; 'FINSI' ; RHOMAX = 'MAXIMUM' RN ; 'SI' ((RHOMAX '>' RHOVN) 'OU' (RHOMAX '<' RHOCJ)) ; 'MESSAGE' 'Densite = ???' ; 'ERREUR' 5 ; 'FINSI' ; 'FIN' ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales