From 2e73ecf58a0d72374c2b9bd5df0fc48f987b1f8d Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 15 Jan 2024 15:16:10 +0530 Subject: [PATCH 01/20] Added mandatory -c/--chemistry CL argument Only one of two chemistry arguments are accepted namely homogeneous and heterogeneous. --- Support/ceptr/ceptr/ceptr.py | 44 +++++++++++++++++++++++++++++++- Support/ceptr/ceptr/converter.py | 3 +++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Support/ceptr/ceptr/ceptr.py b/Support/ceptr/ceptr/ceptr.py index 9278f78b3..6cffda3e0 100644 --- a/Support/ceptr/ceptr/ceptr.py +++ b/Support/ceptr/ceptr/ceptr.py @@ -41,12 +41,27 @@ def convert( jacobian, qss_format_input, qss_symbolic_jac, + chemistry, + gas_name, + interface_name ): """Convert a mechanism file.""" print(f"""Converting file {fname}""") - mechanism = ct.Solution(fname) + + mechanismIsHomogeneous = chemistry == "homogeneous" + if not mechanismIsHomogeneous: + print(f"""\tHomogeneous phase name is '{gas_name}'""") + print(f"""\tGas-solid interface name is '{interface_name}'""") + + interface = None if mechanismIsHomogeneous else\ + ct.Interface(fname, interface_name) + mechanism = ct.Solution(fname) if mechanismIsHomogeneous else\ + interface.adjacent[gas_name] + conv = converter.Converter( mechanism, + interface, + chemistry, jacobian, qss_format_input, qss_symbolic_jac, @@ -105,6 +120,22 @@ def main(): "-lq", "--lst_qss", help="QSS mechanism directory file list", type=str ) + group2 = parser.add_mutually_exclusive_group(required=True) + group2.add_argument("-c", "--chemistry", type=str, + help="Information regarding whether the supplied"+\ + " Mechanism file specified Homogeneous or"+\ + " heterogeneous chemistry") + parser.add_argument( + "--gas_name", + type=str, + default = "gas", + help="Name of the homogeneous phase in the mechanism file") + parser.add_argument( + "--interface_name", + type=str, + default = None, + help="Name of the gas-solid interface in the mechanism file") + parser.add_argument( "--qss_format_input", help="Input file for QSS Jacobian formatting parameters mechanisms", @@ -133,12 +164,23 @@ def main(): args = parser.parse_args() + # sanity checks + assert args.chemistry in ['homogeneous', 'heterogeneous'],\ + """Invalid chemistry specifier.\nThe required -c/--chemistry argument should be either\n"homogeneous" or "heterogeneous." """ + + if args.chemistry == "heterogeneous": + assert not isinstance(args.interface_name, type(None)),\ + f"""Missing --interface_name argument\nPlease specify the name of the gas-solid interface mentioned in {args.fname}""" + if args.fname: convert( args.fname, not args.no_jacobian, args.qss_format_input, args.qss_symbolic_jacobian, + args.chemistry, + args.gas_name, + args.interface_name ) elif args.lst: convert_lst( diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index c882b1ac8..4d9ab63ef 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -27,11 +27,14 @@ class Converter: def __init__( self, mechanism, + interface, + chemistry, jacobian=True, qss_format_input=None, qss_symbolic_jacobian=False, ): self.mechanism = mechanism + self.interface = interface self.jacobian = jacobian From e639d0ab67fea7c423578be3a71d01250b3b045c Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 15 Jan 2024 15:23:01 +0530 Subject: [PATCH 02/20] Using Kolla mechanism to track effects of CEPTR changes --- Support/ceptr/Kolla/ARC/getrates.f | 428 ++ Support/ceptr/Kolla/Make.package | 9 + Support/ceptr/Kolla/README.md | 8 + Support/ceptr/Kolla/chem.cti | 445 ++ Support/ceptr/Kolla/convert.sh | 5 + Support/ceptr/Kolla/mechanism.H | 7898 ++++++++++++++++++++++++++++ Support/ceptr/Kolla/mechanism.cpp | 489 ++ Support/ceptr/Kolla/mechanism.inp | 239 + Support/ceptr/Kolla/mechanism.yaml | 437 ++ Support/ceptr/Kolla/therm.dat | 51 + Support/ceptr/Kolla/tran.dat | 319 ++ 11 files changed, 10328 insertions(+) create mode 100644 Support/ceptr/Kolla/ARC/getrates.f create mode 100644 Support/ceptr/Kolla/Make.package create mode 100644 Support/ceptr/Kolla/README.md create mode 100644 Support/ceptr/Kolla/chem.cti create mode 100755 Support/ceptr/Kolla/convert.sh create mode 100644 Support/ceptr/Kolla/mechanism.H create mode 100644 Support/ceptr/Kolla/mechanism.cpp create mode 100644 Support/ceptr/Kolla/mechanism.inp create mode 100644 Support/ceptr/Kolla/mechanism.yaml create mode 100644 Support/ceptr/Kolla/therm.dat create mode 100644 Support/ceptr/Kolla/tran.dat diff --git a/Support/ceptr/Kolla/ARC/getrates.f b/Support/ceptr/Kolla/ARC/getrates.f new file mode 100644 index 000000000..81f86cf65 --- /dev/null +++ b/Support/ceptr/Kolla/ARC/getrates.f @@ -0,0 +1,428 @@ +c**************************************************************************** +c ... DO NOT EDIT. AUTOMATICALLY GENERATED FILE. +c**************************************************************************** +c ... +c ... CKWYP-compatible GETRATES: return molar production rates for all +c ... species given pressure (P), temperature (T), and mass fractions (Y). +c ... +c ... Generated by cgetrates 1.0b +c ... +c**************************************************************************** + + subroutine getrates(P,T,Y,ICKWRK,RCKWRK,WSPL) + + use thermchem_m, only : gibbsEnrg_all_dimT !HK + use chemkin_m, only : molwt_c !HK + + implicit none + + integer NSMax ! maximum number of species + parameter (NSMax = 1000) + integer NRMax ! maximum number of reactions + parameter (NRMax = 5000) + + real PA ! atm. pressure; dyne/cm^2 + parameter (PA = 1.013250d+06) + real R0 ! gas constant; erg/(mol K) + parameter (R0 = 8.314510d+07) + real R0c ! gas constant; cal/(mol K) + parameter (R0c = 1.9872155832) + real DLn10 ! log(10) + parameter (DLn10 = 2.3025850929940459d0) + + integer ICKWRK(*) ! ... + real RCKWRK(*) ! ... + real P ! pressure + real T ! temperature (K) + real Y(NSMax) ! ... + real WSPL(NSMax) ! ... + + real FCent ! ... + real FDenom ! ... + real FLogPR ! ... + real FQuan ! ... + real CTOT ! ... + real OPRT ! ... + real ORTC ! ... + real OTC ! ... + real PR ! ... + real PRT ! ... + real RC ! ... + real RR_F ! forward reaction rate + real RR_R ! reverse reaction rate + real RR_K0 ! ... + real RR_KInf ! ... + real TC ! ... + real THBCTEMP ! ... + real VLNPRT ! ... + real VLNTEMP ! ... + real XIK ! ... + + real CGSPL(NSMax) ! ... + real CSPL(NSMax) ! ... + real ROPL(NRMax) ! ... + + real or0tc ! HK + + integer KSP ! ... + integer I ! loop index + + intrinsic exp, log + external CKRHOY, CKYTCP + + dimension thbctemp(4) + + integer NC_H2, NC_O2, NC_O, NC_OH, NC_H2O, NC_H, NC_HO2, NC_H2O2 + integer NC_CO, NC_CO2, NC_HCO, NC_N2 + + parameter (NC_H2 = 1) + parameter (NC_O2 = 2) + parameter (NC_O = 3) + parameter (NC_OH = 4) + parameter (NC_H2O = 5) + parameter (NC_H = 6) + parameter (NC_HO2 = 7) + parameter (NC_H2O2 = 8) + parameter (NC_CO = 9) + parameter (NC_CO2 = 10) + parameter (NC_HCO = 11) + parameter (NC_N2 = 12) + + integer NS ! number of species + parameter (NS = 12) + +c---------------------------------------------------------------------------- +c ... loop over all cells + +c$doacross local(i,j,tc,rc,otc,vlntemp,cgspl,ksp,wspl,cspl,rr_f,rr_r, +c$& xik,ctot,ropl,pr,fcent,thbctemp,rr_k0,rr_kinf,flogpr, +c$& fdenom,fquan,prt,vlnprt), +c$& share(m,n,temp,rho,temp1tab,odtab,ns,cgsptab,ys,ospwt,spwt, +c$& temptab,wchem,tempref) + +cmic$ do all +cmic$* private(xik,ctot,ropl,pr,fcent,thbctemp,rr_k0,rr_kinf,flogpr) +cmic$* private(i,j,tc,rc,otc,vlntemp,cgspl,ksp,wspl,cspl,rr_f,rr_r) +cmic$* private(fdenom,fquan,prt,vlnprt) +cmic$* shared(m,n,temp,rho,temp1tab,odtab,ns,cgsptab,ys,ospwt,spwt) +cmic$* shared(temptab,wchem,tempref) + +c---------------------------------------------------------------------------- + + TC = T + + call CKRHOY(P,T,Y,ICKWRK,RCKWRK,RC) + + otc = 1.0 / tc + ortc = 1.0 / (tc * R0c) + vlntemp = log(TC) + or0tc = 1.0/(R0 * TC) + prt = PA *or0tc +! prt = PA / (R0 * TC) + oprt = 1.0 / prt + vlnprt = log(prt) + +c ... get gibbs free energies + +c inlined +c call getcgsp(i,j,cgspl) + +c call CKGML(T,ICKWRK,RCKWRK,CGSPL) +c do I=1,NS +c CGSPL(I) = CGSPL(I) / R0 +c end do +c evatt - this is faster + call gibbsEnrg_all_dimT(T, cgspl(:)) + +c ... initialize + +c do ksp=1,ns +c cspl(ksp) = rc*ys(i,j,ksp)*ospwt(ksp) ! concentrations +c end do + +c call CKYTCP(P,T,Y,ICKWRK,RCKWRK,CSPL) +c evatt - this is faster + cspl(1:ns) = y(1:ns)*molwt_c(1:ns) + rc = p*or0tc/sum(cspl(1:ns)) + cspl(1:ns) = rc*cspl(1:ns) + +c prt = pa / (r0 * tc) +c vlnprt = log(prt) +c---------------------------------------- +c ... calculate third-body concentrations + + ctot = 0.0 + do ksp = 1, ns + ctot = ctot + cspl(ksp) + end do + thbctemp(2) = ctot + 1.5d+000*cspl(NC_H2) + 1.1d+001*cspl(NC_H2O) + & + 8.999999999999999d-001*cspl(NC_CO) + 2.8d+000*cspl(NC_CO2) + thbctemp(3) = ctot + cspl(NC_H2) - 2.2d-001*cspl(NC_O2) + 1.0d+001 + & *cspl(NC_H2O) + 8.999999999999999d-001*cspl(NC_CO) + 2.8d+000* + & cspl(NC_CO2) + thbctemp(4) = ctot + 1.5d+000*cspl(NC_H2) + 5.0d+000*cspl(NC_H2O) + & + 8.999999999999999d-001*cspl(NC_CO) + 2.8d+000*cspl(NC_CO2) + +c---------------------------------------------------- +c ... loop over all rxns to evaluate rate-of-progress + +c 1) O2 + H <=> OH + O + rr_f = 3.547d+015 * exp(-4.06d-001*vlntemp - 1.6599d+004*ortc) + xik = -cgspl(NC_O2) - cgspl(NC_H) + cgspl(NC_OH) + cgspl(NC_O) + rr_r = rr_f * exp(xik*otc) + ropl(1) = rr_f*cspl(NC_O2)*cspl(NC_H) - rr_r*cspl(NC_OH) + & *cspl(NC_O) + +c 2) H2 + O <=> OH + H + rr_f = 5.08d+004 * exp(2.67d+000*vlntemp - 6.29d+003*ortc) + xik = -cgspl(NC_H2) - cgspl(NC_O) + cgspl(NC_OH) + cgspl(NC_H) + rr_r = rr_f * exp(xik*otc) + ropl(2) = rr_f*cspl(NC_H2)*cspl(NC_O) - rr_r*cspl(NC_OH) + & *cspl(NC_H) + +c 3) OH + H2 <=> H + H2O + rr_f = 2.16d+008 * exp(1.51d+000*vlntemp - 3.43d+003*ortc) + xik = -cgspl(NC_OH) - cgspl(NC_H2) + cgspl(NC_H) + cgspl(NC_H2O) + rr_r = rr_f * exp(xik*otc) + ropl(3) = rr_f*cspl(NC_OH)*cspl(NC_H2) - rr_r*cspl(NC_H) + & *cspl(NC_H2O) + +c 4) H2O + O <=> 2 OH + rr_f = 2.97d+006 * exp(2.02d+000*vlntemp - 1.34d+004*ortc) + xik = -cgspl(NC_H2O) - cgspl(NC_O) + 2.0 * cgspl(NC_OH) + rr_r = rr_f * exp(xik*otc) + ropl(4) = rr_f*cspl(NC_H2O)*cspl(NC_O) - rr_r*cspl(NC_OH) + & *cspl(NC_OH) + +c 5) H2 + M <=> 2 H + M + rr_f = 4.577d+019 * exp(-1.4d+000*vlntemp - 1.0438d+005*ortc) + xik = -cgspl(NC_H2) + 2.0 * cgspl(NC_H) + rr_r = rr_f * exp(xik*otc) * oprt + ropl(5) = rr_f*cspl(NC_H2) - rr_r*cspl(NC_H)*cspl(NC_H) + ropl(5) = ropl(5) * thbctemp(2) + +c 6) 2 O + M <=> O2 + M + rr_f = 6.165d+015 * exp(-5.0d-001*vlntemp) + xik = -2.0 * cgspl(NC_O) + cgspl(NC_O2) + rr_r = rr_f * exp(xik*otc) * prt + ropl(6) = rr_f*cspl(NC_O)*cspl(NC_O) - rr_r*cspl(NC_O2) + ropl(6) = ropl(6) * thbctemp(2) + +c 7) H + O + M <=> OH + M + rr_f = 4.714d+018 * otc + xik = -cgspl(NC_H) - cgspl(NC_O) + cgspl(NC_OH) + rr_r = rr_f * exp(xik*otc) * prt + ropl(7) = rr_f*cspl(NC_H)*cspl(NC_O) - rr_r*cspl(NC_OH) + ropl(7) = ropl(7) * thbctemp(2) + +c 8) OH + H + M <=> H2O + M + rr_f = 3.8d+022 * otc * otc + xik = -cgspl(NC_OH) - cgspl(NC_H) + cgspl(NC_H2O) + rr_r = rr_f * exp(xik*otc) * prt + ropl(8) = rr_f*cspl(NC_OH)*cspl(NC_H) - rr_r*cspl(NC_H2O) + ropl(8) = ropl(8) * thbctemp(2) + +c 9) O2 + H (+M) <=> HO2 (+M) + rr_k0 = 6.366d+020 * exp(-1.72d+000*vlntemp - 5.248d+002*ortc) + rr_kinf = 1.475d+012 * exp(6.0d-001*vlntemp) + pr = rr_k0 / rr_kinf * thbctemp(3) +c evatt - fcent always log10(0.8) +c fcent = log10(2.0d-001 * exp(-9.999999999999999d+029 * tc) + +c & 8.0d-001 * exp(-9.999999999999999d-031 * tc)) + fcent = -9.691001300e-02 + flogpr = log10(pr) - 0.4 - 0.67 * fcent + fdenom = 0.75 - 1.27 * fcent - 0.14 * flogpr + fquan = flogpr / fdenom + fquan = fcent / (1.0 + fquan * fquan) + rr_f = rr_kinf * pr/(1.0 + pr) * exp(fquan*dln10) + xik = -cgspl(NC_O2) - cgspl(NC_H) + cgspl(NC_HO2) + rr_r = rr_f * exp(xik*otc) * prt + ropl(9) = rr_f*cspl(NC_O2)*cspl(NC_H) - rr_r*cspl(NC_HO2) + +c 10) H + HO2 <=> O2 + H2 + rr_f = 1.66d+013 * exp(-8.23d+002*ortc) + xik = -cgspl(NC_H) - cgspl(NC_HO2) + cgspl(NC_O2) + cgspl(NC_H2) + rr_r = rr_f * exp(xik*otc) + ropl(10) = rr_f*cspl(NC_H)*cspl(NC_HO2) - rr_r*cspl(NC_O2) + & *cspl(NC_H2) + +c 11) H + HO2 <=> 2 OH + rr_f = 7.079d+013 * exp(-2.95d+002*ortc) + xik = -cgspl(NC_H) - cgspl(NC_HO2) + 2.0 * cgspl(NC_OH) + rr_r = rr_f * exp(xik*otc) + ropl(11) = rr_f*cspl(NC_H)*cspl(NC_HO2) - rr_r*cspl(NC_OH) + & *cspl(NC_OH) + +c 12) O + HO2 <=> OH + O2 + rr_f = 3.25d+013 + xik = -cgspl(NC_O) - cgspl(NC_HO2) + cgspl(NC_OH) + cgspl(NC_O2) + rr_r = rr_f * exp(xik*otc) + ropl(12) = rr_f*cspl(NC_O)*cspl(NC_HO2) - rr_r*cspl(NC_OH) + & *cspl(NC_O2) + +c 13) OH + HO2 <=> O2 + H2O + rr_f = 2.89d+013 * exp(4.97d+002*ortc) + xik = -cgspl(NC_OH) - cgspl(NC_HO2) + cgspl(NC_O2) + cgspl(NC_H2O) + & + rr_r = rr_f * exp(xik*otc) + ropl(13) = rr_f*cspl(NC_OH)*cspl(NC_HO2) - rr_r*cspl(NC_O2) + & *cspl(NC_H2O) + +c 14, 15) 2 HO2 <=> O2 + H2O2 + rr_f = 4.2d+014 * exp(-1.1982d+004*ortc) + rr_f = rr_f + 1.3d+011 * exp(1.6293d+003*ortc) + xik = -2.0 * cgspl(NC_HO2) + cgspl(NC_O2) + cgspl(NC_H2O2) + rr_r = rr_f * exp(xik*otc) + ropl(14) = rr_f*cspl(NC_HO2)*cspl(NC_HO2) - rr_r*cspl(NC_O2) + & *cspl(NC_H2O2) + +c 16) H2O2 (+M) <=> 2 OH (+M) + rr_k0 = 1.202d+017 * exp(-4.55d+004*ortc) + rr_kinf = 2.951d+014 * exp(-4.843d+004*ortc) + pr = rr_k0 / rr_kinf * thbctemp(2) +c evatt - this is always equal to log10(0.5) +c fcent = log10(5.0d-001 * exp(-9.999999999999999d+029 * tc) + +c & 5.0d-001 * exp(-9.999999999999999d-031 * tc)) + fcent = -3.0102999566398e-01 + flogpr = log10(pr) - 0.4 - 0.67 * fcent + fdenom = 0.75 - 1.27 * fcent - 0.14 * flogpr + fquan = flogpr / fdenom + fquan = fcent / (1.0 + fquan * fquan) + rr_f = rr_kinf * pr/(1.0 + pr) * exp(fquan*dln10) + xik = -cgspl(NC_H2O2) + 2.0 * cgspl(NC_OH) + rr_r = rr_f * exp(xik*otc) * oprt + ropl(16) = rr_f*cspl(NC_H2O2) - rr_r*cspl(NC_OH)*cspl(NC_OH) + +c 17) H + H2O2 <=> OH + H2O + rr_f = 2.41d+013 * exp(-3.97d+003*ortc) + xik = -cgspl(NC_H) - cgspl(NC_H2O2) + cgspl(NC_OH) + cgspl(NC_H2O) + & + rr_r = rr_f * exp(xik*otc) + ropl(17) = rr_f*cspl(NC_H)*cspl(NC_H2O2) - rr_r*cspl(NC_OH) + & *cspl(NC_H2O) + +c 18) H + H2O2 <=> H2 + HO2 + rr_f = 4.82d+013 * exp(-7.95d+003*ortc) + xik = -cgspl(NC_H) - cgspl(NC_H2O2) + cgspl(NC_H2) + cgspl(NC_HO2) + & + rr_r = rr_f * exp(xik*otc) + ropl(18) = rr_f*cspl(NC_H)*cspl(NC_H2O2) - rr_r*cspl(NC_H2) + & *cspl(NC_HO2) + +c 19) O + H2O2 <=> HO2 + OH + rr_f = 9.55d+006 * tc * tc * exp(-3.97d+003*ortc) + xik = -cgspl(NC_O) - cgspl(NC_H2O2) + cgspl(NC_HO2) + cgspl(NC_OH) + & + rr_r = rr_f * exp(xik*otc) + ropl(19) = rr_f*cspl(NC_O)*cspl(NC_H2O2) - rr_r*cspl(NC_HO2) + & *cspl(NC_OH) + +c 20, 21) OH + H2O2 <=> H2O + HO2 + rr_f = 1.0d+012 + rr_f = rr_f + 5.8d+014 * exp(-9.557d+003*ortc) + xik = -cgspl(NC_OH) - cgspl(NC_H2O2) + cgspl(NC_H2O) + + & cgspl(NC_HO2) + rr_r = rr_f * exp(xik*otc) + ropl(20) = rr_f*cspl(NC_OH)*cspl(NC_H2O2) - rr_r*cspl(NC_H2O) + & *cspl(NC_HO2) + +c 22) O + CO (+M) <=> CO2 (+M) + rr_k0 = 1.55d+024 * exp(-2.79d+000*vlntemp - 4.191d+003*ortc) + rr_kinf = 1.8d+010 * exp(-2.384d+003*ortc) + pr = rr_k0 / rr_kinf * thbctemp(2) + rr_f = rr_kinf * pr/(1.0 + pr) + xik = -cgspl(NC_O) - cgspl(NC_CO) + cgspl(NC_CO2) + rr_r = rr_f * exp(xik*otc) * prt + ropl(22) = rr_f*cspl(NC_O)*cspl(NC_CO) - rr_r*cspl(NC_CO2) + +c 23) O2 + CO <=> O + CO2 + rr_f = 2.53d+012 * exp(-4.77d+004*ortc) + xik = -cgspl(NC_O2) - cgspl(NC_CO) + cgspl(NC_O) + cgspl(NC_CO2) + rr_r = rr_f * exp(xik*otc) + ropl(23) = rr_f*cspl(NC_O2)*cspl(NC_CO) - rr_r*cspl(NC_O) + & *cspl(NC_CO2) + +c 24) HO2 + CO <=> OH + CO2 + rr_f = 3.01d+013 * exp(-2.3d+004*ortc) + xik = -cgspl(NC_HO2) - cgspl(NC_CO) + cgspl(NC_OH) + cgspl(NC_CO2) + & + rr_r = rr_f * exp(xik*otc) + ropl(24) = rr_f*cspl(NC_HO2)*cspl(NC_CO) - rr_r*cspl(NC_OH) + & *cspl(NC_CO2) + +c 25) OH + CO <=> H + CO2 + rr_f = 2.229d+005 * exp(1.89d+000*vlntemp + 1.1587d+003*ortc) + xik = -cgspl(NC_OH) - cgspl(NC_CO) + cgspl(NC_H) + cgspl(NC_CO2) + rr_r = rr_f * exp(xik*otc) + ropl(25) = rr_f*cspl(NC_OH)*cspl(NC_CO) - rr_r*cspl(NC_H) + & *cspl(NC_CO2) + +c 26) HCO + M <=> CO + H + M + rr_f = 4.7485d+011 * exp(6.59d-001*vlntemp - 1.4874d+004*ortc) + xik = -cgspl(NC_HCO) + cgspl(NC_CO) + cgspl(NC_H) + rr_r = rr_f * exp(xik*otc) * oprt + ropl(26) = rr_f*cspl(NC_HCO) - rr_r*cspl(NC_CO)*cspl(NC_H) + ropl(26) = ropl(26) * thbctemp(4) + +c 27) O2 + HCO <=> HO2 + CO + rr_f = 7.58d+012 * exp(-4.1d+002*ortc) + xik = -cgspl(NC_O2) - cgspl(NC_HCO) + cgspl(NC_HO2) + cgspl(NC_CO) + & + rr_r = rr_f * exp(xik*otc) + ropl(27) = rr_f*cspl(NC_O2)*cspl(NC_HCO) - rr_r*cspl(NC_HO2) + & *cspl(NC_CO) + +c 28) H + HCO <=> H2 + CO + rr_f = 7.23d+013 + xik = -cgspl(NC_H) - cgspl(NC_HCO) + cgspl(NC_H2) + cgspl(NC_CO) + rr_r = rr_f * exp(xik*otc) + ropl(28) = rr_f*cspl(NC_H)*cspl(NC_HCO) - rr_r*cspl(NC_H2) + & *cspl(NC_CO) + +c 29) O + HCO <=> H + CO2 + rr_f = 3.0d+013 + xik = -cgspl(NC_O) - cgspl(NC_HCO) + cgspl(NC_H) + cgspl(NC_CO2) + rr_r = rr_f * exp(xik*otc) + ropl(29) = rr_f*cspl(NC_O)*cspl(NC_HCO) - rr_r*cspl(NC_H) + & *cspl(NC_CO2) + +c----------------------------------------------------- +c ... evaluate contributions to reactants and products + +c 1. H2 + wspl(NC_H2) = -ropl(2)-ropl(3)-ropl(5)+ropl(10)+ropl(18)+ropl(28) +c 2. O2 + wspl(NC_O2) = -ropl(1)+ropl(6)-ropl(9)+ropl(10)+ropl(12)+ropl(13) + & +ropl(14)-ropl(23)-ropl(27) +c 3. O + wspl(NC_O) = ropl(1)-ropl(2)-ropl(4)-2.0*ropl(6)-ropl(7)-ropl(12) + & -ropl(19)-ropl(22)+ropl(23)-ropl(29) +c 4. OH + wspl(NC_OH) = ropl(1)+ropl(2)-ropl(3)+2.0*ropl(4)+ropl(7)-ropl(8) + & +2.0*ropl(11)+ropl(12)-ropl(13)+2.0*ropl(16)+ropl(17)+ropl(19) + & -ropl(20)+ropl(24)-ropl(25) +c 5. H2O + wspl(NC_H2O) = ropl(3)-ropl(4)+ropl(8)+ropl(13)+ropl(17)+ropl(20) +c 6. H + wspl(NC_H) = -ropl(1)+ropl(2)+ropl(3)+2.0*ropl(5)-ropl(7)-ropl(8) + & -ropl(9)-ropl(10)-ropl(11)-ropl(17)-ropl(18)+ropl(25)+ropl(26) + & -ropl(28)+ropl(29) +c 7. HO2 + wspl(NC_HO2) = ropl(9)-ropl(10)-ropl(11)-ropl(12)-ropl(13) + & -2.0*ropl(14)+ropl(18)+ropl(19)+ropl(20)-ropl(24)+ropl(27) +c 8. H2O2 + wspl(NC_H2O2) = ropl(14)-ropl(16)-ropl(17)-ropl(18)-ropl(19) + & -ropl(20) +c 9. CO + wspl(NC_CO) = -ropl(22)-ropl(23)-ropl(24)-ropl(25)+ropl(26) + & +ropl(27)+ropl(28) +c 10. CO2 + wspl(NC_CO2) = ropl(22)+ropl(23)+ropl(24)+ropl(25)+ropl(29) +c 11. HCO + wspl(NC_HCO) = -ropl(26)-ropl(27)-ropl(28)-ropl(29) +c 12. N2 + wspl(NC_N2) = 0.0 + + return + end + diff --git a/Support/ceptr/Kolla/Make.package b/Support/ceptr/Kolla/Make.package new file mode 100644 index 000000000..24c663c9a --- /dev/null +++ b/Support/ceptr/Kolla/Make.package @@ -0,0 +1,9 @@ +CEXE_headers+=mechanism.H + +CEXE_sources+=mechanism.cpp + +LIBRARIES += + +INCLUDE_LOCATIONS += $(CHEM_DIR) + +VPATH_LOCATIONS += $(CHEM_DIR)/PMFs diff --git a/Support/ceptr/Kolla/README.md b/Support/ceptr/Kolla/README.md new file mode 100644 index 000000000..c96577b75 --- /dev/null +++ b/Support/ceptr/Kolla/README.md @@ -0,0 +1,8 @@ +# Analytically Reduced Mechanisms +!!This mechanism is the skeletal version. !! + +There is a fortran routine to reduce it even more to an ARC. However in that case the species production rates +should NOT be evaluated via the reactions provided in the chemkin reaction data file. + +Note that if a .cpp file is generated at this point, +it will implement the skeletal version of the reduced mechanism and it will not use the *.f routine. diff --git a/Support/ceptr/Kolla/chem.cti b/Support/ceptr/Kolla/chem.cti new file mode 100644 index 000000000..2949b06cf --- /dev/null +++ b/Support/ceptr/Kolla/chem.cti @@ -0,0 +1,445 @@ +""" + Mechanism for CO/H2 oxidation by Hemanth Kolla + based on the skeletal mechanism of Evatt R. Hawkes and Ramanan Sankaran + + Only difference from skeletal mechanism is the inclusion of H2O2 and + the reactions corresponding to its formation and consumption + + The skeletal mechanism is derived from a detailed C1 mechanism by J. Li + + Original notes on the skeletal mechanism and the detailed mechanisms follow + + ------------------------------------------------------------------------------ + Skeletal Mechanism for CO/H2 oxidation + by Evatt R. Hawkes and Ramanan Sankaran + + Reduced from complete C1 Mechanism that is published in: + + J. Li, PhD Thesis, + Mechanical and Aerospace Engineering Department, + Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. + + http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip + + At the time of writing, a publication to IJCK is in preparation + by the authors of the complete mechanism. + + This mechanism was reduced specifically for the purpose of the + Direct Numerical Simulations performed in + Hawkes, E.R., Sankaran, R., Sutherland, J.C., and Chen, J.H. (2006) + Proc. Combust. Inst. 31, to appear. + + It was validated by comparison with the full mechanism in several cases: + 1. freely propagating premixed flames in a range of equivalence ratios, + 2. opposed-flow non-premixed flames in a range of strains up to extinction, + 3. homogeneous ignition calculations for mixtures of fuel and oxidizer streams + and equilibrium products, + 4. two-dimensional DNS featuring extinction and local reignition. + In all cases the agreement was excellent. + + However, the mechanism is validated ONLY for the specific conditions of the + DNS and is not expected to be valid in general. + + The following changes (only) were made to the complete mechanism: + 1) Only the species H2 O2 O OH H2O H HO2 CO CO2 HCO N2 were retained. + All other species and reactions involving these species were removed. Note + this includes all C containing species other than those essential for CO + oxidation: CO, CO2 and HCO. For the atmospheric pressure of the simulation, + H2O2 was also found to be unimportant and was removed. + 2) It was found HCO has only a minor importance, and its reaction rates were + dominated by a few key reactions. These reactions (below) were retained + and all others neglected. + + Steady state assumptions were investigated and found to be reasonably accurate + for fully burning conditions but it was found they increased stiffness, hence + they were not employed. For reference, a steady state approximation for HCO + and HO2 may be expected to perform reasonably well if the added stiffness can + be tackled. However, note the HO2 steady state assumption will degrade the + prediction of ignition at longer ignition delay times. + + --------------------------------------------------------------------------------- + + Notes on the original mechanism by its authors: + + Authors: J. Li, Z. Zhao, A. Kazakov, F.L. Dryer, + Address: Dept. of Mechanical and Aerospace Engineering, + Princeton University, Princeton, NJ 08544 + + This C1 mechanism is based on the CH3OH mechanism of Held and Dryer (IJCK,1998, 30, 805) + with following important revision: + 1. H2/O2 subset is updated to that of Li et al. (IJCK, in press, 2004) + 2. CO + OH = CO2 + H is optimized to fit the literature experimental result + 3. HCO + M = H + CO + M is optimized to fit the literature experimental result + 4. CH3 + HO2 = CH3O + OH is modified to match Scire's value at 1000 K + 5. CH3 + HO2 = CH4 + H is taken from Scire (IJCK, 2001, 33, 75) + 6. CH3 + O2 = CH2O + OH is taken from Scire (2002, Ph.D. thesis) + 7. CH2O + HO2 = HCO + H2O2 is from Eiteneer et al. (JPC A. 1998, 102, 5196) + 8. CH2O + H = HCO + H2 is from Irdam et al. (IJCK 1993, 25, 285) + 9. CH2O + M reactions are from Friedrichs et al.(IJCK 2004, 36, 157) + 10. CH3OH decomposition reactions are taken from GRI-3.0 (1999) + 11. CH2OH + HCO = CH2O + CH2O is taken from Friedrichs et al. (IJCK, 2004, 36, 157) + 12. CH2OH + HCO = CH3OH + CO is changed to keep the branching ratio with the above reaction + 13. HCOOH reactions are not included since it is not important and has large uncertainties + 14. dHf of OH is adjusted to 8.91 kcal/mol (Ruscic et al. JPC A. 2002, 106, 2727) + 15. thermochemical data of CH2OH is fit to Johnson & Hudgens' table (JPC 1996, 100, 19874) + + +""" + +units(length='cm', time='s', quantity='mol', act_energy='cal/mol') + +ideal_gas(name='gas', + elements="C H O N", + species="""H2 O2 O OH H2O H HO2 H2O2 CO + CO2 HCO N2""", + reactions='all', + transport='Mix', + initial_state=state(temperature=300.0, pressure=OneAtm)) + +#------------------------------------------------------------------------------- +# Species data +#------------------------------------------------------------------------------- + +species(name=u'H2', + atoms='H:2', + thermo=(NASA([300.00, 1000.00], + [ 3.29812400E+00, 8.24944200E-04, -8.14301500E-07, + -9.47543400E-11, 4.13487200E-13, -1.01252100E+03, + -3.29409400E+00]), + NASA([1000.00, 5000.00], + [ 2.99142300E+00, 7.00064400E-04, -5.63382900E-08, + -9.23157800E-12, 1.58275200E-15, -8.35034000E+02, + -1.35511000E+00])), + transport=gas_transport(geom='linear', + diam=2.92, + well_depth=38.0, + polar=0.79, + rot_relax=280.0), + note=u'121286') + +species(name=u'O2', + atoms='O:2', + thermo=(NASA([300.00, 1000.00], + [ 3.21293600E+00, 1.12748600E-03, -5.75615000E-07, + 1.31387700E-09, -8.76855400E-13, -1.00524900E+03, + 6.03473800E+00]), + NASA([1000.00, 5000.00], + [ 3.69757800E+00, 6.13519700E-04, -1.25884200E-07, + 1.77528100E-11, -1.13643500E-15, -1.23393000E+03, + 3.18916600E+00])), + transport=gas_transport(geom='linear', + diam=3.458, + well_depth=107.4, + polar=1.6, + rot_relax=3.8), + note=u'121386') + +species(name=u'O', + atoms='O:1', + thermo=(NASA([300.00, 1000.00], + [ 2.94642900E+00, -1.63816600E-03, 2.42103200E-06, + -1.60284300E-09, 3.89069600E-13, 2.91476400E+04, + 2.96399500E+00]), + NASA([1000.00, 5000.00], + [ 2.54206000E+00, -2.75506200E-05, -3.10280300E-09, + 4.55106700E-12, -4.36805200E-16, 2.92308000E+04, + 4.92030800E+00])), + transport=gas_transport(geom='atom', + diam=2.75, + well_depth=80.0), + note=u'120186') + +species(name=u'OH', + atoms='H:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 4.12530561E+00, -3.22544939E-03, 6.52764691E-06, + -5.79853643E-09, 2.06237379E-12, 3.34630913E+03, + -6.90432960E-01]), + NASA([1000.00, 6000.00], + [ 2.86472886E+00, 1.05650448E-03, -2.59082758E-07, + 3.05218674E-11, -1.33195876E-15, 3.68362875E+03, + 5.70164073E+00])), + transport=gas_transport(geom='linear', + diam=2.75, + well_depth=80.0), + note=u'S9/01') + +species(name=u'H2O', + atoms='H:2 O:1', + thermo=(NASA([300.00, 1000.00], + [ 3.38684200E+00, 3.47498200E-03, -6.35469600E-06, + 6.96858100E-09, -2.50658800E-12, -3.02081100E+04, + 2.59023300E+00]), + NASA([1000.00, 5000.00], + [ 2.67214600E+00, 3.05629300E-03, -8.73026000E-07, + 1.20099600E-10, -6.39161800E-15, -2.98992100E+04, + 6.86281700E+00])), + transport=gas_transport(geom='nonlinear', + diam=2.605, + well_depth=572.4, + dipole=1.844, + rot_relax=4.0), + note=u'20387') + +species(name=u'H', + atoms='H:1', + thermo=(NASA([300.00, 1000.00], + [ 2.50000000E+00, 0.00000000E+00, 0.00000000E+00, + 0.00000000E+00, 0.00000000E+00, 2.54716300E+04, + -4.60117600E-01]), + NASA([1000.00, 5000.00], + [ 2.50000000E+00, 0.00000000E+00, 0.00000000E+00, + 0.00000000E+00, 0.00000000E+00, 2.54716300E+04, + -4.60117600E-01])), + transport=gas_transport(geom='atom', + diam=2.05, + well_depth=145.0), + note=u'120186') + +species(name=u'HO2', + atoms='H:1 O:2', + thermo=(NASA([200.00, 1000.00], + [ 4.30179801E+00, -4.74912051E-03, 2.11582891E-05, + -2.42763894E-08, 9.29225124E-12, 2.94808040E+02, + 3.71666245E+00]), + NASA([1000.00, 3500.00], + [ 4.01721090E+00, 2.23982013E-03, -6.33658150E-07, + 1.14246370E-10, -1.07908535E-14, 1.11856713E+02, + 3.78510215E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.458, + well_depth=107.4, + rot_relax=1.0), + note=u'L5/89') + +species(name=u'H2O2', + atoms='H:2 O:2', + thermo=(NASA([300.00, 1000.00], + [ 3.38875400E+00, 6.56922600E-03, -1.48501300E-07, + -4.62580600E-09, 2.47151500E-12, -1.76631500E+04, + 6.78536300E+00]), + NASA([1000.00, 5000.00], + [ 4.57316700E+00, 4.33613600E-03, -1.47468900E-06, + 2.34890400E-10, -1.43165400E-14, -1.80069600E+04, + 5.01137000E-01])), + transport=gas_transport(geom='nonlinear', + diam=3.458, + well_depth=107.4, + rot_relax=3.8), + note=u'120186') + +species(name=u'CO', + atoms='C:1 O:1', + thermo=(NASA([300.00, 1000.00], + [ 3.26245200E+00, 1.51194100E-03, -3.88175500E-06, + 5.58194400E-09, -2.47495100E-12, -1.43105400E+04, + 4.84889700E+00]), + NASA([1000.00, 5000.00], + [ 3.02507800E+00, 1.44268900E-03, -5.63082800E-07, + 1.01858100E-10, -6.91095200E-15, -1.42683500E+04, + 6.10821800E+00])), + transport=gas_transport(geom='linear', + diam=3.65, + well_depth=98.1, + polar=1.95, + rot_relax=1.8), + note=u'121286') + +species(name=u'CO2', + atoms='C:1 O:2', + thermo=(NASA([300.00, 1000.00], + [ 2.27572500E+00, 9.92207200E-03, -1.04091100E-05, + 6.86668700E-09, -2.11728000E-12, -4.83731400E+04, + 1.01884900E+01]), + NASA([1000.00, 5000.00], + [ 4.45362300E+00, 3.14016900E-03, -1.27841100E-06, + 2.39399700E-10, -1.66903300E-14, -4.89669600E+04, + -9.55395900E-01])), + transport=gas_transport(geom='linear', + diam=3.763, + well_depth=244.0, + polar=2.65, + rot_relax=2.1), + note=u'121286') + +species(name=u'HCO', + atoms='H:1 C:1 O:1', + thermo=(NASA([300.00, 1000.00], + [ 2.89833000E+00, 6.19914700E-03, -9.62308400E-06, + 1.08982500E-08, -4.57488500E-12, 4.15992200E+03, + 8.98361400E+00]), + NASA([1000.00, 5000.00], + [ 3.55727100E+00, 3.34557300E-03, -1.33500600E-06, + 2.47057300E-10, -1.71385100E-14, 3.91632400E+03, + 5.55229900E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.59, + well_depth=498.0), + note=u'121286') + +species(name=u'N2', + atoms='N:2', + thermo=(NASA([300.00, 1000.00], + [ 3.29867700E+00, 1.40824000E-03, -3.96322200E-06, + 5.64151500E-09, -2.44485500E-12, -1.02090000E+03, + 3.95037200E+00]), + NASA([1000.00, 5000.00], + [ 2.92664000E+00, 1.48797700E-03, -5.68476100E-07, + 1.00970400E-10, -6.75335100E-15, -9.22797700E+02, + 5.98052800E+00])), + transport=gas_transport(geom='linear', + diam=3.621, + well_depth=97.53, + polar=1.76, + rot_relax=4.0), + note=u'121286') + +#------------------------------------------------------------------------------- +# Reaction data +#------------------------------------------------------------------------------- +# ************ H2-O2 Chain Reactions ********************** +# Hessler, J. Phys. Chem. A, 102:4517 (1998) + +# Reaction 1 +reaction('H + O2 <=> O + OH', [3.547000e+15, -0.406, 16599.0]) +# Sutherland et al., 21st Symposium, p. 929 (1986) + +# Reaction 2 +reaction('O + H2 <=> H + OH', [5.080000e+04, 2.67, 6290.0]) +# Michael and Sutherland, J. Phys. Chem. 92:3853 (1988) + +# Reaction 3 +reaction('H2 + OH <=> H2O + H', [2.160000e+08, 1.51, 3430.0]) +# Sutherland et al., 23rd Symposium, p. 51 (1990) + +# Reaction 4 +reaction('O + H2O <=> OH + OH', [2.970000e+06, 2.02, 13400.0]) +# *************** H2-O2 Dissociation Reactions ****************** +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + +# Reaction 5 +three_body_reaction('H2 + M <=> H + H + M', [4.577000e+19, -1.4, 104380.0], + efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + +# Reaction 6 +three_body_reaction('O + O + M <=> O2 + M', [6.165000e+15, -0.5, 0.0], + efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + +# Reaction 7 +three_body_reaction('O + H + M <=> OH + M', [4.714000e+18, -1.0, 0.0], + efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +# H+OH+M=H2O+M 2.212E+22 -2.00 0.000E+00 + +# Reaction 8 +three_body_reaction('H + OH + M <=> H2O + M', [3.800000e+22, -2.0, 0.0], + efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') +# ************** Formation and Consumption of HO2****************** +# Cobos et al., J. Phys. Chem. 89:342 (1985) for kinf +# Michael, et al., J. Phys. Chem. A, 106:5297 (2002) for k0 +# ****************************************************************************** +# MAIN BATH GAS IS N2 (comment this reaction otherwise) + +# Reaction 9 +falloff_reaction('H + O2 (+ M) <=> HO2 (+ M)', + kf=[1.475000e+12, 0.6, 0.0], + kf0=[6.366000e+20, -1.72, 524.8], + efficiencies='H2:2.0 H2O:11.0 CO2:3.8 CO:1.9 O2:0.78', + falloff=Troe(A=0.8, T3=1e-30, T1=1e+30)) +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] + +# Reaction 10 +reaction('HO2 + H <=> H2 + O2', [1.660000e+13, 0.0, 823.0]) +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] + +# Reaction 11 +reaction('HO2 + H <=> OH + OH', [7.079000e+13, 0.0, 295.0]) +# Baulch et al., J. Phys. Chem. Ref Data, 21:411 (1992) + +# Reaction 12 +reaction('HO2 + O <=> O2 + OH', [3.250000e+13, 0.0, 0.0]) +# Keyser, J. Phys. Chem. 92:1193 (1988) + +# Reaction 13 +reaction('HO2 + OH <=> H2O + O2', [2.890000e+13, 0.0, -497.0]) +# ***************Formation and Consumption of H2O2****************** +# Hippler et al., J. Chem. Phys. 93:1755 (1990) + +# Reaction 14 +reaction('HO2 + HO2 <=> H2O2 + O2', [4.200000e+14, 0.0, 11982.0], + options='duplicate') + +# Reaction 15 +reaction('HO2 + HO2 <=> H2O2 + O2', [1.300000e+11, 0.0, -1629.3], + options='duplicate') +# Brouwer et al., J. Chem. Phys. 86:6171 (1987) for kinf +# Warnatz, J. in Combustion chemistry (1984) for k0 + +# Reaction 16 +falloff_reaction('H2O2 (+ M) <=> OH + OH (+ M)', + kf=[2.951000e+14, 0.0, 48430.0], + kf0=[1.202000e+17, 0.0, 45500.0], + efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9', + falloff=Troe(A=0.5, T3=1e-30, T1=1e+30)) +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + +# Reaction 17 +reaction('H2O2 + H <=> H2O + OH', [2.410000e+13, 0.0, 3970.0]) +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + +# Reaction 18 +reaction('H2O2 + H <=> HO2 + H2', [4.820000e+13, 0.0, 7950.0]) +# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + +# Reaction 19 +reaction('H2O2 + O <=> OH + HO2', [9.550000e+06, 2.0, 3970.0]) +# Hippler and Troe, J. Chem. Phys. Lett. 192:333 (1992) + +# Reaction 20 +reaction('H2O2 + OH <=> HO2 + H2O', [1.000000e+12, 0.0, 0.0], + options='duplicate') + +# Reaction 21 +reaction('H2O2 + OH <=> HO2 + H2O', [5.800000e+14, 0.0, 9557.0], + options='duplicate') +# ************** CO/HCO REACTIONS ***************** +# Troe, 15th Symposium + +# Reaction 22 +falloff_reaction('CO + O (+ M) <=> CO2 (+ M)', + kf=[1.800000e+10, 0.0, 2384.0], + kf0=[1.550000e+24, -2.79, 4191.0], + efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') +# Fit of Westmoreland, AiChe J., 1986, rel. to N2 - Tim adjusted from MTA's +# rate constant, which was rel to Ar. +# Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) + +# Reaction 23 +reaction('CO + O2 <=> CO2 + O', [2.530000e+12, 0.0, 47700.0]) +# This rate constant is modified per an updated value for HO2+HO2=H2O2+OH + +# Reaction 24 +reaction('CO + HO2 <=> CO2 + OH', [3.010000e+13, 0.0, 23000.0]) +# This study (2004) by matching literature experiment results + +# Reaction 25 +reaction('CO + OH <=> CO2 + H', [2.229000e+05, 1.89, -1158.7]) +# This study (2004) by matching literature experiment results + +# Reaction 26 +three_body_reaction('HCO + M <=> H + CO + M', [4.748500e+11, 0.659, 14874.0], + efficiencies='H2:2.5 H2O:6.0 CO2:3.8 CO:1.9') +# Timonen et al., JPC, 92:651 (1988) + +# Reaction 27 +reaction('HCO + O2 <=> CO + HO2', [7.580000e+12, 0.0, 410.0]) +# Timonen et al., JPC, 91:692 (1987) + +# Reaction 28 +reaction('HCO + H <=> CO + H2', [7.230000e+13, 0.0, 0.0]) +# All reactions from Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) + +# Reaction 29 +reaction('HCO + O <=> CO2 + H', [3.000000e+13, 0.0, 0.0]) diff --git a/Support/ceptr/Kolla/convert.sh b/Support/ceptr/Kolla/convert.sh new file mode 100755 index 000000000..488208f39 --- /dev/null +++ b/Support/ceptr/Kolla/convert.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +MECH_HOME="$(pwd)" +MECH_FILE="${MECH_HOME}/mechanism.yaml" +bash ../converter.sh -f "${MECH_FILE}" diff --git a/Support/ceptr/Kolla/mechanism.H b/Support/ceptr/Kolla/mechanism.H new file mode 100644 index 000000000..2086a5e83 --- /dev/null +++ b/Support/ceptr/Kolla/mechanism.H @@ -0,0 +1,7898 @@ +#ifndef MECHANISM_H +#define MECHANISM_H + +#include +#include + +/* Elements +0 C +1 H +2 O +3 N +*/ + +// Species +#define H2_ID 0 +#define O2_ID 1 +#define O_ID 2 +#define OH_ID 3 +#define H2O_ID 4 +#define H_ID 5 +#define HO2_ID 6 +#define H2O2_ID 7 +#define CO_ID 8 +#define CO2_ID 9 +#define HCO_ID 10 +#define N2_ID 11 + +#define NUM_ELEMENTS 4 +#define NUM_SPECIES 12 +#define NUM_IONS 0 +#define NUM_REACTIONS 29 + +#define NUM_FIT 4 + +// ALWAYS on CPU stuff -- can have different def depending on if we are CPU or +// GPU based. Defined in mechanism.cpp +void atomicWeight(amrex::Real* awt); +// MISC +void CKAWT(amrex::Real* awt); +void CKNCF(int* ncf); +void CKSYME_STR(amrex::Vector& ename); +void CKSYMS_STR(amrex::Vector& kname); +void GET_RMAP(int* _rmap); +void CKINU(const int i, int& nspec, int* ki, int* nu); +void CKKFKR( + const amrex::Real P, + const amrex::Real T, + const amrex::Real* x, + amrex::Real* q_f, + amrex::Real* q_r); +void progressRateFR( + amrex::Real* q_f, amrex::Real* q_r, amrex::Real* sc, amrex::Real T); +// SPARSE INFORMATION +void SPARSITY_INFO(int* nJdata, const int* consP, int NCELLS); +void SPARSITY_INFO_SYST(int* nJdata, const int* consP, int NCELLS); +void SPARSITY_INFO_SYST_SIMPLIFIED(int* nJdata, const int* consP); +void +SPARSITY_PREPROC_CSC(int* rowVals, int* colPtrs, const int* consP, int NCELLS); +void SPARSITY_PREPROC_CSR( + int* colVals, int* rowPtrs, const int* consP, int NCELLS, int base); +void SPARSITY_PREPROC_SYST_CSR( + int* colVals, int* rowPtrs, const int* consP, int NCELLS, int base); +void SPARSITY_PREPROC_SYST_SIMPLIFIED_CSC( + int* rowVals, int* colPtrs, int* indx, const int* consP); +void SPARSITY_PREPROC_SYST_SIMPLIFIED_CSR( + int* colVals, int* rowPtr, const int* consP, int base); + +// A few mechanism parameters +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKINDX(int& mm, int& kk, int& ii, int& nfit) +{ + mm = 4; + kk = 12; + ii = 29; + nfit = -1; // Why do you need this anyway ? +} + +// inverse molecular weights +#ifdef AMREX_USE_GPU +AMREX_GPU_CONSTANT const amrex::Real global_imw[12] = { + 0.4960317460317460, // H2 + 0.0312519532470779, // O2 + 0.0625039064941559, // O + 0.0587993179279120, // OH + 0.0555092978073827, // H2O + 0.9920634920634921, // H + 0.0302975216627280, // HO2 + 0.0293996589639560, // H2O2 + 0.0357015351660121, // CO + 0.0227226249176305, // CO2 + 0.0344613688055690, // HCO + 0.0356964374955379, // N2 +}; +#endif +const amrex::Real h_global_imw[12] = { + 0.4960317460317460, // H2 + 0.0312519532470779, // O2 + 0.0625039064941559, // O + 0.0587993179279120, // OH + 0.0555092978073827, // H2O + 0.9920634920634921, // H + 0.0302975216627280, // HO2 + 0.0293996589639560, // H2O2 + 0.0357015351660121, // CO + 0.0227226249176305, // CO2 + 0.0344613688055690, // HCO + 0.0356964374955379, // N2 +}; + +// molecular weights +#ifdef AMREX_USE_GPU +AMREX_GPU_CONSTANT const amrex::Real global_mw[12] = { + 2.016000, // H2 + 31.998000, // O2 + 15.999000, // O + 17.007000, // OH + 18.015000, // H2O + 1.008000, // H + 33.006000, // HO2 + 34.014000, // H2O2 + 28.010000, // CO + 44.009000, // CO2 + 29.018000, // HCO + 28.014000, // N2 +}; +#endif +const amrex::Real h_global_mw[12] = { + 2.016000, // H2 + 31.998000, // O2 + 15.999000, // O + 17.007000, // OH + 18.015000, // H2O + 1.008000, // H + 33.006000, // HO2 + 34.014000, // H2O2 + 28.010000, // CO + 44.009000, // CO2 + 29.018000, // HCO + 28.014000, // N2 +}; + +// inverse molecular weights +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +get_imw(amrex::Real* imw_new) +{ + imw_new[0] = 0.4960317460317460; // H2 + imw_new[1] = 0.0312519532470779; // O2 + imw_new[2] = 0.0625039064941559; // O + imw_new[3] = 0.0587993179279120; // OH + imw_new[4] = 0.0555092978073827; // H2O + imw_new[5] = 0.9920634920634921; // H + imw_new[6] = 0.0302975216627280; // HO2 + imw_new[7] = 0.0293996589639560; // H2O2 + imw_new[8] = 0.0357015351660121; // CO + imw_new[9] = 0.0227226249176305; // CO2 + imw_new[10] = 0.0344613688055690; // HCO + imw_new[11] = 0.0356964374955379; // N2 +} + +// inverse molecular weight +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real +imw(const int n) +{ +#if AMREX_DEVICE_COMPILE + return global_imw[n]; +#else + return h_global_imw[n]; +#endif +} +// molecular weights +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +get_mw(amrex::Real* mw_new) +{ + mw_new[0] = 2.016000; // H2 + mw_new[1] = 31.998000; // O2 + mw_new[2] = 15.999000; // O + mw_new[3] = 17.007000; // OH + mw_new[4] = 18.015000; // H2O + mw_new[5] = 1.008000; // H + mw_new[6] = 33.006000; // HO2 + mw_new[7] = 34.014000; // H2O2 + mw_new[8] = 28.010000; // CO + mw_new[9] = 44.009000; // CO2 + mw_new[10] = 29.018000; // HCO + mw_new[11] = 28.014000; // N2 +} + +// molecular weight +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real +mw(const int n) +{ +#if AMREX_DEVICE_COMPILE + return global_mw[n]; +#else + return h_global_mw[n]; +#endif +} + +// Returns R, Rc, Patm +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKRP(amrex::Real& ru, amrex::Real& ruc, amrex::Real& pa) +{ + ru = 8.31446261815324e+07; + ruc = 1.98721558317399615845; + pa = 1.01325e+06; +} + +// compute Cv/R at the given temperature +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +cv_R(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + + // species with no change across T + // species 5: H + species[5] = +1.50000000e+00; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = +2.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - + 9.47543400e-11 * T3 + 4.13487200e-13 * T4; + // species 1: O2 + species[1] = +2.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + + 1.31387700e-09 * T3 - 8.76855400e-13 * T4; + // species 2: O + species[2] = +1.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - + 1.60284300e-09 * T3 + 3.89069600e-13 * T4; + // species 3: OH + species[3] = +3.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - + 5.79853643e-09 * T3 + 2.06237379e-12 * T4; + // species 4: H2O + species[4] = +2.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + + 6.96858100e-09 * T3 - 2.50658800e-12 * T4; + // species 6: HO2 + species[6] = +3.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - + 2.42763894e-08 * T3 + 9.29225124e-12 * T4; + // species 7: H2O2 + species[7] = +2.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - + 4.62580600e-09 * T3 + 2.47151500e-12 * T4; + // species 8: CO + species[8] = +2.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + + 5.58194400e-09 * T3 - 2.47495100e-12 * T4; + // species 9: CO2 + species[9] = +1.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + + 6.86668700e-09 * T3 - 2.11728000e-12 * T4; + // species 10: HCO + species[10] = +1.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + + 1.08982500e-08 * T3 - 4.57488500e-12 * T4; + // species 11: N2 + species[11] = +2.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + + 5.64151500e-09 * T3 - 2.44485500e-12 * T4; + } else { + // species 0: H2 + species[0] = +1.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - + 9.23157800e-12 * T3 + 1.58275200e-15 * T4; + // species 1: O2 + species[1] = +2.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + + 1.77528100e-11 * T3 - 1.13643500e-15 * T4; + // species 2: O + species[2] = +1.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + + 4.55106700e-12 * T3 - 4.36805200e-16 * T4; + // species 3: OH + species[3] = +1.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + + 3.05218674e-11 * T3 - 1.33195876e-15 * T4; + // species 4: H2O + species[4] = +1.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + + 1.20099600e-10 * T3 - 6.39161800e-15 * T4; + // species 6: HO2 + species[6] = +3.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + + 1.14246370e-10 * T3 - 1.07908535e-14 * T4; + // species 7: H2O2 + species[7] = +3.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + + 2.34890400e-10 * T3 - 1.43165400e-14 * T4; + // species 8: CO + species[8] = +2.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + + 1.01858100e-10 * T3 - 6.91095200e-15 * T4; + // species 9: CO2 + species[9] = +3.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + + 2.39399700e-10 * T3 - 1.66903300e-14 * T4; + // species 10: HCO + species[10] = +2.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + + 2.47057300e-10 * T3 - 1.71385100e-14 * T4; + // species 11: N2 + species[11] = +1.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + + 1.00970400e-10 * T3 - 6.75335100e-15 * T4; + } +} + +// compute Cp/R at the given temperature +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +cp_R(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + + // species with no change across T + // species 5: H + species[5] = +2.50000000e+00; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = +3.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - + 9.47543400e-11 * T3 + 4.13487200e-13 * T4; + // species 1: O2 + species[1] = +3.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + + 1.31387700e-09 * T3 - 8.76855400e-13 * T4; + // species 2: O + species[2] = +2.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - + 1.60284300e-09 * T3 + 3.89069600e-13 * T4; + // species 3: OH + species[3] = +4.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - + 5.79853643e-09 * T3 + 2.06237379e-12 * T4; + // species 4: H2O + species[4] = +3.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + + 6.96858100e-09 * T3 - 2.50658800e-12 * T4; + // species 6: HO2 + species[6] = +4.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - + 2.42763894e-08 * T3 + 9.29225124e-12 * T4; + // species 7: H2O2 + species[7] = +3.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - + 4.62580600e-09 * T3 + 2.47151500e-12 * T4; + // species 8: CO + species[8] = +3.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + + 5.58194400e-09 * T3 - 2.47495100e-12 * T4; + // species 9: CO2 + species[9] = +2.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + + 6.86668700e-09 * T3 - 2.11728000e-12 * T4; + // species 10: HCO + species[10] = +2.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + + 1.08982500e-08 * T3 - 4.57488500e-12 * T4; + // species 11: N2 + species[11] = +3.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + + 5.64151500e-09 * T3 - 2.44485500e-12 * T4; + } else { + // species 0: H2 + species[0] = +2.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - + 9.23157800e-12 * T3 + 1.58275200e-15 * T4; + // species 1: O2 + species[1] = +3.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + + 1.77528100e-11 * T3 - 1.13643500e-15 * T4; + // species 2: O + species[2] = +2.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + + 4.55106700e-12 * T3 - 4.36805200e-16 * T4; + // species 3: OH + species[3] = +2.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + + 3.05218674e-11 * T3 - 1.33195876e-15 * T4; + // species 4: H2O + species[4] = +2.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + + 1.20099600e-10 * T3 - 6.39161800e-15 * T4; + // species 6: HO2 + species[6] = +4.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + + 1.14246370e-10 * T3 - 1.07908535e-14 * T4; + // species 7: H2O2 + species[7] = +4.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + + 2.34890400e-10 * T3 - 1.43165400e-14 * T4; + // species 8: CO + species[8] = +3.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + + 1.01858100e-10 * T3 - 6.91095200e-15 * T4; + // species 9: CO2 + species[9] = +4.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + + 2.39399700e-10 * T3 - 1.66903300e-14 * T4; + // species 10: HCO + species[10] = +3.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + + 2.47057300e-10 * T3 - 1.71385100e-14 * T4; + // species 11: N2 + species[11] = +2.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + + 1.00970400e-10 * T3 - 6.75335100e-15 * T4; + } +} + +// compute the g/(RT) at the given temperature +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +gibbs(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real invT = 1.0 / T; + const amrex::Real logT = log(T); + + // species with no change across T + // species 5: H + species[5] = +2.547163000000000e+04 * invT + 2.960117600000000e+00 - + 2.500000000000000e+00 * logT; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = -1.012521000000000e+03 * invT + 6.592218000000000e+00 - + 3.298124000000000e+00 * logT - 4.124721000000000e-04 * T + + 1.357169166666667e-07 * T2 + 7.896194999999999e-12 * T3 - + 2.067436000000000e-14 * T4; + // species 1: O2 + species[1] = -1.005249000000000e+03 * invT - 2.821802000000000e+00 - + 3.212936000000000e+00 * logT - 5.637430000000000e-04 * T + + 9.593583333333333e-08 * T2 - 1.094897500000000e-10 * T3 + + 4.384277000000000e-14 * T4; + // species 2: O + species[2] = +2.914764000000000e+04 * invT - 1.756599999999997e-02 - + 2.946429000000000e+00 * logT + 8.190830000000000e-04 * T - + 4.035053333333333e-07 * T2 + 1.335702500000000e-10 * T3 - + 1.945348000000000e-14 * T4; + // species 3: OH + species[3] = +3.346309130000000e+03 * invT + 4.815738570000000e+00 - + 4.125305610000000e+00 * logT + 1.612724695000000e-03 * T - + 1.087941151666667e-06 * T2 + 4.832113691666666e-10 * T3 - + 1.031186895000000e-13 * T4; + // species 4: H2O + species[4] = -3.020811000000000e+04 * invT + 7.966090000000001e-01 - + 3.386842000000000e+00 * logT - 1.737491000000000e-03 * T + + 1.059116000000000e-06 * T2 - 5.807150833333333e-10 * T3 + + 1.253294000000000e-13 * T4; + // species 6: HO2 + species[6] = +2.948080400000000e+02 * invT + 5.851355599999999e-01 - + 4.301798010000000e+00 * logT + 2.374560255000000e-03 * T - + 3.526381516666666e-06 * T2 + 2.023032450000000e-09 * T3 - + 4.646125620000001e-13 * T4; + // species 7: H2O2 + species[7] = -1.766315000000000e+04 * invT - 3.396609000000000e+00 - + 3.388754000000000e+00 * logT - 3.284613000000000e-03 * T + + 2.475021666666666e-08 * T2 + 3.854838333333333e-10 * T3 - + 1.235757500000000e-13 * T4; + // species 8: CO + species[8] = -1.431054000000000e+04 * invT - 1.586445000000000e+00 - + 3.262452000000000e+00 * logT - 7.559705000000000e-04 * T + + 6.469591666666667e-07 * T2 - 4.651620000000000e-10 * T3 + + 1.237475500000000e-13 * T4; + // species 9: CO2 + species[9] = -4.837314000000000e+04 * invT - 7.912765000000000e+00 - + 2.275725000000000e+00 * logT - 4.961036000000000e-03 * T + + 1.734851666666667e-06 * T2 - 5.722239166666667e-10 * T3 + + 1.058640000000000e-13 * T4; + // species 10: HCO + species[10] = +4.159922000000000e+03 * invT - 6.085284000000000e+00 - + 2.898330000000000e+00 * logT - 3.099573500000000e-03 * T + + 1.603847333333333e-06 * T2 - 9.081875000000000e-10 * T3 + + 2.287442500000000e-13 * T4; + // species 11: N2 + species[11] = -1.020900000000000e+03 * invT - 6.516950000000001e-01 - + 3.298677000000000e+00 * logT - 7.041200000000000e-04 * T + + 6.605369999999999e-07 * T2 - 4.701262500000001e-10 * T3 + + 1.222427500000000e-13 * T4; + } else { + // species 0: H2 + species[0] = -8.350340000000000e+02 * invT + 4.346533000000000e+00 - + 2.991423000000000e+00 * logT - 3.500322000000000e-04 * T + + 9.389715000000000e-09 * T2 + 7.692981666666667e-13 * T3 - + 7.913760000000000e-17 * T4; + // species 1: O2 + species[1] = -1.233930000000000e+03 * invT + 5.084119999999999e-01 - + 3.697578000000000e+00 * logT - 3.067598500000000e-04 * T + + 2.098070000000000e-08 * T2 - 1.479400833333333e-12 * T3 + + 5.682175000000001e-17 * T4; + // species 2: O + species[2] = +2.923080000000000e+04 * invT - 2.378248000000000e+00 - + 2.542060000000000e+00 * logT + 1.377531000000000e-05 * T + + 5.171338333333333e-10 * T2 - 3.792555833333334e-13 * T3 + + 2.184026000000000e-17 * T4; + // species 3: OH + species[3] = +3.683628750000000e+03 * invT - 2.836911870000000e+00 - + 2.864728860000000e+00 * logT - 5.282522400000000e-04 * T + + 4.318045966666667e-08 * T2 - 2.543488950000000e-12 * T3 + + 6.659793800000000e-17 * T4; + // species 4: H2O + species[4] = -2.989921000000000e+04 * invT - 4.190671000000000e+00 - + 2.672146000000000e+00 * logT - 1.528146500000000e-03 * T + + 1.455043333333333e-07 * T2 - 1.000830000000000e-11 * T3 + + 3.195809000000000e-16 * T4; + // species 6: HO2 + species[6] = +1.118567130000000e+02 * invT + 2.321087500000001e-01 - + 4.017210900000000e+00 * logT - 1.119910065000000e-03 * T + + 1.056096916666667e-07 * T2 - 9.520530833333334e-12 * T3 + + 5.395426750000000e-16 * T4; + // species 7: H2O2 + species[7] = -1.800696000000000e+04 * invT + 4.072030000000000e+00 - + 4.573167000000000e+00 * logT - 2.168068000000000e-03 * T + + 2.457815000000000e-07 * T2 - 1.957420000000000e-11 * T3 + + 7.158270000000000e-16 * T4; + // species 8: CO + species[8] = -1.426835000000000e+04 * invT - 3.083140000000000e+00 - + 3.025078000000000e+00 * logT - 7.213445000000000e-04 * T + + 9.384713333333334e-08 * T2 - 8.488174999999999e-12 * T3 + + 3.455476000000000e-16 * T4; + // species 9: CO2 + species[9] = -4.896696000000000e+04 * invT + 5.409018900000000e+00 - + 4.453623000000000e+00 * logT - 1.570084500000000e-03 * T + + 2.130685000000000e-07 * T2 - 1.994997500000000e-11 * T3 + + 8.345165000000000e-16 * T4; + // species 10: HCO + species[10] = +3.916324000000000e+03 * invT - 1.995028000000000e+00 - + 3.557271000000000e+00 * logT - 1.672786500000000e-03 * T + + 2.225010000000000e-07 * T2 - 2.058810833333333e-11 * T3 + + 8.569255000000000e-16 * T4; + // species 11: N2 + species[11] = -9.227977000000000e+02 * invT - 3.053888000000000e+00 - + 2.926640000000000e+00 * logT - 7.439885000000000e-04 * T + + 9.474601666666666e-08 * T2 - 8.414199999999999e-12 * T3 + + 3.376675500000000e-16 * T4; + } +} + +// compute the a/(RT) at the given temperature +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +helmholtz(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real invT = 1.0 / T; + const amrex::Real logT = log(T); + + // species with no change across T + // species 5: H + species[5] = +2.54716300e+04 * invT + 1.96011760e+00 - 2.50000000e+00 * logT; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = -1.01252100e+03 * invT + 5.59221800e+00 - + 3.29812400e+00 * logT - 4.12472100e-04 * T + + 1.35716917e-07 * T2 + 7.89619500e-12 * T3 - + 2.06743600e-14 * T4; + // species 1: O2 + species[1] = -1.00524900e+03 * invT - 3.82180200e+00 - + 3.21293600e+00 * logT - 5.63743000e-04 * T + + 9.59358333e-08 * T2 - 1.09489750e-10 * T3 + + 4.38427700e-14 * T4; + // species 2: O + species[2] = +2.91476400e+04 * invT - 1.01756600e+00 - + 2.94642900e+00 * logT + 8.19083000e-04 * T - + 4.03505333e-07 * T2 + 1.33570250e-10 * T3 - + 1.94534800e-14 * T4; + // species 3: OH + species[3] = +3.34630913e+03 * invT + 3.81573857e+00 - + 4.12530561e+00 * logT + 1.61272470e-03 * T - + 1.08794115e-06 * T2 + 4.83211369e-10 * T3 - + 1.03118689e-13 * T4; + // species 4: H2O + species[4] = -3.02081100e+04 * invT - 2.03391000e-01 - + 3.38684200e+00 * logT - 1.73749100e-03 * T + + 1.05911600e-06 * T2 - 5.80715083e-10 * T3 + + 1.25329400e-13 * T4; + // species 6: HO2 + species[6] = +2.94808040e+02 * invT - 4.14864440e-01 - + 4.30179801e+00 * logT + 2.37456025e-03 * T - + 3.52638152e-06 * T2 + 2.02303245e-09 * T3 - + 4.64612562e-13 * T4; + // species 7: H2O2 + species[7] = -1.76631500e+04 * invT - 4.39660900e+00 - + 3.38875400e+00 * logT - 3.28461300e-03 * T + + 2.47502167e-08 * T2 + 3.85483833e-10 * T3 - + 1.23575750e-13 * T4; + // species 8: CO + species[8] = -1.43105400e+04 * invT - 2.58644500e+00 - + 3.26245200e+00 * logT - 7.55970500e-04 * T + + 6.46959167e-07 * T2 - 4.65162000e-10 * T3 + + 1.23747550e-13 * T4; + // species 9: CO2 + species[9] = -4.83731400e+04 * invT - 8.91276500e+00 - + 2.27572500e+00 * logT - 4.96103600e-03 * T + + 1.73485167e-06 * T2 - 5.72223917e-10 * T3 + + 1.05864000e-13 * T4; + // species 10: HCO + species[10] = +4.15992200e+03 * invT - 7.08528400e+00 - + 2.89833000e+00 * logT - 3.09957350e-03 * T + + 1.60384733e-06 * T2 - 9.08187500e-10 * T3 + + 2.28744250e-13 * T4; + // species 11: N2 + species[11] = -1.02090000e+03 * invT - 1.65169500e+00 - + 3.29867700e+00 * logT - 7.04120000e-04 * T + + 6.60537000e-07 * T2 - 4.70126250e-10 * T3 + + 1.22242750e-13 * T4; + } else { + // species 0: H2 + species[0] = -8.35034000e+02 * invT + 3.34653300e+00 - + 2.99142300e+00 * logT - 3.50032200e-04 * T + + 9.38971500e-09 * T2 + 7.69298167e-13 * T3 - + 7.91376000e-17 * T4; + // species 1: O2 + species[1] = -1.23393000e+03 * invT - 4.91588000e-01 - + 3.69757800e+00 * logT - 3.06759850e-04 * T + + 2.09807000e-08 * T2 - 1.47940083e-12 * T3 + + 5.68217500e-17 * T4; + // species 2: O + species[2] = +2.92308000e+04 * invT - 3.37824800e+00 - + 2.54206000e+00 * logT + 1.37753100e-05 * T + + 5.17133833e-10 * T2 - 3.79255583e-13 * T3 + + 2.18402600e-17 * T4; + // species 3: OH + species[3] = +3.68362875e+03 * invT - 3.83691187e+00 - + 2.86472886e+00 * logT - 5.28252240e-04 * T + + 4.31804597e-08 * T2 - 2.54348895e-12 * T3 + + 6.65979380e-17 * T4; + // species 4: H2O + species[4] = -2.98992100e+04 * invT - 5.19067100e+00 - + 2.67214600e+00 * logT - 1.52814650e-03 * T + + 1.45504333e-07 * T2 - 1.00083000e-11 * T3 + + 3.19580900e-16 * T4; + // species 6: HO2 + species[6] = +1.11856713e+02 * invT - 7.67891250e-01 - + 4.01721090e+00 * logT - 1.11991006e-03 * T + + 1.05609692e-07 * T2 - 9.52053083e-12 * T3 + + 5.39542675e-16 * T4; + // species 7: H2O2 + species[7] = -1.80069600e+04 * invT + 3.07203000e+00 - + 4.57316700e+00 * logT - 2.16806800e-03 * T + + 2.45781500e-07 * T2 - 1.95742000e-11 * T3 + + 7.15827000e-16 * T4; + // species 8: CO + species[8] = -1.42683500e+04 * invT - 4.08314000e+00 - + 3.02507800e+00 * logT - 7.21344500e-04 * T + + 9.38471333e-08 * T2 - 8.48817500e-12 * T3 + + 3.45547600e-16 * T4; + // species 9: CO2 + species[9] = -4.89669600e+04 * invT + 4.40901890e+00 - + 4.45362300e+00 * logT - 1.57008450e-03 * T + + 2.13068500e-07 * T2 - 1.99499750e-11 * T3 + + 8.34516500e-16 * T4; + // species 10: HCO + species[10] = +3.91632400e+03 * invT - 2.99502800e+00 - + 3.55727100e+00 * logT - 1.67278650e-03 * T + + 2.22501000e-07 * T2 - 2.05881083e-11 * T3 + + 8.56925500e-16 * T4; + // species 11: N2 + species[11] = -9.22797700e+02 * invT - 4.05388800e+00 - + 2.92664000e+00 * logT - 7.43988500e-04 * T + + 9.47460167e-08 * T2 - 8.41420000e-12 * T3 + + 3.37667550e-16 * T4; + } +} + +// compute the e/(RT) at the given temperature +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +speciesInternalEnergy(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real invT = 1.0 / T; + + // species with no change across T + // species 5: H + species[5] = +1.50000000e+00 + 2.54716300e+04 * invT; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = +2.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - + 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - + 1.01252100e+03 * invT; + // species 1: O2 + species[1] = +2.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + + 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - + 1.00524900e+03 * invT; + // species 2: O + species[2] = +1.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - + 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + + 2.91476400e+04 * invT; + // species 3: OH + species[3] = +3.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - + 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + + 3.34630913e+03 * invT; + // species 4: H2O + species[4] = +2.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + + 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - + 3.02081100e+04 * invT; + // species 6: HO2 + species[6] = +3.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - + 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + + 2.94808040e+02 * invT; + // species 7: H2O2 + species[7] = +2.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - + 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - + 1.76631500e+04 * invT; + // species 8: CO + species[8] = +2.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + + 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - + 1.43105400e+04 * invT; + // species 9: CO2 + species[9] = +1.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + + 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - + 4.83731400e+04 * invT; + // species 10: HCO + species[10] = +1.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + + 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + + 4.15992200e+03 * invT; + // species 11: N2 + species[11] = +2.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + + 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - + 1.02090000e+03 * invT; + } else { + // species 0: H2 + species[0] = +1.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - + 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - + 8.35034000e+02 * invT; + // species 1: O2 + species[1] = +2.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + + 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - + 1.23393000e+03 * invT; + // species 2: O + species[2] = +1.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + + 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + + 2.92308000e+04 * invT; + // species 3: OH + species[3] = +1.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + + 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + + 3.68362875e+03 * invT; + // species 4: H2O + species[4] = +1.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + + 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - + 2.98992100e+04 * invT; + // species 6: HO2 + species[6] = +3.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + + 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + + 1.11856713e+02 * invT; + // species 7: H2O2 + species[7] = +3.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + + 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - + 1.80069600e+04 * invT; + // species 8: CO + species[8] = +2.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + + 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - + 1.42683500e+04 * invT; + // species 9: CO2 + species[9] = +3.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + + 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - + 4.89669600e+04 * invT; + // species 10: HCO + species[10] = +2.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + + 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + + 3.91632400e+03 * invT; + // species 11: N2 + species[11] = +1.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + + 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - + 9.22797700e+02 * invT; + } +} + +// compute the h/(RT) at the given temperature (Eq 20) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +speciesEnthalpy(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real invT = 1.0 / T; + + // species with no change across T + // species 5: H + species[5] = +2.50000000e+00 + 2.54716300e+04 * invT; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = +3.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - + 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - + 1.01252100e+03 * invT; + // species 1: O2 + species[1] = +3.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + + 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - + 1.00524900e+03 * invT; + // species 2: O + species[2] = +2.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - + 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + + 2.91476400e+04 * invT; + // species 3: OH + species[3] = +4.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - + 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + + 3.34630913e+03 * invT; + // species 4: H2O + species[4] = +3.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + + 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - + 3.02081100e+04 * invT; + // species 6: HO2 + species[6] = +4.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - + 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + + 2.94808040e+02 * invT; + // species 7: H2O2 + species[7] = +3.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - + 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - + 1.76631500e+04 * invT; + // species 8: CO + species[8] = +3.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + + 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - + 1.43105400e+04 * invT; + // species 9: CO2 + species[9] = +2.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + + 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - + 4.83731400e+04 * invT; + // species 10: HCO + species[10] = +2.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + + 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + + 4.15992200e+03 * invT; + // species 11: N2 + species[11] = +3.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + + 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - + 1.02090000e+03 * invT; + } else { + // species 0: H2 + species[0] = +2.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - + 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - + 8.35034000e+02 * invT; + // species 1: O2 + species[1] = +3.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + + 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - + 1.23393000e+03 * invT; + // species 2: O + species[2] = +2.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + + 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + + 2.92308000e+04 * invT; + // species 3: OH + species[3] = +2.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + + 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + + 3.68362875e+03 * invT; + // species 4: H2O + species[4] = +2.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + + 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - + 2.98992100e+04 * invT; + // species 6: HO2 + species[6] = +4.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + + 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + + 1.11856713e+02 * invT; + // species 7: H2O2 + species[7] = +4.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + + 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - + 1.80069600e+04 * invT; + // species 8: CO + species[8] = +3.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + + 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - + 1.42683500e+04 * invT; + // species 9: CO2 + species[9] = +4.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + + 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - + 4.89669600e+04 * invT; + // species 10: HCO + species[10] = +3.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + + 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + + 3.91632400e+03 * invT; + // species 11: N2 + species[11] = +2.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + + 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - + 9.22797700e+02 * invT; + } +} + +// compute the S/R at the given temperature (Eq 21) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +speciesEntropy(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real logT = log(T); + + // species with no change across T + // species 5: H + species[5] = +2.50000000e+00 * logT - 4.60117600e-01; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = +3.29812400e+00 * logT + 8.24944200e-04 * T - + 4.07150750e-07 * T2 - 3.15847800e-11 * T3 + + 1.03371800e-13 * T4 - 3.29409400e+00; + // species 1: O2 + species[1] = +3.21293600e+00 * logT + 1.12748600e-03 * T - + 2.87807500e-07 * T2 + 4.37959000e-10 * T3 - + 2.19213850e-13 * T4 + 6.03473800e+00; + // species 2: O + species[2] = +2.94642900e+00 * logT - 1.63816600e-03 * T + + 1.21051600e-06 * T2 - 5.34281000e-10 * T3 + + 9.72674000e-14 * T4 + 2.96399500e+00; + // species 3: OH + species[3] = +4.12530561e+00 * logT - 3.22544939e-03 * T + + 3.26382346e-06 * T2 - 1.93284548e-09 * T3 + + 5.15593447e-13 * T4 - 6.90432960e-01; + // species 4: H2O + species[4] = +3.38684200e+00 * logT + 3.47498200e-03 * T - + 3.17734800e-06 * T2 + 2.32286033e-09 * T3 - + 6.26647000e-13 * T4 + 2.59023300e+00; + // species 6: HO2 + species[6] = +4.30179801e+00 * logT - 4.74912051e-03 * T + + 1.05791445e-05 * T2 - 8.09212980e-09 * T3 + + 2.32306281e-12 * T4 + 3.71666245e+00; + // species 7: H2O2 + species[7] = +3.38875400e+00 * logT + 6.56922600e-03 * T - + 7.42506500e-08 * T2 - 1.54193533e-09 * T3 + + 6.17878750e-13 * T4 + 6.78536300e+00; + // species 8: CO + species[8] = +3.26245200e+00 * logT + 1.51194100e-03 * T - + 1.94087750e-06 * T2 + 1.86064800e-09 * T3 - + 6.18737750e-13 * T4 + 4.84889700e+00; + // species 9: CO2 + species[9] = +2.27572500e+00 * logT + 9.92207200e-03 * T - + 5.20455500e-06 * T2 + 2.28889567e-09 * T3 - + 5.29320000e-13 * T4 + 1.01884900e+01; + // species 10: HCO + species[10] = +2.89833000e+00 * logT + 6.19914700e-03 * T - + 4.81154200e-06 * T2 + 3.63275000e-09 * T3 - + 1.14372125e-12 * T4 + 8.98361400e+00; + // species 11: N2 + species[11] = +3.29867700e+00 * logT + 1.40824000e-03 * T - + 1.98161100e-06 * T2 + 1.88050500e-09 * T3 - + 6.11213750e-13 * T4 + 3.95037200e+00; + } else { + // species 0: H2 + species[0] = +2.99142300e+00 * logT + 7.00064400e-04 * T - + 2.81691450e-08 * T2 - 3.07719267e-12 * T3 + + 3.95688000e-16 * T4 - 1.35511000e+00; + // species 1: O2 + species[1] = +3.69757800e+00 * logT + 6.13519700e-04 * T - + 6.29421000e-08 * T2 + 5.91760333e-12 * T3 - + 2.84108750e-16 * T4 + 3.18916600e+00; + // species 2: O + species[2] = +2.54206000e+00 * logT - 2.75506200e-05 * T - + 1.55140150e-09 * T2 + 1.51702233e-12 * T3 - + 1.09201300e-16 * T4 + 4.92030800e+00; + // species 3: OH + species[3] = +2.86472886e+00 * logT + 1.05650448e-03 * T - + 1.29541379e-07 * T2 + 1.01739558e-11 * T3 - + 3.32989690e-16 * T4 + 5.70164073e+00; + // species 4: H2O + species[4] = +2.67214600e+00 * logT + 3.05629300e-03 * T - + 4.36513000e-07 * T2 + 4.00332000e-11 * T3 - + 1.59790450e-15 * T4 + 6.86281700e+00; + // species 6: HO2 + species[6] = +4.01721090e+00 * logT + 2.23982013e-03 * T - + 3.16829075e-07 * T2 + 3.80821233e-11 * T3 - + 2.69771337e-15 * T4 + 3.78510215e+00; + // species 7: H2O2 + species[7] = +4.57316700e+00 * logT + 4.33613600e-03 * T - + 7.37344500e-07 * T2 + 7.82968000e-11 * T3 - + 3.57913500e-15 * T4 + 5.01137000e-01; + // species 8: CO + species[8] = +3.02507800e+00 * logT + 1.44268900e-03 * T - + 2.81541400e-07 * T2 + 3.39527000e-11 * T3 - + 1.72773800e-15 * T4 + 6.10821800e+00; + // species 9: CO2 + species[9] = +4.45362300e+00 * logT + 3.14016900e-03 * T - + 6.39205500e-07 * T2 + 7.97999000e-11 * T3 - + 4.17258250e-15 * T4 - 9.55395900e-01; + // species 10: HCO + species[10] = +3.55727100e+00 * logT + 3.34557300e-03 * T - + 6.67503000e-07 * T2 + 8.23524333e-11 * T3 - + 4.28462750e-15 * T4 + 5.55229900e+00; + // species 11: N2 + species[11] = +2.92664000e+00 * logT + 1.48797700e-03 * T - + 2.84238050e-07 * T2 + 3.36568000e-11 * T3 - + 1.68833775e-15 * T4 + 5.98052800e+00; + } +} + +// compute d(Cp/R)/dT and d(Cv/R)/dT at the given temperature +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +dcvpRdT(amrex::Real* species, const amrex::Real T) +{ + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + + // species with no change across T + // species 5: H + species[5] = 0.0; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + species[0] = +8.24944200e-04 - 1.62860300e-06 * T - 2.84263020e-10 * T2 + + 1.65394880e-12 * T3; + // species 1: O2 + species[1] = +1.12748600e-03 - 1.15123000e-06 * T + 3.94163100e-09 * T2 - + 3.50742160e-12 * T3; + // species 2: O + species[2] = -1.63816600e-03 + 4.84206400e-06 * T - 4.80852900e-09 * T2 + + 1.55627840e-12 * T3; + // species 3: OH + species[3] = -3.22544939e-03 + 1.30552938e-05 * T - 1.73956093e-08 * T2 + + 8.24949516e-12 * T3; + // species 4: H2O + species[4] = +3.47498200e-03 - 1.27093920e-05 * T + 2.09057430e-08 * T2 - + 1.00263520e-11 * T3; + // species 6: HO2 + species[6] = -4.74912051e-03 + 4.23165782e-05 * T - 7.28291682e-08 * T2 + + 3.71690050e-11 * T3; + // species 7: H2O2 + species[7] = +6.56922600e-03 - 2.97002600e-07 * T - 1.38774180e-08 * T2 + + 9.88606000e-12 * T3; + // species 8: CO + species[8] = +1.51194100e-03 - 7.76351000e-06 * T + 1.67458320e-08 * T2 - + 9.89980400e-12 * T3; + // species 9: CO2 + species[9] = +9.92207200e-03 - 2.08182200e-05 * T + 2.06000610e-08 * T2 - + 8.46912000e-12 * T3; + // species 10: HCO + species[10] = +6.19914700e-03 - 1.92461680e-05 * T + 3.26947500e-08 * T2 - + 1.82995400e-11 * T3; + // species 11: N2 + species[11] = +1.40824000e-03 - 7.92644400e-06 * T + 1.69245450e-08 * T2 - + 9.77942000e-12 * T3; + } else { + // species 0: H2 + species[0] = +7.00064400e-04 - 1.12676580e-07 * T - 2.76947340e-11 * T2 + + 6.33100800e-15 * T3; + // species 1: O2 + species[1] = +6.13519700e-04 - 2.51768400e-07 * T + 5.32584300e-11 * T2 - + 4.54574000e-15 * T3; + // species 2: O + species[2] = -2.75506200e-05 - 6.20560600e-09 * T + 1.36532010e-11 * T2 - + 1.74722080e-15 * T3; + // species 3: OH + species[3] = +1.05650448e-03 - 5.18165516e-07 * T + 9.15656022e-11 * T2 - + 5.32783504e-15 * T3; + // species 4: H2O + species[4] = +3.05629300e-03 - 1.74605200e-06 * T + 3.60298800e-10 * T2 - + 2.55664720e-14 * T3; + // species 6: HO2 + species[6] = +2.23982013e-03 - 1.26731630e-06 * T + 3.42739110e-10 * T2 - + 4.31634140e-14 * T3; + // species 7: H2O2 + species[7] = +4.33613600e-03 - 2.94937800e-06 * T + 7.04671200e-10 * T2 - + 5.72661600e-14 * T3; + // species 8: CO + species[8] = +1.44268900e-03 - 1.12616560e-06 * T + 3.05574300e-10 * T2 - + 2.76438080e-14 * T3; + // species 9: CO2 + species[9] = +3.14016900e-03 - 2.55682200e-06 * T + 7.18199100e-10 * T2 - + 6.67613200e-14 * T3; + // species 10: HCO + species[10] = +3.34557300e-03 - 2.67001200e-06 * T + 7.41171900e-10 * T2 - + 6.85540400e-14 * T3; + // species 11: N2 + species[11] = +1.48797700e-03 - 1.13695220e-06 * T + 3.02911200e-10 * T2 - + 2.70134040e-14 * T3; + } +} + +// Returns the mean specific heat at CP (Eq. 33) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCPBL(const amrex::Real T, const amrex::Real x[], amrex::Real& cpbl) +{ + amrex::Real result = 0; + amrex::Real cpor[12]; // temporary storage + cp_R(cpor, T); + + // perform dot product + for (int id = 0; id < 12; ++id) { + result += x[id] * cpor[id]; + } + + cpbl = result * 8.31446261815324e+07; +} + +// Returns the mean specific heat at CP (Eq. 34) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCPBS(const amrex::Real T, const amrex::Real y[], amrex::Real& cpbs) +{ + amrex::Real result = 0.0; + + // compute Cp/R at the given temperature + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + + // species with no change across T + // species 5: H + result += y[5] * (+2.50000000e+00) * 0.9920634920634921; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + result += y[0] * + (+3.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - + 9.47543400e-11 * T3 + 4.13487200e-13 * T4) * + 0.4960317460317460; + // species 1: O2 + result += y[1] * + (+3.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + + 1.31387700e-09 * T3 - 8.76855400e-13 * T4) * + 0.0312519532470779; + // species 2: O + result += y[2] * + (+2.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - + 1.60284300e-09 * T3 + 3.89069600e-13 * T4) * + 0.0625039064941559; + // species 3: OH + result += y[3] * + (+4.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - + 5.79853643e-09 * T3 + 2.06237379e-12 * T4) * + 0.0587993179279120; + // species 4: H2O + result += y[4] * + (+3.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + + 6.96858100e-09 * T3 - 2.50658800e-12 * T4) * + 0.0555092978073827; + // species 6: HO2 + result += y[6] * + (+4.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - + 2.42763894e-08 * T3 + 9.29225124e-12 * T4) * + 0.0302975216627280; + // species 7: H2O2 + result += y[7] * + (+3.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - + 4.62580600e-09 * T3 + 2.47151500e-12 * T4) * + 0.0293996589639560; + // species 8: CO + result += y[8] * + (+3.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + + 5.58194400e-09 * T3 - 2.47495100e-12 * T4) * + 0.0357015351660121; + // species 9: CO2 + result += y[9] * + (+2.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + + 6.86668700e-09 * T3 - 2.11728000e-12 * T4) * + 0.0227226249176305; + // species 10: HCO + result += y[10] * + (+2.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + + 1.08982500e-08 * T3 - 4.57488500e-12 * T4) * + 0.0344613688055690; + // species 11: N2 + result += y[11] * + (+3.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + + 5.64151500e-09 * T3 - 2.44485500e-12 * T4) * + 0.0356964374955379; + } else { + // species 0: H2 + result += y[0] * + (+2.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - + 9.23157800e-12 * T3 + 1.58275200e-15 * T4) * + 0.4960317460317460; + // species 1: O2 + result += y[1] * + (+3.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + + 1.77528100e-11 * T3 - 1.13643500e-15 * T4) * + 0.0312519532470779; + // species 2: O + result += y[2] * + (+2.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + + 4.55106700e-12 * T3 - 4.36805200e-16 * T4) * + 0.0625039064941559; + // species 3: OH + result += y[3] * + (+2.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + + 3.05218674e-11 * T3 - 1.33195876e-15 * T4) * + 0.0587993179279120; + // species 4: H2O + result += y[4] * + (+2.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + + 1.20099600e-10 * T3 - 6.39161800e-15 * T4) * + 0.0555092978073827; + // species 6: HO2 + result += y[6] * + (+4.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + + 1.14246370e-10 * T3 - 1.07908535e-14 * T4) * + 0.0302975216627280; + // species 7: H2O2 + result += y[7] * + (+4.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + + 2.34890400e-10 * T3 - 1.43165400e-14 * T4) * + 0.0293996589639560; + // species 8: CO + result += y[8] * + (+3.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + + 1.01858100e-10 * T3 - 6.91095200e-15 * T4) * + 0.0357015351660121; + // species 9: CO2 + result += y[9] * + (+4.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + + 2.39399700e-10 * T3 - 1.66903300e-14 * T4) * + 0.0227226249176305; + // species 10: HCO + result += y[10] * + (+3.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + + 2.47057300e-10 * T3 - 1.71385100e-14 * T4) * + 0.0344613688055690; + // species 11: N2 + result += y[11] * + (+2.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + + 1.00970400e-10 * T3 - 6.75335100e-15 * T4) * + 0.0356964374955379; + } + + cpbs = result * 8.31446261815324e+07; +} + +// Returns the mean specific heat at CV (Eq. 35) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCVBL(const amrex::Real T, const amrex::Real x[], amrex::Real& cvbl) +{ + amrex::Real result = 0; + amrex::Real cvor[12]; // temporary storage + cv_R(cvor, T); + + // perform dot product + for (int id = 0; id < 12; ++id) { + result += x[id] * cvor[id]; + } + + cvbl = result * 8.31446261815324e+07; +} + +// Returns the mean specific heat at CV (Eq. 36) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCVBS(const amrex::Real T, const amrex::Real y[], amrex::Real& cvbs) +{ + amrex::Real result = 0.0; + // compute Cv/R at the given temperature + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + + // species with no change across T + // species 5: H + result += y[5] * (+1.50000000e+00) * 0.9920634920634921; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + result += y[0] * + (+2.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - + 9.47543400e-11 * T3 + 4.13487200e-13 * T4) * + 0.4960317460317460; + // species 1: O2 + result += y[1] * + (+2.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + + 1.31387700e-09 * T3 - 8.76855400e-13 * T4) * + 0.0312519532470779; + // species 2: O + result += y[2] * + (+1.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - + 1.60284300e-09 * T3 + 3.89069600e-13 * T4) * + 0.0625039064941559; + // species 3: OH + result += y[3] * + (+3.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - + 5.79853643e-09 * T3 + 2.06237379e-12 * T4) * + 0.0587993179279120; + // species 4: H2O + result += y[4] * + (+2.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + + 6.96858100e-09 * T3 - 2.50658800e-12 * T4) * + 0.0555092978073827; + // species 6: HO2 + result += y[6] * + (+3.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - + 2.42763894e-08 * T3 + 9.29225124e-12 * T4) * + 0.0302975216627280; + // species 7: H2O2 + result += y[7] * + (+2.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - + 4.62580600e-09 * T3 + 2.47151500e-12 * T4) * + 0.0293996589639560; + // species 8: CO + result += y[8] * + (+2.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + + 5.58194400e-09 * T3 - 2.47495100e-12 * T4) * + 0.0357015351660121; + // species 9: CO2 + result += y[9] * + (+1.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + + 6.86668700e-09 * T3 - 2.11728000e-12 * T4) * + 0.0227226249176305; + // species 10: HCO + result += y[10] * + (+1.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + + 1.08982500e-08 * T3 - 4.57488500e-12 * T4) * + 0.0344613688055690; + // species 11: N2 + result += y[11] * + (+2.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + + 5.64151500e-09 * T3 - 2.44485500e-12 * T4) * + 0.0356964374955379; + } else { + // species 0: H2 + result += y[0] * + (+1.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - + 9.23157800e-12 * T3 + 1.58275200e-15 * T4) * + 0.4960317460317460; + // species 1: O2 + result += y[1] * + (+2.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + + 1.77528100e-11 * T3 - 1.13643500e-15 * T4) * + 0.0312519532470779; + // species 2: O + result += y[2] * + (+1.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + + 4.55106700e-12 * T3 - 4.36805200e-16 * T4) * + 0.0625039064941559; + // species 3: OH + result += y[3] * + (+1.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + + 3.05218674e-11 * T3 - 1.33195876e-15 * T4) * + 0.0587993179279120; + // species 4: H2O + result += y[4] * + (+1.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + + 1.20099600e-10 * T3 - 6.39161800e-15 * T4) * + 0.0555092978073827; + // species 6: HO2 + result += y[6] * + (+3.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + + 1.14246370e-10 * T3 - 1.07908535e-14 * T4) * + 0.0302975216627280; + // species 7: H2O2 + result += y[7] * + (+3.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + + 2.34890400e-10 * T3 - 1.43165400e-14 * T4) * + 0.0293996589639560; + // species 8: CO + result += y[8] * + (+2.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + + 1.01858100e-10 * T3 - 6.91095200e-15 * T4) * + 0.0357015351660121; + // species 9: CO2 + result += y[9] * + (+3.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + + 2.39399700e-10 * T3 - 1.66903300e-14 * T4) * + 0.0227226249176305; + // species 10: HCO + result += y[10] * + (+2.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + + 2.47057300e-10 * T3 - 1.71385100e-14 * T4) * + 0.0344613688055690; + // species 11: N2 + result += y[11] * + (+1.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + + 1.00970400e-10 * T3 - 6.75335100e-15 * T4) * + 0.0356964374955379; + } + + cvbs = result * 8.31446261815324e+07; +} + +// Returns the mean enthalpy of the mixture in molar units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKHBML(const amrex::Real T, const amrex::Real x[], amrex::Real& hbml) +{ + amrex::Real result = 0; + amrex::Real hml[12]; // temporary storage + amrex::Real RT = 8.31446261815324e+07 * T; // R*T + speciesEnthalpy(hml, T); + + // perform dot product + for (int id = 0; id < 12; ++id) { + result += x[id] * hml[id]; + } + + hbml = result * RT; +} + +// Returns mean enthalpy of mixture in mass units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKHBMS(const amrex::Real T, const amrex::Real y[], amrex::Real& hbms) +{ + amrex::Real result = 0.0; + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real invT = 1.0 / T; + + // species with no change across T + // species 5: H + result += + y[5] * (+2.50000000e+00 + 2.54716300e+04 * invT) * 0.9920634920634921; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + result += + y[0] * + (+3.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - + 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - 1.01252100e+03 * invT) * + 0.4960317460317460; + // species 1: O2 + result += + y[1] * + (+3.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + + 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - 1.00524900e+03 * invT) * + 0.0312519532470779; + // species 2: O + result += + y[2] * + (+2.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - + 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + 2.91476400e+04 * invT) * + 0.0625039064941559; + // species 3: OH + result += + y[3] * + (+4.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - + 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + 3.34630913e+03 * invT) * + 0.0587993179279120; + // species 4: H2O + result += + y[4] * + (+3.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + + 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - 3.02081100e+04 * invT) * + 0.0555092978073827; + // species 6: HO2 + result += + y[6] * + (+4.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - + 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + 2.94808040e+02 * invT) * + 0.0302975216627280; + // species 7: H2O2 + result += + y[7] * + (+3.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - + 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - 1.76631500e+04 * invT) * + 0.0293996589639560; + // species 8: CO + result += + y[8] * + (+3.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + + 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - 1.43105400e+04 * invT) * + 0.0357015351660121; + // species 9: CO2 + result += + y[9] * + (+2.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + + 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - 4.83731400e+04 * invT) * + 0.0227226249176305; + // species 10: HCO + result += + y[10] * + (+2.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + + 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + 4.15992200e+03 * invT) * + 0.0344613688055690; + // species 11: N2 + result += + y[11] * + (+3.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + + 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - 1.02090000e+03 * invT) * + 0.0356964374955379; + } else { + // species 0: H2 + result += + y[0] * + (+2.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - + 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - 8.35034000e+02 * invT) * + 0.4960317460317460; + // species 1: O2 + result += + y[1] * + (+3.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + + 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - 1.23393000e+03 * invT) * + 0.0312519532470779; + // species 2: O + result += + y[2] * + (+2.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + + 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + 2.92308000e+04 * invT) * + 0.0625039064941559; + // species 3: OH + result += + y[3] * + (+2.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + + 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + 3.68362875e+03 * invT) * + 0.0587993179279120; + // species 4: H2O + result += + y[4] * + (+2.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + + 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - 2.98992100e+04 * invT) * + 0.0555092978073827; + // species 6: HO2 + result += + y[6] * + (+4.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + + 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + 1.11856713e+02 * invT) * + 0.0302975216627280; + // species 7: H2O2 + result += + y[7] * + (+4.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + + 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - 1.80069600e+04 * invT) * + 0.0293996589639560; + // species 8: CO + result += + y[8] * + (+3.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + + 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - 1.42683500e+04 * invT) * + 0.0357015351660121; + // species 9: CO2 + result += + y[9] * + (+4.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + + 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - 4.89669600e+04 * invT) * + 0.0227226249176305; + // species 10: HCO + result += + y[10] * + (+3.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + + 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + 3.91632400e+03 * invT) * + 0.0344613688055690; + // species 11: N2 + result += + y[11] * + (+2.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + + 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - 9.22797700e+02 * invT) * + 0.0356964374955379; + } + + const amrex::Real RT = 8.31446261815324e+07 * T; // R*T + + hbms = result * RT; +} + +// get mean internal energy in molar units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKUBML(const amrex::Real T, const amrex::Real x[], amrex::Real& ubml) +{ + amrex::Real result = 0; + amrex::Real uml[12]; // temporary energy array + amrex::Real RT = 8.31446261815324e+07 * T; // R*T + speciesInternalEnergy(uml, T); + + // perform dot product + for (int id = 0; id < 12; ++id) { + result += x[id] * uml[id]; + } + + ubml = result * RT; +} + +// get mean internal energy in mass units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKUBMS(const amrex::Real T, const amrex::Real y[], amrex::Real& ubms) +{ + amrex::Real result = 0.0; + const amrex::Real T2 = T * T; + const amrex::Real T3 = T * T * T; + const amrex::Real T4 = T * T * T * T; + const amrex::Real invT = 1.0 / T; + + // species with no change across T + // species 5: H + result += + y[5] * (+1.50000000e+00 + 2.54716300e+04 * invT) * 0.9920634920634921; + + // species with midpoint at T=1000 kelvin + if (T < 1000) { + // species 0: H2 + result += + y[0] * + (+2.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - + 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - 1.01252100e+03 * invT) * + 0.4960317460317460; + // species 1: O2 + result += + y[1] * + (+2.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + + 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - 1.00524900e+03 * invT) * + 0.0312519532470779; + // species 2: O + result += + y[2] * + (+1.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - + 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + 2.91476400e+04 * invT) * + 0.0625039064941559; + // species 3: OH + result += + y[3] * + (+3.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - + 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + 3.34630913e+03 * invT) * + 0.0587993179279120; + // species 4: H2O + result += + y[4] * + (+2.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + + 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - 3.02081100e+04 * invT) * + 0.0555092978073827; + // species 6: HO2 + result += + y[6] * + (+3.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - + 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + 2.94808040e+02 * invT) * + 0.0302975216627280; + // species 7: H2O2 + result += + y[7] * + (+2.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - + 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - 1.76631500e+04 * invT) * + 0.0293996589639560; + // species 8: CO + result += + y[8] * + (+2.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + + 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - 1.43105400e+04 * invT) * + 0.0357015351660121; + // species 9: CO2 + result += + y[9] * + (+1.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + + 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - 4.83731400e+04 * invT) * + 0.0227226249176305; + // species 10: HCO + result += + y[10] * + (+1.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + + 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + 4.15992200e+03 * invT) * + 0.0344613688055690; + // species 11: N2 + result += + y[11] * + (+2.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + + 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - 1.02090000e+03 * invT) * + 0.0356964374955379; + } else { + // species 0: H2 + result += + y[0] * + (+1.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - + 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - 8.35034000e+02 * invT) * + 0.4960317460317460; + // species 1: O2 + result += + y[1] * + (+2.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + + 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - 1.23393000e+03 * invT) * + 0.0312519532470779; + // species 2: O + result += + y[2] * + (+1.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + + 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + 2.92308000e+04 * invT) * + 0.0625039064941559; + // species 3: OH + result += + y[3] * + (+1.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + + 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + 3.68362875e+03 * invT) * + 0.0587993179279120; + // species 4: H2O + result += + y[4] * + (+1.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + + 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - 2.98992100e+04 * invT) * + 0.0555092978073827; + // species 6: HO2 + result += + y[6] * + (+3.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + + 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + 1.11856713e+02 * invT) * + 0.0302975216627280; + // species 7: H2O2 + result += + y[7] * + (+3.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + + 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - 1.80069600e+04 * invT) * + 0.0293996589639560; + // species 8: CO + result += + y[8] * + (+2.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + + 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - 1.42683500e+04 * invT) * + 0.0357015351660121; + // species 9: CO2 + result += + y[9] * + (+3.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + + 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - 4.89669600e+04 * invT) * + 0.0227226249176305; + // species 10: HCO + result += + y[10] * + (+2.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + + 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + 3.91632400e+03 * invT) * + 0.0344613688055690; + // species 11: N2 + result += + y[11] * + (+1.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + + 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - 9.22797700e+02 * invT) * + 0.0356964374955379; + } + + const amrex::Real RT = 8.31446261815324e+07 * T; // R*T + + ubms = result * RT; +} + +// get mixture entropy in molar units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKSBML( + const amrex::Real P, + const amrex::Real T, + const amrex::Real x[], + amrex::Real& sbml) +{ + amrex::Real result = 0; + // Log of normalized pressure in cgs units dynes/cm^2 by Patm + amrex::Real logPratio = log(P / 1013250.0); + amrex::Real sor[12]; // temporary storage + speciesEntropy(sor, T); + + // Compute Eq 42 + for (int id = 0; id < 12; ++id) { + result += x[id] * (sor[id] - log((x[id] + 1e-100)) - logPratio); + } + + sbml = result * 8.31446261815324e+07; +} + +// get mixture entropy in mass units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKSBMS( + const amrex::Real P, + const amrex::Real T, + const amrex::Real y[], + amrex::Real& sbms) +{ + amrex::Real result = 0; + // Log of normalized pressure in cgs units dynes/cm^2 by Patm + amrex::Real logPratio = log(P / 1013250.0); + amrex::Real sor[12]; // temporary storage + amrex::Real x[12]; // need a ytx conversion + amrex::Real YOW = 0; // See Eq 4, 6 in CK Manual + + // Compute inverse of mean molecular wt first + for (int i = 0; i < 12; i++) { + YOW += y[i] * imw(i); + } + // Now compute y to x conversion + x[0] = y[0] / (2.016000 * YOW); + x[1] = y[1] / (31.998000 * YOW); + x[2] = y[2] / (15.999000 * YOW); + x[3] = y[3] / (17.007000 * YOW); + x[4] = y[4] / (18.015000 * YOW); + x[5] = y[5] / (1.008000 * YOW); + x[6] = y[6] / (33.006000 * YOW); + x[7] = y[7] / (34.014000 * YOW); + x[8] = y[8] / (28.010000 * YOW); + x[9] = y[9] / (44.009000 * YOW); + x[10] = y[10] / (29.018000 * YOW); + x[11] = y[11] / (28.014000 * YOW); + speciesEntropy(sor, T); + // Perform computation in Eq 42 and 43 + for (int i = 0; i < 12; i++) { + result += x[i] * (sor[i] - log((x[i] + 1e-100)) - logPratio); + } + // Scale by R/W + sbms = result * 8.31446261815324e+07 * YOW; +} + +// get temperature given internal energy in mass units and mass fracs +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +GET_T_GIVEN_EY( + const amrex::Real e, const amrex::Real y[], amrex::Real& t, int& ierr) +{ +#ifdef CONVERGENCE + const int maxiter = 5000; + const amrex::Real tol = 1.e-12; +#else + const int maxiter = 200; + const amrex::Real tol = 1.e-6; +#endif + amrex::Real tmin = 90; // max lower bound for thermo def + amrex::Real tmax = 4000; // min upper bound for thermo def + amrex::Real e1, emin, emax, cv, t1, dt; + CKUBMS(tmin, y, emin); + CKUBMS(tmax, y, emax); + if (e < emin) { + // Linear Extrapolation below tmin + CKCVBS(tmin, y, cv); + t = tmin - (emin - e) / cv; + ierr = 1; + return; + } + if (e > emax) { + // Linear Extrapolation above tmax + CKCVBS(tmax, y, cv); + t = tmax - (emax - e) / cv; + ierr = 1; + return; + } + t1 = t; + if (t1 < tmin || t1 > tmax) { + t1 = tmin + (tmax - tmin) / (emax - emin) * (e - emin); + } + for (int i = 0; i < maxiter; ++i) { + CKUBMS(t1, y, e1); + CKCVBS(t1, y, cv); + dt = (e - e1) / cv; + if (dt > 100.) { + dt = 100.; + } else if (dt < -100.) { + dt = -100.; + } else if (fabs(dt) < tol) { + break; + } + t1 += dt; + } + t = t1; + ierr = 0; +} + +// get temperature given enthalpy in mass units and mass fracs +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +GET_T_GIVEN_HY( + const amrex::Real h, const amrex::Real y[], amrex::Real& t, int& ierr) +{ +#ifdef CONVERGENCE + const int maxiter = 5000; + const amrex::Real tol = 1.e-12; +#else + const int maxiter = 200; + const amrex::Real tol = 1.e-6; +#endif + amrex::Real tmin = 90; // max lower bound for thermo def + amrex::Real tmax = 4000; // min upper bound for thermo def + amrex::Real h1, hmin, hmax, cp, t1, dt; + CKHBMS(tmin, y, hmin); + CKHBMS(tmax, y, hmax); + if (h < hmin) { + // Linear Extrapolation below tmin + CKCPBS(tmin, y, cp); + t = tmin - (hmin - h) / cp; + ierr = 1; + return; + } + if (h > hmax) { + // Linear Extrapolation above tmax + CKCPBS(tmax, y, cp); + t = tmax - (hmax - h) / cp; + ierr = 1; + return; + } + t1 = t; + if (t1 < tmin || t1 > tmax) { + t1 = tmin + (tmax - tmin) / (hmax - hmin) * (h - hmin); + } + for (int i = 0; i < maxiter; ++i) { + CKHBMS(t1, y, h1); + CKCPBS(t1, y, cp); + dt = (h - h1) / cp; + if (dt > 100.) { + dt = 100.; + } else if (dt < -100.) { + dt = -100.; + } else if (fabs(dt) < tol) { + break; + } + t1 += dt; + } + t = t1; + ierr = 0; +} + +// Compute P = rhoRT/W(x) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKPX( + const amrex::Real rho, + const amrex::Real T, + const amrex::Real x[], + amrex::Real& P) +{ + amrex::Real XW = 0; // To hold mean molecular wt + XW += x[0] * 2.016000; // H2 + XW += x[1] * 31.998000; // O2 + XW += x[2] * 15.999000; // O + XW += x[3] * 17.007000; // OH + XW += x[4] * 18.015000; // H2O + XW += x[5] * 1.008000; // H + XW += x[6] * 33.006000; // HO2 + XW += x[7] * 34.014000; // H2O2 + XW += x[8] * 28.010000; // CO + XW += x[9] * 44.009000; // CO2 + XW += x[10] * 29.018000; // HCO + XW += x[11] * 28.014000; // N2 + P = rho * 8.31446261815324e+07 * T / XW; // P = rho*R*T/W +} + +// Compute P = rhoRT/W(y) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKPY( + const amrex::Real rho, + const amrex::Real T, + const amrex::Real y[], + amrex::Real& P) +{ + amrex::Real YOW = 0; // for computing mean MW + + for (int i = 0; i < 12; i++) { + YOW += y[i] * imw(i); + } + P = rho * 8.31446261815324e+07 * T * YOW; // P = rho*R*T/W +} + +// Compute P = rhoRT/W(c) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKPC( + const amrex::Real rho, + const amrex::Real T, + const amrex::Real c[], + amrex::Real& P) +{ + // See Eq 5 in CK Manual + amrex::Real W = 0; + amrex::Real sumC = 0; + W += c[0] * 2.016000; // H2 + W += c[1] * 31.998000; // O2 + W += c[2] * 15.999000; // O + W += c[3] * 17.007000; // OH + W += c[4] * 18.015000; // H2O + W += c[5] * 1.008000; // H + W += c[6] * 33.006000; // HO2 + W += c[7] * 34.014000; // H2O2 + W += c[8] * 28.010000; // CO + W += c[9] * 44.009000; // CO2 + W += c[10] * 29.018000; // HCO + W += c[11] * 28.014000; // N2 + + for (int id = 0; id < 12; ++id) { + sumC += c[id]; + } + P = rho * 8.31446261815324e+07 * T * sumC / W; // P = rho*R*T/W +} + +// Compute rho = PW(x)/RT +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKRHOX( + const amrex::Real P, + const amrex::Real T, + const amrex::Real x[], + amrex::Real& rho) +{ + amrex::Real XW = 0; // To hold mean molecular wt + XW += x[0] * 2.016000; // H2 + XW += x[1] * 31.998000; // O2 + XW += x[2] * 15.999000; // O + XW += x[3] * 17.007000; // OH + XW += x[4] * 18.015000; // H2O + XW += x[5] * 1.008000; // H + XW += x[6] * 33.006000; // HO2 + XW += x[7] * 34.014000; // H2O2 + XW += x[8] * 28.010000; // CO + XW += x[9] * 44.009000; // CO2 + XW += x[10] * 29.018000; // HCO + XW += x[11] * 28.014000; // N2 + rho = P * XW / (8.31446261815324e+07 * T); // rho = P*W/(R*T) +} + +// Compute rho = P*W(y)/RT +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKRHOY( + const amrex::Real P, + const amrex::Real T, + const amrex::Real y[], + amrex::Real& rho) +{ + amrex::Real YOW = 0; + + for (int i = 0; i < 12; i++) { + YOW += y[i] * imw(i); + } + + rho = P / (8.31446261815324e+07 * T * YOW); // rho = P*W/(R*T) +} + +// Compute rho = P*W(c)/(R*T) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKRHOC( + const amrex::Real P, + const amrex::Real T, + const amrex::Real c[], + amrex::Real& rho) +{ + // See Eq 5 in CK Manual + amrex::Real W = 0; + amrex::Real sumC = 0; + W += c[0] * 2.016000; // H2 + W += c[1] * 31.998000; // O2 + W += c[2] * 15.999000; // O + W += c[3] * 17.007000; // OH + W += c[4] * 18.015000; // H2O + W += c[5] * 1.008000; // H + W += c[6] * 33.006000; // HO2 + W += c[7] * 34.014000; // H2O2 + W += c[8] * 28.010000; // CO + W += c[9] * 44.009000; // CO2 + W += c[10] * 29.018000; // HCO + W += c[11] * 28.014000; // N2 + + for (int id = 0; id < 12; ++id) { + sumC += c[id]; + } + rho = P * W / (sumC * T * 8.31446261815324e+07); // rho = PW/(R*T) +} + +// get molecular weight for all species +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKWT(amrex::Real wt[]) +{ + get_mw(wt); +} + +// given y[species]: mass fractions +// s mean molecular weight (gm/mole) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKMMWY(const amrex::Real y[], amrex::Real& wtm) +{ + amrex::Real YOW = 0; + + for (int i = 0; i < 12; i++) { + YOW += y[i] * imw(i); + } + + wtm = 1.0 / YOW; +} + +// given x[species]: mole fractions +// returns mean molecular weight (gm/mole) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKMMWX(const amrex::Real x[], amrex::Real& wtm) +{ + amrex::Real XW = 0; // see Eq 4 in CK Manual + XW += x[0] * 2.016000; // H2 + XW += x[1] * 31.998000; // O2 + XW += x[2] * 15.999000; // O + XW += x[3] * 17.007000; // OH + XW += x[4] * 18.015000; // H2O + XW += x[5] * 1.008000; // H + XW += x[6] * 33.006000; // HO2 + XW += x[7] * 34.014000; // H2O2 + XW += x[8] * 28.010000; // CO + XW += x[9] * 44.009000; // CO2 + XW += x[10] * 29.018000; // HCO + XW += x[11] * 28.014000; // N2 + wtm = XW; +} + +// given c[species]: molar concentration +// returns mean molecular weight (gm/mole) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKMMWC(const amrex::Real c[], amrex::Real& wtm) +{ + // See Eq 5 in CK Manual + amrex::Real W = 0; + amrex::Real sumC = 0; + W += c[0] * 2.016000; // H2 + W += c[1] * 31.998000; // O2 + W += c[2] * 15.999000; // O + W += c[3] * 17.007000; // OH + W += c[4] * 18.015000; // H2O + W += c[5] * 1.008000; // H + W += c[6] * 33.006000; // HO2 + W += c[7] * 34.014000; // H2O2 + W += c[8] * 28.010000; // CO + W += c[9] * 44.009000; // CO2 + W += c[10] * 29.018000; // HCO + W += c[11] * 28.014000; // N2 + + for (int id = 0; id < 12; ++id) { + sumC += c[id]; + } + // CK provides no guard against division by zero + wtm = W / sumC; +} + +// get Cp/R as a function of T +// for all species (Eq 19) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCPOR(const amrex::Real T, amrex::Real cpor[]) +{ + cp_R(cpor, T); +} + +// get H/RT as a function of T +// for all species (Eq 20) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKHORT(const amrex::Real T, amrex::Real hort[]) +{ + speciesEnthalpy(hort, T); +} + +// get S/R as a function of T +// for all species (Eq 21) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKSOR(const amrex::Real T, amrex::Real sor[]) +{ + speciesEntropy(sor, T); +} + +// convert y[species] (mass fracs) to x[species] (mole fracs) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKYTX(const amrex::Real y[], amrex::Real x[]) +{ + amrex::Real YOW = 0; + + for (int i = 0; i < 12; i++) { + YOW += y[i] * imw(i); + } + + amrex::Real YOWINV = 1.0 / YOW; + + for (int i = 0; i < 12; i++) { + x[i] = y[i] * imw(i) * YOWINV; + } +} + +// convert y[species] (mass fracs) to c[species] (molar conc) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKYTCP( + const amrex::Real P, + const amrex::Real T, + const amrex::Real y[], + amrex::Real c[]) +{ + amrex::Real YOW = 0; + amrex::Real PWORT; + + // Compute inverse of mean molecular wt first + for (int i = 0; i < 12; i++) { + c[i] = y[i] * imw(i); + } + for (int i = 0; i < 12; i++) { + YOW += c[i]; + } + + // PW/RT (see Eq. 7) + PWORT = P / (YOW * 8.31446261815324e+07 * T); + // Now compute conversion + + for (int i = 0; i < 12; i++) { + c[i] = PWORT * y[i] * imw(i); + } +} + +// convert y[species] (mass fracs) to c[species] (molar conc) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKYTCR( + const amrex::Real rho, + amrex::Real /*T*/, + const amrex::Real y[], + amrex::Real c[]) +{ + + for (int i = 0; i < 12; i++) { + c[i] = rho * y[i] * imw(i); + } +} + +// convert x[species] (mole fracs) to y[species] (mass fracs) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKXTY(const amrex::Real x[], amrex::Real y[]) +{ + amrex::Real XW = 0; // See Eq 4, 9 in CK Manual + // Compute mean molecular wt first + XW += x[0] * 2.016000; // H2 + XW += x[1] * 31.998000; // O2 + XW += x[2] * 15.999000; // O + XW += x[3] * 17.007000; // OH + XW += x[4] * 18.015000; // H2O + XW += x[5] * 1.008000; // H + XW += x[6] * 33.006000; // HO2 + XW += x[7] * 34.014000; // H2O2 + XW += x[8] * 28.010000; // CO + XW += x[9] * 44.009000; // CO2 + XW += x[10] * 29.018000; // HCO + XW += x[11] * 28.014000; // N2 + // Now compute conversion + amrex::Real XWinv = 1.0 / XW; + y[0] = x[0] * 2.016000 * XWinv; + y[1] = x[1] * 31.998000 * XWinv; + y[2] = x[2] * 15.999000 * XWinv; + y[3] = x[3] * 17.007000 * XWinv; + y[4] = x[4] * 18.015000 * XWinv; + y[5] = x[5] * 1.008000 * XWinv; + y[6] = x[6] * 33.006000 * XWinv; + y[7] = x[7] * 34.014000 * XWinv; + y[8] = x[8] * 28.010000 * XWinv; + y[9] = x[9] * 44.009000 * XWinv; + y[10] = x[10] * 29.018000 * XWinv; + y[11] = x[11] * 28.014000 * XWinv; +} + +// convert x[species] (mole fracs) to c[species] (molar conc) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKXTCP( + const amrex::Real P, + const amrex::Real T, + const amrex::Real x[], + amrex::Real c[]) +{ + amrex::Real PORT = P / (8.31446261815324e+07 * T); // P/RT + + // Compute conversion, see Eq 10 + for (int id = 0; id < 12; ++id) { + c[id] = x[id] * PORT; + } +} + +// convert x[species] (mole fracs) to c[species] (molar conc) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKXTCR( + const amrex::Real rho, + const amrex::Real /*T*/, + const amrex::Real x[], + amrex::Real c[]) +{ + amrex::Real XW = 0; // See Eq 4, 11 in CK Manual + amrex::Real ROW; + // Compute mean molecular wt first + XW += x[0] * 2.016000; // H2 + XW += x[1] * 31.998000; // O2 + XW += x[2] * 15.999000; // O + XW += x[3] * 17.007000; // OH + XW += x[4] * 18.015000; // H2O + XW += x[5] * 1.008000; // H + XW += x[6] * 33.006000; // HO2 + XW += x[7] * 34.014000; // H2O2 + XW += x[8] * 28.010000; // CO + XW += x[9] * 44.009000; // CO2 + XW += x[10] * 29.018000; // HCO + XW += x[11] * 28.014000; // N2 + ROW = rho / XW; + + // Compute conversion, see Eq 11 + for (int id = 0; id < 12; ++id) { + c[id] = x[id] * ROW; + } +} + +// convert c[species] (molar conc) to x[species] (mole fracs) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCTX(const amrex::Real c[], amrex::Real x[]) +{ + amrex::Real sumC = 0; + + // compute sum of c + for (int id = 0; id < 12; ++id) { + sumC += c[id]; + } + + // See Eq 13 + amrex::Real sumCinv = 1.0 / sumC; + for (int id = 0; id < 12; ++id) { + x[id] = c[id] * sumCinv; + } +} + +// convert c[species] (molar conc) to y[species] (mass fracs) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCTY(const amrex::Real c[], amrex::Real y[]) +{ + amrex::Real CW = 0; // See Eq 12 in CK Manual + // compute denominator in eq 12 first + CW += c[0] * 2.016000; // H2 + CW += c[1] * 31.998000; // O2 + CW += c[2] * 15.999000; // O + CW += c[3] * 17.007000; // OH + CW += c[4] * 18.015000; // H2O + CW += c[5] * 1.008000; // H + CW += c[6] * 33.006000; // HO2 + CW += c[7] * 34.014000; // H2O2 + CW += c[8] * 28.010000; // CO + CW += c[9] * 44.009000; // CO2 + CW += c[10] * 29.018000; // HCO + CW += c[11] * 28.014000; // N2 + // Now compute conversion + amrex::Real CWinv = 1.0 / CW; + y[0] = c[0] * 2.016000 * CWinv; + y[1] = c[1] * 31.998000 * CWinv; + y[2] = c[2] * 15.999000 * CWinv; + y[3] = c[3] * 17.007000 * CWinv; + y[4] = c[4] * 18.015000 * CWinv; + y[5] = c[5] * 1.008000 * CWinv; + y[6] = c[6] * 33.006000 * CWinv; + y[7] = c[7] * 34.014000 * CWinv; + y[8] = c[8] * 28.010000 * CWinv; + y[9] = c[9] * 44.009000 * CWinv; + y[10] = c[10] * 29.018000 * CWinv; + y[11] = c[11] * 28.014000 * CWinv; +} + +// get specific heat at constant volume as a function +// of T for all species (molar units) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCVML(const amrex::Real T, amrex::Real cvml[]) +{ + cv_R(cvml, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + cvml[id] *= 8.31446261815324e+07; + } +} + +// get specific heat at constant pressure as a +// function of T for all species (molar units) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCPML(const amrex::Real T, amrex::Real cpml[]) +{ + cp_R(cpml, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + cpml[id] *= 8.31446261815324e+07; + } +} + +// get internal energy as a function +// of T for all species (molar units) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKUML(const amrex::Real T, amrex::Real uml[]) +{ + amrex::Real RT = 8.31446261815324e+07 * T; // R*T + speciesInternalEnergy(uml, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + uml[id] *= RT; + } +} + +// get enthalpy as a function +// of T for all species (molar units) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKHML(const amrex::Real T, amrex::Real hml[]) +{ + amrex::Real RT = 8.31446261815324e+07 * T; // R*T + speciesEnthalpy(hml, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + hml[id] *= RT; + } +} + +// Returns the standard-state entropies in molar units +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKSML(const amrex::Real T, amrex::Real sml[]) +{ + speciesEntropy(sml, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + sml[id] *= 8.31446261815324e+07; + } +} + +// Returns the specific heats at constant volume +// in mass units (Eq. 29) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCVMS(const amrex::Real T, amrex::Real cvms[]) +{ + cv_R(cvms, T); + // multiply by R/molecularweight + cvms[0] *= 4.124237409798234e+07; // H2 + cvms[1] *= 2.598431970171023e+06; // O2 + cvms[2] *= 5.196863940342046e+06; // O + cvms[3] *= 4.888847308845322e+06; // OH + cvms[4] *= 4.615299815794193e+06; // H2O + cvms[5] *= 8.248474819596468e+07; // H + cvms[6] *= 2.519076112874398e+06; // HO2 + cvms[7] *= 2.444423654422661e+06; // H2O2 + cvms[8] *= 2.968390795484913e+06; // CO + cvms[9] *= 1.889264154639560e+06; // CO2 + cvms[10] *= 2.865277627042952e+06; // HCO + cvms[11] *= 2.967966951578939e+06; // N2 +} + +// Returns the specific heats at constant pressure +// in mass units (Eq. 26) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCPMS(const amrex::Real T, amrex::Real cpms[]) +{ + cp_R(cpms, T); + // multiply by R/molecularweight + cpms[0] *= 4.124237409798234e+07; // H2 + cpms[1] *= 2.598431970171023e+06; // O2 + cpms[2] *= 5.196863940342046e+06; // O + cpms[3] *= 4.888847308845322e+06; // OH + cpms[4] *= 4.615299815794193e+06; // H2O + cpms[5] *= 8.248474819596468e+07; // H + cpms[6] *= 2.519076112874398e+06; // HO2 + cpms[7] *= 2.444423654422661e+06; // H2O2 + cpms[8] *= 2.968390795484913e+06; // CO + cpms[9] *= 1.889264154639560e+06; // CO2 + cpms[10] *= 2.865277627042952e+06; // HCO + cpms[11] *= 2.967966951578939e+06; // N2 +} + +// Returns internal energy in mass units (Eq 30.) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKUMS(const amrex::Real T, amrex::Real ums[]) +{ + amrex::Real RT = 8.31446261815324e+07 * T; // R*T + + speciesInternalEnergy(ums, T); + + for (int i = 0; i < 12; i++) { + ums[i] *= RT * imw(i); + } +} + +// Returns enthalpy in mass units (Eq 27.) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKHMS(const amrex::Real T, amrex::Real hms[]) +{ + amrex::Real RT = 8.31446261815324e+07 * T; // R*T + + speciesEnthalpy(hms, T); + + for (int i = 0; i < 12; i++) { + hms[i] *= RT * imw(i); + } +} + +// Returns the entropies in mass units (Eq 28.) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKSMS(const amrex::Real T, amrex::Real sms[]) +{ + speciesEntropy(sms, T); + // multiply by R/molecularweight + sms[0] *= 4.124237409798234e+07; // H2 + sms[1] *= 2.598431970171023e+06; // O2 + sms[2] *= 5.196863940342046e+06; // O + sms[3] *= 4.888847308845322e+06; // OH + sms[4] *= 4.615299815794193e+06; // H2O + sms[5] *= 8.248474819596468e+07; // H + sms[6] *= 2.519076112874398e+06; // HO2 + sms[7] *= 2.444423654422661e+06; // H2O2 + sms[8] *= 2.968390795484913e+06; // CO + sms[9] *= 1.889264154639560e+06; // CO2 + sms[10] *= 2.865277627042952e+06; // HCO + sms[11] *= 2.967966951578939e+06; // N2 +} + +// GPU version of productionRate: no more use of thermo namespace vectors +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +comp_qfqr( + amrex::Real* qf, + amrex::Real* qr, + const amrex::Real* sc, + const amrex::Real* /*sc_qss*/, + const amrex::Real T, + const amrex::Real invT, + const amrex::Real logT) +{ + + // reaction 8: H + O2 (+M) <=> HO2 (+M) + qf[0] = sc[1] * sc[5]; + qr[0] = sc[6]; + + // reaction 15: H2O2 (+M) <=> 2 OH (+M) + qf[1] = sc[7]; + qr[1] = (sc[3] * sc[3]); + + // reaction 21: CO + O (+M) <=> CO2 (+M) + qf[2] = sc[2] * sc[8]; + qr[2] = sc[9]; + + // reaction 4: H2 + M <=> 2 H + M + qf[3] = sc[0]; + qr[3] = (sc[5] * sc[5]); + + // reaction 5: 2 O + M <=> O2 + M + qf[4] = (sc[2] * sc[2]); + qr[4] = sc[1]; + + // reaction 6: H + O + M <=> OH + M + qf[5] = sc[2] * sc[5]; + qr[5] = sc[3]; + + // reaction 7: H + OH + M <=> H2O + M + qf[6] = sc[3] * sc[5]; + qr[6] = sc[4]; + + // reaction 25: HCO + M <=> CO + H + M + qf[7] = sc[10]; + qr[7] = sc[5] * sc[8]; + + // reaction 0: H + O2 <=> O + OH + qf[8] = sc[1] * sc[5]; + qr[8] = sc[2] * sc[3]; + + // reaction 1: H2 + O <=> H + OH + qf[9] = sc[0] * sc[2]; + qr[9] = sc[3] * sc[5]; + + // reaction 2: H2 + OH <=> H + H2O + qf[10] = sc[0] * sc[3]; + qr[10] = sc[4] * sc[5]; + + // reaction 3: H2O + O <=> 2 OH + qf[11] = sc[2] * sc[4]; + qr[11] = (sc[3] * sc[3]); + + // reaction 9: H + HO2 <=> H2 + O2 + qf[12] = sc[5] * sc[6]; + qr[12] = sc[0] * sc[1]; + + // reaction 10: H + HO2 <=> 2 OH + qf[13] = sc[5] * sc[6]; + qr[13] = (sc[3] * sc[3]); + + // reaction 11: HO2 + O <=> O2 + OH + qf[14] = sc[2] * sc[6]; + qr[14] = sc[1] * sc[3]; + + // reaction 12: HO2 + OH <=> H2O + O2 + qf[15] = sc[3] * sc[6]; + qr[15] = sc[1] * sc[4]; + + // reaction 13: 2 HO2 <=> H2O2 + O2 + qf[16] = (sc[6] * sc[6]); + qr[16] = sc[1] * sc[7]; + + // reaction 14: 2 HO2 <=> H2O2 + O2 + qf[17] = (sc[6] * sc[6]); + qr[17] = sc[1] * sc[7]; + + // reaction 16: H + H2O2 <=> H2O + OH + qf[18] = sc[5] * sc[7]; + qr[18] = sc[3] * sc[4]; + + // reaction 17: H + H2O2 <=> H2 + HO2 + qf[19] = sc[5] * sc[7]; + qr[19] = sc[0] * sc[6]; + + // reaction 18: H2O2 + O <=> HO2 + OH + qf[20] = sc[2] * sc[7]; + qr[20] = sc[3] * sc[6]; + + // reaction 19: H2O2 + OH <=> H2O + HO2 + qf[21] = sc[3] * sc[7]; + qr[21] = sc[4] * sc[6]; + + // reaction 20: H2O2 + OH <=> H2O + HO2 + qf[22] = sc[3] * sc[7]; + qr[22] = sc[4] * sc[6]; + + // reaction 22: CO + O2 <=> CO2 + O + qf[23] = sc[1] * sc[8]; + qr[23] = sc[2] * sc[9]; + + // reaction 23: CO + HO2 <=> CO2 + OH + qf[24] = sc[6] * sc[8]; + qr[24] = sc[3] * sc[9]; + + // reaction 24: CO + OH <=> CO2 + H + qf[25] = sc[3] * sc[8]; + qr[25] = sc[5] * sc[9]; + + // reaction 26: HCO + O2 <=> CO + HO2 + qf[26] = sc[1] * sc[10]; + qr[26] = sc[6] * sc[8]; + + // reaction 27: H + HCO <=> CO + H2 + qf[27] = sc[5] * sc[10]; + qr[27] = sc[0] * sc[8]; + + // reaction 28: HCO + O <=> CO2 + H + qf[28] = sc[2] * sc[10]; + qr[28] = sc[5] * sc[9]; + + // compute the mixture concentration + amrex::Real mixture = 0.0; + for (int i = 0; i < 12; ++i) { + mixture += sc[i]; + } + + // compute the Gibbs free energy + amrex::Real g_RT[12]; + gibbs(g_RT, T); + + // reference concentration: P_atm / (RT) in inverse mol/m^3 + amrex::Real refC = 101325 / 8.31446 * invT; + amrex::Real refCinv = 1 / refC; + + // Evaluate the kfs + amrex::Real k_f, Corr; + amrex::Real redP, F, logPred, logFcent, troe_c, troe_n, troe, F_troe; + + // reaction 0: H + O2 <=> O + OH + k_f = 3547000000 * exp((-0.406) * logT - (8352.89343569254) * invT); + qf[8] *= k_f; + qr[8] *= k_f * exp(-(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5])); + // reaction 1: H2 + O <=> H + OH + k_f = 0.0508 * exp((2.67) * logT - (3165.23282791169) * invT); + qf[9] *= k_f; + qr[9] *= k_f * exp(-(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5])); + // reaction 2: H2 + OH <=> H + H2O + k_f = 216 * exp((1.51) * logT - (1726.03316371019) * invT); + qf[10] *= k_f; + qr[10] *= k_f * exp(-(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5])); + // reaction 3: H2O + O <=> 2 OH + k_f = 2.97 * exp((2.02) * logT - (6743.10332178324) * invT); + qf[11] *= k_f; + qr[11] *= k_f * exp(-(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4])); + // reaction 4: H2 + M <=> 2 H + M + k_f = 45770000000000 * exp((-1.4) * logT - (52525.7555766966) * invT); + Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + qf[3] *= Corr * k_f; + qr[3] *= Corr * k_f * exp(-(g_RT[0] - 2.000000 * g_RT[5])) * (refCinv); + // reaction 5: 2 O + M <=> O2 + M + k_f = 6165 * exp((-0.5) * logT); + Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + qf[4] *= Corr * k_f; + qr[4] *= Corr * k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[2])) * (refC); + // reaction 6: H + O + M <=> OH + M + k_f = 4714000 * exp((-1) * logT); + Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + qf[5] *= Corr * k_f; + qr[5] *= Corr * k_f * exp(-(g_RT[2] - g_RT[3] + g_RT[5])) * (refC); + // reaction 7: H + OH + M <=> H2O + M + k_f = 38000000000 * exp((-2) * logT); + Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + qf[6] *= Corr * k_f; + qr[6] *= Corr * k_f * exp(-(g_RT[3] - g_RT[4] + g_RT[5])) * (refC); + // reaction 8: H + O2 (+M) <=> HO2 (+M) + k_f = 1475000 * exp((0.6) * logT); + Corr = mixture + sc[0] + (-0.22) * sc[1] + (10) * sc[4] + (0.9) * sc[8] + + (2.8) * sc[9]; + redP = Corr / k_f * 636600000 * exp(-1.72 * logT - (264.088106214317) * invT); + F = redP / (1.0 + redP); + logPred = log10(redP); + logFcent = log10((0.2) * exp(-T * 1e+30) + 0.8 * exp(-T * 1e-30) + 0.0); + troe_c = -0.4 - 0.67 * logFcent; + troe_n = 0.75 - 1.27 * logFcent; + troe = (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); + F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); + Corr = F * F_troe; + qf[0] *= Corr * k_f; + qr[0] *= Corr * k_f * exp(-(g_RT[1] + g_RT[5] - g_RT[6])) * (refC); + // reaction 9: H + HO2 <=> H2 + O2 + k_f = 16600000 * exp(-(414.147315957284) * invT); + qf[12] *= k_f; + qr[12] *= k_f * exp(-(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6])); + // reaction 10: H + HO2 <=> 2 OH + k_f = 70790000 * exp(-(148.448916412392) * invT); + qf[13] *= k_f; + qr[13] *= k_f * exp(-(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6])); + // reaction 11: HO2 + O <=> O2 + OH + k_f = 32500000; + qf[14] *= k_f; + qr[14] *= k_f * exp(-(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6])); + // reaction 12: HO2 + OH <=> H2O + O2 + k_f = 28900000 * exp(-(-250.098682904946) * invT); + qf[15] *= k_f; + qr[15] *= k_f * exp(-(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6])); + // reaction 13: 2 HO2 <=> H2O2 + O2 + k_f = 420000000 * exp(-(6029.54208967215) * invT); + qf[16] *= k_f; + qr[16] *= k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])); + // reaction 14: 2 HO2 <=> H2O2 + O2 + k_f = 130000 * exp(-(-819.89091359563) * invT); + qf[17] *= k_f; + qr[17] *= k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])); + // reaction 15: H2O2 (+M) <=> 2 OH (+M) + k_f = 295100000000000 * exp(-(24370.7831249226) * invT); + Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + redP = Corr / k_f * 120200000000 * exp(-(22896.3582941147) * invT); + F = redP / (1.0 + redP); + logPred = log10(redP); + logFcent = log10((0.5) * exp(-T * 1e+30) + 0.5 * exp(-T * 1e-30) + 0.0); + troe_c = -0.4 - 0.67 * logFcent; + troe_n = 0.75 - 1.27 * logFcent; + troe = (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); + F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); + Corr = F * F_troe; + qf[1] *= Corr * k_f; + qr[1] *= Corr * k_f * exp(-(-2.000000 * g_RT[3] + g_RT[7])) * (refCinv); + // reaction 16: H + H2O2 <=> H2O + OH + k_f = 24100000 * exp(-(1997.77016324474) * invT); + qf[18] *= k_f; + qr[18] *= k_f * exp(-(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7])); + // reaction 17: H + H2O2 <=> H2 + HO2 + k_f = 48200000 * exp(-(4000.57249314752) * invT); + qf[19] *= k_f; + qr[19] *= k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7])); + // reaction 18: H2O2 + O <=> HO2 + OH + k_f = 9.55 * exp((2) * logT - (1997.77016324474) * invT); + qf[20] *= k_f; + qr[20] *= k_f * exp(-(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7])); + // reaction 19: H2O2 + OH <=> H2O + HO2 + k_f = 1000000; + qf[21] *= k_f; + qr[21] *= k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])); + // reaction 20: H2O2 + OH <=> H2O + HO2 + k_f = 580000000 * exp(-(4809.24167509571) * invT); + qf[22] *= k_f; + qr[22] *= k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])); + // reaction 21: CO + O (+M) <=> CO2 (+M) + k_f = 18000 * exp(-(1199.66853127845) * invT); + Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + redP = + Corr / k_f * 1550000000000 * exp(-2.79 * logT - (2108.98104638758) * invT); + Corr = redP / (1. + redP); + qf[2] *= Corr * k_f; + qr[2] *= Corr * k_f * exp(-(g_RT[2] + g_RT[8] - g_RT[9])) * (refC); + // reaction 22: CO + O2 <=> CO2 + O + k_f = 2530000 * exp(-(24003.4349588851) * invT); + qf[23] *= k_f; + qr[23] *= k_f * exp(-(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9])); + // reaction 23: CO + HO2 <=> CO2 + OH + k_f = 30100000 * exp(-(11573.9833135086) * invT); + qf[24] *= k_f; + qr[24] *= k_f * exp(-(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9])); + // reaction 24: CO + OH <=> CO2 + H + k_f = 0.2229 * exp((1.89) * logT - (-583.077150667929) * invT); + qf[25] *= k_f; + qr[25] *= k_f * exp(-(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9])); + // reaction 25: HCO + M <=> CO + H + M + k_f = 474850 * exp((0.659) * logT - (7484.8446871794) * invT); + Corr = mixture + (1.5) * sc[0] + (5) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + qf[7] *= Corr * k_f; + qr[7] *= Corr * k_f * exp(-(-g_RT[5] - g_RT[8] + g_RT[10])) * (refCinv); + // reaction 26: HCO + O2 <=> CO + HO2 + k_f = 7580000 * exp(-(206.318832979935) * invT); + qf[26] *= k_f; + qr[26] *= k_f * exp(-(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10])); + // reaction 27: H + HCO <=> CO + H2 + k_f = 72300000; + qf[27] *= k_f; + qr[27] *= k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10])); + // reaction 28: HCO + O <=> CO2 + H + k_f = 30000000; + qf[28] *= k_f; + qr[28] *= k_f * exp(-(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10])); +} + +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +productionRate(amrex::Real* wdot, const amrex::Real* sc, const amrex::Real T) +{ + const amrex::Real invT = 1.0 / T; + const amrex::Real logT = log(T); + + // reference concentration: P_atm / (RT) in inverse mol/m^3 + const amrex::Real refC = 101325 / 8.31446 * invT; + const amrex::Real refCinv = 1 / refC; + + for (int i = 0; i < 12; ++i) { + wdot[i] = 0.0; + } + + // compute the mixture concentration + amrex::Real mixture = 0.0; + for (int i = 0; i < 12; ++i) { + mixture += sc[i]; + } + + // compute the Gibbs free energy + amrex::Real g_RT[12]; + gibbs(g_RT, T); + + { + // reaction 8: H + O2 (+M) <=> HO2 (+M) + const amrex::Real k_f = 1475000 * exp((0.6) * logT); + amrex::Real Corr = mixture + sc[0] + (-0.22) * sc[1] + (10) * sc[4] + + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real redP = + Corr / k_f * 636600000 * exp(-1.72 * logT - 264.088106214317 * invT); + const amrex::Real F = redP / (1.0 + redP); + const amrex::Real logPred = log10(redP); + const amrex::Real logFcent = + log10(0.2 * exp(-T * 1e+30) + 0.8 * exp(-T * 1e-30) + 0.0); + const amrex::Real troe_c = -0.4 - 0.67 * logFcent; + const amrex::Real troe_n = 0.75 - 1.27 * logFcent; + const amrex::Real troe = + (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); + const amrex::Real F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); + Corr = F * F_troe; + const amrex::Real qf = Corr * k_f * (sc[1] * sc[5]); + const amrex::Real qr = + Corr * k_f * exp(-(g_RT[1] + g_RT[5] - g_RT[6])) * (refC) * (sc[6]); + const amrex::Real qdot = qf - qr; + wdot[1] -= qdot; + wdot[5] -= qdot; + wdot[6] += qdot; + } + + { + // reaction 15: H2O2 (+M) <=> 2 OH (+M) + const amrex::Real k_f = 295100000000000 * exp(-(24370.7831249226) * invT); + amrex::Real Corr = + mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real redP = + Corr / k_f * 120200000000 * exp(-22896.3582941147 * invT); + const amrex::Real F = redP / (1.0 + redP); + const amrex::Real logPred = log10(redP); + const amrex::Real logFcent = + log10(0.5 * exp(-T * 1e+30) + 0.5 * exp(-T * 1e-30) + 0.0); + const amrex::Real troe_c = -0.4 - 0.67 * logFcent; + const amrex::Real troe_n = 0.75 - 1.27 * logFcent; + const amrex::Real troe = + (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); + const amrex::Real F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); + Corr = F * F_troe; + const amrex::Real qf = Corr * k_f * (sc[7]); + const amrex::Real qr = Corr * k_f * exp(-(-2.000000 * g_RT[3] + g_RT[7])) * + (refCinv) * ((sc[3] * sc[3])); + const amrex::Real qdot = qf - qr; + wdot[3] += 2.000000 * qdot; + wdot[7] -= qdot; + } + + { + // reaction 21: CO + O (+M) <=> CO2 (+M) + const amrex::Real k_f = 18000 * exp(-(1199.66853127845) * invT); + amrex::Real Corr = + mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real redP = + Corr / k_f * 1550000000000 * exp(-2.79 * logT - 2108.98104638758 * invT); + Corr = redP / (1.0 + redP); + const amrex::Real qf = Corr * k_f * (sc[2] * sc[8]); + const amrex::Real qr = + Corr * k_f * exp(-(g_RT[2] + g_RT[8] - g_RT[9])) * (refC) * (sc[9]); + const amrex::Real qdot = qf - qr; + wdot[2] -= qdot; + wdot[8] -= qdot; + wdot[9] += qdot; + } + + { + // reaction 4: H2 + M <=> 2 H + M + const amrex::Real k_f = + 45770000000000 * exp((-1.4) * logT - (52525.7555766966) * invT); + const amrex::Real Corr = + mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real qf = Corr * k_f * (sc[0]); + const amrex::Real qr = Corr * k_f * exp(-(g_RT[0] - 2.000000 * g_RT[5])) * + (refCinv) * ((sc[5] * sc[5])); + const amrex::Real qdot = qf - qr; + wdot[0] -= qdot; + wdot[5] += 2.000000 * qdot; + } + + { + // reaction 5: 2 O + M <=> O2 + M + const amrex::Real k_f = 6165 * exp((-0.5) * logT); + const amrex::Real Corr = + mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real qf = Corr * k_f * ((sc[2] * sc[2])); + const amrex::Real qr = + Corr * k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[2])) * (refC) * (sc[1]); + const amrex::Real qdot = qf - qr; + wdot[1] += qdot; + wdot[2] -= 2.000000 * qdot; + } + + { + // reaction 6: H + O + M <=> OH + M + const amrex::Real k_f = 4714000 * exp((-1) * logT); + const amrex::Real Corr = + mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real qf = Corr * k_f * (sc[2] * sc[5]); + const amrex::Real qr = + Corr * k_f * exp(-(g_RT[2] - g_RT[3] + g_RT[5])) * (refC) * (sc[3]); + const amrex::Real qdot = qf - qr; + wdot[2] -= qdot; + wdot[3] += qdot; + wdot[5] -= qdot; + } + + { + // reaction 7: H + OH + M <=> H2O + M + const amrex::Real k_f = 38000000000 * exp((-2) * logT); + const amrex::Real Corr = + mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real qf = Corr * k_f * (sc[3] * sc[5]); + const amrex::Real qr = + Corr * k_f * exp(-(g_RT[3] - g_RT[4] + g_RT[5])) * (refC) * (sc[4]); + const amrex::Real qdot = qf - qr; + wdot[3] -= qdot; + wdot[4] += qdot; + wdot[5] -= qdot; + } + + { + // reaction 25: HCO + M <=> CO + H + M + const amrex::Real k_f = + 474850 * exp((0.659) * logT - (7484.8446871794) * invT); + const amrex::Real Corr = + mixture + (1.5) * sc[0] + (5) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; + const amrex::Real qf = Corr * k_f * (sc[10]); + const amrex::Real qr = Corr * k_f * exp(-(-g_RT[5] - g_RT[8] + g_RT[10])) * + (refCinv) * (sc[5] * sc[8]); + const amrex::Real qdot = qf - qr; + wdot[5] += qdot; + wdot[8] += qdot; + wdot[10] -= qdot; + } + + { + // reaction 0: H + O2 <=> O + OH + const amrex::Real k_f = + 3547000000 * exp((-0.406) * logT - (8352.89343569254) * invT); + const amrex::Real qf = k_f * (sc[1] * sc[5]); + const amrex::Real qr = + k_f * exp(-(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5])) * (sc[2] * sc[3]); + const amrex::Real qdot = qf - qr; + wdot[1] -= qdot; + wdot[2] += qdot; + wdot[3] += qdot; + wdot[5] -= qdot; + } + + { + // reaction 1: H2 + O <=> H + OH + const amrex::Real k_f = + 0.0508 * exp((2.67) * logT - (3165.23282791169) * invT); + const amrex::Real qf = k_f * (sc[0] * sc[2]); + const amrex::Real qr = + k_f * exp(-(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5])) * (sc[3] * sc[5]); + const amrex::Real qdot = qf - qr; + wdot[0] -= qdot; + wdot[2] -= qdot; + wdot[3] += qdot; + wdot[5] += qdot; + } + + { + // reaction 2: H2 + OH <=> H + H2O + const amrex::Real k_f = + 216 * exp((1.51) * logT - (1726.03316371019) * invT); + const amrex::Real qf = k_f * (sc[0] * sc[3]); + const amrex::Real qr = + k_f * exp(-(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5])) * (sc[4] * sc[5]); + const amrex::Real qdot = qf - qr; + wdot[0] -= qdot; + wdot[3] -= qdot; + wdot[4] += qdot; + wdot[5] += qdot; + } + + { + // reaction 3: H2O + O <=> 2 OH + const amrex::Real k_f = + 2.97 * exp((2.02) * logT - (6743.10332178324) * invT); + const amrex::Real qf = k_f * (sc[2] * sc[4]); + const amrex::Real qr = + k_f * exp(-(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4])) * ((sc[3] * sc[3])); + const amrex::Real qdot = qf - qr; + wdot[2] -= qdot; + wdot[3] += 2.000000 * qdot; + wdot[4] -= qdot; + } + + { + // reaction 9: H + HO2 <=> H2 + O2 + const amrex::Real k_f = 16600000 * exp(-(414.147315957284) * invT); + const amrex::Real qf = k_f * (sc[5] * sc[6]); + const amrex::Real qr = + k_f * exp(-(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6])) * (sc[0] * sc[1]); + const amrex::Real qdot = qf - qr; + wdot[0] += qdot; + wdot[1] += qdot; + wdot[5] -= qdot; + wdot[6] -= qdot; + } + + { + // reaction 10: H + HO2 <=> 2 OH + const amrex::Real k_f = 70790000 * exp(-(148.448916412392) * invT); + const amrex::Real qf = k_f * (sc[5] * sc[6]); + const amrex::Real qr = + k_f * exp(-(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6])) * ((sc[3] * sc[3])); + const amrex::Real qdot = qf - qr; + wdot[3] += 2.000000 * qdot; + wdot[5] -= qdot; + wdot[6] -= qdot; + } + + { + // reaction 11: HO2 + O <=> O2 + OH + const amrex::Real k_f = 32500000; + const amrex::Real qf = k_f * (sc[2] * sc[6]); + const amrex::Real qr = + k_f * exp(-(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6])) * (sc[1] * sc[3]); + const amrex::Real qdot = qf - qr; + wdot[1] += qdot; + wdot[2] -= qdot; + wdot[3] += qdot; + wdot[6] -= qdot; + } + + { + // reaction 12: HO2 + OH <=> H2O + O2 + const amrex::Real k_f = 28900000 * exp(-(-250.098682904946) * invT); + const amrex::Real qf = k_f * (sc[3] * sc[6]); + const amrex::Real qr = + k_f * exp(-(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6])) * (sc[1] * sc[4]); + const amrex::Real qdot = qf - qr; + wdot[1] += qdot; + wdot[3] -= qdot; + wdot[4] += qdot; + wdot[6] -= qdot; + } + + { + // reaction 13: 2 HO2 <=> H2O2 + O2 + const amrex::Real k_f = 420000000 * exp(-(6029.54208967215) * invT); + const amrex::Real qf = k_f * ((sc[6] * sc[6])); + const amrex::Real qr = + k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])) * (sc[1] * sc[7]); + const amrex::Real qdot = qf - qr; + wdot[1] += qdot; + wdot[6] -= 2.000000 * qdot; + wdot[7] += qdot; + } + + { + // reaction 14: 2 HO2 <=> H2O2 + O2 + const amrex::Real k_f = 130000 * exp(-(-819.89091359563) * invT); + const amrex::Real qf = k_f * ((sc[6] * sc[6])); + const amrex::Real qr = + k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])) * (sc[1] * sc[7]); + const amrex::Real qdot = qf - qr; + wdot[1] += qdot; + wdot[6] -= 2.000000 * qdot; + wdot[7] += qdot; + } + + { + // reaction 16: H + H2O2 <=> H2O + OH + const amrex::Real k_f = 24100000 * exp(-(1997.77016324474) * invT); + const amrex::Real qf = k_f * (sc[5] * sc[7]); + const amrex::Real qr = + k_f * exp(-(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7])) * (sc[3] * sc[4]); + const amrex::Real qdot = qf - qr; + wdot[3] += qdot; + wdot[4] += qdot; + wdot[5] -= qdot; + wdot[7] -= qdot; + } + + { + // reaction 17: H + H2O2 <=> H2 + HO2 + const amrex::Real k_f = 48200000 * exp(-(4000.57249314752) * invT); + const amrex::Real qf = k_f * (sc[5] * sc[7]); + const amrex::Real qr = + k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7])) * (sc[0] * sc[6]); + const amrex::Real qdot = qf - qr; + wdot[0] += qdot; + wdot[5] -= qdot; + wdot[6] += qdot; + wdot[7] -= qdot; + } + + { + // reaction 18: H2O2 + O <=> HO2 + OH + const amrex::Real k_f = 9.55 * exp((2) * logT - (1997.77016324474) * invT); + const amrex::Real qf = k_f * (sc[2] * sc[7]); + const amrex::Real qr = + k_f * exp(-(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7])) * (sc[3] * sc[6]); + const amrex::Real qdot = qf - qr; + wdot[2] -= qdot; + wdot[3] += qdot; + wdot[6] += qdot; + wdot[7] -= qdot; + } + + { + // reaction 19: H2O2 + OH <=> H2O + HO2 + const amrex::Real k_f = 1000000; + const amrex::Real qf = k_f * (sc[3] * sc[7]); + const amrex::Real qr = + k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])) * (sc[4] * sc[6]); + const amrex::Real qdot = qf - qr; + wdot[3] -= qdot; + wdot[4] += qdot; + wdot[6] += qdot; + wdot[7] -= qdot; + } + + { + // reaction 20: H2O2 + OH <=> H2O + HO2 + const amrex::Real k_f = 580000000 * exp(-(4809.24167509571) * invT); + const amrex::Real qf = k_f * (sc[3] * sc[7]); + const amrex::Real qr = + k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])) * (sc[4] * sc[6]); + const amrex::Real qdot = qf - qr; + wdot[3] -= qdot; + wdot[4] += qdot; + wdot[6] += qdot; + wdot[7] -= qdot; + } + + { + // reaction 22: CO + O2 <=> CO2 + O + const amrex::Real k_f = 2530000 * exp(-(24003.4349588851) * invT); + const amrex::Real qf = k_f * (sc[1] * sc[8]); + const amrex::Real qr = + k_f * exp(-(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9])) * (sc[2] * sc[9]); + const amrex::Real qdot = qf - qr; + wdot[1] -= qdot; + wdot[2] += qdot; + wdot[8] -= qdot; + wdot[9] += qdot; + } + + { + // reaction 23: CO + HO2 <=> CO2 + OH + const amrex::Real k_f = 30100000 * exp(-(11573.9833135086) * invT); + const amrex::Real qf = k_f * (sc[6] * sc[8]); + const amrex::Real qr = + k_f * exp(-(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9])) * (sc[3] * sc[9]); + const amrex::Real qdot = qf - qr; + wdot[3] += qdot; + wdot[6] -= qdot; + wdot[8] -= qdot; + wdot[9] += qdot; + } + + { + // reaction 24: CO + OH <=> CO2 + H + const amrex::Real k_f = + 0.2229 * exp((1.89) * logT - (-583.077150667929) * invT); + const amrex::Real qf = k_f * (sc[3] * sc[8]); + const amrex::Real qr = + k_f * exp(-(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9])) * (sc[5] * sc[9]); + const amrex::Real qdot = qf - qr; + wdot[3] -= qdot; + wdot[5] += qdot; + wdot[8] -= qdot; + wdot[9] += qdot; + } + + { + // reaction 26: HCO + O2 <=> CO + HO2 + const amrex::Real k_f = 7580000 * exp(-(206.318832979935) * invT); + const amrex::Real qf = k_f * (sc[1] * sc[10]); + const amrex::Real qr = + k_f * exp(-(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10])) * (sc[6] * sc[8]); + const amrex::Real qdot = qf - qr; + wdot[1] -= qdot; + wdot[6] += qdot; + wdot[8] += qdot; + wdot[10] -= qdot; + } + + { + // reaction 27: H + HCO <=> CO + H2 + const amrex::Real k_f = 72300000; + const amrex::Real qf = k_f * (sc[5] * sc[10]); + const amrex::Real qr = + k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10])) * (sc[0] * sc[8]); + const amrex::Real qdot = qf - qr; + wdot[0] += qdot; + wdot[5] -= qdot; + wdot[8] += qdot; + wdot[10] -= qdot; + } + + { + // reaction 28: HCO + O <=> CO2 + H + const amrex::Real k_f = 30000000; + const amrex::Real qf = k_f * (sc[2] * sc[10]); + const amrex::Real qr = + k_f * exp(-(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10])) * (sc[5] * sc[9]); + const amrex::Real qdot = qf - qr; + wdot[2] -= qdot; + wdot[5] += qdot; + wdot[9] += qdot; + wdot[10] -= qdot; + } +} + +// compute the production rate for each species +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKWC(const amrex::Real T, amrex::Real C[], amrex::Real wdot[]) +{ + + // convert to SI + for (int id = 0; id < 12; ++id) { + C[id] *= 1.0e6; + } + + // convert to chemkin units + productionRate(wdot, C, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + C[id] *= 1.0e-6; + wdot[id] *= 1.0e-6; + } +} + +// Returns the molar production rate of species +// Given P, T, and mass fractions +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKWYP( + const amrex::Real P, + const amrex::Real T, + const amrex::Real y[], + amrex::Real wdot[]) +{ + amrex::Real c[12]; // temporary storage + amrex::Real YOW = 0; + amrex::Real PWORT; + + // Compute inverse of mean molecular wt first + for (int i = 0; i < 12; i++) { + YOW += y[i] * imw(i); + } + // PW/RT (see Eq. 7) + PWORT = P / (YOW * 8.31446261815324e+07 * T); + // multiply by 1e6 so c goes to SI + PWORT *= 1e6; + // Now compute conversion (and go to SI) + for (int i = 0; i < 12; i++) { + c[i] = PWORT * y[i] * imw(i); + } + + // convert to chemkin units + productionRate(wdot, c, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + wdot[id] *= 1.0e-6; + } +} + +// Returns the molar production rate of species +// Given P, T, and mole fractions +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKWXP( + const amrex::Real P, + const amrex::Real T, + const amrex::Real x[], + amrex::Real wdot[]) +{ + amrex::Real c[12]; // temporary storage + amrex::Real PORT = + 1e6 * P / (8.31446261815324e+07 * T); // 1e6 * P/RT so c goes to SI units + + // Compute conversion, see Eq 10 + for (int id = 0; id < 12; ++id) { + c[id] = x[id] * PORT; + } + + // convert to chemkin units + productionRate(wdot, c, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + wdot[id] *= 1.0e-6; + } +} + +// Returns the molar production rate of species +// Given rho, T, and mass fractions +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKWYR( + const amrex::Real rho, + const amrex::Real T, + const amrex::Real y[], + amrex::Real wdot[]) +{ + amrex::Real c[12]; // temporary storage + + // See Eq 8 with an extra 1e6 so c goes to SI + for (int i = 0; i < 12; i++) { + c[i] = 1e6 * rho * y[i] * imw(i); + } + + // call productionRate + productionRate(wdot, c, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + wdot[id] *= 1.0e-6; + } +} + +// Returns the molar production rate of species +// Given rho, T, and mole fractions +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKWXR( + const amrex::Real rho, + const amrex::Real T, + const amrex::Real x[], + amrex::Real wdot[]) +{ + amrex::Real c[12]; // temporary storage + amrex::Real XW = 0; // See Eq 4, 11 in CK Manual + amrex::Real ROW; + // Compute mean molecular wt first + XW += x[0] * 2.016000; // H2 + XW += x[1] * 31.998000; // O2 + XW += x[2] * 15.999000; // O + XW += x[3] * 17.007000; // OH + XW += x[4] * 18.015000; // H2O + XW += x[5] * 1.008000; // H + XW += x[6] * 33.006000; // HO2 + XW += x[7] * 34.014000; // H2O2 + XW += x[8] * 28.010000; // CO + XW += x[9] * 44.009000; // CO2 + XW += x[10] * 29.018000; // HCO + XW += x[11] * 28.014000; // N2 + // Extra 1e6 factor to take c to SI + ROW = 1e6 * rho / XW; + + // Compute conversion, see Eq 11 + for (int id = 0; id < 12; ++id) { + c[id] = x[id] * ROW; + } + + // convert to chemkin units + productionRate(wdot, c, T); + + // convert to chemkin units + for (int id = 0; id < 12; ++id) { + wdot[id] *= 1.0e-6; + } +} + +// species unit charge number +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCHRG(int kcharge[]) +{ + kcharge[0] = 0; // H2 + kcharge[1] = 0; // O2 + kcharge[2] = 0; // O + kcharge[3] = 0; // OH + kcharge[4] = 0; // H2O + kcharge[5] = 0; // H + kcharge[6] = 0; // HO2 + kcharge[7] = 0; // H2O2 + kcharge[8] = 0; // CO + kcharge[9] = 0; // CO2 + kcharge[10] = 0; // HCO + kcharge[11] = 0; // N2 +} + +// species charge per unit mass +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +CKCHRGMASS(amrex::Real zk[]) +{ + + int kchrg[12]; + CKCHRG(kchrg); + + for (int id = 0; id < 12; ++id) { + zk[id] = 6.02214076e+23 * 1.60217663e-19 * kchrg[id] * imw(id); + } +} + +// compute an approx to the reaction Jacobian +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +aJacobian_precond( + amrex::Real* J, const amrex::Real* sc, const amrex::Real T, const int HP) +{ + +#if defined(PELE_COMPILE_AJACOBIAN) || !defined(AMREX_USE_HIP) + for (int i = 0; i < 169; i++) { + J[i] = 0.0; + } + + amrex::Real wdot[12]; + for (auto& val : wdot) { + val = 0.0; + } + + const amrex::Real invT = 1.0 / T; + const amrex::Real invT2 = invT * invT; + const amrex::Real logT = log(T); + + // reference concentration: P_atm / (RT) in inverse mol/m^3 + amrex::Real refC = 101325 / 8.31446 / T; + amrex::Real refCinv = 1.0 / refC; + + // compute the mixture concentration + amrex::Real mixture = 0.0; + for (int k = 0; k < 12; ++k) { + mixture += sc[k]; + } + + // compute the Gibbs free energy + amrex::Real g_RT[12]; + gibbs(g_RT, T); + + // compute the species enthalpy + amrex::Real h_RT[12]; + speciesEnthalpy(h_RT, T); + + amrex::Real phi_f, k_f, k_r, phi_r, Kc, q, q_nocor, Corr, alpha; + amrex::Real dlnkfdT, dlnk0dT, dlnKcdT, dkrdT, dqdT; + amrex::Real dqdci, dcdc_fac, dqdc[12]; + amrex::Real Pr, fPr, F, k_0, logPr; + amrex::Real logFcent, troe_c, troe_n, troePr_den, troePr, troe; + amrex::Real Fcent1, Fcent2, Fcent3, Fcent; + amrex::Real dlogFdc, dlogFdn, dlogFdcn_fac; + amrex::Real dlogPrdT, dlogfPrdT, dlogFdT, dlogFcentdT, dlogFdlogPr, dlnCorrdT; + const amrex::Real ln10 = log(10.0); + const amrex::Real log10e = 1.0 / log(10.0); + // reaction 8: H + O2 (+M) <=> HO2 (+M) + // a third-body and pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + sc[0] + (0.78 - 1) * sc[1] + (11 - 1) * sc[4] + + (1.9 - 1) * sc[8] + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[1] * sc[5]; + k_f = 1475000 * exp(0.6 * logT); + dlnkfdT = 0.6 * invT; + // pressure-fall-off + k_0 = 6.366e+20 * exp(-1.72 * logT - (264.088106214317) * invT); + Pr = 1e-12 * alpha / k_f * k_0; + fPr = Pr / (1.0 + Pr); + dlnk0dT = -1.72 * invT + (264.088106214317) * invT2; + dlogPrdT = log10e * (dlnk0dT - dlnkfdT); + dlogfPrdT = dlogPrdT / (1.0 + Pr); + // Troe form + logPr = log10(Pr); + Fcent1 = (1. - 0.8) * exp(-T / 1e-30); + Fcent2 = 0.8 * exp(-T / 1e+30); + Fcent3 = 0.; + Fcent = Fcent1 + Fcent2 + Fcent3; + logFcent = log10(Fcent); + troe_c = -.4 - .67 * logFcent; + troe_n = .75 - 1.27 * logFcent; + troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); + troePr = (troe_c + logPr) * troePr_den; + troe = 1.0 / (1.0 + troePr * troePr); + F = exp(M_LN10 * logFcent * troe); + dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); + dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; + dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; + dlogFdn = dlogFdcn_fac * troePr; + dlogFdlogPr = dlogFdc; + dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + + dlogFdlogPr * dlogPrdT; + // reverse + phi_r = sc[6]; + Kc = refCinv * exp(g_RT[1] + g_RT[5] - g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[6]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + Corr = fPr * F; + q = Corr * q_nocor; + dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); + dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; + // update wdot + wdot[1] -= q; // O2 + wdot[5] -= q; // H + wdot[6] += q; // HO2 + // for convenience + k_f *= Corr; + k_r *= Corr; + dcdc_fac = 0.0; + dqdc[0] = 2 * dcdc_fac; + dqdc[1] = 0.78 * dcdc_fac + k_f * sc[5]; + dqdc[2] = dcdc_fac; + dqdc[3] = dcdc_fac; + dqdc[4] = 11 * dcdc_fac; + dqdc[5] = dcdc_fac + k_f * sc[1]; + dqdc[6] = dcdc_fac - k_r; + dqdc[7] = dcdc_fac; + dqdc[8] = 1.9 * dcdc_fac; + dqdc[9] = 3.8 * dcdc_fac; + dqdc[10] = dcdc_fac; + dqdc[11] = dcdc_fac; + for (int k = 0; k < 12; k++) { + J[13 * k + 1] -= dqdc[k]; + J[13 * k + 5] -= dqdc[k]; + J[13 * k + 6] += dqdc[k]; + } + J[157] -= dqdT; // dwdot[O2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] += dqdT; // dwdot[HO2]/dT + + // reaction 15: H2O2 (+M) <=> 2 OH (+M) + // a third-body and pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[7]; + k_f = 295100000000000 * exp(-(24370.7831249226) * invT); + dlnkfdT = (24370.7831249226) * invT2; + // pressure-fall-off + k_0 = 1.202e+17 * exp(-(22896.3582941147) * invT); + Pr = 1e-6 * alpha / k_f * k_0; + fPr = Pr / (1.0 + Pr); + dlnk0dT = (22896.3582941147) * invT2; + dlogPrdT = log10e * (dlnk0dT - dlnkfdT); + dlogfPrdT = dlogPrdT / (1.0 + Pr); + // Troe form + logPr = log10(Pr); + Fcent1 = (1. - 0.5) * exp(-T / 1e-30); + Fcent2 = 0.5 * exp(-T / 1e+30); + Fcent3 = 0.; + Fcent = Fcent1 + Fcent2 + Fcent3; + logFcent = log10(Fcent); + troe_c = -.4 - .67 * logFcent; + troe_n = .75 - 1.27 * logFcent; + troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); + troePr = (troe_c + logPr) * troePr_den; + troe = 1.0 / (1.0 + troePr * troePr); + F = exp(M_LN10 * logFcent * troe); + dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); + dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; + dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; + dlogFdn = dlogFdcn_fac * troePr; + dlogFdlogPr = dlogFdc; + dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + + dlogFdlogPr * dlogPrdT; + // reverse + phi_r = (sc[3] * sc[3]); + Kc = refC * exp(-2.000000 * g_RT[3] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[7]) + (2.000000 * h_RT[3]) - 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + Corr = fPr * F; + q = Corr * q_nocor; + dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); + dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; + // update wdot + wdot[3] += 2 * q; // OH + wdot[7] -= q; // H2O2 + // for convenience + k_f *= Corr; + k_r *= Corr; + dcdc_fac = 0.0; + dqdc[0] = 2.5 * dcdc_fac; + dqdc[1] = dcdc_fac; + dqdc[2] = dcdc_fac; + dqdc[3] = dcdc_fac - k_r * 2.000000 * sc[3]; + dqdc[4] = 12 * dcdc_fac; + dqdc[5] = dcdc_fac; + dqdc[6] = dcdc_fac; + dqdc[7] = dcdc_fac + k_f; + dqdc[8] = 1.9 * dcdc_fac; + dqdc[9] = 3.8 * dcdc_fac; + dqdc[10] = dcdc_fac; + dqdc[11] = dcdc_fac; + for (int k = 0; k < 12; k++) { + J[13 * k + 3] += 2 * dqdc[k]; + J[13 * k + 7] -= dqdc[k]; + } + J[159] += 2 * dqdT; // dwdot[OH]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 21: CO + O (+M) <=> CO2 (+M) + // a third-body and pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[2] * sc[8]; + k_f = 18000 * exp(-(1199.66853127845) * invT); + dlnkfdT = (1199.66853127845) * invT2; + // pressure-fall-off + k_0 = 1.55e+24 * exp(-2.79 * logT - (2108.98104638758) * invT); + Pr = 1e-12 * alpha / k_f * k_0; + fPr = Pr / (1.0 + Pr); + dlnk0dT = -2.79 * invT + (2108.98104638758) * invT2; + dlogPrdT = log10e * (dlnk0dT - dlnkfdT); + dlogfPrdT = dlogPrdT / (1.0 + Pr); + // Lindemann form + F = 1.0; + // dlogFdlogPr is 0.0 and unused + dlogFdT = 0.0; + // reverse + phi_r = sc[9]; + Kc = refCinv * exp(g_RT[2] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[8]) + (h_RT[9]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + Corr = fPr * F; + q = Corr * q_nocor; + dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); + dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; + // update wdot + wdot[2] -= q; // O + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // for convenience + k_f *= Corr; + k_r *= Corr; + dcdc_fac = 0.0; + dqdc[0] = 2.5 * dcdc_fac; + dqdc[1] = dcdc_fac; + dqdc[2] = dcdc_fac + k_f * sc[8]; + dqdc[3] = dcdc_fac; + dqdc[4] = 12 * dcdc_fac; + dqdc[5] = dcdc_fac; + dqdc[6] = dcdc_fac; + dqdc[7] = dcdc_fac; + dqdc[8] = 1.9 * dcdc_fac + k_f * sc[2]; + dqdc[9] = 3.8 * dcdc_fac - k_r; + dqdc[10] = dcdc_fac; + dqdc[11] = dcdc_fac; + for (int k = 0; k < 12; k++) { + J[13 * k + 2] -= dqdc[k]; + J[13 * k + 8] -= dqdc[k]; + J[13 * k + 9] += dqdc[k]; + } + J[158] -= dqdT; // dwdot[O]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 4: H2 + M <=> 2 H + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[0]; + k_f = 45770000000000 * exp(-1.4 * logT - (52525.7555766966) * invT); + dlnkfdT = -1.4 * invT + (52525.7555766966) * invT2; + // reverse + phi_r = (sc[5] * sc[5]); + Kc = refC * exp(g_RT[0] - 2.000000 * g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[0]) + (2.000000 * h_RT[5]) - 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] -= q; // H2 + wdot[5] += 2 * q; // H + // for convenience + k_f *= alpha; + k_r *= alpha; + dqdc[0] = 2.5 * q_nocor + k_f; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor; + dqdc[3] = q_nocor; + dqdc[4] = 12 * q_nocor; + dqdc[5] = q_nocor - k_r * 2.000000 * sc[5]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 0] -= dqdc[k]; + J[13 * k + 5] += 2 * dqdc[k]; + } + J[156] -= dqdT; // dwdot[H2]/dT + J[161] += 2 * dqdT; // dwdot[H]/dT + + // reaction 5: 2 O + M <=> O2 + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = (sc[2] * sc[2]); + k_f = 6165 * exp(-0.5 * logT); + dlnkfdT = -0.5 * invT; + // reverse + phi_r = sc[1]; + Kc = refCinv * exp(-g_RT[1] + 2.000000 * g_RT[2]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(2.000000 * h_RT[2]) + (h_RT[1]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[2] -= 2 * q; // O + // for convenience + k_f *= alpha; + k_r *= alpha; + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor - k_r; + dqdc[2] = q_nocor + k_f * 2.000000 * sc[2]; + dqdc[3] = q_nocor; + dqdc[4] = 12 * q_nocor; + dqdc[5] = q_nocor; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 1] += dqdc[k]; + J[13 * k + 2] += -2 * dqdc[k]; + } + J[157] += dqdT; // dwdot[O2]/dT + J[158] += -2 * dqdT; // dwdot[O]/dT + + // reaction 6: H + O + M <=> OH + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[2] * sc[5]; + k_f = 4714000 * exp(-1 * logT); + dlnkfdT = -1 * invT; + // reverse + phi_r = sc[3]; + Kc = refCinv * exp(g_RT[2] - g_RT[3] + g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[5]) + (h_RT[3]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[5] -= q; // H + // for convenience + k_f *= alpha; + k_r *= alpha; + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor + k_f * sc[5]; + dqdc[3] = q_nocor - k_r; + dqdc[4] = 12 * q_nocor; + dqdc[5] = q_nocor + k_f * sc[2]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 2] -= dqdc[k]; + J[13 * k + 3] += dqdc[k]; + J[13 * k + 5] -= dqdc[k]; + } + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[161] -= dqdT; // dwdot[H]/dT + + // reaction 7: H + OH + M <=> H2O + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[3] * sc[5]; + k_f = 38000000000 * exp(-2 * logT); + dlnkfdT = -2 * invT; + // reverse + phi_r = sc[4]; + Kc = refCinv * exp(g_RT[3] - g_RT[4] + g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[5]) + (h_RT[4]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[5] -= q; // H + // for convenience + k_f *= alpha; + k_r *= alpha; + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor; + dqdc[3] = q_nocor + k_f * sc[5]; + dqdc[4] = 12 * q_nocor - k_r; + dqdc[5] = q_nocor + k_f * sc[3]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 3] -= dqdc[k]; + J[13 * k + 4] += dqdc[k]; + J[13 * k + 5] -= dqdc[k]; + } + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[161] -= dqdT; // dwdot[H]/dT + + // reaction 25: HCO + M <=> CO + H + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (6 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[10]; + k_f = 474850 * exp(0.659 * logT - (7484.8446871794) * invT); + dlnkfdT = 0.659 * invT + (7484.8446871794) * invT2; + // reverse + phi_r = sc[5] * sc[8]; + Kc = refC * exp(-g_RT[5] - g_RT[8] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[10]) + (h_RT[5] + h_RT[8]) - 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[5] += q; // H + wdot[8] += q; // CO + wdot[10] -= q; // HCO + // for convenience + k_f *= alpha; + k_r *= alpha; + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor; + dqdc[3] = q_nocor; + dqdc[4] = 6 * q_nocor; + dqdc[5] = q_nocor - k_r * sc[8]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor - k_r * sc[5]; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor + k_f; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 5] += dqdc[k]; + J[13 * k + 8] += dqdc[k]; + J[13 * k + 10] -= dqdc[k]; + } + J[161] += dqdT; // dwdot[H]/dT + J[164] += dqdT; // dwdot[CO]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + // reaction 0: H + O2 <=> O + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[1] * sc[5]; + k_f = 3547000000 * exp(-0.406 * logT - (8352.89343569254) * invT); + dlnkfdT = -0.406 * invT + (8352.89343569254) * invT2; + // reverse + phi_r = sc[2] * sc[3]; + Kc = exp(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[2] + h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] -= q; // O2 + wdot[2] += q; // O + wdot[3] += q; // OH + wdot[5] -= q; // H + // d()/d[O2] + dqdci = +k_f * sc[5]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[15] += dqdci; // dwdot[O]/d[O2] + J[16] += dqdci; // dwdot[OH]/d[O2] + J[18] -= dqdci; // dwdot[H]/d[O2] + // d()/d[O] + dqdci = -k_r * sc[3]; + J[27] -= dqdci; // dwdot[O2]/d[O] + J[28] += dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[31] -= dqdci; // dwdot[H]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[2]; + J[40] -= dqdci; // dwdot[O2]/d[OH] + J[41] += dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + // d()/d[H] + dqdci = +k_f * sc[1]; + J[66] -= dqdci; // dwdot[O2]/d[H] + J[67] += dqdci; // dwdot[O]/d[H] + J[68] += dqdci; // dwdot[OH]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + // d()/dT + J[157] -= dqdT; // dwdot[O2]/dT + J[158] += dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[161] -= dqdT; // dwdot[H]/dT + + // reaction 1: H2 + O <=> H + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[0] * sc[2]; + k_f = 0.0508 * exp(2.67 * logT - (3165.23282791169) * invT); + dlnkfdT = 2.67 * invT + (3165.23282791169) * invT2; + // reverse + phi_r = sc[3] * sc[5]; + Kc = exp(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[0] + h_RT[2]) + (h_RT[3] + h_RT[5])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] -= q; // H2 + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[5] += q; // H + // d()/d[H2] + dqdci = +k_f * sc[2]; + J[0] -= dqdci; // dwdot[H2]/d[H2] + J[2] -= dqdci; // dwdot[O]/d[H2] + J[3] += dqdci; // dwdot[OH]/d[H2] + J[5] += dqdci; // dwdot[H]/d[H2] + // d()/d[O] + dqdci = +k_f * sc[0]; + J[26] -= dqdci; // dwdot[H2]/d[O] + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[31] += dqdci; // dwdot[H]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[5]; + J[39] -= dqdci; // dwdot[H2]/d[OH] + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[44] += dqdci; // dwdot[H]/d[OH] + // d()/d[H] + dqdci = -k_r * sc[3]; + J[65] -= dqdci; // dwdot[H2]/d[H] + J[67] -= dqdci; // dwdot[O]/d[H] + J[68] += dqdci; // dwdot[OH]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + // d()/dT + J[156] -= dqdT; // dwdot[H2]/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[161] += dqdT; // dwdot[H]/dT + + // reaction 2: H2 + OH <=> H + H2O + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[0] * sc[3]; + k_f = 216 * exp(1.51 * logT - (1726.03316371019) * invT); + dlnkfdT = 1.51 * invT + (1726.03316371019) * invT2; + // reverse + phi_r = sc[4] * sc[5]; + Kc = exp(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[0] + h_RT[3]) + (h_RT[4] + h_RT[5])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] -= q; // H2 + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[5] += q; // H + // d()/d[H2] + dqdci = +k_f * sc[3]; + J[0] -= dqdci; // dwdot[H2]/d[H2] + J[3] -= dqdci; // dwdot[OH]/d[H2] + J[4] += dqdci; // dwdot[H2O]/d[H2] + J[5] += dqdci; // dwdot[H]/d[H2] + // d()/d[OH] + dqdci = +k_f * sc[0]; + J[39] -= dqdci; // dwdot[H2]/d[OH] + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[44] += dqdci; // dwdot[H]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[5]; + J[52] -= dqdci; // dwdot[H2]/d[H2O] + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[57] += dqdci; // dwdot[H]/d[H2O] + // d()/d[H] + dqdci = -k_r * sc[4]; + J[65] -= dqdci; // dwdot[H2]/d[H] + J[68] -= dqdci; // dwdot[OH]/d[H] + J[69] += dqdci; // dwdot[H2O]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + // d()/dT + J[156] -= dqdT; // dwdot[H2]/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[161] += dqdT; // dwdot[H]/dT + + // reaction 3: H2O + O <=> 2 OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[4]; + k_f = 2.97 * exp(2.02 * logT - (6743.10332178324) * invT); + dlnkfdT = 2.02 * invT + (6743.10332178324) * invT2; + // reverse + phi_r = (sc[3] * sc[3]); + Kc = exp(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[4]) + (2.000000 * h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[3] += 2 * q; // OH + wdot[4] -= q; // H2O + // d()/d[O] + dqdci = +k_f * sc[4]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += 2 * dqdci; // dwdot[OH]/d[O] + J[30] -= dqdci; // dwdot[H2O]/d[O] + // d()/d[OH] + dqdci = -k_r * 2.000000 * sc[3]; + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += 2 * dqdci; // dwdot[OH]/d[OH] + J[43] -= dqdci; // dwdot[H2O]/d[OH] + // d()/d[H2O] + dqdci = +k_f * sc[2]; + J[54] -= dqdci; // dwdot[O]/d[H2O] + J[55] += 2 * dqdci; // dwdot[OH]/d[H2O] + J[56] -= dqdci; // dwdot[H2O]/d[H2O] + // d()/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += 2 * dqdT; // dwdot[OH]/dT + J[160] -= dqdT; // dwdot[H2O]/dT + + // reaction 9: H + HO2 <=> H2 + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[6]; + k_f = 16600000 * exp(-(414.147315957284) * invT); + dlnkfdT = (414.147315957284) * invT2; + // reverse + phi_r = sc[0] * sc[1]; + Kc = exp(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (h_RT[0] + h_RT[1])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] += q; // H2 + wdot[1] += q; // O2 + wdot[5] -= q; // H + wdot[6] -= q; // HO2 + // d()/d[H2] + dqdci = -k_r * sc[1]; + J[0] += dqdci; // dwdot[H2]/d[H2] + J[1] += dqdci; // dwdot[O2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[6] -= dqdci; // dwdot[HO2]/d[H2] + // d()/d[O2] + dqdci = -k_r * sc[0]; + J[13] += dqdci; // dwdot[H2]/d[O2] + J[14] += dqdci; // dwdot[O2]/d[O2] + J[18] -= dqdci; // dwdot[H]/d[O2] + J[19] -= dqdci; // dwdot[HO2]/d[O2] + // d()/d[H] + dqdci = +k_f * sc[6]; + J[65] += dqdci; // dwdot[H2]/d[H] + J[66] += dqdci; // dwdot[O2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] -= dqdci; // dwdot[HO2]/d[H] + // d()/d[HO2] + dqdci = +k_f * sc[5]; + J[78] += dqdci; // dwdot[H2]/d[HO2] + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[156] += dqdT; // dwdot[H2]/dT + J[157] += dqdT; // dwdot[O2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 10: H + HO2 <=> 2 OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[6]; + k_f = 70790000 * exp(-(148.448916412392) * invT); + dlnkfdT = (148.448916412392) * invT2; + // reverse + phi_r = (sc[3] * sc[3]); + Kc = exp(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (2.000000 * h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] += 2 * q; // OH + wdot[5] -= q; // H + wdot[6] -= q; // HO2 + // d()/d[OH] + dqdci = -k_r * 2.000000 * sc[3]; + J[42] += 2 * dqdci; // dwdot[OH]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + // d()/d[H] + dqdci = +k_f * sc[6]; + J[68] += 2 * dqdci; // dwdot[OH]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] -= dqdci; // dwdot[HO2]/d[H] + // d()/d[HO2] + dqdci = +k_f * sc[5]; + J[81] += 2 * dqdci; // dwdot[OH]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[159] += 2 * dqdT; // dwdot[OH]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 11: HO2 + O <=> O2 + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[6]; + k_f = 32500000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[1] * sc[3]; + Kc = exp(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[6]) + (h_RT[1] + h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[6] -= q; // HO2 + // d()/d[O2] + dqdci = -k_r * sc[3]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[15] -= dqdci; // dwdot[O]/d[O2] + J[16] += dqdci; // dwdot[OH]/d[O2] + J[19] -= dqdci; // dwdot[HO2]/d[O2] + // d()/d[O] + dqdci = +k_f * sc[6]; + J[27] += dqdci; // dwdot[O2]/d[O] + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[32] -= dqdci; // dwdot[HO2]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[1]; + J[40] += dqdci; // dwdot[O2]/d[OH] + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + // d()/d[HO2] + dqdci = +k_f * sc[2]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[80] -= dqdci; // dwdot[O]/d[HO2] + J[81] += dqdci; // dwdot[OH]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 12: HO2 + OH <=> H2O + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[6]; + k_f = 28900000 * exp(-(-250.098682904946) * invT); + dlnkfdT = (-250.098682904946) * invT2; + // reverse + phi_r = sc[1] * sc[4]; + Kc = exp(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[6]) + (h_RT[1] + h_RT[4])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[6] -= q; // HO2 + // d()/d[O2] + dqdci = -k_r * sc[4]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[16] -= dqdci; // dwdot[OH]/d[O2] + J[17] += dqdci; // dwdot[H2O]/d[O2] + J[19] -= dqdci; // dwdot[HO2]/d[O2] + // d()/d[OH] + dqdci = +k_f * sc[6]; + J[40] += dqdci; // dwdot[O2]/d[OH] + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[1]; + J[53] += dqdci; // dwdot[O2]/d[H2O] + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[58] -= dqdci; // dwdot[HO2]/d[H2O] + // d()/d[HO2] + dqdci = +k_f * sc[3]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[81] -= dqdci; // dwdot[OH]/d[HO2] + J[82] += dqdci; // dwdot[H2O]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 13: 2 HO2 <=> H2O2 + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = (sc[6] * sc[6]); + k_f = 420000000 * exp(-(6029.54208967215) * invT); + dlnkfdT = (6029.54208967215) * invT2; + // reverse + phi_r = sc[1] * sc[7]; + Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[6] -= 2 * q; // HO2 + wdot[7] += q; // H2O2 + // d()/d[O2] + dqdci = -k_r * sc[7]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] + J[20] += dqdci; // dwdot[H2O2]/d[O2] + // d()/d[HO2] + dqdci = +k_f * 2.000000 * sc[6]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] + J[85] += dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = -k_r * sc[1]; + J[92] += dqdci; // dwdot[O2]/d[H2O2] + J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] + J[98] += dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[162] += -2 * dqdT; // dwdot[HO2]/dT + J[163] += dqdT; // dwdot[H2O2]/dT + + // reaction 14: 2 HO2 <=> H2O2 + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = (sc[6] * sc[6]); + k_f = 130000 * exp(-(-819.89091359563) * invT); + dlnkfdT = (-819.89091359563) * invT2; + // reverse + phi_r = sc[1] * sc[7]; + Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[6] -= 2 * q; // HO2 + wdot[7] += q; // H2O2 + // d()/d[O2] + dqdci = -k_r * sc[7]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] + J[20] += dqdci; // dwdot[H2O2]/d[O2] + // d()/d[HO2] + dqdci = +k_f * 2.000000 * sc[6]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] + J[85] += dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = -k_r * sc[1]; + J[92] += dqdci; // dwdot[O2]/d[H2O2] + J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] + J[98] += dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[162] += -2 * dqdT; // dwdot[HO2]/dT + J[163] += dqdT; // dwdot[H2O2]/dT + + // reaction 16: H + H2O2 <=> H2O + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[7]; + k_f = 24100000 * exp(-(1997.77016324474) * invT); + dlnkfdT = (1997.77016324474) * invT2; + // reverse + phi_r = sc[3] * sc[4]; + Kc = exp(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[3] + h_RT[4])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] += q; // OH + wdot[4] += q; // H2O + wdot[5] -= q; // H + wdot[7] -= q; // H2O2 + // d()/d[OH] + dqdci = -k_r * sc[4]; + J[42] += dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[3]; + J[55] += dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[57] -= dqdci; // dwdot[H]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[H] + dqdci = +k_f * sc[7]; + J[68] += dqdci; // dwdot[OH]/d[H] + J[69] += dqdci; // dwdot[H2O]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[72] -= dqdci; // dwdot[H2O2]/d[H] + // d()/d[H2O2] + dqdci = +k_f * sc[5]; + J[94] += dqdci; // dwdot[OH]/d[H2O2] + J[95] += dqdci; // dwdot[H2O]/d[H2O2] + J[96] -= dqdci; // dwdot[H]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[159] += dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 17: H + H2O2 <=> H2 + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[7]; + k_f = 48200000 * exp(-(4000.57249314752) * invT); + dlnkfdT = (4000.57249314752) * invT2; + // reverse + phi_r = sc[0] * sc[6]; + Kc = exp(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[0] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] += q; // H2 + wdot[5] -= q; // H + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[H2] + dqdci = -k_r * sc[6]; + J[0] += dqdci; // dwdot[H2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[6] += dqdci; // dwdot[HO2]/d[H2] + J[7] -= dqdci; // dwdot[H2O2]/d[H2] + // d()/d[H] + dqdci = +k_f * sc[7]; + J[65] += dqdci; // dwdot[H2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] += dqdci; // dwdot[HO2]/d[H] + J[72] -= dqdci; // dwdot[H2O2]/d[H] + // d()/d[HO2] + dqdci = -k_r * sc[0]; + J[78] += dqdci; // dwdot[H2]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[5]; + J[91] += dqdci; // dwdot[H2]/d[H2O2] + J[96] -= dqdci; // dwdot[H]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[156] += dqdT; // dwdot[H2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 18: H2O2 + O <=> HO2 + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[7]; + k_f = 9.55 * exp(2 * logT - (1997.77016324474) * invT); + dlnkfdT = 2 * invT + (1997.77016324474) * invT2; + // reverse + phi_r = sc[3] * sc[6]; + Kc = exp(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[7]) + (h_RT[3] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[O] + dqdci = +k_f * sc[7]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[32] += dqdci; // dwdot[HO2]/d[O] + J[33] -= dqdci; // dwdot[H2O2]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[6]; + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[45] += dqdci; // dwdot[HO2]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[HO2] + dqdci = -k_r * sc[3]; + J[80] -= dqdci; // dwdot[O]/d[HO2] + J[81] += dqdci; // dwdot[OH]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[2]; + J[93] -= dqdci; // dwdot[O]/d[H2O2] + J[94] += dqdci; // dwdot[OH]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 19: H2O2 + OH <=> H2O + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[7]; + k_f = 1000000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[4] * sc[6]; + Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[OH] + dqdci = +k_f * sc[7]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[45] += dqdci; // dwdot[HO2]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[6]; + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[58] += dqdci; // dwdot[HO2]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[HO2] + dqdci = -k_r * sc[4]; + J[81] -= dqdci; // dwdot[OH]/d[HO2] + J[82] += dqdci; // dwdot[H2O]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[3]; + J[94] -= dqdci; // dwdot[OH]/d[H2O2] + J[95] += dqdci; // dwdot[H2O]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 20: H2O2 + OH <=> H2O + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[7]; + k_f = 580000000 * exp(-(4809.24167509571) * invT); + dlnkfdT = (4809.24167509571) * invT2; + // reverse + phi_r = sc[4] * sc[6]; + Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[OH] + dqdci = +k_f * sc[7]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[45] += dqdci; // dwdot[HO2]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[6]; + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[58] += dqdci; // dwdot[HO2]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[HO2] + dqdci = -k_r * sc[4]; + J[81] -= dqdci; // dwdot[OH]/d[HO2] + J[82] += dqdci; // dwdot[H2O]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[3]; + J[94] -= dqdci; // dwdot[OH]/d[H2O2] + J[95] += dqdci; // dwdot[H2O]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 22: CO + O2 <=> CO2 + O + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[1] * sc[8]; + k_f = 2530000 * exp(-(24003.4349588851) * invT); + dlnkfdT = (24003.4349588851) * invT2; + // reverse + phi_r = sc[2] * sc[9]; + Kc = exp(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[8]) + (h_RT[2] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] -= q; // O2 + wdot[2] += q; // O + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // d()/d[O2] + dqdci = +k_f * sc[8]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[15] += dqdci; // dwdot[O]/d[O2] + J[21] -= dqdci; // dwdot[CO]/d[O2] + J[22] += dqdci; // dwdot[CO2]/d[O2] + // d()/d[O] + dqdci = -k_r * sc[9]; + J[27] -= dqdci; // dwdot[O2]/d[O] + J[28] += dqdci; // dwdot[O]/d[O] + J[34] -= dqdci; // dwdot[CO]/d[O] + J[35] += dqdci; // dwdot[CO2]/d[O] + // d()/d[CO] + dqdci = +k_f * sc[1]; + J[105] -= dqdci; // dwdot[O2]/d[CO] + J[106] += dqdci; // dwdot[O]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = -k_r * sc[2]; + J[118] -= dqdci; // dwdot[O2]/d[CO2] + J[119] += dqdci; // dwdot[O]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + // d()/dT + J[157] -= dqdT; // dwdot[O2]/dT + J[158] += dqdT; // dwdot[O]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 23: CO + HO2 <=> CO2 + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[6] * sc[8]; + k_f = 30100000 * exp(-(11573.9833135086) * invT); + dlnkfdT = (11573.9833135086) * invT2; + // reverse + phi_r = sc[3] * sc[9]; + Kc = exp(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[6] + h_RT[8]) + (h_RT[3] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] += q; // OH + wdot[6] -= q; // HO2 + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // d()/d[OH] + dqdci = -k_r * sc[9]; + J[42] += dqdci; // dwdot[OH]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + J[47] -= dqdci; // dwdot[CO]/d[OH] + J[48] += dqdci; // dwdot[CO2]/d[OH] + // d()/d[HO2] + dqdci = +k_f * sc[8]; + J[81] += dqdci; // dwdot[OH]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + J[86] -= dqdci; // dwdot[CO]/d[HO2] + J[87] += dqdci; // dwdot[CO2]/d[HO2] + // d()/d[CO] + dqdci = +k_f * sc[6]; + J[107] += dqdci; // dwdot[OH]/d[CO] + J[110] -= dqdci; // dwdot[HO2]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = -k_r * sc[3]; + J[120] += dqdci; // dwdot[OH]/d[CO2] + J[123] -= dqdci; // dwdot[HO2]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + // d()/dT + J[159] += dqdT; // dwdot[OH]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 24: CO + OH <=> CO2 + H + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[8]; + k_f = 0.2229 * exp(1.89 * logT - (-583.077150667929) * invT); + dlnkfdT = 1.89 * invT + (-583.077150667929) * invT2; + // reverse + phi_r = sc[5] * sc[9]; + Kc = exp(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[8]) + (h_RT[5] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[5] += q; // H + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // d()/d[OH] + dqdci = +k_f * sc[8]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[44] += dqdci; // dwdot[H]/d[OH] + J[47] -= dqdci; // dwdot[CO]/d[OH] + J[48] += dqdci; // dwdot[CO2]/d[OH] + // d()/d[H] + dqdci = -k_r * sc[9]; + J[68] -= dqdci; // dwdot[OH]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + J[73] -= dqdci; // dwdot[CO]/d[H] + J[74] += dqdci; // dwdot[CO2]/d[H] + // d()/d[CO] + dqdci = +k_f * sc[3]; + J[107] -= dqdci; // dwdot[OH]/d[CO] + J[109] += dqdci; // dwdot[H]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = -k_r * sc[5]; + J[120] -= dqdci; // dwdot[OH]/d[CO2] + J[122] += dqdci; // dwdot[H]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + // d()/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[161] += dqdT; // dwdot[H]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 26: HCO + O2 <=> CO + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[1] * sc[10]; + k_f = 7580000 * exp(-(206.318832979935) * invT); + dlnkfdT = (206.318832979935) * invT2; + // reverse + phi_r = sc[6] * sc[8]; + Kc = exp(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[10]) + (h_RT[6] + h_RT[8])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] -= q; // O2 + wdot[6] += q; // HO2 + wdot[8] += q; // CO + wdot[10] -= q; // HCO + // d()/d[O2] + dqdci = +k_f * sc[10]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[19] += dqdci; // dwdot[HO2]/d[O2] + J[21] += dqdci; // dwdot[CO]/d[O2] + J[23] -= dqdci; // dwdot[HCO]/d[O2] + // d()/d[HO2] + dqdci = -k_r * sc[8]; + J[79] -= dqdci; // dwdot[O2]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[86] += dqdci; // dwdot[CO]/d[HO2] + J[88] -= dqdci; // dwdot[HCO]/d[HO2] + // d()/d[CO] + dqdci = -k_r * sc[6]; + J[105] -= dqdci; // dwdot[O2]/d[CO] + J[110] += dqdci; // dwdot[HO2]/d[CO] + J[112] += dqdci; // dwdot[CO]/d[CO] + J[114] -= dqdci; // dwdot[HCO]/d[CO] + // d()/d[HCO] + dqdci = +k_f * sc[1]; + J[131] -= dqdci; // dwdot[O2]/d[HCO] + J[136] += dqdci; // dwdot[HO2]/d[HCO] + J[138] += dqdci; // dwdot[CO]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + // d()/dT + J[157] -= dqdT; // dwdot[O2]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[164] += dqdT; // dwdot[CO]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + // reaction 27: H + HCO <=> CO + H2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[10]; + k_f = 72300000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[0] * sc[8]; + Kc = exp(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[10]) + (h_RT[0] + h_RT[8])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] += q; // H2 + wdot[5] -= q; // H + wdot[8] += q; // CO + wdot[10] -= q; // HCO + // d()/d[H2] + dqdci = -k_r * sc[8]; + J[0] += dqdci; // dwdot[H2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[8] += dqdci; // dwdot[CO]/d[H2] + J[10] -= dqdci; // dwdot[HCO]/d[H2] + // d()/d[H] + dqdci = +k_f * sc[10]; + J[65] += dqdci; // dwdot[H2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[73] += dqdci; // dwdot[CO]/d[H] + J[75] -= dqdci; // dwdot[HCO]/d[H] + // d()/d[CO] + dqdci = -k_r * sc[0]; + J[104] += dqdci; // dwdot[H2]/d[CO] + J[109] -= dqdci; // dwdot[H]/d[CO] + J[112] += dqdci; // dwdot[CO]/d[CO] + J[114] -= dqdci; // dwdot[HCO]/d[CO] + // d()/d[HCO] + dqdci = +k_f * sc[5]; + J[130] += dqdci; // dwdot[H2]/d[HCO] + J[135] -= dqdci; // dwdot[H]/d[HCO] + J[138] += dqdci; // dwdot[CO]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + // d()/dT + J[156] += dqdT; // dwdot[H2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[164] += dqdT; // dwdot[CO]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + // reaction 28: HCO + O <=> CO2 + H + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[10]; + k_f = 30000000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[5] * sc[9]; + Kc = exp(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[10]) + (h_RT[5] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[5] += q; // H + wdot[9] += q; // CO2 + wdot[10] -= q; // HCO + // d()/d[O] + dqdci = +k_f * sc[10]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[31] += dqdci; // dwdot[H]/d[O] + J[35] += dqdci; // dwdot[CO2]/d[O] + J[36] -= dqdci; // dwdot[HCO]/d[O] + // d()/d[H] + dqdci = -k_r * sc[9]; + J[67] -= dqdci; // dwdot[O]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + J[74] += dqdci; // dwdot[CO2]/d[H] + J[75] -= dqdci; // dwdot[HCO]/d[H] + // d()/d[CO2] + dqdci = -k_r * sc[5]; + J[119] -= dqdci; // dwdot[O]/d[CO2] + J[122] += dqdci; // dwdot[H]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + J[127] -= dqdci; // dwdot[HCO]/d[CO2] + // d()/d[HCO] + dqdci = +k_f * sc[2]; + J[132] -= dqdci; // dwdot[O]/d[HCO] + J[135] += dqdci; // dwdot[H]/d[HCO] + J[139] += dqdci; // dwdot[CO2]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + // d()/dT + J[158] -= dqdT; // dwdot[O]/dT + J[161] += dqdT; // dwdot[H]/dT + J[165] += dqdT; // dwdot[CO2]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + amrex::Real c_R[12], dcRdT[12], e_RT[12]; + amrex::Real* eh_RT; + if (HP == 1) { + cp_R(c_R, T); + dcvpRdT(dcRdT, T); + eh_RT = &h_RT[0]; + } else { + cv_R(c_R, T); + dcvpRdT(dcRdT, T); + speciesInternalEnergy(e_RT, T); + eh_RT = &e_RT[0]; + } + + amrex::Real cmix = 0.0, ehmix = 0.0, dcmixdT = 0.0, dehmixdT = 0.0; + for (int k = 0; k < 12; ++k) { + cmix += c_R[k] * sc[k]; + dcmixdT += dcRdT[k] * sc[k]; + ehmix += eh_RT[k] * wdot[k]; + dehmixdT += invT * (c_R[k] - eh_RT[k]) * wdot[k] + eh_RT[k] * J[156 + k]; + } + + amrex::Real cmixinv = 1.0 / cmix; + amrex::Real tmp1 = ehmix * cmixinv; + amrex::Real tmp3 = cmixinv * T; + amrex::Real tmp2 = tmp1 * tmp3; + amrex::Real dehmixdc; + // dTdot/d[X] + for (int k = 0; k < 12; ++k) { + dehmixdc = 0.0; + for (int m = 0; m < 12; ++m) { + dehmixdc += eh_RT[m] * J[k * 13 + m]; + } + J[k * 13 + 12] = tmp2 * c_R[k] - tmp3 * dehmixdc; + } + // dTdot/dT + J[168] = -tmp1 + tmp2 * dcmixdT - tmp3 * dehmixdT; +#else + amrex::Abort(); +#endif +} + +// compute an approx to the reaction Jacobian (for preconditioning) +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +DWDOT_SIMPLIFIED( + amrex::Real* J, const amrex::Real* sc, const amrex::Real* Tp, const int* HP) +{ + amrex::Real c[12]; + + for (int k = 0; k < 12; k++) { + c[k] = 1.e6 * sc[k]; + } + + aJacobian_precond(J, c, *Tp, *HP); + + // dwdot[k]/dT + // dTdot/d[X] + for (int k = 0; k < 12; k++) { + J[156 + k] *= 1.e-6; + J[k * 13 + 12] *= 1.e6; + } +} + +// compute the reaction Jacobian +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +aJacobian( + amrex::Real* J, const amrex::Real* sc, const amrex::Real T, const int consP) +{ + +#if defined(PELE_COMPILE_AJACOBIAN) || !defined(AMREX_USE_HIP) + for (int i = 0; i < 169; i++) { + J[i] = 0.0; + } + + amrex::Real wdot[12]; + for (auto& val : wdot) { + val = 0.0; + } + + const amrex::Real invT = 1.0 / T; + const amrex::Real invT2 = invT * invT; + const amrex::Real logT = log(T); + + // reference concentration: P_atm / (RT) in inverse mol/m^3 + amrex::Real refC = 101325 / 8.31446 / T; + amrex::Real refCinv = 1.0 / refC; + + // compute the mixture concentration + amrex::Real mixture = 0.0; + for (int k = 0; k < 12; ++k) { + mixture += sc[k]; + } + + // compute the Gibbs free energy + amrex::Real g_RT[12]; + gibbs(g_RT, T); + + // compute the species enthalpy + amrex::Real h_RT[12]; + speciesEnthalpy(h_RT, T); + + amrex::Real phi_f, k_f, k_r, phi_r, Kc, q, q_nocor, Corr, alpha; + amrex::Real dlnkfdT, dlnk0dT, dlnKcdT, dkrdT, dqdT; + amrex::Real dqdci, dcdc_fac, dqdc[12]; + amrex::Real Pr, fPr, F, k_0, logPr; + amrex::Real logFcent, troe_c, troe_n, troePr_den, troePr, troe; + amrex::Real Fcent1, Fcent2, Fcent3, Fcent; + amrex::Real dlogFdc, dlogFdn, dlogFdcn_fac; + amrex::Real dlogPrdT, dlogfPrdT, dlogFdT, dlogFcentdT, dlogFdlogPr, dlnCorrdT; + const amrex::Real ln10 = log(10.0); + const amrex::Real log10e = 1.0 / log(10.0); + // reaction 8: H + O2 (+M) <=> HO2 (+M) + // a third-body and pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + sc[0] + (0.78 - 1) * sc[1] + (11 - 1) * sc[4] + + (1.9 - 1) * sc[8] + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[1] * sc[5]; + k_f = 1475000 * exp(0.6 * logT); + dlnkfdT = 0.6 * invT; + // pressure-fall-off + k_0 = 6.366e+20 * exp(-1.72 * logT - (264.088106214317) * invT); + Pr = 1e-12 * alpha / k_f * k_0; + fPr = Pr / (1.0 + Pr); + dlnk0dT = -1.72 * invT + (264.088106214317) * invT2; + dlogPrdT = log10e * (dlnk0dT - dlnkfdT); + dlogfPrdT = dlogPrdT / (1.0 + Pr); + // Troe form + logPr = log10(Pr); + Fcent1 = (1. - 0.8) * exp(-T / 1e-30); + Fcent2 = 0.8 * exp(-T / 1e+30); + Fcent3 = 0.; + Fcent = Fcent1 + Fcent2 + Fcent3; + logFcent = log10(Fcent); + troe_c = -.4 - .67 * logFcent; + troe_n = .75 - 1.27 * logFcent; + troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); + troePr = (troe_c + logPr) * troePr_den; + troe = 1.0 / (1.0 + troePr * troePr); + F = exp(M_LN10 * logFcent * troe); + dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); + dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; + dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; + dlogFdn = dlogFdcn_fac * troePr; + dlogFdlogPr = dlogFdc; + dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + + dlogFdlogPr * dlogPrdT; + // reverse + phi_r = sc[6]; + Kc = refCinv * exp(g_RT[1] + g_RT[5] - g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[6]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + Corr = fPr * F; + q = Corr * q_nocor; + dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); + dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; + // update wdot + wdot[1] -= q; // O2 + wdot[5] -= q; // H + wdot[6] += q; // HO2 + // for convenience + k_f *= Corr; + k_r *= Corr; + dcdc_fac = q / alpha * (1.0 / (Pr + 1.0) + dlogFdlogPr); + if (consP == 1) { + // d()/d[H2] + dqdci = (2 - 1) * dcdc_fac; + J[1] -= dqdci; // dwdot[O2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[6] += dqdci; // dwdot[HO2]/d[H2] + // d()/d[O2] + dqdci = (0.78 - 1) * dcdc_fac + k_f * sc[5]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[18] -= dqdci; // dwdot[H]/d[O2] + J[19] += dqdci; // dwdot[HO2]/d[O2] + // d()/d[H2O] + dqdci = (11 - 1) * dcdc_fac; + J[53] -= dqdci; // dwdot[O2]/d[H2O] + J[57] -= dqdci; // dwdot[H]/d[H2O] + J[58] += dqdci; // dwdot[HO2]/d[H2O] + // d()/d[H] + dqdci = +k_f * sc[1]; + J[66] -= dqdci; // dwdot[O2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] += dqdci; // dwdot[HO2]/d[H] + // d()/d[HO2] + dqdci = -k_r; + J[79] -= dqdci; // dwdot[O2]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + // d()/d[CO] + dqdci = (1.9 - 1) * dcdc_fac; + J[105] -= dqdci; // dwdot[O2]/d[CO] + J[109] -= dqdci; // dwdot[H]/d[CO] + J[110] += dqdci; // dwdot[HO2]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * dcdc_fac; + J[118] -= dqdci; // dwdot[O2]/d[CO2] + J[122] -= dqdci; // dwdot[H]/d[CO2] + J[123] += dqdci; // dwdot[HO2]/d[CO2] + } else { + dqdc[0] = 2 * dcdc_fac; + dqdc[1] = 0.78 * dcdc_fac + k_f * sc[5]; + dqdc[2] = dcdc_fac; + dqdc[3] = dcdc_fac; + dqdc[4] = 11 * dcdc_fac; + dqdc[5] = dcdc_fac + k_f * sc[1]; + dqdc[6] = dcdc_fac - k_r; + dqdc[7] = dcdc_fac; + dqdc[8] = 1.9 * dcdc_fac; + dqdc[9] = 3.8 * dcdc_fac; + dqdc[10] = dcdc_fac; + dqdc[11] = dcdc_fac; + for (int k = 0; k < 12; k++) { + J[13 * k + 1] -= dqdc[k]; + J[13 * k + 5] -= dqdc[k]; + J[13 * k + 6] += dqdc[k]; + } + } + J[157] -= dqdT; // dwdot[O2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] += dqdT; // dwdot[HO2]/dT + + // reaction 15: H2O2 (+M) <=> 2 OH (+M) + // a third-body and pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[7]; + k_f = 295100000000000 * exp(-(24370.7831249226) * invT); + dlnkfdT = (24370.7831249226) * invT2; + // pressure-fall-off + k_0 = 1.202e+17 * exp(-(22896.3582941147) * invT); + Pr = 1e-6 * alpha / k_f * k_0; + fPr = Pr / (1.0 + Pr); + dlnk0dT = (22896.3582941147) * invT2; + dlogPrdT = log10e * (dlnk0dT - dlnkfdT); + dlogfPrdT = dlogPrdT / (1.0 + Pr); + // Troe form + logPr = log10(Pr); + Fcent1 = (1. - 0.5) * exp(-T / 1e-30); + Fcent2 = 0.5 * exp(-T / 1e+30); + Fcent3 = 0.; + Fcent = Fcent1 + Fcent2 + Fcent3; + logFcent = log10(Fcent); + troe_c = -.4 - .67 * logFcent; + troe_n = .75 - 1.27 * logFcent; + troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); + troePr = (troe_c + logPr) * troePr_den; + troe = 1.0 / (1.0 + troePr * troePr); + F = exp(M_LN10 * logFcent * troe); + dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); + dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; + dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; + dlogFdn = dlogFdcn_fac * troePr; + dlogFdlogPr = dlogFdc; + dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + + dlogFdlogPr * dlogPrdT; + // reverse + phi_r = (sc[3] * sc[3]); + Kc = refC * exp(-2.000000 * g_RT[3] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[7]) + (2.000000 * h_RT[3]) - 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + Corr = fPr * F; + q = Corr * q_nocor; + dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); + dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; + // update wdot + wdot[3] += 2 * q; // OH + wdot[7] -= q; // H2O2 + // for convenience + k_f *= Corr; + k_r *= Corr; + dcdc_fac = q / alpha * (1.0 / (Pr + 1.0) + dlogFdlogPr); + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * dcdc_fac; + J[3] += 2 * dqdci; // dwdot[OH]/d[H2] + J[7] -= dqdci; // dwdot[H2O2]/d[H2] + // d()/d[OH] + dqdci = -k_r * 2.000000 * sc[3]; + J[42] += 2 * dqdci; // dwdot[OH]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = (12 - 1) * dcdc_fac; + J[55] += 2 * dqdci; // dwdot[OH]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[H2O2] + dqdci = +k_f; + J[94] += 2 * dqdci; // dwdot[OH]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/d[CO] + dqdci = (1.9 - 1) * dcdc_fac; + J[107] += 2 * dqdci; // dwdot[OH]/d[CO] + J[111] -= dqdci; // dwdot[H2O2]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * dcdc_fac; + J[120] += 2 * dqdci; // dwdot[OH]/d[CO2] + J[124] -= dqdci; // dwdot[H2O2]/d[CO2] + } else { + dqdc[0] = 2.5 * dcdc_fac; + dqdc[1] = dcdc_fac; + dqdc[2] = dcdc_fac; + dqdc[3] = dcdc_fac - k_r * 2.000000 * sc[3]; + dqdc[4] = 12 * dcdc_fac; + dqdc[5] = dcdc_fac; + dqdc[6] = dcdc_fac; + dqdc[7] = dcdc_fac + k_f; + dqdc[8] = 1.9 * dcdc_fac; + dqdc[9] = 3.8 * dcdc_fac; + dqdc[10] = dcdc_fac; + dqdc[11] = dcdc_fac; + for (int k = 0; k < 12; k++) { + J[13 * k + 3] += 2 * dqdc[k]; + J[13 * k + 7] -= dqdc[k]; + } + } + J[159] += 2 * dqdT; // dwdot[OH]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 21: CO + O (+M) <=> CO2 (+M) + // a third-body and pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[2] * sc[8]; + k_f = 18000 * exp(-(1199.66853127845) * invT); + dlnkfdT = (1199.66853127845) * invT2; + // pressure-fall-off + k_0 = 1.55e+24 * exp(-2.79 * logT - (2108.98104638758) * invT); + Pr = 1e-12 * alpha / k_f * k_0; + fPr = Pr / (1.0 + Pr); + dlnk0dT = -2.79 * invT + (2108.98104638758) * invT2; + dlogPrdT = log10e * (dlnk0dT - dlnkfdT); + dlogfPrdT = dlogPrdT / (1.0 + Pr); + // Lindemann form + F = 1.0; + dlogFdlogPr = 0.0; + dlogFdT = 0.0; + // reverse + phi_r = sc[9]; + Kc = refCinv * exp(g_RT[2] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[8]) + (h_RT[9]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + Corr = fPr * F; + q = Corr * q_nocor; + dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); + dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; + // update wdot + wdot[2] -= q; // O + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // for convenience + k_f *= Corr; + k_r *= Corr; + dcdc_fac = q / alpha * (1.0 / (Pr + 1.0) + dlogFdlogPr); + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * dcdc_fac; + J[2] -= dqdci; // dwdot[O]/d[H2] + J[8] -= dqdci; // dwdot[CO]/d[H2] + J[9] += dqdci; // dwdot[CO2]/d[H2] + // d()/d[O] + dqdci = +k_f * sc[8]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[34] -= dqdci; // dwdot[CO]/d[O] + J[35] += dqdci; // dwdot[CO2]/d[O] + // d()/d[H2O] + dqdci = (12 - 1) * dcdc_fac; + J[54] -= dqdci; // dwdot[O]/d[H2O] + J[60] -= dqdci; // dwdot[CO]/d[H2O] + J[61] += dqdci; // dwdot[CO2]/d[H2O] + // d()/d[CO] + dqdci = (1.9 - 1) * dcdc_fac + k_f * sc[2]; + J[106] -= dqdci; // dwdot[O]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * dcdc_fac - k_r; + J[119] -= dqdci; // dwdot[O]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + } else { + dqdc[0] = 2.5 * dcdc_fac; + dqdc[1] = dcdc_fac; + dqdc[2] = dcdc_fac + k_f * sc[8]; + dqdc[3] = dcdc_fac; + dqdc[4] = 12 * dcdc_fac; + dqdc[5] = dcdc_fac; + dqdc[6] = dcdc_fac; + dqdc[7] = dcdc_fac; + dqdc[8] = 1.9 * dcdc_fac + k_f * sc[2]; + dqdc[9] = 3.8 * dcdc_fac - k_r; + dqdc[10] = dcdc_fac; + dqdc[11] = dcdc_fac; + for (int k = 0; k < 12; k++) { + J[13 * k + 2] -= dqdc[k]; + J[13 * k + 8] -= dqdc[k]; + J[13 * k + 9] += dqdc[k]; + } + } + J[158] -= dqdT; // dwdot[O]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 4: H2 + M <=> 2 H + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[0]; + k_f = 45770000000000 * exp(-1.4 * logT - (52525.7555766966) * invT); + dlnkfdT = -1.4 * invT + (52525.7555766966) * invT2; + // reverse + phi_r = (sc[5] * sc[5]); + Kc = refC * exp(g_RT[0] - 2.000000 * g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[0]) + (2.000000 * h_RT[5]) - 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] -= q; // H2 + wdot[5] += 2 * q; // H + // for convenience + k_f *= alpha; + k_r *= alpha; + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * q_nocor + k_f; + J[0] -= dqdci; // dwdot[H2]/d[H2] + J[5] += 2 * dqdci; // dwdot[H]/d[H2] + // d()/d[H2O] + dqdci = (12 - 1) * q_nocor; + J[52] -= dqdci; // dwdot[H2]/d[H2O] + J[57] += 2 * dqdci; // dwdot[H]/d[H2O] + // d()/d[H] + dqdci = -k_r * 2.000000 * sc[5]; + J[65] -= dqdci; // dwdot[H2]/d[H] + J[70] += 2 * dqdci; // dwdot[H]/d[H] + // d()/d[CO] + dqdci = (1.9 - 1) * q_nocor; + J[104] -= dqdci; // dwdot[H2]/d[CO] + J[109] += 2 * dqdci; // dwdot[H]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * q_nocor; + J[117] -= dqdci; // dwdot[H2]/d[CO2] + J[122] += 2 * dqdci; // dwdot[H]/d[CO2] + } else { + dqdc[0] = 2.5 * q_nocor + k_f; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor; + dqdc[3] = q_nocor; + dqdc[4] = 12 * q_nocor; + dqdc[5] = q_nocor - k_r * 2.000000 * sc[5]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 0] -= dqdc[k]; + J[13 * k + 5] += 2 * dqdc[k]; + } + } + J[156] -= dqdT; // dwdot[H2]/dT + J[161] += 2 * dqdT; // dwdot[H]/dT + + // reaction 5: 2 O + M <=> O2 + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = (sc[2] * sc[2]); + k_f = 6165 * exp(-0.5 * logT); + dlnkfdT = -0.5 * invT; + // reverse + phi_r = sc[1]; + Kc = refCinv * exp(-g_RT[1] + 2.000000 * g_RT[2]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(2.000000 * h_RT[2]) + (h_RT[1]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[2] -= 2 * q; // O + // for convenience + k_f *= alpha; + k_r *= alpha; + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * q_nocor; + J[1] += dqdci; // dwdot[O2]/d[H2] + J[2] += -2 * dqdci; // dwdot[O]/d[H2] + // d()/d[O2] + dqdci = -k_r; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[15] += -2 * dqdci; // dwdot[O]/d[O2] + // d()/d[O] + dqdci = +k_f * 2.000000 * sc[2]; + J[27] += dqdci; // dwdot[O2]/d[O] + J[28] += -2 * dqdci; // dwdot[O]/d[O] + // d()/d[H2O] + dqdci = (12 - 1) * q_nocor; + J[53] += dqdci; // dwdot[O2]/d[H2O] + J[54] += -2 * dqdci; // dwdot[O]/d[H2O] + // d()/d[CO] + dqdci = (1.9 - 1) * q_nocor; + J[105] += dqdci; // dwdot[O2]/d[CO] + J[106] += -2 * dqdci; // dwdot[O]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * q_nocor; + J[118] += dqdci; // dwdot[O2]/d[CO2] + J[119] += -2 * dqdci; // dwdot[O]/d[CO2] + } else { + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor - k_r; + dqdc[2] = q_nocor + k_f * 2.000000 * sc[2]; + dqdc[3] = q_nocor; + dqdc[4] = 12 * q_nocor; + dqdc[5] = q_nocor; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 1] += dqdc[k]; + J[13 * k + 2] += -2 * dqdc[k]; + } + } + J[157] += dqdT; // dwdot[O2]/dT + J[158] += -2 * dqdT; // dwdot[O]/dT + + // reaction 6: H + O + M <=> OH + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[2] * sc[5]; + k_f = 4714000 * exp(-1 * logT); + dlnkfdT = -1 * invT; + // reverse + phi_r = sc[3]; + Kc = refCinv * exp(g_RT[2] - g_RT[3] + g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[5]) + (h_RT[3]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[5] -= q; // H + // for convenience + k_f *= alpha; + k_r *= alpha; + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * q_nocor; + J[2] -= dqdci; // dwdot[O]/d[H2] + J[3] += dqdci; // dwdot[OH]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + // d()/d[O] + dqdci = +k_f * sc[5]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[31] -= dqdci; // dwdot[H]/d[O] + // d()/d[OH] + dqdci = -k_r; + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + // d()/d[H2O] + dqdci = (12 - 1) * q_nocor; + J[54] -= dqdci; // dwdot[O]/d[H2O] + J[55] += dqdci; // dwdot[OH]/d[H2O] + J[57] -= dqdci; // dwdot[H]/d[H2O] + // d()/d[H] + dqdci = +k_f * sc[2]; + J[67] -= dqdci; // dwdot[O]/d[H] + J[68] += dqdci; // dwdot[OH]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + // d()/d[CO] + dqdci = (1.9 - 1) * q_nocor; + J[106] -= dqdci; // dwdot[O]/d[CO] + J[107] += dqdci; // dwdot[OH]/d[CO] + J[109] -= dqdci; // dwdot[H]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * q_nocor; + J[119] -= dqdci; // dwdot[O]/d[CO2] + J[120] += dqdci; // dwdot[OH]/d[CO2] + J[122] -= dqdci; // dwdot[H]/d[CO2] + } else { + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor + k_f * sc[5]; + dqdc[3] = q_nocor - k_r; + dqdc[4] = 12 * q_nocor; + dqdc[5] = q_nocor + k_f * sc[2]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 2] -= dqdc[k]; + J[13 * k + 3] += dqdc[k]; + J[13 * k + 5] -= dqdc[k]; + } + } + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[161] -= dqdT; // dwdot[H]/dT + + // reaction 7: H + OH + M <=> H2O + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[3] * sc[5]; + k_f = 38000000000 * exp(-2 * logT); + dlnkfdT = -2 * invT; + // reverse + phi_r = sc[4]; + Kc = refCinv * exp(g_RT[3] - g_RT[4] + g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[5]) + (h_RT[4]) + 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[5] -= q; // H + // for convenience + k_f *= alpha; + k_r *= alpha; + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * q_nocor; + J[3] -= dqdci; // dwdot[OH]/d[H2] + J[4] += dqdci; // dwdot[H2O]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + // d()/d[OH] + dqdci = +k_f * sc[5]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + // d()/d[H2O] + dqdci = (12 - 1) * q_nocor - k_r; + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[57] -= dqdci; // dwdot[H]/d[H2O] + // d()/d[H] + dqdci = +k_f * sc[3]; + J[68] -= dqdci; // dwdot[OH]/d[H] + J[69] += dqdci; // dwdot[H2O]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + // d()/d[CO] + dqdci = (1.9 - 1) * q_nocor; + J[107] -= dqdci; // dwdot[OH]/d[CO] + J[108] += dqdci; // dwdot[H2O]/d[CO] + J[109] -= dqdci; // dwdot[H]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * q_nocor; + J[120] -= dqdci; // dwdot[OH]/d[CO2] + J[121] += dqdci; // dwdot[H2O]/d[CO2] + J[122] -= dqdci; // dwdot[H]/d[CO2] + } else { + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor; + dqdc[3] = q_nocor + k_f * sc[5]; + dqdc[4] = 12 * q_nocor - k_r; + dqdc[5] = q_nocor + k_f * sc[3]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 3] -= dqdc[k]; + J[13 * k + 4] += dqdc[k]; + J[13 * k + 5] -= dqdc[k]; + } + } + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[161] -= dqdT; // dwdot[H]/dT + + // reaction 25: HCO + M <=> CO + H + M + // a third-body and non-pressure-fall-off reaction + // 3-body correction factor + alpha = mixture + (2.5 - 1) * sc[0] + (6 - 1) * sc[4] + (1.9 - 1) * sc[8] + + (3.8 - 1) * sc[9]; + // forward + phi_f = sc[10]; + k_f = 474850 * exp(0.659 * logT - (7484.8446871794) * invT); + dlnkfdT = 0.659 * invT + (7484.8446871794) * invT2; + // reverse + phi_r = sc[5] * sc[8]; + Kc = refC * exp(-g_RT[5] - g_RT[8] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[10]) + (h_RT[5] + h_RT[8]) - 1.000000); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q_nocor = k_f * phi_f - k_r * phi_r; + q = alpha * q_nocor; + dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[5] += q; // H + wdot[8] += q; // CO + wdot[10] -= q; // HCO + // for convenience + k_f *= alpha; + k_r *= alpha; + if (consP == 1) { + // d()/d[H2] + dqdci = (2.5 - 1) * q_nocor; + J[5] += dqdci; // dwdot[H]/d[H2] + J[8] += dqdci; // dwdot[CO]/d[H2] + J[10] -= dqdci; // dwdot[HCO]/d[H2] + // d()/d[H2O] + dqdci = (6 - 1) * q_nocor; + J[57] += dqdci; // dwdot[H]/d[H2O] + J[60] += dqdci; // dwdot[CO]/d[H2O] + J[62] -= dqdci; // dwdot[HCO]/d[H2O] + // d()/d[H] + dqdci = -k_r * sc[8]; + J[70] += dqdci; // dwdot[H]/d[H] + J[73] += dqdci; // dwdot[CO]/d[H] + J[75] -= dqdci; // dwdot[HCO]/d[H] + // d()/d[CO] + dqdci = (1.9 - 1) * q_nocor - k_r * sc[5]; + J[109] += dqdci; // dwdot[H]/d[CO] + J[112] += dqdci; // dwdot[CO]/d[CO] + J[114] -= dqdci; // dwdot[HCO]/d[CO] + // d()/d[CO2] + dqdci = (3.8 - 1) * q_nocor; + J[122] += dqdci; // dwdot[H]/d[CO2] + J[125] += dqdci; // dwdot[CO]/d[CO2] + J[127] -= dqdci; // dwdot[HCO]/d[CO2] + // d()/d[HCO] + dqdci = +k_f; + J[135] += dqdci; // dwdot[H]/d[HCO] + J[138] += dqdci; // dwdot[CO]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + } else { + dqdc[0] = 2.5 * q_nocor; + dqdc[1] = q_nocor; + dqdc[2] = q_nocor; + dqdc[3] = q_nocor; + dqdc[4] = 6 * q_nocor; + dqdc[5] = q_nocor - k_r * sc[8]; + dqdc[6] = q_nocor; + dqdc[7] = q_nocor; + dqdc[8] = 1.9 * q_nocor - k_r * sc[5]; + dqdc[9] = 3.8 * q_nocor; + dqdc[10] = q_nocor + k_f; + dqdc[11] = q_nocor; + for (int k = 0; k < 12; k++) { + J[13 * k + 5] += dqdc[k]; + J[13 * k + 8] += dqdc[k]; + J[13 * k + 10] -= dqdc[k]; + } + } + J[161] += dqdT; // dwdot[H]/dT + J[164] += dqdT; // dwdot[CO]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + // reaction 0: H + O2 <=> O + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[1] * sc[5]; + k_f = 3547000000 * exp(-0.406 * logT - (8352.89343569254) * invT); + dlnkfdT = -0.406 * invT + (8352.89343569254) * invT2; + // reverse + phi_r = sc[2] * sc[3]; + Kc = exp(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[2] + h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] -= q; // O2 + wdot[2] += q; // O + wdot[3] += q; // OH + wdot[5] -= q; // H + // d()/d[O2] + dqdci = +k_f * sc[5]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[15] += dqdci; // dwdot[O]/d[O2] + J[16] += dqdci; // dwdot[OH]/d[O2] + J[18] -= dqdci; // dwdot[H]/d[O2] + // d()/d[O] + dqdci = -k_r * sc[3]; + J[27] -= dqdci; // dwdot[O2]/d[O] + J[28] += dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[31] -= dqdci; // dwdot[H]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[2]; + J[40] -= dqdci; // dwdot[O2]/d[OH] + J[41] += dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + // d()/d[H] + dqdci = +k_f * sc[1]; + J[66] -= dqdci; // dwdot[O2]/d[H] + J[67] += dqdci; // dwdot[O]/d[H] + J[68] += dqdci; // dwdot[OH]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + // d()/dT + J[157] -= dqdT; // dwdot[O2]/dT + J[158] += dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[161] -= dqdT; // dwdot[H]/dT + + // reaction 1: H2 + O <=> H + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[0] * sc[2]; + k_f = 0.0508 * exp(2.67 * logT - (3165.23282791169) * invT); + dlnkfdT = 2.67 * invT + (3165.23282791169) * invT2; + // reverse + phi_r = sc[3] * sc[5]; + Kc = exp(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[0] + h_RT[2]) + (h_RT[3] + h_RT[5])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] -= q; // H2 + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[5] += q; // H + // d()/d[H2] + dqdci = +k_f * sc[2]; + J[0] -= dqdci; // dwdot[H2]/d[H2] + J[2] -= dqdci; // dwdot[O]/d[H2] + J[3] += dqdci; // dwdot[OH]/d[H2] + J[5] += dqdci; // dwdot[H]/d[H2] + // d()/d[O] + dqdci = +k_f * sc[0]; + J[26] -= dqdci; // dwdot[H2]/d[O] + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[31] += dqdci; // dwdot[H]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[5]; + J[39] -= dqdci; // dwdot[H2]/d[OH] + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[44] += dqdci; // dwdot[H]/d[OH] + // d()/d[H] + dqdci = -k_r * sc[3]; + J[65] -= dqdci; // dwdot[H2]/d[H] + J[67] -= dqdci; // dwdot[O]/d[H] + J[68] += dqdci; // dwdot[OH]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + // d()/dT + J[156] -= dqdT; // dwdot[H2]/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[161] += dqdT; // dwdot[H]/dT + + // reaction 2: H2 + OH <=> H + H2O + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[0] * sc[3]; + k_f = 216 * exp(1.51 * logT - (1726.03316371019) * invT); + dlnkfdT = 1.51 * invT + (1726.03316371019) * invT2; + // reverse + phi_r = sc[4] * sc[5]; + Kc = exp(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[0] + h_RT[3]) + (h_RT[4] + h_RT[5])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] -= q; // H2 + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[5] += q; // H + // d()/d[H2] + dqdci = +k_f * sc[3]; + J[0] -= dqdci; // dwdot[H2]/d[H2] + J[3] -= dqdci; // dwdot[OH]/d[H2] + J[4] += dqdci; // dwdot[H2O]/d[H2] + J[5] += dqdci; // dwdot[H]/d[H2] + // d()/d[OH] + dqdci = +k_f * sc[0]; + J[39] -= dqdci; // dwdot[H2]/d[OH] + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[44] += dqdci; // dwdot[H]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[5]; + J[52] -= dqdci; // dwdot[H2]/d[H2O] + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[57] += dqdci; // dwdot[H]/d[H2O] + // d()/d[H] + dqdci = -k_r * sc[4]; + J[65] -= dqdci; // dwdot[H2]/d[H] + J[68] -= dqdci; // dwdot[OH]/d[H] + J[69] += dqdci; // dwdot[H2O]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + // d()/dT + J[156] -= dqdT; // dwdot[H2]/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[161] += dqdT; // dwdot[H]/dT + + // reaction 3: H2O + O <=> 2 OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[4]; + k_f = 2.97 * exp(2.02 * logT - (6743.10332178324) * invT); + dlnkfdT = 2.02 * invT + (6743.10332178324) * invT2; + // reverse + phi_r = (sc[3] * sc[3]); + Kc = exp(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[4]) + (2.000000 * h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[3] += 2 * q; // OH + wdot[4] -= q; // H2O + // d()/d[O] + dqdci = +k_f * sc[4]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += 2 * dqdci; // dwdot[OH]/d[O] + J[30] -= dqdci; // dwdot[H2O]/d[O] + // d()/d[OH] + dqdci = -k_r * 2.000000 * sc[3]; + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += 2 * dqdci; // dwdot[OH]/d[OH] + J[43] -= dqdci; // dwdot[H2O]/d[OH] + // d()/d[H2O] + dqdci = +k_f * sc[2]; + J[54] -= dqdci; // dwdot[O]/d[H2O] + J[55] += 2 * dqdci; // dwdot[OH]/d[H2O] + J[56] -= dqdci; // dwdot[H2O]/d[H2O] + // d()/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += 2 * dqdT; // dwdot[OH]/dT + J[160] -= dqdT; // dwdot[H2O]/dT + + // reaction 9: H + HO2 <=> H2 + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[6]; + k_f = 16600000 * exp(-(414.147315957284) * invT); + dlnkfdT = (414.147315957284) * invT2; + // reverse + phi_r = sc[0] * sc[1]; + Kc = exp(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (h_RT[0] + h_RT[1])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] += q; // H2 + wdot[1] += q; // O2 + wdot[5] -= q; // H + wdot[6] -= q; // HO2 + // d()/d[H2] + dqdci = -k_r * sc[1]; + J[0] += dqdci; // dwdot[H2]/d[H2] + J[1] += dqdci; // dwdot[O2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[6] -= dqdci; // dwdot[HO2]/d[H2] + // d()/d[O2] + dqdci = -k_r * sc[0]; + J[13] += dqdci; // dwdot[H2]/d[O2] + J[14] += dqdci; // dwdot[O2]/d[O2] + J[18] -= dqdci; // dwdot[H]/d[O2] + J[19] -= dqdci; // dwdot[HO2]/d[O2] + // d()/d[H] + dqdci = +k_f * sc[6]; + J[65] += dqdci; // dwdot[H2]/d[H] + J[66] += dqdci; // dwdot[O2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] -= dqdci; // dwdot[HO2]/d[H] + // d()/d[HO2] + dqdci = +k_f * sc[5]; + J[78] += dqdci; // dwdot[H2]/d[HO2] + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[156] += dqdT; // dwdot[H2]/dT + J[157] += dqdT; // dwdot[O2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 10: H + HO2 <=> 2 OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[6]; + k_f = 70790000 * exp(-(148.448916412392) * invT); + dlnkfdT = (148.448916412392) * invT2; + // reverse + phi_r = (sc[3] * sc[3]); + Kc = exp(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (2.000000 * h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] += 2 * q; // OH + wdot[5] -= q; // H + wdot[6] -= q; // HO2 + // d()/d[OH] + dqdci = -k_r * 2.000000 * sc[3]; + J[42] += 2 * dqdci; // dwdot[OH]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + // d()/d[H] + dqdci = +k_f * sc[6]; + J[68] += 2 * dqdci; // dwdot[OH]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] -= dqdci; // dwdot[HO2]/d[H] + // d()/d[HO2] + dqdci = +k_f * sc[5]; + J[81] += 2 * dqdci; // dwdot[OH]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[159] += 2 * dqdT; // dwdot[OH]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 11: HO2 + O <=> O2 + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[6]; + k_f = 32500000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[1] * sc[3]; + Kc = exp(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[6]) + (h_RT[1] + h_RT[3])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[6] -= q; // HO2 + // d()/d[O2] + dqdci = -k_r * sc[3]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[15] -= dqdci; // dwdot[O]/d[O2] + J[16] += dqdci; // dwdot[OH]/d[O2] + J[19] -= dqdci; // dwdot[HO2]/d[O2] + // d()/d[O] + dqdci = +k_f * sc[6]; + J[27] += dqdci; // dwdot[O2]/d[O] + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[32] -= dqdci; // dwdot[HO2]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[1]; + J[40] += dqdci; // dwdot[O2]/d[OH] + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + // d()/d[HO2] + dqdci = +k_f * sc[2]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[80] -= dqdci; // dwdot[O]/d[HO2] + J[81] += dqdci; // dwdot[OH]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 12: HO2 + OH <=> H2O + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[6]; + k_f = 28900000 * exp(-(-250.098682904946) * invT); + dlnkfdT = (-250.098682904946) * invT2; + // reverse + phi_r = sc[1] * sc[4]; + Kc = exp(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[6]) + (h_RT[1] + h_RT[4])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[6] -= q; // HO2 + // d()/d[O2] + dqdci = -k_r * sc[4]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[16] -= dqdci; // dwdot[OH]/d[O2] + J[17] += dqdci; // dwdot[H2O]/d[O2] + J[19] -= dqdci; // dwdot[HO2]/d[O2] + // d()/d[OH] + dqdci = +k_f * sc[6]; + J[40] += dqdci; // dwdot[O2]/d[OH] + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[1]; + J[53] += dqdci; // dwdot[O2]/d[H2O] + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[58] -= dqdci; // dwdot[HO2]/d[H2O] + // d()/d[HO2] + dqdci = +k_f * sc[3]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[81] -= dqdci; // dwdot[OH]/d[HO2] + J[82] += dqdci; // dwdot[H2O]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + + // reaction 13: 2 HO2 <=> H2O2 + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = (sc[6] * sc[6]); + k_f = 420000000 * exp(-(6029.54208967215) * invT); + dlnkfdT = (6029.54208967215) * invT2; + // reverse + phi_r = sc[1] * sc[7]; + Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[6] -= 2 * q; // HO2 + wdot[7] += q; // H2O2 + // d()/d[O2] + dqdci = -k_r * sc[7]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] + J[20] += dqdci; // dwdot[H2O2]/d[O2] + // d()/d[HO2] + dqdci = +k_f * 2.000000 * sc[6]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] + J[85] += dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = -k_r * sc[1]; + J[92] += dqdci; // dwdot[O2]/d[H2O2] + J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] + J[98] += dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[162] += -2 * dqdT; // dwdot[HO2]/dT + J[163] += dqdT; // dwdot[H2O2]/dT + + // reaction 14: 2 HO2 <=> H2O2 + O2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = (sc[6] * sc[6]); + k_f = 130000 * exp(-(-819.89091359563) * invT); + dlnkfdT = (-819.89091359563) * invT2; + // reverse + phi_r = sc[1] * sc[7]; + Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] += q; // O2 + wdot[6] -= 2 * q; // HO2 + wdot[7] += q; // H2O2 + // d()/d[O2] + dqdci = -k_r * sc[7]; + J[14] += dqdci; // dwdot[O2]/d[O2] + J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] + J[20] += dqdci; // dwdot[H2O2]/d[O2] + // d()/d[HO2] + dqdci = +k_f * 2.000000 * sc[6]; + J[79] += dqdci; // dwdot[O2]/d[HO2] + J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] + J[85] += dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = -k_r * sc[1]; + J[92] += dqdci; // dwdot[O2]/d[H2O2] + J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] + J[98] += dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[157] += dqdT; // dwdot[O2]/dT + J[162] += -2 * dqdT; // dwdot[HO2]/dT + J[163] += dqdT; // dwdot[H2O2]/dT + + // reaction 16: H + H2O2 <=> H2O + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[7]; + k_f = 24100000 * exp(-(1997.77016324474) * invT); + dlnkfdT = (1997.77016324474) * invT2; + // reverse + phi_r = sc[3] * sc[4]; + Kc = exp(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[3] + h_RT[4])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] += q; // OH + wdot[4] += q; // H2O + wdot[5] -= q; // H + wdot[7] -= q; // H2O2 + // d()/d[OH] + dqdci = -k_r * sc[4]; + J[42] += dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[44] -= dqdci; // dwdot[H]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[3]; + J[55] += dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[57] -= dqdci; // dwdot[H]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[H] + dqdci = +k_f * sc[7]; + J[68] += dqdci; // dwdot[OH]/d[H] + J[69] += dqdci; // dwdot[H2O]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[72] -= dqdci; // dwdot[H2O2]/d[H] + // d()/d[H2O2] + dqdci = +k_f * sc[5]; + J[94] += dqdci; // dwdot[OH]/d[H2O2] + J[95] += dqdci; // dwdot[H2O]/d[H2O2] + J[96] -= dqdci; // dwdot[H]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[159] += dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 17: H + H2O2 <=> H2 + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[7]; + k_f = 48200000 * exp(-(4000.57249314752) * invT); + dlnkfdT = (4000.57249314752) * invT2; + // reverse + phi_r = sc[0] * sc[6]; + Kc = exp(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[0] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] += q; // H2 + wdot[5] -= q; // H + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[H2] + dqdci = -k_r * sc[6]; + J[0] += dqdci; // dwdot[H2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[6] += dqdci; // dwdot[HO2]/d[H2] + J[7] -= dqdci; // dwdot[H2O2]/d[H2] + // d()/d[H] + dqdci = +k_f * sc[7]; + J[65] += dqdci; // dwdot[H2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[71] += dqdci; // dwdot[HO2]/d[H] + J[72] -= dqdci; // dwdot[H2O2]/d[H] + // d()/d[HO2] + dqdci = -k_r * sc[0]; + J[78] += dqdci; // dwdot[H2]/d[HO2] + J[83] -= dqdci; // dwdot[H]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[5]; + J[91] += dqdci; // dwdot[H2]/d[H2O2] + J[96] -= dqdci; // dwdot[H]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[156] += dqdT; // dwdot[H2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 18: H2O2 + O <=> HO2 + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[7]; + k_f = 9.55 * exp(2 * logT - (1997.77016324474) * invT); + dlnkfdT = 2 * invT + (1997.77016324474) * invT2; + // reverse + phi_r = sc[3] * sc[6]; + Kc = exp(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[7]) + (h_RT[3] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[3] += q; // OH + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[O] + dqdci = +k_f * sc[7]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[29] += dqdci; // dwdot[OH]/d[O] + J[32] += dqdci; // dwdot[HO2]/d[O] + J[33] -= dqdci; // dwdot[H2O2]/d[O] + // d()/d[OH] + dqdci = -k_r * sc[6]; + J[41] -= dqdci; // dwdot[O]/d[OH] + J[42] += dqdci; // dwdot[OH]/d[OH] + J[45] += dqdci; // dwdot[HO2]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[HO2] + dqdci = -k_r * sc[3]; + J[80] -= dqdci; // dwdot[O]/d[HO2] + J[81] += dqdci; // dwdot[OH]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[2]; + J[93] -= dqdci; // dwdot[O]/d[H2O2] + J[94] += dqdci; // dwdot[OH]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[158] -= dqdT; // dwdot[O]/dT + J[159] += dqdT; // dwdot[OH]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 19: H2O2 + OH <=> H2O + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[7]; + k_f = 1000000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[4] * sc[6]; + Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[OH] + dqdci = +k_f * sc[7]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[45] += dqdci; // dwdot[HO2]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[6]; + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[58] += dqdci; // dwdot[HO2]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[HO2] + dqdci = -k_r * sc[4]; + J[81] -= dqdci; // dwdot[OH]/d[HO2] + J[82] += dqdci; // dwdot[H2O]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[3]; + J[94] -= dqdci; // dwdot[OH]/d[H2O2] + J[95] += dqdci; // dwdot[H2O]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 20: H2O2 + OH <=> H2O + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[7]; + k_f = 580000000 * exp(-(4809.24167509571) * invT); + dlnkfdT = (4809.24167509571) * invT2; + // reverse + phi_r = sc[4] * sc[6]; + Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[4] += q; // H2O + wdot[6] += q; // HO2 + wdot[7] -= q; // H2O2 + // d()/d[OH] + dqdci = +k_f * sc[7]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[43] += dqdci; // dwdot[H2O]/d[OH] + J[45] += dqdci; // dwdot[HO2]/d[OH] + J[46] -= dqdci; // dwdot[H2O2]/d[OH] + // d()/d[H2O] + dqdci = -k_r * sc[6]; + J[55] -= dqdci; // dwdot[OH]/d[H2O] + J[56] += dqdci; // dwdot[H2O]/d[H2O] + J[58] += dqdci; // dwdot[HO2]/d[H2O] + J[59] -= dqdci; // dwdot[H2O2]/d[H2O] + // d()/d[HO2] + dqdci = -k_r * sc[4]; + J[81] -= dqdci; // dwdot[OH]/d[HO2] + J[82] += dqdci; // dwdot[H2O]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[85] -= dqdci; // dwdot[H2O2]/d[HO2] + // d()/d[H2O2] + dqdci = +k_f * sc[3]; + J[94] -= dqdci; // dwdot[OH]/d[H2O2] + J[95] += dqdci; // dwdot[H2O]/d[H2O2] + J[97] += dqdci; // dwdot[HO2]/d[H2O2] + J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] + // d()/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[160] += dqdT; // dwdot[H2O]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[163] -= dqdT; // dwdot[H2O2]/dT + + // reaction 22: CO + O2 <=> CO2 + O + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[1] * sc[8]; + k_f = 2530000 * exp(-(24003.4349588851) * invT); + dlnkfdT = (24003.4349588851) * invT2; + // reverse + phi_r = sc[2] * sc[9]; + Kc = exp(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[8]) + (h_RT[2] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] -= q; // O2 + wdot[2] += q; // O + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // d()/d[O2] + dqdci = +k_f * sc[8]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[15] += dqdci; // dwdot[O]/d[O2] + J[21] -= dqdci; // dwdot[CO]/d[O2] + J[22] += dqdci; // dwdot[CO2]/d[O2] + // d()/d[O] + dqdci = -k_r * sc[9]; + J[27] -= dqdci; // dwdot[O2]/d[O] + J[28] += dqdci; // dwdot[O]/d[O] + J[34] -= dqdci; // dwdot[CO]/d[O] + J[35] += dqdci; // dwdot[CO2]/d[O] + // d()/d[CO] + dqdci = +k_f * sc[1]; + J[105] -= dqdci; // dwdot[O2]/d[CO] + J[106] += dqdci; // dwdot[O]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = -k_r * sc[2]; + J[118] -= dqdci; // dwdot[O2]/d[CO2] + J[119] += dqdci; // dwdot[O]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + // d()/dT + J[157] -= dqdT; // dwdot[O2]/dT + J[158] += dqdT; // dwdot[O]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 23: CO + HO2 <=> CO2 + OH + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[6] * sc[8]; + k_f = 30100000 * exp(-(11573.9833135086) * invT); + dlnkfdT = (11573.9833135086) * invT2; + // reverse + phi_r = sc[3] * sc[9]; + Kc = exp(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[6] + h_RT[8]) + (h_RT[3] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] += q; // OH + wdot[6] -= q; // HO2 + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // d()/d[OH] + dqdci = -k_r * sc[9]; + J[42] += dqdci; // dwdot[OH]/d[OH] + J[45] -= dqdci; // dwdot[HO2]/d[OH] + J[47] -= dqdci; // dwdot[CO]/d[OH] + J[48] += dqdci; // dwdot[CO2]/d[OH] + // d()/d[HO2] + dqdci = +k_f * sc[8]; + J[81] += dqdci; // dwdot[OH]/d[HO2] + J[84] -= dqdci; // dwdot[HO2]/d[HO2] + J[86] -= dqdci; // dwdot[CO]/d[HO2] + J[87] += dqdci; // dwdot[CO2]/d[HO2] + // d()/d[CO] + dqdci = +k_f * sc[6]; + J[107] += dqdci; // dwdot[OH]/d[CO] + J[110] -= dqdci; // dwdot[HO2]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = -k_r * sc[3]; + J[120] += dqdci; // dwdot[OH]/d[CO2] + J[123] -= dqdci; // dwdot[HO2]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + // d()/dT + J[159] += dqdT; // dwdot[OH]/dT + J[162] -= dqdT; // dwdot[HO2]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 24: CO + OH <=> CO2 + H + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[3] * sc[8]; + k_f = 0.2229 * exp(1.89 * logT - (-583.077150667929) * invT); + dlnkfdT = 1.89 * invT + (-583.077150667929) * invT2; + // reverse + phi_r = sc[5] * sc[9]; + Kc = exp(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[3] + h_RT[8]) + (h_RT[5] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[3] -= q; // OH + wdot[5] += q; // H + wdot[8] -= q; // CO + wdot[9] += q; // CO2 + // d()/d[OH] + dqdci = +k_f * sc[8]; + J[42] -= dqdci; // dwdot[OH]/d[OH] + J[44] += dqdci; // dwdot[H]/d[OH] + J[47] -= dqdci; // dwdot[CO]/d[OH] + J[48] += dqdci; // dwdot[CO2]/d[OH] + // d()/d[H] + dqdci = -k_r * sc[9]; + J[68] -= dqdci; // dwdot[OH]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + J[73] -= dqdci; // dwdot[CO]/d[H] + J[74] += dqdci; // dwdot[CO2]/d[H] + // d()/d[CO] + dqdci = +k_f * sc[3]; + J[107] -= dqdci; // dwdot[OH]/d[CO] + J[109] += dqdci; // dwdot[H]/d[CO] + J[112] -= dqdci; // dwdot[CO]/d[CO] + J[113] += dqdci; // dwdot[CO2]/d[CO] + // d()/d[CO2] + dqdci = -k_r * sc[5]; + J[120] -= dqdci; // dwdot[OH]/d[CO2] + J[122] += dqdci; // dwdot[H]/d[CO2] + J[125] -= dqdci; // dwdot[CO]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + // d()/dT + J[159] -= dqdT; // dwdot[OH]/dT + J[161] += dqdT; // dwdot[H]/dT + J[164] -= dqdT; // dwdot[CO]/dT + J[165] += dqdT; // dwdot[CO2]/dT + + // reaction 26: HCO + O2 <=> CO + HO2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[1] * sc[10]; + k_f = 7580000 * exp(-(206.318832979935) * invT); + dlnkfdT = (206.318832979935) * invT2; + // reverse + phi_r = sc[6] * sc[8]; + Kc = exp(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[1] + h_RT[10]) + (h_RT[6] + h_RT[8])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[1] -= q; // O2 + wdot[6] += q; // HO2 + wdot[8] += q; // CO + wdot[10] -= q; // HCO + // d()/d[O2] + dqdci = +k_f * sc[10]; + J[14] -= dqdci; // dwdot[O2]/d[O2] + J[19] += dqdci; // dwdot[HO2]/d[O2] + J[21] += dqdci; // dwdot[CO]/d[O2] + J[23] -= dqdci; // dwdot[HCO]/d[O2] + // d()/d[HO2] + dqdci = -k_r * sc[8]; + J[79] -= dqdci; // dwdot[O2]/d[HO2] + J[84] += dqdci; // dwdot[HO2]/d[HO2] + J[86] += dqdci; // dwdot[CO]/d[HO2] + J[88] -= dqdci; // dwdot[HCO]/d[HO2] + // d()/d[CO] + dqdci = -k_r * sc[6]; + J[105] -= dqdci; // dwdot[O2]/d[CO] + J[110] += dqdci; // dwdot[HO2]/d[CO] + J[112] += dqdci; // dwdot[CO]/d[CO] + J[114] -= dqdci; // dwdot[HCO]/d[CO] + // d()/d[HCO] + dqdci = +k_f * sc[1]; + J[131] -= dqdci; // dwdot[O2]/d[HCO] + J[136] += dqdci; // dwdot[HO2]/d[HCO] + J[138] += dqdci; // dwdot[CO]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + // d()/dT + J[157] -= dqdT; // dwdot[O2]/dT + J[162] += dqdT; // dwdot[HO2]/dT + J[164] += dqdT; // dwdot[CO]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + // reaction 27: H + HCO <=> CO + H2 + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[5] * sc[10]; + k_f = 72300000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[0] * sc[8]; + Kc = exp(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[5] + h_RT[10]) + (h_RT[0] + h_RT[8])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[0] += q; // H2 + wdot[5] -= q; // H + wdot[8] += q; // CO + wdot[10] -= q; // HCO + // d()/d[H2] + dqdci = -k_r * sc[8]; + J[0] += dqdci; // dwdot[H2]/d[H2] + J[5] -= dqdci; // dwdot[H]/d[H2] + J[8] += dqdci; // dwdot[CO]/d[H2] + J[10] -= dqdci; // dwdot[HCO]/d[H2] + // d()/d[H] + dqdci = +k_f * sc[10]; + J[65] += dqdci; // dwdot[H2]/d[H] + J[70] -= dqdci; // dwdot[H]/d[H] + J[73] += dqdci; // dwdot[CO]/d[H] + J[75] -= dqdci; // dwdot[HCO]/d[H] + // d()/d[CO] + dqdci = -k_r * sc[0]; + J[104] += dqdci; // dwdot[H2]/d[CO] + J[109] -= dqdci; // dwdot[H]/d[CO] + J[112] += dqdci; // dwdot[CO]/d[CO] + J[114] -= dqdci; // dwdot[HCO]/d[CO] + // d()/d[HCO] + dqdci = +k_f * sc[5]; + J[130] += dqdci; // dwdot[H2]/d[HCO] + J[135] -= dqdci; // dwdot[H]/d[HCO] + J[138] += dqdci; // dwdot[CO]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + // d()/dT + J[156] += dqdT; // dwdot[H2]/dT + J[161] -= dqdT; // dwdot[H]/dT + J[164] += dqdT; // dwdot[CO]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + // reaction 28: HCO + O <=> CO2 + H + // a non-third-body and non-pressure-fall-off reaction + // forward + phi_f = sc[2] * sc[10]; + k_f = 30000000; + dlnkfdT = 0.0; + // reverse + phi_r = sc[5] * sc[9]; + Kc = exp(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10]); + k_r = k_f / Kc; + dlnKcdT = invT * (-(h_RT[2] + h_RT[10]) + (h_RT[5] + h_RT[9])); + dkrdT = (dlnkfdT - dlnKcdT) * k_r; + // rate of progress + q = k_f * phi_f - k_r * phi_r; + dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); + // update wdot + wdot[2] -= q; // O + wdot[5] += q; // H + wdot[9] += q; // CO2 + wdot[10] -= q; // HCO + // d()/d[O] + dqdci = +k_f * sc[10]; + J[28] -= dqdci; // dwdot[O]/d[O] + J[31] += dqdci; // dwdot[H]/d[O] + J[35] += dqdci; // dwdot[CO2]/d[O] + J[36] -= dqdci; // dwdot[HCO]/d[O] + // d()/d[H] + dqdci = -k_r * sc[9]; + J[67] -= dqdci; // dwdot[O]/d[H] + J[70] += dqdci; // dwdot[H]/d[H] + J[74] += dqdci; // dwdot[CO2]/d[H] + J[75] -= dqdci; // dwdot[HCO]/d[H] + // d()/d[CO2] + dqdci = -k_r * sc[5]; + J[119] -= dqdci; // dwdot[O]/d[CO2] + J[122] += dqdci; // dwdot[H]/d[CO2] + J[126] += dqdci; // dwdot[CO2]/d[CO2] + J[127] -= dqdci; // dwdot[HCO]/d[CO2] + // d()/d[HCO] + dqdci = +k_f * sc[2]; + J[132] -= dqdci; // dwdot[O]/d[HCO] + J[135] += dqdci; // dwdot[H]/d[HCO] + J[139] += dqdci; // dwdot[CO2]/d[HCO] + J[140] -= dqdci; // dwdot[HCO]/d[HCO] + // d()/dT + J[158] -= dqdT; // dwdot[O]/dT + J[161] += dqdT; // dwdot[H]/dT + J[165] += dqdT; // dwdot[CO2]/dT + J[166] -= dqdT; // dwdot[HCO]/dT + + amrex::Real c_R[12], dcRdT[12], e_RT[12]; + amrex::Real* eh_RT; + if (consP == 1) { + cp_R(c_R, T); + dcvpRdT(dcRdT, T); + eh_RT = &h_RT[0]; + } else { + cv_R(c_R, T); + dcvpRdT(dcRdT, T); + speciesInternalEnergy(e_RT, T); + eh_RT = &e_RT[0]; + } + + amrex::Real cmix = 0.0, ehmix = 0.0, dcmixdT = 0.0, dehmixdT = 0.0; + for (int k = 0; k < 12; ++k) { + cmix += c_R[k] * sc[k]; + dcmixdT += dcRdT[k] * sc[k]; + ehmix += eh_RT[k] * wdot[k]; + dehmixdT += invT * (c_R[k] - eh_RT[k]) * wdot[k] + eh_RT[k] * J[156 + k]; + } + + amrex::Real cmixinv = 1.0 / cmix; + amrex::Real tmp1 = ehmix * cmixinv; + amrex::Real tmp3 = cmixinv * T; + amrex::Real tmp2 = tmp1 * tmp3; + amrex::Real dehmixdc; + // dTdot/d[X] + for (int k = 0; k < 12; ++k) { + dehmixdc = 0.0; + for (int m = 0; m < 12; ++m) { + dehmixdc += eh_RT[m] * J[k * 13 + m]; + } + J[k * 13 + 12] = tmp2 * c_R[k] - tmp3 * dehmixdc; + } + // dTdot/dT + J[168] = -tmp1 + tmp2 * dcmixdT - tmp3 * dehmixdT; +#else + amrex::Abort(); +#endif +} + +// compute the reaction Jacobian +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +DWDOT( + amrex::Real* J, + const amrex::Real* sc, + const amrex::Real* Tp, + const int* consP) +{ + amrex::Real c[12]; + + for (int k = 0; k < 12; k++) { + c[k] = 1.e6 * sc[k]; + } + + aJacobian(J, c, *Tp, *consP); + + // dwdot[k]/dT + // dTdot/d[X] + for (int k = 0; k < 12; k++) { + J[156 + k] *= 1.e-6; + J[k * 13 + 12] *= 1.e6; + } +} + +// Transport function declarations + +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetLENIMC(int* LENIMC) +{ + *LENIMC = 50; +} + +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetLENRMC(int* LENRMC) +{ + *LENRMC = 3156; +} + +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetNO(int* NO) +{ + *NO = 4; +} + +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetKK(int* KK) +{ + *KK = 12; +} + +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetNLITE(int* NLITE) +{ + *NLITE = 2; +} + +// Patm in ergs/cm3 +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetPATM(amrex::Real* PATM) +{ + *PATM = 0.1013250000000000E+07; +} + +// the molecular weights in g/mol +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetWT(amrex::Real* WT) +{ + WT[0] = 2.01600000E+00; + WT[1] = 3.19980000E+01; + WT[2] = 1.59990000E+01; + WT[3] = 1.70070000E+01; + WT[4] = 1.80150000E+01; + WT[5] = 1.00800000E+00; + WT[6] = 3.30060000E+01; + WT[7] = 3.40140000E+01; + WT[8] = 2.80100000E+01; + WT[9] = 4.40090000E+01; + WT[10] = 2.90180000E+01; + WT[11] = 2.80140000E+01; +} + +// the lennard-jones potential well depth eps/kb in K +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetEPS(amrex::Real* EPS) +{ + EPS[0] = 3.80000000E+01; + EPS[1] = 1.07400000E+02; + EPS[2] = 8.00000000E+01; + EPS[3] = 8.00000000E+01; + EPS[4] = 5.72400000E+02; + EPS[5] = 1.45000000E+02; + EPS[6] = 1.07400000E+02; + EPS[7] = 1.07400000E+02; + EPS[8] = 9.81000000E+01; + EPS[9] = 2.44000000E+02; + EPS[10] = 4.98000000E+02; + EPS[11] = 9.75300000E+01; +} + +// the lennard-jones collision diameter in Angstroms +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetSIG(amrex::Real* SIG) +{ + SIG[0] = 2.92000000E+00; + SIG[1] = 3.45800000E+00; + SIG[2] = 2.75000000E+00; + SIG[3] = 2.75000000E+00; + SIG[4] = 2.60500000E+00; + SIG[5] = 2.05000000E+00; + SIG[6] = 3.45800000E+00; + SIG[7] = 3.45800000E+00; + SIG[8] = 3.65000000E+00; + SIG[9] = 3.76300000E+00; + SIG[10] = 3.59000000E+00; + SIG[11] = 3.62100000E+00; +} + +// the dipole moment in Debye +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetDIP(amrex::Real* DIP) +{ + DIP[0] = 0.00000000E+00; + DIP[1] = 0.00000000E+00; + DIP[2] = 0.00000000E+00; + DIP[3] = 0.00000000E+00; + DIP[4] = 1.84400000E+00; + DIP[5] = 0.00000000E+00; + DIP[6] = 0.00000000E+00; + DIP[7] = 0.00000000E+00; + DIP[8] = 0.00000000E+00; + DIP[9] = 0.00000000E+00; + DIP[10] = 0.00000000E+00; + DIP[11] = 0.00000000E+00; +} + +// the polarizability in cubic Angstroms +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetPOL(amrex::Real* POL) +{ + POL[0] = 7.90000000E-01; + POL[1] = 1.60000000E+00; + POL[2] = 0.00000000E+00; + POL[3] = 0.00000000E+00; + POL[4] = 0.00000000E+00; + POL[5] = 0.00000000E+00; + POL[6] = 0.00000000E+00; + POL[7] = 0.00000000E+00; + POL[8] = 1.95000000E+00; + POL[9] = 2.65000000E+00; + POL[10] = 0.00000000E+00; + POL[11] = 1.76000000E+00; +} + +// the rotational relaxation collision number at 298 K +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetZROT(amrex::Real* ZROT) +{ + ZROT[0] = 2.80000000E+02; + ZROT[1] = 3.80000000E+00; + ZROT[2] = 0.00000000E+00; + ZROT[3] = 0.00000000E+00; + ZROT[4] = 4.00000000E+00; + ZROT[5] = 0.00000000E+00; + ZROT[6] = 1.00000000E+00; + ZROT[7] = 3.80000000E+00; + ZROT[8] = 1.80000000E+00; + ZROT[9] = 2.10000000E+00; + ZROT[10] = 0.00000000E+00; + ZROT[11] = 4.00000000E+00; +} + +// 0: monoatomic, 1: linear, 2: nonlinear +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetNLIN(int* NLIN) +{ + NLIN[0] = 1; + NLIN[1] = 1; + NLIN[2] = 0; + NLIN[3] = 1; + NLIN[4] = 2; + NLIN[5] = 0; + NLIN[6] = 2; + NLIN[7] = 2; + NLIN[8] = 1; + NLIN[9] = 1; + NLIN[10] = 2; + NLIN[11] = 1; +} + +// Poly fits for the viscosities, dim NO*KK +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetCOFETA(amrex::Real* COFETA) +{ + COFETA[0] = -1.37549291E+01; + COFETA[1] = 9.65530587E-01; + COFETA[2] = -4.45720114E-02; + COFETA[3] = 2.05871810E-03; + COFETA[4] = -1.68118998E+01; + COFETA[5] = 2.52362554E+00; + COFETA[6] = -2.49309128E-01; + COFETA[7] = 1.10211025E-02; + COFETA[8] = -1.48001711E+01; + COFETA[9] = 1.79491990E+00; + COFETA[10] = -1.54008440E-01; + COFETA[11] = 6.86719439E-03; + COFETA[12] = -1.47696217E+01; + COFETA[13] = 1.79491990E+00; + COFETA[14] = -1.54008440E-01; + COFETA[15] = 6.86719439E-03; + COFETA[16] = -1.17770995E+01; + COFETA[17] = -8.26744826E-01; + COFETA[18] = 3.39009392E-01; + COFETA[19] = -2.00674472E-02; + COFETA[20] = -1.98744352E+01; + COFETA[21] = 3.41660514E+00; + COFETA[22] = -3.63206306E-01; + COFETA[23] = 1.58671021E-02; + COFETA[24] = -1.67963918E+01; + COFETA[25] = 2.52362554E+00; + COFETA[26] = -2.49309128E-01; + COFETA[27] = 1.10211025E-02; + COFETA[28] = -1.67813504E+01; + COFETA[29] = 2.52362554E+00; + COFETA[30] = -2.49309128E-01; + COFETA[31] = 1.10211025E-02; + COFETA[32] = -1.63031343E+01; + COFETA[33] = 2.26143219E+00; + COFETA[34] = -2.15114671E-01; + COFETA[35] = 9.53461976E-03; + COFETA[36] = -2.36749638E+01; + COFETA[37] = 4.99775518E+00; + COFETA[38] = -5.52687718E-01; + COFETA[39] = 2.34353338E-02; + COFETA[40] = -2.11306886E+01; + COFETA[41] = 3.26961843E+00; + COFETA[42] = -2.51355092E-01; + COFETA[43] = 7.35605058E-03; + COFETA[44] = -1.62526676E+01; + COFETA[45] = 2.24839597E+00; + COFETA[46] = -2.13428438E-01; + COFETA[47] = 9.46192413E-03; +} + +// Poly fits for the conductivities, dim NO*KK +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetCOFLAM(amrex::Real* COFLAM) +{ + COFLAM[0] = 1.11035309E+01; + COFLAM[1] = -1.31883723E+00; + COFLAM[2] = 2.44042222E-01; + COFLAM[3] = -8.99835317E-03; + COFLAM[4] = -2.51295522E+00; + COFLAM[5] = 3.15165699E+00; + COFLAM[6] = -3.10007687E-01; + COFLAM[7] = 1.34522334E-02; + COFLAM[8] = 1.98515155E+00; + COFLAM[9] = 1.79491990E+00; + COFLAM[10] = -1.54008440E-01; + COFLAM[11] = 6.86719439E-03; + COFLAM[12] = 1.60618776E+01; + COFLAM[13] = -4.10626624E+00; + COFLAM[14] = 6.63570999E-01; + COFLAM[15] = -2.97906170E-02; + COFLAM[16] = 2.21730553E+01; + COFLAM[17] = -8.46935470E+00; + COFLAM[18] = 1.46153792E+00; + COFLAM[19] = -7.29502313E-02; + COFLAM[20] = -3.24554543E-01; + COFLAM[21] = 3.41660514E+00; + COFLAM[22] = -3.63206306E-01; + COFLAM[23] = 1.58671021E-02; + COFLAM[24] = 5.56033781E-01; + COFLAM[25] = 1.59073629E+00; + COFLAM[26] = -5.28054537E-02; + COFLAM[27] = 4.07605156E-04; + COFLAM[28] = 1.48802076E+00; + COFLAM[29] = 1.06176261E+00; + COFLAM[30] = 5.72195029E-02; + COFLAM[31] = -6.38391114E-03; + COFLAM[32] = 9.94279641E+00; + COFLAM[33] = -2.29161583E+00; + COFLAM[34] = 4.74393158E-01; + COFLAM[35] = -2.40686330E-02; + COFLAM[36] = -1.21375517E+01; + COFLAM[37] = 6.23624372E+00; + COFLAM[38] = -6.22471355E-01; + COFLAM[39] = 2.30613270E-02; + COFLAM[40] = 1.70862641E+00; + COFLAM[41] = -1.65304969E-01; + COFLAM[42] = 3.30690188E-01; + COFLAM[43] = -2.30097301E-02; + COFLAM[44] = 1.15507226E+01; + COFLAM[45] = -2.91453572E+00; + COFLAM[46] = 5.55045264E-01; + COFLAM[47] = -2.75173246E-02; +} + +// Poly fits for the diffusion coefficients, dim NO*KK*KK +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetCOFD(amrex::Real* COFD) +{ + COFD[0] = -1.02395385E+01; + COFD[1] = 2.15403244E+00; + COFD[2] = -6.97480266E-02; + COFD[3] = 3.23666871E-03; + COFD[4] = -1.15797897E+01; + COFD[5] = 2.43235504E+00; + COFD[6] = -1.02890179E-01; + COFD[7] = 4.52903603E-03; + COFD[8] = -1.06250314E+01; + COFD[9] = 2.15849701E+00; + COFD[10] = -6.53886401E-02; + COFD[11] = 2.81453370E-03; + COFD[12] = -1.06283588E+01; + COFD[13] = 2.15849701E+00; + COFD[14] = -6.53886401E-02; + COFD[15] = 2.81453370E-03; + COFD[16] = -1.68759075E+01; + COFD[17] = 4.49460341E+00; + COFD[18] = -3.64766179E-01; + COFD[19] = 1.56457173E-02; + COFD[20] = -1.11808845E+01; + COFD[21] = 2.66936727E+00; + COFD[22] = -1.34411514E-01; + COFD[23] = 5.92957488E-03; + COFD[24] = -1.15806955E+01; + COFD[25] = 2.43235504E+00; + COFD[26] = -1.02890179E-01; + COFD[27] = 4.52903603E-03; + COFD[28] = -1.15815492E+01; + COFD[29] = 2.43235504E+00; + COFD[30] = -1.02890179E-01; + COFD[31] = 4.52903603E-03; + COFD[32] = -1.13541221E+01; + COFD[33] = 2.31999438E+00; + COFD[34] = -8.75064804E-02; + COFD[35] = 3.82656365E-03; + COFD[36] = -1.35545391E+01; + COFD[37] = 3.13878730E+00; + COFD[38] = -1.94980335E-01; + COFD[39] = 8.53744486E-03; + COFD[40] = -1.57161352E+01; + COFD[41] = 3.96062263E+00; + COFD[42] = -2.98964970E-01; + COFD[43] = 1.29322565E-02; + COFD[44] = -1.13253618E+01; + COFD[45] = 2.31195095E+00; + COFD[46] = -8.63988037E-02; + COFD[47] = 3.77573452E-03; + COFD[48] = -1.15797897E+01; + COFD[49] = 2.43235504E+00; + COFD[50] = -1.02890179E-01; + COFD[51] = 4.52903603E-03; + COFD[52] = -1.53110597E+01; + COFD[53] = 3.37317428E+00; + COFD[54] = -2.24900439E-01; + COFD[55] = 9.81228151E-03; + COFD[56] = -1.40864784E+01; + COFD[57] = 3.07458927E+00; + COFD[58] = -1.86899591E-01; + COFD[59] = 8.19829781E-03; + COFD[60] = -1.41066358E+01; + COFD[61] = 3.07458927E+00; + COFD[62] = -1.86899591E-01; + COFD[63] = 8.19829781E-03; + COFD[64] = -2.10639926E+01; + COFD[65] = 5.50980703E+00; + COFD[66] = -4.78335492E-01; + COFD[67] = 1.98515434E-02; + COFD[68] = -1.43713019E+01; + COFD[69] = 3.70920439E+00; + COFD[70] = -2.67274113E-01; + COFD[71] = 1.15967481E-02; + COFD[72] = -1.53187536E+01; + COFD[73] = 3.37317428E+00; + COFD[74] = -2.24900439E-01; + COFD[75] = 9.81228151E-03; + COFD[76] = -1.53261011E+01; + COFD[77] = 3.37317428E+00; + COFD[78] = -2.24900439E-01; + COFD[79] = 9.81228151E-03; + COFD[80] = -1.50371688E+01; + COFD[81] = 3.26249588E+00; + COFD[82] = -2.10658287E-01; + COFD[83] = 9.20032462E-03; + COFD[84] = -1.81197250E+01; + COFD[85] = 4.33684042E+00; + COFD[86] = -3.44981265E-01; + COFD[87] = 1.48142449E-02; + COFD[88] = -2.05107395E+01; + COFD[89] = 5.21473296E+00; + COFD[90] = -4.48646311E-01; + COFD[91] = 1.89013813E-02; + COFD[92] = -1.50096252E+01; + COFD[93] = 3.25515933E+00; + COFD[94] = -2.09710110E-01; + COFD[95] = 9.15941830E-03; + COFD[96] = -1.06250314E+01; + COFD[97] = 2.15849701E+00; + COFD[98] = -6.53886401E-02; + COFD[99] = 2.81453370E-03; + COFD[100] = -1.40864784E+01; + COFD[101] = 3.07458927E+00; + COFD[102] = -1.86899591E-01; + COFD[103] = 8.19829781E-03; + COFD[104] = -1.29877255E+01; + COFD[105] = 2.80841511E+00; + COFD[106] = -1.52629888E-01; + COFD[107] = 6.72604927E-03; + COFD[108] = -1.30027669E+01; + COFD[109] = 2.80841511E+00; + COFD[110] = -1.52629888E-01; + COFD[111] = 6.72604927E-03; + COFD[112] = -1.91096700E+01; + COFD[113] = 5.02608697E+00; + COFD[114] = -4.26959993E-01; + COFD[115] = 1.80709910E-02; + COFD[116] = -1.31860264E+01; + COFD[117] = 3.38003453E+00; + COFD[118] = -2.25783856E-01; + COFD[119] = 9.85028660E-03; + COFD[120] = -1.40915944E+01; + COFD[121] = 3.07458927E+00; + COFD[122] = -1.86899591E-01; + COFD[123] = 8.19829781E-03; + COFD[124] = -1.40964555E+01; + COFD[125] = 3.07458927E+00; + COFD[126] = -1.86899591E-01; + COFD[127] = 8.19829781E-03; + COFD[128] = -1.39007309E+01; + COFD[129] = 2.99164244E+00; + COFD[130] = -1.76293106E-01; + COFD[131] = 7.74575100E-03; + COFD[132] = -1.67115471E+01; + COFD[133] = 3.98859394E+00; + COFD[134] = -3.02316219E-01; + COFD[135] = 1.30661099E-02; + COFD[136] = -1.91045520E+01; + COFD[137] = 4.87977047E+00; + COFD[138] = -4.10448693E-01; + COFD[139] = 1.74535827E-02; + COFD[140] = -1.38756380E+01; + COFD[141] = 2.98558426E+00; + COFD[142] = -1.75507216E-01; + COFD[143] = 7.71173691E-03; + COFD[144] = -1.06283588E+01; + COFD[145] = 2.15849701E+00; + COFD[146] = -6.53886401E-02; + COFD[147] = 2.81453370E-03; + COFD[148] = -1.41066358E+01; + COFD[149] = 3.07458927E+00; + COFD[150] = -1.86899591E-01; + COFD[151] = 8.19829781E-03; + COFD[152] = -1.30027669E+01; + COFD[153] = 2.80841511E+00; + COFD[154] = -1.52629888E-01; + COFD[155] = 6.72604927E-03; + COFD[156] = -1.30182749E+01; + COFD[157] = 2.80841511E+00; + COFD[158] = -1.52629888E-01; + COFD[159] = 6.72604927E-03; + COFD[160] = -1.91256173E+01; + COFD[161] = 5.02608697E+00; + COFD[162] = -4.26959993E-01; + COFD[163] = 1.80709910E-02; + COFD[164] = -1.31877859E+01; + COFD[165] = 3.38003453E+00; + COFD[166] = -2.25783856E-01; + COFD[167] = 9.85028660E-03; + COFD[168] = -1.41119635E+01; + COFD[169] = 3.07458927E+00; + COFD[170] = -1.86899591E-01; + COFD[171] = 8.19829781E-03; + COFD[172] = -1.41170278E+01; + COFD[173] = 3.07458927E+00; + COFD[174] = -1.86899591E-01; + COFD[175] = 8.19829781E-03; + COFD[176] = -1.39199573E+01; + COFD[177] = 2.99164244E+00; + COFD[178] = -1.76293106E-01; + COFD[179] = 7.74575100E-03; + COFD[180] = -1.67337674E+01; + COFD[181] = 3.98859394E+00; + COFD[182] = -3.02316219E-01; + COFD[183] = 1.30661099E-02; + COFD[184] = -1.91240292E+01; + COFD[185] = 4.87977047E+00; + COFD[186] = -4.10448693E-01; + COFD[187] = 1.74535827E-02; + COFD[188] = -1.38948654E+01; + COFD[189] = 2.98558426E+00; + COFD[190] = -1.75507216E-01; + COFD[191] = 7.71173691E-03; + COFD[192] = -1.68759075E+01; + COFD[193] = 4.49460341E+00; + COFD[194] = -3.64766179E-01; + COFD[195] = 1.56457173E-02; + COFD[196] = -2.10639926E+01; + COFD[197] = 5.50980703E+00; + COFD[198] = -4.78335492E-01; + COFD[199] = 1.98515434E-02; + COFD[200] = -1.91096700E+01; + COFD[201] = 5.02608697E+00; + COFD[202] = -4.26959993E-01; + COFD[203] = 1.80709910E-02; + COFD[204] = -1.91256173E+01; + COFD[205] = 5.02608697E+00; + COFD[206] = -4.26959993E-01; + COFD[207] = 1.80709910E-02; + COFD[208] = -1.31492509E+01; + COFD[209] = 1.48004045E+00; + COFD[210] = 1.60499956E-01; + COFD[211] = -1.19765871E-02; + COFD[212] = -1.93611201E+01; + COFD[213] = 5.51579726E+00; + COFD[214] = -4.76061961E-01; + COFD[215] = 1.96329391E-02; + COFD[216] = -2.04177394E+01; + COFD[217] = 5.31457079E+00; + COFD[218] = -4.58216496E-01; + COFD[219] = 1.91825910E-02; + COFD[220] = -2.04229988E+01; + COFD[221] = 5.31457079E+00; + COFD[222] = -4.58216496E-01; + COFD[223] = 1.91825910E-02; + COFD[224] = -2.08943723E+01; + COFD[225] = 5.44718673E+00; + COFD[226] = -4.72082974E-01; + COFD[227] = 1.96531328E-02; + COFD[228] = -2.12021420E+01; + COFD[229] = 5.20775027E+00; + COFD[230] = -4.07348285E-01; + COFD[231] = 1.55473262E-02; + COFD[232] = -1.87171338E+01; + COFD[233] = 4.00967621E+00; + COFD[234] = -2.21153539E-01; + COFD[235] = 6.31528745E-03; + COFD[236] = -2.08123331E+01; + COFD[237] = 5.42470175E+00; + COFD[238] = -4.69700438E-01; + COFD[239] = 1.95706912E-02; + COFD[240] = -1.11808845E+01; + COFD[241] = 2.66936727E+00; + COFD[242] = -1.34411514E-01; + COFD[243] = 5.92957488E-03; + COFD[244] = -1.43713019E+01; + COFD[245] = 3.70920439E+00; + COFD[246] = -2.67274113E-01; + COFD[247] = 1.15967481E-02; + COFD[248] = -1.31860264E+01; + COFD[249] = 3.38003453E+00; + COFD[250] = -2.25783856E-01; + COFD[251] = 9.85028660E-03; + COFD[252] = -1.31877859E+01; + COFD[253] = 3.38003453E+00; + COFD[254] = -2.25783856E-01; + COFD[255] = 9.85028660E-03; + COFD[256] = -1.93611201E+01; + COFD[257] = 5.51579726E+00; + COFD[258] = -4.76061961E-01; + COFD[259] = 1.96329391E-02; + COFD[260] = -1.43693219E+01; + COFD[261] = 4.03992999E+00; + COFD[262] = -3.08044800E-01; + COFD[263] = 1.32757775E-02; + COFD[264] = -1.43717684E+01; + COFD[265] = 3.70920439E+00; + COFD[266] = -2.67274113E-01; + COFD[267] = 1.15967481E-02; + COFD[268] = -1.43722077E+01; + COFD[269] = 3.70920439E+00; + COFD[270] = -2.67274113E-01; + COFD[271] = 1.15967481E-02; + COFD[272] = -1.40524219E+01; + COFD[273] = 3.56261348E+00; + COFD[274] = -2.48287981E-01; + COFD[275] = 1.07752947E-02; + COFD[276] = -1.72994129E+01; + COFD[277] = 4.71931868E+00; + COFD[278] = -3.91258152E-01; + COFD[279] = 1.66866639E-02; + COFD[280] = -1.95312879E+01; + COFD[281] = 5.47046983E+00; + COFD[282] = -4.74577605E-01; + COFD[283] = 1.97408822E-02; + COFD[284] = -1.40298991E+01; + COFD[285] = 3.55837688E+00; + COFD[286] = -2.47785790E-01; + COFD[287] = 1.07555332E-02; + COFD[288] = -1.15806955E+01; + COFD[289] = 2.43235504E+00; + COFD[290] = -1.02890179E-01; + COFD[291] = 4.52903603E-03; + COFD[292] = -1.53187536E+01; + COFD[293] = 3.37317428E+00; + COFD[294] = -2.24900439E-01; + COFD[295] = 9.81228151E-03; + COFD[296] = -1.40915944E+01; + COFD[297] = 3.07458927E+00; + COFD[298] = -1.86899591E-01; + COFD[299] = 8.19829781E-03; + COFD[300] = -1.41119635E+01; + COFD[301] = 3.07458927E+00; + COFD[302] = -1.86899591E-01; + COFD[303] = 8.19829781E-03; + COFD[304] = -2.04177394E+01; + COFD[305] = 5.31457079E+00; + COFD[306] = -4.58216496E-01; + COFD[307] = 1.91825910E-02; + COFD[308] = -1.43717684E+01; + COFD[309] = 3.70920439E+00; + COFD[310] = -2.67274113E-01; + COFD[311] = 1.15967481E-02; + COFD[312] = -1.53265677E+01; + COFD[313] = 3.37317428E+00; + COFD[314] = -2.24900439E-01; + COFD[315] = 9.81228151E-03; + COFD[316] = -1.53340319E+01; + COFD[317] = 3.37317428E+00; + COFD[318] = -2.24900439E-01; + COFD[319] = 9.81228151E-03; + COFD[320] = -1.50443476E+01; + COFD[321] = 3.26249588E+00; + COFD[322] = -2.10658287E-01; + COFD[323] = 9.20032462E-03; + COFD[324] = -1.81286456E+01; + COFD[325] = 4.33684042E+00; + COFD[326] = -3.44981265E-01; + COFD[327] = 1.48142449E-02; + COFD[328] = -2.05180548E+01; + COFD[329] = 5.21473296E+00; + COFD[330] = -4.48646311E-01; + COFD[331] = 1.89013813E-02; + COFD[332] = -1.50168047E+01; + COFD[333] = 3.25515933E+00; + COFD[334] = -2.09710110E-01; + COFD[335] = 9.15941830E-03; + COFD[336] = -1.15815492E+01; + COFD[337] = 2.43235504E+00; + COFD[338] = -1.02890179E-01; + COFD[339] = 4.52903603E-03; + COFD[340] = -1.53261011E+01; + COFD[341] = 3.37317428E+00; + COFD[342] = -2.24900439E-01; + COFD[343] = 9.81228151E-03; + COFD[344] = -1.40964555E+01; + COFD[345] = 3.07458927E+00; + COFD[346] = -1.86899591E-01; + COFD[347] = 8.19829781E-03; + COFD[348] = -1.41170278E+01; + COFD[349] = 3.07458927E+00; + COFD[350] = -1.86899591E-01; + COFD[351] = 8.19829781E-03; + COFD[352] = -2.04229988E+01; + COFD[353] = 5.31457079E+00; + COFD[354] = -4.58216496E-01; + COFD[355] = 1.91825910E-02; + COFD[356] = -1.43722077E+01; + COFD[357] = 3.70920439E+00; + COFD[358] = -2.67274113E-01; + COFD[359] = 1.15967481E-02; + COFD[360] = -1.53340319E+01; + COFD[361] = 3.37317428E+00; + COFD[362] = -2.24900439E-01; + COFD[363] = 9.81228151E-03; + COFD[364] = -1.53416091E+01; + COFD[365] = 3.37317428E+00; + COFD[366] = -2.24900439E-01; + COFD[367] = 9.81228151E-03; + COFD[368] = -1.50511964E+01; + COFD[369] = 3.26249588E+00; + COFD[370] = -2.10658287E-01; + COFD[371] = 9.20032462E-03; + COFD[372] = -1.81371853E+01; + COFD[373] = 4.33684042E+00; + COFD[374] = -3.44981265E-01; + COFD[375] = 1.48142449E-02; + COFD[376] = -2.05250357E+01; + COFD[377] = 5.21473296E+00; + COFD[378] = -4.48646311E-01; + COFD[379] = 1.89013813E-02; + COFD[380] = -1.50236540E+01; + COFD[381] = 3.25515933E+00; + COFD[382] = -2.09710110E-01; + COFD[383] = 9.15941830E-03; + COFD[384] = -1.13541221E+01; + COFD[385] = 2.31999438E+00; + COFD[386] = -8.75064804E-02; + COFD[387] = 3.82656365E-03; + COFD[388] = -1.50371688E+01; + COFD[389] = 3.26249588E+00; + COFD[390] = -2.10658287E-01; + COFD[391] = 9.20032462E-03; + COFD[392] = -1.39007309E+01; + COFD[393] = 2.99164244E+00; + COFD[394] = -1.76293106E-01; + COFD[395] = 7.74575100E-03; + COFD[396] = -1.39199573E+01; + COFD[397] = 2.99164244E+00; + COFD[398] = -1.76293106E-01; + COFD[399] = 7.74575100E-03; + COFD[400] = -2.08943723E+01; + COFD[401] = 5.44718673E+00; + COFD[402] = -4.72082974E-01; + COFD[403] = 1.96531328E-02; + COFD[404] = -1.40524219E+01; + COFD[405] = 3.56261348E+00; + COFD[406] = -2.48287981E-01; + COFD[407] = 1.07752947E-02; + COFD[408] = -1.50443476E+01; + COFD[409] = 3.26249588E+00; + COFD[410] = -2.10658287E-01; + COFD[411] = 9.20032462E-03; + COFD[412] = -1.50511964E+01; + COFD[413] = 3.26249588E+00; + COFD[414] = -2.10658287E-01; + COFD[415] = 9.20032462E-03; + COFD[416] = -1.48061406E+01; + COFD[417] = 3.16912473E+00; + COFD[418] = -1.98792456E-01; + COFD[419] = 8.69726395E-03; + COFD[420] = -1.77672912E+01; + COFD[421] = 4.20234040E+00; + COFD[422] = -3.28057658E-01; + COFD[423] = 1.41006192E-02; + COFD[424] = -2.02361782E+01; + COFD[425] = 5.11785645E+00; + COFD[426] = -4.37867828E-01; + COFD[427] = 1.85047543E-02; + COFD[428] = -1.47850505E+01; + COFD[429] = 3.16433919E+00; + COFD[430] = -1.98191564E-01; + COFD[431] = 8.67209742E-03; + COFD[432] = -1.35545391E+01; + COFD[433] = 3.13878730E+00; + COFD[434] = -1.94980335E-01; + COFD[435] = 8.53744486E-03; + COFD[436] = -1.81197250E+01; + COFD[437] = 4.33684042E+00; + COFD[438] = -3.44981265E-01; + COFD[439] = 1.48142449E-02; + COFD[440] = -1.67115471E+01; + COFD[441] = 3.98859394E+00; + COFD[442] = -3.02316219E-01; + COFD[443] = 1.30661099E-02; + COFD[444] = -1.67337674E+01; + COFD[445] = 3.98859394E+00; + COFD[446] = -3.02316219E-01; + COFD[447] = 1.30661099E-02; + COFD[448] = -2.12021420E+01; + COFD[449] = 5.20775027E+00; + COFD[450] = -4.07348285E-01; + COFD[451] = 1.55473262E-02; + COFD[452] = -1.72994129E+01; + COFD[453] = 4.71931868E+00; + COFD[454] = -3.91258152E-01; + COFD[455] = 1.66866639E-02; + COFD[456] = -1.81286456E+01; + COFD[457] = 4.33684042E+00; + COFD[458] = -3.44981265E-01; + COFD[459] = 1.48142449E-02; + COFD[460] = -1.81371853E+01; + COFD[461] = 4.33684042E+00; + COFD[462] = -3.44981265E-01; + COFD[463] = 1.48142449E-02; + COFD[464] = -1.77672912E+01; + COFD[465] = 4.20234040E+00; + COFD[466] = -3.28057658E-01; + COFD[467] = 1.41006192E-02; + COFD[468] = -2.10907633E+01; + COFD[469] = 5.29211327E+00; + COFD[470] = -4.56068366E-01; + COFD[471] = 1.91195062E-02; + COFD[472] = -2.20758670E+01; + COFD[473] = 5.52171573E+00; + COFD[474] = -4.63284984E-01; + COFD[475] = 1.85570924E-02; + COFD[476] = -1.77350630E+01; + COFD[477] = 4.19328271E+00; + COFD[478] = -3.26911461E-01; + COFD[479] = 1.40520357E-02; + COFD[480] = -1.57161352E+01; + COFD[481] = 3.96062263E+00; + COFD[482] = -2.98964970E-01; + COFD[483] = 1.29322565E-02; + COFD[484] = -2.05107395E+01; + COFD[485] = 5.21473296E+00; + COFD[486] = -4.48646311E-01; + COFD[487] = 1.89013813E-02; + COFD[488] = -1.91045520E+01; + COFD[489] = 4.87977047E+00; + COFD[490] = -4.10448693E-01; + COFD[491] = 1.74535827E-02; + COFD[492] = -1.91240292E+01; + COFD[493] = 4.87977047E+00; + COFD[494] = -4.10448693E-01; + COFD[495] = 1.74535827E-02; + COFD[496] = -1.87171338E+01; + COFD[497] = 4.00967621E+00; + COFD[498] = -2.21153539E-01; + COFD[499] = 6.31528745E-03; + COFD[500] = -1.95312879E+01; + COFD[501] = 5.47046983E+00; + COFD[502] = -4.74577605E-01; + COFD[503] = 1.97408822E-02; + COFD[504] = -2.05180548E+01; + COFD[505] = 5.21473296E+00; + COFD[506] = -4.48646311E-01; + COFD[507] = 1.89013813E-02; + COFD[508] = -2.05250357E+01; + COFD[509] = 5.21473296E+00; + COFD[510] = -4.48646311E-01; + COFD[511] = 1.89013813E-02; + COFD[512] = -2.02361782E+01; + COFD[513] = 5.11785645E+00; + COFD[514] = -4.37867828E-01; + COFD[515] = 1.85047543E-02; + COFD[516] = -2.20758670E+01; + COFD[517] = 5.52171573E+00; + COFD[518] = -4.63284984E-01; + COFD[519] = 1.85570924E-02; + COFD[520] = -1.98983685E+01; + COFD[521] = 4.38041133E+00; + COFD[522] = -2.77538214E-01; + COFD[523] = 9.06748822E-03; + COFD[524] = -2.02052920E+01; + COFD[525] = 5.10993120E+00; + COFD[526] = -4.36931630E-01; + COFD[527] = 1.84677592E-02; + COFD[528] = -1.13253618E+01; + COFD[529] = 2.31195095E+00; + COFD[530] = -8.63988037E-02; + COFD[531] = 3.77573452E-03; + COFD[532] = -1.50096252E+01; + COFD[533] = 3.25515933E+00; + COFD[534] = -2.09710110E-01; + COFD[535] = 9.15941830E-03; + COFD[536] = -1.38756380E+01; + COFD[537] = 2.98558426E+00; + COFD[538] = -1.75507216E-01; + COFD[539] = 7.71173691E-03; + COFD[540] = -1.38948654E+01; + COFD[541] = 2.98558426E+00; + COFD[542] = -1.75507216E-01; + COFD[543] = 7.71173691E-03; + COFD[544] = -2.08123331E+01; + COFD[545] = 5.42470175E+00; + COFD[546] = -4.69700438E-01; + COFD[547] = 1.95706912E-02; + COFD[548] = -1.40298991E+01; + COFD[549] = 3.55837688E+00; + COFD[550] = -2.47785790E-01; + COFD[551] = 1.07555332E-02; + COFD[552] = -1.50168047E+01; + COFD[553] = 3.25515933E+00; + COFD[554] = -2.09710110E-01; + COFD[555] = 9.15941830E-03; + COFD[556] = -1.50236540E+01; + COFD[557] = 3.25515933E+00; + COFD[558] = -2.09710110E-01; + COFD[559] = 9.15941830E-03; + COFD[560] = -1.47850505E+01; + COFD[561] = 3.16433919E+00; + COFD[562] = -1.98191564E-01; + COFD[563] = 8.67209742E-03; + COFD[564] = -1.77350630E+01; + COFD[565] = 4.19328271E+00; + COFD[566] = -3.26911461E-01; + COFD[567] = 1.40520357E-02; + COFD[568] = -2.02052920E+01; + COFD[569] = 5.10993120E+00; + COFD[570] = -4.36931630E-01; + COFD[571] = 1.84677592E-02; + COFD[572] = -1.47639411E+01; + COFD[573] = 3.15955654E+00; + COFD[574] = -1.97590757E-01; + COFD[575] = 8.64692156E-03; +} + +// List of specs with small weight, dim NLITE +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetKTDIF(int* KTDIF) +{ + KTDIF[0] = 0; + KTDIF[1] = 5; +} + +// Poly fits for thermal diff ratios, dim NO*NLITE*KK +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +egtransetCOFTD(amrex::Real* COFTD) +{ + COFTD[0] = 0.00000000E+00; + COFTD[1] = 0.00000000E+00; + COFTD[2] = 0.00000000E+00; + COFTD[3] = 0.00000000E+00; + COFTD[4] = 4.42736017E-01; + COFTD[5] = 7.11765887E-05; + COFTD[6] = -3.84765396E-08; + COFTD[7] = 6.86318682E-12; + COFTD[8] = 4.15577509E-01; + COFTD[9] = 1.09736860E-05; + COFTD[10] = -3.96016410E-09; + COFTD[11] = 1.14412838E-12; + COFTD[12] = 4.21927217E-01; + COFTD[13] = 1.11413555E-05; + COFTD[14] = -4.02067239E-09; + COFTD[15] = 1.16160979E-12; + COFTD[16] = 6.02021050E-02; + COFTD[17] = 5.61555733E-04; + COFTD[18] = -2.55370065E-07; + COFTD[19] = 3.63385926E-11; + COFTD[20] = -1.52534742E-01; + COFTD[21] = -5.46404022E-05; + COFTD[22] = 2.93412470E-08; + COFTD[23] = -4.87091914E-12; + COFTD[24] = 4.44449675E-01; + COFTD[25] = 7.14520855E-05; + COFTD[26] = -3.86254673E-08; + COFTD[27] = 6.88975155E-12; + COFTD[28] = 4.46067449E-01; + COFTD[29] = 7.17121674E-05; + COFTD[30] = -3.87660620E-08; + COFTD[31] = 6.91482989E-12; + COFTD[32] = 4.44650439E-01; + COFTD[33] = 5.06628083E-05; + COFTD[34] = -2.69818971E-08; + COFTD[35] = 5.01286176E-12; + COFTD[36] = 3.25740914E-01; + COFTD[37] = 3.03631979E-04; + COFTD[38] = -1.55289598E-07; + COFTD[39] = 2.41465297E-11; + COFTD[40] = 1.61391212E-01; + COFTD[41] = 5.01080793E-04; + COFTD[42] = -2.38272376E-07; + COFTD[43] = 3.49342098E-11; + COFTD[44] = 4.45261429E-01; + COFTD[45] = 4.94696577E-05; + COFTD[46] = -2.63023124E-08; + COFTD[47] = 4.90305626E-12; + COFTD[48] = 1.52534742E-01; + COFTD[49] = 5.46404022E-05; + COFTD[50] = -2.93412470E-08; + COFTD[51] = 4.87091914E-12; + COFTD[52] = 2.20482081E-01; + COFTD[53] = 4.80162630E-04; + COFTD[54] = -2.32927140E-07; + COFTD[55] = 3.46469239E-11; + COFTD[56] = 2.70008280E-01; + COFTD[57] = 3.61552588E-04; + COFTD[58] = -1.80743499E-07; + COFTD[59] = 2.75319341E-11; + COFTD[60] = 2.72039997E-01; + COFTD[61] = 3.64273144E-04; + COFTD[62] = -1.82103531E-07; + COFTD[63] = 2.77391022E-11; + COFTD[64] = -1.41882969E-01; + COFTD[65] = 7.66554625E-04; + COFTD[66] = -3.06548330E-07; + COFTD[67] = 4.02957302E-11; + COFTD[68] = 0.00000000E+00; + COFTD[69] = 0.00000000E+00; + COFTD[70] = 0.00000000E+00; + COFTD[71] = 0.00000000E+00; + COFTD[72] = 2.20907136E-01; + COFTD[73] = 4.81088308E-04; + COFTD[74] = -2.33376187E-07; + COFTD[75] = 3.47137178E-11; + COFTD[76] = 2.21307723E-01; + COFTD[77] = 4.81960701E-04; + COFTD[78] = -2.33799385E-07; + COFTD[79] = 3.47766667E-11; + COFTD[80] = 2.39409087E-01; + COFTD[81] = 4.47195587E-04; + COFTD[82] = -2.18950923E-07; + COFTD[83] = 3.27972343E-11; + COFTD[84] = 2.44368810E-02; + COFTD[85] = 7.18240808E-04; + COFTD[86] = -3.19717751E-07; + COFTD[87] = 4.48827629E-11; + COFTD[88] = -1.24647578E-01; + COFTD[89] = 7.96522972E-04; + COFTD[90] = -3.24997704E-07; + COFTD[91] = 4.32515301E-11; + COFTD[92] = 2.40744276E-01; + COFTD[93] = 4.45343183E-04; + COFTD[94] = -2.18173742E-07; + COFTD[95] = 3.26958310E-11; +} + +// compute the critical parameters for each species +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +GET_CRITPARAMS( + amrex::Real* Tci, amrex::Real* ai, amrex::Real* bi, amrex::Real* acentric_i) +{ + + amrex::Real EPS[12]; + amrex::Real SIG[12]; + amrex::Real wt[12]; + amrex::Real Rcst = 83.144598; // in bar [CGS] ! + amrex::Real avogadro = 6.02214199e23; + amrex::Real boltzmann = 1.3806503e-16; // we work in CGS + + egtransetEPS(EPS); + egtransetSIG(SIG); + get_mw(wt); + + // species 0: H2 + // Imported from NIST + Tci[0] = 33.145000; + ai[0] = 1e6 * 0.42748 * Rcst * Rcst * Tci[0] * Tci[0] / + (2.015880 * 2.015880 * 12.964000); + bi[0] = 0.08664 * Rcst * Tci[0] / (2.015880 * 12.964000); + acentric_i[0] = -0.219000; + + // species 1: O2 + // Imported from NIST + Tci[1] = 154.581000; + ai[1] = 1e6 * 0.42748 * Rcst * Rcst * Tci[1] * Tci[1] / + (31.998800 * 31.998800 * 50.430466); + bi[1] = 0.08664 * Rcst * Tci[1] / (31.998800 * 50.430466); + acentric_i[1] = 0.022200; + + // species 2: O + Tci[2] = 1.316 * EPS[2]; + ai[2] = (5.55 * avogadro * avogadro * EPS[2] * boltzmann * 1e-24 * SIG[2] * + SIG[2] * SIG[2]) / + (wt[2] * wt[2]); + bi[2] = 0.855 * avogadro * 1e-24 * SIG[2] * SIG[2] * SIG[2] / (wt[2]); + acentric_i[2] = 0.0; + + // species 3: OH + Tci[3] = 1.316 * EPS[3]; + ai[3] = (5.55 * avogadro * avogadro * EPS[3] * boltzmann * 1e-24 * SIG[3] * + SIG[3] * SIG[3]) / + (wt[3] * wt[3]); + bi[3] = 0.855 * avogadro * 1e-24 * SIG[3] * SIG[3] * SIG[3] / (wt[3]); + acentric_i[3] = 0.0; + + // species 4: H2O + // Imported from NIST + Tci[4] = 647.096000; + ai[4] = 1e6 * 0.42748 * Rcst * Rcst * Tci[4] * Tci[4] / + (18.015340 * 18.015340 * 220.640000); + bi[4] = 0.08664 * Rcst * Tci[4] / (18.015340 * 220.640000); + acentric_i[4] = 0.344300; + + // species 5: H + Tci[5] = 1.316 * EPS[5]; + ai[5] = (5.55 * avogadro * avogadro * EPS[5] * boltzmann * 1e-24 * SIG[5] * + SIG[5] * SIG[5]) / + (wt[5] * wt[5]); + bi[5] = 0.855 * avogadro * 1e-24 * SIG[5] * SIG[5] * SIG[5] / (wt[5]); + acentric_i[5] = 0.0; + + // species 6: HO2 + Tci[6] = 1.316 * EPS[6]; + ai[6] = (5.55 * avogadro * avogadro * EPS[6] * boltzmann * 1e-24 * SIG[6] * + SIG[6] * SIG[6]) / + (wt[6] * wt[6]); + bi[6] = 0.855 * avogadro * 1e-24 * SIG[6] * SIG[6] * SIG[6] / (wt[6]); + acentric_i[6] = 0.0; + + // species 7: H2O2 + Tci[7] = 1.316 * EPS[7]; + ai[7] = (5.55 * avogadro * avogadro * EPS[7] * boltzmann * 1e-24 * SIG[7] * + SIG[7] * SIG[7]) / + (wt[7] * wt[7]); + bi[7] = 0.855 * avogadro * 1e-24 * SIG[7] * SIG[7] * SIG[7] / (wt[7]); + acentric_i[7] = 0.0; + + // species 8: CO + // Imported from NIST + Tci[8] = 132.850000; + ai[8] = 1e6 * 0.42748 * Rcst * Rcst * Tci[8] * Tci[8] / + (28.010000 * 28.010000 * 34.940000); + bi[8] = 0.08664 * Rcst * Tci[8] / (28.010000 * 34.940000); + acentric_i[8] = 0.045000; + + // species 9: CO2 + // Imported from NIST + Tci[9] = 304.120000; + ai[9] = 1e6 * 0.42748 * Rcst * Rcst * Tci[9] * Tci[9] / + (44.009950 * 44.009950 * 73.740000); + bi[9] = 0.08664 * Rcst * Tci[9] / (44.009950 * 73.740000); + acentric_i[9] = 0.225000; + + // species 10: HCO + Tci[10] = 1.316 * EPS[10]; + ai[10] = (5.55 * avogadro * avogadro * EPS[10] * boltzmann * 1e-24 * SIG[10] * + SIG[10] * SIG[10]) / + (wt[10] * wt[10]); + bi[10] = 0.855 * avogadro * 1e-24 * SIG[10] * SIG[10] * SIG[10] / (wt[10]); + acentric_i[10] = 0.0; + + // species 11: N2 + // Imported from NIST + Tci[11] = 126.192000; + ai[11] = 1e6 * 0.42748 * Rcst * Rcst * Tci[11] * Tci[11] / + (28.013400 * 28.013400 * 33.958000); + bi[11] = 0.08664 * Rcst * Tci[11] / (28.013400 * 33.958000); + acentric_i[11] = 0.037200; +} + +// compute the critical parameter quantities for each species for SRK +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +GET_CRITPARAMS_SRK( + amrex::Real* sqrtOneOverTc, + amrex::Real* sqrtAsti, + amrex::Real* Bi, + amrex::Real* Fomega) +{ + + // species 0: H2 + // Imported from NIST + sqrtOneOverTc[0] = 1.7369646834812e-01; + sqrtAsti[0] = 2.4824229305911e+05; + Bi[0] = 9.1362254169923e+00; + Fomega[0] = 1.3798618890700e-01; + + // species 1: O2 + // Imported from NIST + sqrtOneOverTc[1] = 8.0430717653241e-02; + sqrtAsti[1] = 3.6980081924740e+04; + Bi[1] = 6.9005216444999e-01; + Fomega[1] = 5.1945301904908e-01; + + // species 2: O + // Computed from Lennard-Jones + sqrtOneOverTc[2] = 9.7460146948181e-02; + sqrtAsti[2] = 4.2500156012386e+04; + Bi[2] = 6.6930234851885e-01; + Fomega[2] = 4.8508000000000e-01; + + // species 3: OH + // Computed from Lennard-Jones + sqrtOneOverTc[3] = 9.7460146948181e-02; + sqrtAsti[3] = 3.9981183985545e+04; + Bi[3] = 6.2963299076575e-01; + Fomega[3] = 4.8508000000000e-01; + + // species 4: H2O + // Imported from NIST + sqrtOneOverTc[4] = 3.9311140369715e-02; + sqrtAsti[4] = 1.3145468419592e+05; + Bi[4] = 1.1727204136223e+00; + Fomega[4] = 1.0013577274636e+00; + + // species 5: H + // Computed from Lennard-Jones + sqrtOneOverTc[5] = 7.2391579785311e-02; + sqrtAsti[5] = 5.8451221185793e+05; + Bi[5] = 4.4006634563410e+00; + Fomega[5] = 4.8508000000000e-01; + + // species 6: HO2 + // Computed from Lennard-Jones + sqrtOneOverTc[6] = 8.4114315417892e-02; + sqrtAsti[6] = 3.3657825710980e+04; + Bi[6] = 6.4505861132042e-01; + Fomega[6] = 4.8508000000000e-01; + + // species 7: H2O2 + // Computed from Lennard-Jones + sqrtOneOverTc[7] = 8.4114315417892e-02; + sqrtAsti[7] = 3.2660380884830e+04; + Bi[7] = 6.2594239211036e-01; + Fomega[7] = 4.8508000000000e-01; + + // species 8: CO + // Imported from NIST + sqrtOneOverTc[8] = 8.6759935530451e-02; + sqrtAsti[8] = 4.3619324712923e+04; + Bi[8] = 9.7786303823350e-01; + Fomega[8] = 5.5459948367500e-01; + + // species 9: CO2 + // Imported from NIST + sqrtOneOverTc[9] = 5.7342616962522e-02; + sqrtAsti[9] = 4.3745610142919e+04; + Bi[9] = 6.7506167841745e-01; + Fomega[9] = 8.2653709187500e-01; + + // species 10: HCO + // Computed from Lennard-Jones + sqrtOneOverTc[10] = 3.9062261583604e-02; + sqrtAsti[10] = 8.7202351509582e+04; + Bi[10] = 8.2098075206475e-01; + Fomega[10] = 4.8508000000000e-01; + + // species 11: N2 + // Imported from NIST + sqrtOneOverTc[11] = 8.9019282240563e-02; + sqrtAsti[11] = 4.2022983929562e+04; + Bi[11] = 9.5560052221563e-01; + Fomega[11] = 5.4259343186608e-01; +} + +// gauss-jordan solver external routine +// Replace this routine with the one generated by the Gauss Jordan solver of DW +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +sgjsolve(amrex::Real* /*A*/, amrex::Real* /*x*/, amrex::Real* /*b*/) +{ + amrex::Abort("sgjsolve not implemented, choose a different solver "); +} + +// Replace this routine with the one generated by the Gauss Jordan solver of DW +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void +sgjsolve_simplified(amrex::Real* /*A*/, amrex::Real* /*x*/, amrex::Real* /*b*/) +{ + amrex::Abort( + "sgjsolve_simplified not implemented, choose a different solver "); +} + +#endif diff --git a/Support/ceptr/Kolla/mechanism.cpp b/Support/ceptr/Kolla/mechanism.cpp new file mode 100644 index 000000000..8cfa257c1 --- /dev/null +++ b/Support/ceptr/Kolla/mechanism.cpp @@ -0,0 +1,489 @@ +#include "mechanism.H" +const int rmap[29] = {8, 15, 21, 4, 5, 6, 7, 25, 0, 1, + 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, + 18, 19, 20, 22, 23, 24, 26, 27, 28}; + +// Returns 0-based map of reaction order +void +GET_RMAP(int* _rmap) +{ + for (int j = 0; j < 29; ++j) { + _rmap[j] = rmap[j]; + } +} + +// Returns a count of species in a reaction, and their indices +// and stoichiometric coefficients. (Eq 50) +void +CKINU(const int i, int& nspec, int ki[], int nu[]) +{ + const int ns[29] = {4, 4, 4, 3, 2, 2, 3, 3, 3, 4, 3, 4, 4, 3, 3, + 2, 4, 4, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4}; + const int kiv[116] = { + 5, 1, 2, 3, 0, 2, 5, 3, 0, 3, 5, 4, 4, 2, 3, 0, 0, 5, 0, 0, 2, 1, 0, 0, + 5, 2, 3, 0, 5, 3, 4, 0, 5, 1, 6, 0, 5, 6, 0, 1, 5, 6, 3, 0, 6, 2, 1, 3, + 6, 3, 4, 1, 6, 7, 1, 0, 6, 7, 1, 0, 7, 3, 0, 0, 5, 7, 4, 3, 5, 7, 0, 6, + 7, 2, 6, 3, 7, 3, 4, 6, 7, 3, 4, 6, 8, 2, 9, 0, 8, 1, 9, 2, 8, 6, 9, 3, + 8, 3, 9, 5, 10, 8, 5, 0, 10, 1, 8, 6, 5, 10, 8, 0, 10, 2, 9, 5}; + const int nuv[116] = { + -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 2, 0, -1, 2, 0, 0, + -2, 1, 0, 0, -1, -1, 1, 0, -1, -1, 1, 0, -1, -1, 1, 0, -1, -1, 1, 1, + -1, -1, 2, 0, -1, -1, 1, 1, -1, -1, 1, 1, -2, 1, 1, 0, -2, 1, 1, 0, + -1, 2, 0, 0, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, + -1, -1, 1, 1, -1, -1, 1, 0, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, + -1, 1, 1, 0, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1}; + if (i < 1) { + // Return max num species per reaction + nspec = 4; + } else { + if (i > 29) { + nspec = -1; + } else { + nspec = ns[i - 1]; + for (int j = 0; j < nspec; ++j) { + ki[j] = kiv[(i - 1) * 4 + j] + 1; + nu[j] = nuv[(i - 1) * 4 + j]; + } + } + } +} + +// Returns the progress rates of each reactions +// Given P, T, and mole fractions +void +CKKFKR( + const amrex::Real P, + const amrex::Real T, + const amrex::Real x[], + amrex::Real q_f[], + amrex::Real q_r[]) +{ + amrex::Real c[12]; // temporary storage + amrex::Real PORT = + 1e6 * P / (8.31446261815324e+07 * T); // 1e6 * P/RT so c goes to SI units + + // Compute conversion, see Eq 10 + for (int id = 0; id < 12; ++id) { + c[id] = x[id] * PORT; + } + + // convert to chemkin units + progressRateFR(q_f, q_r, c, T); + + // convert to chemkin units + for (int id = 0; id < 29; ++id) { + q_f[id] *= 1.0e-6; + q_r[id] *= 1.0e-6; + } +} + +// compute the progress rate for each reaction +// USES progressRate : todo switch to GPU +void +progressRateFR( + amrex::Real* q_f, amrex::Real* q_r, amrex::Real* sc, amrex::Real T) +{ + const amrex::Real invT = 1.0 / T; + const amrex::Real logT = log(T); + // compute the Gibbs free energy + amrex::Real g_RT[12]; + gibbs(g_RT, T); + + amrex::Real sc_qss[1]; + comp_qfqr(q_f, q_r, sc, sc_qss, T, invT, logT); +} + +// save atomic weights into array +void +atomicWeight(amrex::Real* awt) +{ + awt[0] = 12.011000; // C + awt[1] = 1.008000; // H + awt[2] = 15.999000; // O + awt[3] = 14.007000; // N +} + +// get atomic weight for all elements +void +CKAWT(amrex::Real* awt) +{ + atomicWeight(awt); +} + +// Returns the elemental composition +// of the speciesi (mdim is num of elements) +void +CKNCF(int* ncf) +{ + int kd = 4; + // Zero ncf + for (int id = 0; id < kd * 12; ++id) { + ncf[id] = 0; + } + + // H2 + ncf[0 * kd + 1] = 2; // H + + // O2 + ncf[1 * kd + 2] = 2; // O + + // O + ncf[2 * kd + 2] = 1; // O + + // OH + ncf[3 * kd + 1] = 1; // H + ncf[3 * kd + 2] = 1; // O + + // H2O + ncf[4 * kd + 1] = 2; // H + ncf[4 * kd + 2] = 1; // O + + // H + ncf[5 * kd + 1] = 1; // H + + // HO2 + ncf[6 * kd + 1] = 1; // H + ncf[6 * kd + 2] = 2; // O + + // H2O2 + ncf[7 * kd + 1] = 2; // H + ncf[7 * kd + 2] = 2; // O + + // CO + ncf[8 * kd + 0] = 1; // C + ncf[8 * kd + 2] = 1; // O + + // CO2 + ncf[9 * kd + 0] = 1; // C + ncf[9 * kd + 2] = 2; // O + + // HCO + ncf[10 * kd + 0] = 1; // C + ncf[10 * kd + 1] = 1; // H + ncf[10 * kd + 2] = 1; // O + + // N2 + ncf[11 * kd + 3] = 2; // N +} + +// Returns the vector of strings of element names +void +CKSYME_STR(amrex::Vector& ename) +{ + ename.resize(4); + ename[0] = "C"; + ename[1] = "H"; + ename[2] = "O"; + ename[3] = "N"; +} + +// Returns the vector of strings of species names +void +CKSYMS_STR(amrex::Vector& kname) +{ + kname.resize(12); + kname[0] = "H2"; + kname[1] = "O2"; + kname[2] = "O"; + kname[3] = "OH"; + kname[4] = "H2O"; + kname[5] = "H"; + kname[6] = "HO2"; + kname[7] = "H2O2"; + kname[8] = "CO"; + kname[9] = "CO2"; + kname[10] = "HCO"; + kname[11] = "N2"; +} + +// compute the sparsity pattern of the chemistry Jacobian +void +SPARSITY_INFO(int* nJdata, const int* consP, int NCELLS) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian(Jac.data(), conc.data(), 1500.0, *consP); + + int nJdata_tmp = 0; + for (int k = 0; k < 13; k++) { + for (int l = 0; l < 13; l++) { + if (Jac[13 * k + l] != 0.0) { + nJdata_tmp = nJdata_tmp + 1; + } + } + } + + *nJdata = NCELLS * nJdata_tmp; +} + +// compute the sparsity pattern of the system Jacobian +void +SPARSITY_INFO_SYST(int* nJdata, const int* consP, int NCELLS) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian(Jac.data(), conc.data(), 1500.0, *consP); + + int nJdata_tmp = 0; + for (int k = 0; k < 13; k++) { + for (int l = 0; l < 13; l++) { + if (k == l) { + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + nJdata_tmp = nJdata_tmp + 1; + } + } + } + } + + *nJdata = NCELLS * nJdata_tmp; +} + +// compute the sparsity pattern of the simplified (for preconditioning) system +// Jacobian +void +SPARSITY_INFO_SYST_SIMPLIFIED(int* nJdata, const int* consP) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian_precond(Jac.data(), conc.data(), 1500.0, *consP); + + int nJdata_tmp = 0; + for (int k = 0; k < 13; k++) { + for (int l = 0; l < 13; l++) { + if (k == l) { + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + nJdata_tmp = nJdata_tmp + 1; + } + } + } + } + + nJdata[0] = nJdata_tmp; +} + +// compute the sparsity pattern of the chemistry Jacobian in CSC format -- base +// 0 +void +SPARSITY_PREPROC_CSC(int* rowVals, int* colPtrs, const int* consP, int NCELLS) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian(Jac.data(), conc.data(), 1500.0, *consP); + + colPtrs[0] = 0; + int nJdata_tmp = 0; + for (int nc = 0; nc < NCELLS; nc++) { + int offset_row = nc * 13; + int offset_col = nc * 13; + for (int k = 0; k < 13; k++) { + for (int l = 0; l < 13; l++) { + if (Jac[13 * k + l] != 0.0) { + rowVals[nJdata_tmp] = l + offset_row; + nJdata_tmp = nJdata_tmp + 1; + } + } + colPtrs[offset_col + (k + 1)] = nJdata_tmp; + } + } +} + +// compute the sparsity pattern of the chemistry Jacobian in CSR format -- base +// 0 +void +SPARSITY_PREPROC_CSR( + int* colVals, int* rowPtrs, const int* consP, int NCELLS, int base) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian(Jac.data(), conc.data(), 1500.0, *consP); + + if (base == 1) { + rowPtrs[0] = 1; + int nJdata_tmp = 1; + for (int nc = 0; nc < NCELLS; nc++) { + int offset = nc * 13; + for (int l = 0; l < 13; l++) { + for (int k = 0; k < 13; k++) { + if (Jac[13 * k + l] != 0.0) { + colVals[nJdata_tmp - 1] = k + 1 + offset; + nJdata_tmp = nJdata_tmp + 1; + } + } + rowPtrs[offset + (l + 1)] = nJdata_tmp; + } + } + } else { + rowPtrs[0] = 0; + int nJdata_tmp = 0; + for (int nc = 0; nc < NCELLS; nc++) { + int offset = nc * 13; + for (int l = 0; l < 13; l++) { + for (int k = 0; k < 13; k++) { + if (Jac[13 * k + l] != 0.0) { + colVals[nJdata_tmp] = k + offset; + nJdata_tmp = nJdata_tmp + 1; + } + } + rowPtrs[offset + (l + 1)] = nJdata_tmp; + } + } + } +} + +// compute the sparsity pattern of the system Jacobian +// CSR format BASE is user choice +void +SPARSITY_PREPROC_SYST_CSR( + int* colVals, int* rowPtr, const int* consP, int NCELLS, int base) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian(Jac.data(), conc.data(), 1500.0, *consP); + + if (base == 1) { + rowPtr[0] = 1; + int nJdata_tmp = 1; + for (int nc = 0; nc < NCELLS; nc++) { + int offset = nc * 13; + for (int l = 0; l < 13; l++) { + for (int k = 0; k < 13; k++) { + if (k == l) { + colVals[nJdata_tmp - 1] = l + 1 + offset; + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + colVals[nJdata_tmp - 1] = k + 1 + offset; + nJdata_tmp = nJdata_tmp + 1; + } + } + } + rowPtr[offset + (l + 1)] = nJdata_tmp; + } + } + } else { + rowPtr[0] = 0; + int nJdata_tmp = 0; + for (int nc = 0; nc < NCELLS; nc++) { + int offset = nc * 13; + for (int l = 0; l < 13; l++) { + for (int k = 0; k < 13; k++) { + if (k == l) { + colVals[nJdata_tmp] = l + offset; + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + colVals[nJdata_tmp] = k + offset; + nJdata_tmp = nJdata_tmp + 1; + } + } + } + rowPtr[offset + (l + 1)] = nJdata_tmp; + } + } + } +} + +// compute the sparsity pattern of the simplified (for precond) system Jacobian +// on CPU BASE 0 +void +SPARSITY_PREPROC_SYST_SIMPLIFIED_CSC( + int* rowVals, int* colPtrs, int* indx, const int* consP) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian_precond(Jac.data(), conc.data(), 1500.0, *consP); + + colPtrs[0] = 0; + int nJdata_tmp = 0; + for (int k = 0; k < 13; k++) { + for (int l = 0; l < 13; l++) { + if (k == l) { + rowVals[nJdata_tmp] = l; + indx[nJdata_tmp] = 13 * k + l; + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + rowVals[nJdata_tmp] = l; + indx[nJdata_tmp] = 13 * k + l; + nJdata_tmp = nJdata_tmp + 1; + } + } + } + colPtrs[k + 1] = nJdata_tmp; + } +} + +// compute the sparsity pattern of the simplified (for precond) system Jacobian +// CSR format BASE is under choice +void +SPARSITY_PREPROC_SYST_SIMPLIFIED_CSR( + int* colVals, int* rowPtr, const int* consP, int base) +{ + amrex::GpuArray Jac = {0.0}; + amrex::GpuArray conc = {0.0}; + for (int n = 0; n < 12; n++) { + conc[n] = 1.0 / 12.000000; + } + aJacobian_precond(Jac.data(), conc.data(), 1500.0, *consP); + + if (base == 1) { + rowPtr[0] = 1; + int nJdata_tmp = 1; + for (int l = 0; l < 13; l++) { + for (int k = 0; k < 13; k++) { + if (k == l) { + colVals[nJdata_tmp - 1] = l + 1; + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + colVals[nJdata_tmp - 1] = k + 1; + nJdata_tmp = nJdata_tmp + 1; + } + } + } + rowPtr[l + 1] = nJdata_tmp; + } + } else { + rowPtr[0] = 0; + int nJdata_tmp = 0; + for (int l = 0; l < 13; l++) { + for (int k = 0; k < 13; k++) { + if (k == l) { + colVals[nJdata_tmp] = l; + nJdata_tmp = nJdata_tmp + 1; + } else { + if (Jac[13 * k + l] != 0.0) { + colVals[nJdata_tmp] = k; + nJdata_tmp = nJdata_tmp + 1; + } + } + } + rowPtr[l + 1] = nJdata_tmp; + } + } +} diff --git a/Support/ceptr/Kolla/mechanism.inp b/Support/ceptr/Kolla/mechanism.inp new file mode 100644 index 000000000..b54399c2d --- /dev/null +++ b/Support/ceptr/Kolla/mechanism.inp @@ -0,0 +1,239 @@ +! Mechanism for CO/H2 oxidation by Hemanth Kolla +! based on the skeletal mechanism of Evatt R. Hawkes and Ramanan Sankaran +! +! Only difference from skeletal mechanism is the inclusion of H2O2 and +! the reactions corresponding to its formation and consumption +! +! The skeletal mechanism is derived from a detailed C1 mechanism by J. Li +! +! Original notes on the skeletal mechanism and the detailed mechanisms follow +! +! ------------------------------------------------------------------------------ +! Skeletal Mechanism for CO/H2 oxidation +! by Evatt R. Hawkes and Ramanan Sankaran +! +! Reduced from complete C1 Mechanism that is published in: +! +! J. Li, PhD Thesis, +! Mechanical and Aerospace Engineering Department, +! Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. +! +! http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip +! +! At the time of writing, a publication to IJCK is in preparation +! by the authors of the complete mechanism. +! +! This mechanism was reduced specifically for the purpose of the +! Direct Numerical Simulations performed in +! Hawkes, E.R., Sankaran, R., Sutherland, J.C., and Chen, J.H. (2006) +! Proc. Combust. Inst. 31, to appear. +! +! It was validated by comparison with the full mechanism in several cases: +! 1. freely propagating premixed flames in a range of equivalence ratios, +! 2. opposed-flow non-premixed flames in a range of strains up to extinction, +! 3. homogeneous ignition calculations for mixtures of fuel and oxidizer streams +! and equilibrium products, +! 4. two-dimensional DNS featuring extinction and local reignition. +! In all cases the agreement was excellent. +! +! However, the mechanism is validated ONLY for the specific conditions of the +! DNS and is not expected to be valid in general. +! +! The following changes (only) were made to the complete mechanism: +! 1) Only the species H2 O2 O OH H2O H HO2 CO CO2 HCO N2 were retained. +! All other species and reactions involving these species were removed. Note +! this includes all C containing species other than those essential for CO +! oxidation: CO, CO2 and HCO. For the atmospheric pressure of the simulation, +! H2O2 was also found to be unimportant and was removed. +! 2) It was found HCO has only a minor importance, and its reaction rates were +! dominated by a few key reactions. These reactions (below) were retained +! and all others neglected. +! +! Steady state assumptions were investigated and found to be reasonably accurate +! for fully burning conditions but it was found they increased stiffness, hence +! they were not employed. For reference, a steady state approximation for HCO +! and HO2 may be expected to perform reasonably well if the added stiffness can +! be tackled. However, note the HO2 steady state assumption will degrade the +! prediction of ignition at longer ignition delay times. +! +! --------------------------------------------------------------------------------- +! +! Notes on the original mechanism by its authors: +! +! Authors: J. Li, Z. Zhao, A. Kazakov, F.L. Dryer, +! Address: Dept. of Mechanical and Aerospace Engineering, +! Princeton University, Princeton, NJ 08544 +! +! This C1 mechanism is based on the CH3OH mechanism of Held and Dryer (IJCK,1998, 30, 805) +! with following important revision: +! 1. H2/O2 subset is updated to that of Li et al. (IJCK, in press, 2004) +! 2. CO + OH = CO2 + H is optimized to fit the literature experimental result +! 3. HCO + M = H + CO + M is optimized to fit the literature experimental result +! 4. CH3 + HO2 = CH3O + OH is modified to match Scire's value at 1000 K +! 5. CH3 + HO2 = CH4 + H is taken from Scire (IJCK, 2001, 33, 75) +! 6. CH3 + O2 = CH2O + OH is taken from Scire (2002, Ph.D. thesis) +! 7. CH2O + HO2 = HCO + H2O2 is from Eiteneer et al. (JPC A. 1998, 102, 5196) +! 8. CH2O + H = HCO + H2 is from Irdam et al. (IJCK 1993, 25, 285) +! 9. CH2O + M reactions are from Friedrichs et al.(IJCK 2004, 36, 157) +! 10. CH3OH decomposition reactions are taken from GRI-3.0 (1999) +! 11. CH2OH + HCO = CH2O + CH2O is taken from Friedrichs et al. (IJCK, 2004, 36, 157) +! 12. CH2OH + HCO = CH3OH + CO is changed to keep the branching ratio with the above reaction +! 13. HCOOH reactions are not included since it is not important and has large uncertainties +! 14. dHf of OH is adjusted to 8.91 kcal/mol (Ruscic et al. JPC A. 2002, 106, 2727) +! 15. thermochemical data of CH2OH is fit to Johnson & Hudgens' table (JPC 1996, 100, 19874) + + +ELEMENTS +C H O N +END + +SPECIES +H2 O2 O OH H2O H HO2 H2O2 CO CO2 HCO N2 +END + +TRANS ALL +H2 1 38.000 2.920 0.000 0.790 280.000 +O2 1 107.400 3.458 0.000 1.600 3.800 +O 0 80.000 2.750 0.000 0.000 0.000 +OH 1 80.000 2.750 0.000 0.000 0.000 +H2O 2 572.400 2.605 1.844 0.000 4.000 +H 0 145.000 2.050 0.000 0.000 0.000 +HO2 2 107.400 3.458 0.000 0.000 1.000 +H2O2 2 107.400 3.458 0.000 0.000 3.800 +CO 1 98.100 3.650 0.000 1.950 1.800 +CO2 1 244.000 3.763 0.000 2.650 2.100 +HCO 2 498.000 3.590 0.000 0.000 0.000 +N2 1 97.530 3.621 0.000 1.760 4.000 +END + + + +REACTIONS + +! ************ H2-O2 Chain Reactions ********************** + +! Hessler, J. Phys. Chem. A, 102:4517 (1998) +H+O2=O+OH 3.547e+15 -0.406 1.6599E+4 + +! Sutherland et al., 21st Symposium, p. 929 (1986) +O+H2=H+OH 0.508E+05 2.67 0.629E+04 + +! Michael and Sutherland, J. Phys. Chem. 92:3853 (1988) +H2+OH=H2O+H 0.216E+09 1.51 0.343E+04 + +! Sutherland et al., 23rd Symposium, p. 51 (1990) +O+H2O=OH+OH 2.97e+06 2.02 1.34e+4 + +! *************** H2-O2 Dissociation Reactions ****************** + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +H2+M=H+H+M 4.577E+19 -1.40 1.0438E+05 + H2/2.5/ H2O/12/ + CO/1.9/ CO2/3.8/ + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +O+O+M=O2+M 6.165E+15 -0.50 0.000E+00 + H2/2.5/ H2O/12/ + CO/1.9/ CO2/3.8/ + + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +O+H+M=OH+M 4.714E+18 -1.00 0.000E+00 + H2/2.5/ H2O/12/ + CO/1.9/ CO2/3.8/ + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +!H+OH+M=H2O+M 2.212E+22 -2.00 0.000E+00 +H+OH+M=H2O+M 3.800E+22 -2.00 0.000E+00 + H2/2.5/ H2O/12/ + CO/1.9/ CO2/3.8/ + +!************** Formation and Consumption of HO2****************** + +! Cobos et al., J. Phys. Chem. 89:342 (1985) for kinf +! Michael, et al., J. Phys. Chem. A, 106:5297 (2002) for k0 + +!****************************************************************************** +! MAIN BATH GAS IS N2 (comment this reaction otherwise) +! + H+O2(+M)=HO2(+M) 1.475E+12 0.60 0.00E+00 + LOW/6.366E+20 -1.72 5.248E+02/ + TROE/0.8 1E-30 1E+30/ + H2/2.0/ H2O/11./ O2/0.78/ CO/1.9/ CO2/3.8/ + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] +HO2+H=H2+O2 1.66E+13 0.00 0.823E+03 + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] +HO2+H=OH+OH 7.079E+13 0.00 2.95E+02 + +! Baulch et al., J. Phys. Chem. Ref Data, 21:411 (1992) +HO2+O=O2+OH 0.325E+14 0.00 0.00E+00 + +! Keyser, J. Phys. Chem. 92:1193 (1988) +HO2+OH=H2O+O2 2.890E+13 0.00 -4.970E+02 + +! ***************Formation and Consumption of H2O2****************** + +! Hippler et al., J. Chem. Phys. 93:1755 (1990) +HO2+HO2=H2O2+O2 4.200e+14 0.00 1.1982e+04 + DUPLICATE +HO2+HO2=H2O2+O2 1.300e+11 0.00 -1.6293e+3 + DUPLICATE + +! Brouwer et al., J. Chem. Phys. 86:6171 (1987) for kinf +! Warnatz, J. in Combustion chemistry (1984) for k0 +H2O2(+M)=OH+OH(+M) 2.951e+14 0.00 4.843E+04 + LOW/1.202E+17 0.00 4.55E+04/ + TROE/0.5 1E-30 1E+30/ + H2/2.5/ H2O/12/ + CO/1.9/ CO2/3.8/ + + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +H2O2+H=H2O+OH 0.241E+14 0.00 0.397E+04 + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +H2O2+H=HO2+H2 0.482E+14 0.00 0.795E+04 + +! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +H2O2+O=OH+HO2 9.550E+06 2.00 3.970E+03 + +! Hippler and Troe, J. Chem. Phys. Lett. 192:333 (1992) +H2O2+OH=HO2+H2O 1.000E+12 0.00 0.000 + DUPLICATE +H2O2+OH=HO2+H2O 5.800E+14 0.00 9.557E+03 + DUPLICATE + +!************** CO/HCO REACTIONS ***************** + +! Troe, 15th Symposium +CO+O(+M)=CO2(+M) 1.80E+10 0.00 2384. +! Fit of Westmoreland, AiChe J., 1986, rel. to N2 - Tim adjusted from MTA's +! rate constant, which was rel to Ar. + LOW/1.55E+24 -2.79 4191./ + H2/2.5/ H2O/12/ CO/1.9/ CO2/3.8/ + +! Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) +CO+O2=CO2+O 0.253E+13 0.00 0.477E+05 + +! This rate constant is modified per an updated value for HO2+HO2=H2O2+OH +CO+HO2=CO2+OH 3.01E+13 0.00 2.30E+04 + +! This study (2004) by matching literature experiment results +CO+OH=CO2+H 2.229E+05 1.89 -1158.7 + +! This study (2004) by matching literature experiment results +HCO+M=H+CO+M 4.7485E+11 0.659 1.4874E+04 +H2/2.5/ H2O/6/ CO/1.9/ CO2/3.8/ + +! Timonen et al., JPC, 92:651 (1988) +HCO+O2=CO+HO2 0.758E+13 0.00 0.410E+03 + +! Timonen et al., JPC, 91:692 (1987) +HCO+H=CO+H2 0.723E+14 0.00 0.000E+00 + +! All reactions from Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) +HCO + O = CO2 + H 3.000E+13 0.00 0.000E+00 + +END diff --git a/Support/ceptr/Kolla/mechanism.yaml b/Support/ceptr/Kolla/mechanism.yaml new file mode 100644 index 000000000..14292861f --- /dev/null +++ b/Support/ceptr/Kolla/mechanism.yaml @@ -0,0 +1,437 @@ +description: |- + Mechanism for CO/H2 oxidation by Hemanth Kolla + based on the skeletal mechanism of Evatt R. Hawkes and Ramanan Sankaran + + Only difference from skeletal mechanism is the inclusion of H2O2 and + the reactions corresponding to its formation and consumption + + The skeletal mechanism is derived from a detailed C1 mechanism by J. Li + + Original notes on the skeletal mechanism and the detailed mechanisms follow + + ------------------------------------------------------------------------------ + Skeletal Mechanism for CO/H2 oxidation + by Evatt R. Hawkes and Ramanan Sankaran + + Reduced from complete C1 Mechanism that is published in: + + J. Li, PhD Thesis, + Mechanical and Aerospace Engineering Department, + Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. + + http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip + + At the time of writing, a publication to IJCK is in preparation + by the authors of the complete mechanism. + + This mechanism was reduced specifically for the purpose of the + Direct Numerical Simulations performed in + Hawkes, E.R., Sankaran, R., Sutherland, J.C., and Chen, J.H. (2006) + Proc. Combust. Inst. 31, to appear. + + It was validated by comparison with the full mechanism in several cases: + 1. freely propagating premixed flames in a range of equivalence ratios, + 2. opposed-flow non-premixed flames in a range of strains up to extinction, + 3. homogeneous ignition calculations for mixtures of fuel and oxidizer streams + and equilibrium products, + 4. two-dimensional DNS featuring extinction and local reignition. + In all cases the agreement was excellent. + + However, the mechanism is validated ONLY for the specific conditions of the + DNS and is not expected to be valid in general. + + The following changes (only) were made to the complete mechanism: + 1) Only the species H2 O2 O OH H2O H HO2 CO CO2 HCO N2 were retained. + All other species and reactions involving these species were removed. Note + this includes all C containing species other than those essential for CO + oxidation: CO, CO2 and HCO. For the atmospheric pressure of the simulation, + H2O2 was also found to be unimportant and was removed. + 2) It was found HCO has only a minor importance, and its reaction rates were + dominated by a few key reactions. These reactions (below) were retained + and all others neglected. + + Steady state assumptions were investigated and found to be reasonably accurate + for fully burning conditions but it was found they increased stiffness, hence + they were not employed. For reference, a steady state approximation for HCO + and HO2 may be expected to perform reasonably well if the added stiffness can + be tackled. However, note the HO2 steady state assumption will degrade the + prediction of ignition at longer ignition delay times. + + --------------------------------------------------------------------------------- + + Notes on the original mechanism by its authors: + + Authors: J. Li, Z. Zhao, A. Kazakov, F.L. Dryer, + Address: Dept. of Mechanical and Aerospace Engineering, + Princeton University, Princeton, NJ 08544 + + This C1 mechanism is based on the CH3OH mechanism of Held and Dryer (IJCK,1998, 30, 805) + with following important revision: + 1. H2/O2 subset is updated to that of Li et al. (IJCK, in press, 2004) + 2. CO + OH = CO2 + H is optimized to fit the literature experimental result + 3. HCO + M = H + CO + M is optimized to fit the literature experimental result + 4. CH3 + HO2 = CH3O + OH is modified to match Scire's value at 1000 K + 5. CH3 + HO2 = CH4 + H is taken from Scire (IJCK, 2001, 33, 75) + 6. CH3 + O2 = CH2O + OH is taken from Scire (2002, Ph.D. thesis) + 7. CH2O + HO2 = HCO + H2O2 is from Eiteneer et al. (JPC A. 1998, 102, 5196) + 8. CH2O + H = HCO + H2 is from Irdam et al. (IJCK 1993, 25, 285) + 9. CH2O + M reactions are from Friedrichs et al.(IJCK 2004, 36, 157) + 10. CH3OH decomposition reactions are taken from GRI-3.0 (1999) + 11. CH2OH + HCO = CH2O + CH2O is taken from Friedrichs et al. (IJCK, 2004, 36, 157) + 12. CH2OH + HCO = CH3OH + CO is changed to keep the branching ratio with the above reaction + 13. HCOOH reactions are not included since it is not important and has large uncertainties + 14. dHf of OH is adjusted to 8.91 kcal/mol (Ruscic et al. JPC A. 2002, 106, 2727) + 15. thermochemical data of CH2OH is fit to Johnson & Hudgens' table (JPC 1996, 100, 19874) + +generator: ck2yaml +input-files: [mechanism.inp, therm.dat, tran.dat] +cantera-version: 2.6.0 +date: Wed, 11 May 2022 17:40:41 -0700 + +units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol} + +phases: +- name: gas + thermo: ideal-gas + elements: [C, H, O, N] + species: [H2, O2, O, OH, H2O, H, HO2, H2O2, CO, CO2, HCO, N2] + kinetics: gas + transport: mixture-averaged + state: {T: 300.0, P: 1 atm} + +species: +- name: H2 + composition: {H: 2} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.298124, 8.249442e-04, -8.143015e-07, -9.475434e-11, 4.134872e-13, + -1012.521, -3.294094] + - [2.991423, 7.000644e-04, -5.633829e-08, -9.231578e-12, 1.582752e-15, + -835.034, -1.35511] + note: '121286' + transport: + model: gas + geometry: linear + well-depth: 38.0 + diameter: 2.92 + polarizability: 0.79 + rotational-relaxation: 280.0 +- name: O2 + composition: {O: 2} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.212936, 1.127486e-03, -5.75615e-07, 1.313877e-09, -8.768554e-13, + -1005.249, 6.034738] + - [3.697578, 6.135197e-04, -1.258842e-07, 1.775281e-11, -1.136435e-15, + -1233.93, 3.189166] + note: '121386' + transport: + model: gas + geometry: linear + well-depth: 107.4 + diameter: 3.458 + polarizability: 1.6 + rotational-relaxation: 3.8 +- name: O + composition: {O: 1} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [2.946429, -1.638166e-03, 2.421032e-06, -1.602843e-09, 3.890696e-13, + 2.914764e+04, 2.963995] + - [2.54206, -2.755062e-05, -3.102803e-09, 4.551067e-12, -4.368052e-16, + 2.92308e+04, 4.920308] + note: '120186' + transport: + model: gas + geometry: atom + well-depth: 80.0 + diameter: 2.75 +- name: OH + composition: {O: 1, H: 1} + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 6000.0] + data: + - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, + 3346.30913, -0.69043296] + - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, + 3683.62875, 5.70164073] + note: S 9/01 + transport: + model: gas + geometry: linear + well-depth: 80.0 + diameter: 2.75 +- name: H2O + composition: {H: 2, O: 1} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.386842, 3.474982e-03, -6.354696e-06, 6.968581e-09, -2.506588e-12, + -3.020811e+04, 2.590233] + - [2.672146, 3.056293e-03, -8.73026e-07, 1.200996e-10, -6.391618e-15, + -2.989921e+04, 6.862817] + note: '20387' + transport: + model: gas + geometry: nonlinear + well-depth: 572.4 + diameter: 2.605 + dipole: 1.844 + rotational-relaxation: 4.0 +- name: H + composition: {H: 1} + thermo: + model: NASA7 + temperature-ranges: [300.0, 5000.0] + data: + - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547163e+04, -0.4601176] + note: '120186' + transport: + model: gas + geometry: atom + well-depth: 145.0 + diameter: 2.05 +- name: HO2 + composition: {H: 1, O: 2} + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, + 294.80804, 3.71666245] + - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, + 111.856713, 3.78510215] + note: L 5/89 + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + rotational-relaxation: 1.0 +- name: H2O2 + composition: {H: 2, O: 2} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.388754, 6.569226e-03, -1.485013e-07, -4.625806e-09, 2.471515e-12, + -1.766315e+04, 6.785363] + - [4.573167, 4.336136e-03, -1.474689e-06, 2.348904e-10, -1.431654e-14, + -1.800696e+04, 0.501137] + note: '120186' + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + rotational-relaxation: 3.8 +- name: CO + composition: {C: 1, O: 1} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.262452, 1.511941e-03, -3.881755e-06, 5.581944e-09, -2.474951e-12, + -1.431054e+04, 4.848897] + - [3.025078, 1.442689e-03, -5.630828e-07, 1.018581e-10, -6.910952e-15, + -1.426835e+04, 6.108218] + note: '121286' + transport: + model: gas + geometry: linear + well-depth: 98.1 + diameter: 3.65 + polarizability: 1.95 + rotational-relaxation: 1.8 +- name: CO2 + composition: {C: 1, O: 2} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [2.275725, 9.922072e-03, -1.040911e-05, 6.866687e-09, -2.11728e-12, + -4.837314e+04, 10.18849] + - [4.453623, 3.140169e-03, -1.278411e-06, 2.393997e-10, -1.669033e-14, + -4.896696e+04, -0.9553959] + note: '121286' + transport: + model: gas + geometry: linear + well-depth: 244.0 + diameter: 3.763 + polarizability: 2.65 + rotational-relaxation: 2.1 +- name: HCO + composition: {H: 1, C: 1, O: 1} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [2.89833, 6.199147e-03, -9.623084e-06, 1.089825e-08, -4.574885e-12, + 4159.922, 8.983614] + - [3.557271, 3.345573e-03, -1.335006e-06, 2.470573e-10, -1.713851e-14, + 3916.324, 5.552299] + note: '121286' + transport: + model: gas + geometry: nonlinear + well-depth: 498.0 + diameter: 3.59 +- name: N2 + composition: {N: 2} + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.298677, 1.40824e-03, -3.963222e-06, 5.641515e-09, -2.444855e-12, + -1020.9, 3.950372] + - [2.92664, 1.487977e-03, -5.684761e-07, 1.009704e-10, -6.753351e-15, + -922.7977, 5.980528] + note: '121286' + transport: + model: gas + geometry: linear + well-depth: 97.53 + diameter: 3.621 + polarizability: 1.76 + rotational-relaxation: 4.0 + +reactions: +- equation: H + O2 <=> O + OH # Reaction 1 + rate-constant: {A: 3.547e+15, b: -0.406, Ea: 1.6599e+04} + note: |- + ************ H2-O2 Chain Reactions ********************** + Hessler, J. Phys. Chem. A, 102:4517 (1998) +- equation: O + H2 <=> H + OH # Reaction 2 + rate-constant: {A: 5.08e+04, b: 2.67, Ea: 6290.0} + note: Sutherland et al., 21st Symposium, p. 929 (1986) +- equation: H2 + OH <=> H2O + H # Reaction 3 + rate-constant: {A: 2.16e+08, b: 1.51, Ea: 3430.0} + note: Michael and Sutherland, J. Phys. Chem. 92:3853 (1988) +- equation: O + H2O <=> OH + OH # Reaction 4 + rate-constant: {A: 2.97e+06, b: 2.02, Ea: 1.34e+04} + note: Sutherland et al., 23rd Symposium, p. 51 (1990) +- equation: H2 + M <=> H + H + M # Reaction 5 + type: three-body + rate-constant: {A: 4.577e+19, b: -1.4, Ea: 1.0438e+05} + efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} + note: |- + *************** H2-O2 Dissociation Reactions ****************** + Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +- equation: O + O + M <=> O2 + M # Reaction 6 + type: three-body + rate-constant: {A: 6.165e+15, b: -0.5, Ea: 0.0} + efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +- equation: O + H + M <=> OH + M # Reaction 7 + type: three-body + rate-constant: {A: 4.714e+18, b: -1.0, Ea: 0.0} + efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +- equation: H + OH + M <=> H2O + M # Reaction 8 + type: three-body + rate-constant: {A: 3.8e+22, b: -2.0, Ea: 0.0} + efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} + note: |2- + Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) + H+OH+M=H2O+M 2.212E+22 -2.00 0.000E+00 +- equation: H + O2 (+M) <=> HO2 (+M) # Reaction 9 + type: falloff + low-P-rate-constant: {A: 6.366e+20, b: -1.72, Ea: 524.8} + high-P-rate-constant: {A: 1.475e+12, b: 0.6, Ea: 0.0} + Troe: {A: 0.8, T3: 1.0e-30, T1: 1.0e+30} + efficiencies: {H2: 2.0, H2O: 11.0, O2: 0.78, CO: 1.9, CO2: 3.8} + note: |- + ************** Formation and Consumption of HO2****************** + Cobos et al., J. Phys. Chem. 89:342 (1985) for kinf + Michael, et al., J. Phys. Chem. A, 106:5297 (2002) for k0 + ****************************************************************************** + MAIN BATH GAS IS N2 (comment this reaction otherwise) +- equation: HO2 + H <=> H2 + O2 # Reaction 10 + rate-constant: {A: 1.66e+13, b: 0.0, Ea: 823.0} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] +- equation: HO2 + H <=> OH + OH # Reaction 11 + rate-constant: {A: 7.079e+13, b: 0.0, Ea: 295.0} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] +- equation: HO2 + O <=> O2 + OH # Reaction 12 + rate-constant: {A: 3.25e+13, b: 0.0, Ea: 0.0} + note: Baulch et al., J. Phys. Chem. Ref Data, 21:411 (1992) +- equation: HO2 + OH <=> H2O + O2 # Reaction 13 + rate-constant: {A: 2.89e+13, b: 0.0, Ea: -497.0} + note: Keyser, J. Phys. Chem. 92:1193 (1988) +- equation: HO2 + HO2 <=> H2O2 + O2 # Reaction 14 + duplicate: true + rate-constant: {A: 4.2e+14, b: 0.0, Ea: 1.1982e+04} + note: |- + ***************Formation and Consumption of H2O2****************** + Hippler et al., J. Chem. Phys. 93:1755 (1990) +- equation: HO2 + HO2 <=> H2O2 + O2 # Reaction 15 + duplicate: true + rate-constant: {A: 1.3e+11, b: 0.0, Ea: -1629.3} +- equation: H2O2 (+M) <=> OH + OH (+M) # Reaction 16 + type: falloff + low-P-rate-constant: {A: 1.202e+17, b: 0.0, Ea: 4.55e+04} + high-P-rate-constant: {A: 2.951e+14, b: 0.0, Ea: 4.843e+04} + Troe: {A: 0.5, T3: 1.0e-30, T1: 1.0e+30} + efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} + note: |- + Brouwer et al., J. Chem. Phys. 86:6171 (1987) for kinf + Warnatz, J. in Combustion chemistry (1984) for k0 +- equation: H2O2 + H <=> H2O + OH # Reaction 17 + rate-constant: {A: 2.41e+13, b: 0.0, Ea: 3970.0} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +- equation: H2O2 + H <=> HO2 + H2 # Reaction 18 + rate-constant: {A: 4.82e+13, b: 0.0, Ea: 7950.0} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +- equation: H2O2 + O <=> OH + HO2 # Reaction 19 + rate-constant: {A: 9.55e+06, b: 2.0, Ea: 3970.0} + note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) +- equation: H2O2 + OH <=> HO2 + H2O # Reaction 20 + duplicate: true + rate-constant: {A: 1.0e+12, b: 0.0, Ea: 0.0} + note: Hippler and Troe, J. Chem. Phys. Lett. 192:333 (1992) +- equation: H2O2 + OH <=> HO2 + H2O # Reaction 21 + duplicate: true + rate-constant: {A: 5.8e+14, b: 0.0, Ea: 9557.0} +- equation: CO + O (+M) <=> CO2 (+M) # Reaction 22 + type: falloff + low-P-rate-constant: {A: 1.55e+24, b: -2.79, Ea: 4191.0} + high-P-rate-constant: {A: 1.8e+10, b: 0.0, Ea: 2384.0} + efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} + note: |- + ************** CO/HCO REACTIONS ***************** + Troe, 15th Symposium +- equation: CO + O2 <=> CO2 + O # Reaction 23 + rate-constant: {A: 2.53e+12, b: 0.0, Ea: 4.77e+04} + note: |- + Fit of Westmoreland, AiChe J., 1986, rel. to N2 - Tim adjusted from MTA's + rate constant, which was rel to Ar. + Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) +- equation: CO + HO2 <=> CO2 + OH # Reaction 24 + rate-constant: {A: 3.01e+13, b: 0.0, Ea: 2.3e+04} + note: This rate constant is modified per an updated value for HO2+HO2=H2O2+OH +- equation: CO + OH <=> CO2 + H # Reaction 25 + rate-constant: {A: 2.229e+05, b: 1.89, Ea: -1158.7} + note: This study (2004) by matching literature experiment results +- equation: HCO + M <=> H + CO + M # Reaction 26 + type: three-body + rate-constant: {A: 4.7485e+11, b: 0.659, Ea: 1.4874e+04} + efficiencies: {H2: 2.5, H2O: 6.0, CO: 1.9, CO2: 3.8} + note: This study (2004) by matching literature experiment results +- equation: HCO + O2 <=> CO + HO2 # Reaction 27 + rate-constant: {A: 7.58e+12, b: 0.0, Ea: 410.0} + note: Timonen et al., JPC, 92:651 (1988) +- equation: HCO + H <=> CO + H2 # Reaction 28 + rate-constant: {A: 7.23e+13, b: 0.0, Ea: 0.0} + note: Timonen et al., JPC, 91:692 (1987) +- equation: HCO + O <=> CO2 + H # Reaction 29 + rate-constant: {A: 3.0e+13, b: 0.0, Ea: 0.0} + note: All reactions from Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) diff --git a/Support/ceptr/Kolla/therm.dat b/Support/ceptr/Kolla/therm.dat new file mode 100644 index 000000000..df43c61ee --- /dev/null +++ b/Support/ceptr/Kolla/therm.dat @@ -0,0 +1,51 @@ +THERMO ALL +0300.00 1000.00 5000.00 +HO2 L 5/89H 1O 2 00 00G 200.000 3500.000 1000.000 1 + 4.01721090E+00 2.23982013E-03-6.33658150E-07 1.14246370E-10-1.07908535E-14 2 + 1.11856713E+02 3.78510215E+00 4.30179801E+00-4.74912051E-03 2.11582891E-05 3 +-2.42763894E-08 9.29225124E-12 2.94808040E+02 3.71666245E+00 1.00021620E+04 4 +CO 121286C 1O 1 G 0300.00 5000.00 1000.00 1 + 0.03025078E+02 0.01442689E-01-0.05630828E-05 0.01018581E-08-0.06910952E-13 2 +-0.01426835E+06 0.06108218E+02 0.03262452E+02 0.01511941E-01-0.03881755E-04 3 + 0.05581944E-07-0.02474951E-10-0.01431054E+06 0.04848897E+02 4 +CO2 121286C 1O 2 G 0300.00 5000.00 1000.00 1 + 0.04453623E+02 0.03140169E-01-0.01278411E-04 0.02393997E-08-0.01669033E-12 2 +-0.04896696E+06-0.09553959E+01 0.02275725E+02 0.09922072E-01-0.01040911E-03 3 + 0.06866687E-07-0.02117280E-10-0.04837314E+06 0.01018849E+03 4 +H 120186H 1 G 0300.00 5000.00 1000.00 1 + 0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2 + 0.02547163E+06-0.04601176E+01 0.02500000E+02 0.00000000E+00 0.00000000E+00 3 + 0.00000000E+00 0.00000000E+00 0.02547163E+06-0.04601176E+01 4 +H2 121286H 2 G 0300.00 5000.00 1000.00 1 + 0.02991423E+02 0.07000644E-02-0.05633829E-06-0.09231578E-10 0.01582752E-13 2 +-0.08350340E+04-0.01355110E+02 0.03298124E+02 0.08249442E-02-0.08143015E-05 3 +-0.09475434E-09 0.04134872E-11-0.01012521E+05-0.03294094E+02 4 +H2O 20387H 2O 1 G 0300.00 5000.00 1000.00 1 + 0.02672146E+02 0.03056293E-01-0.08730260E-05 0.01200996E-08-0.06391618E-13 2 +-0.02989921E+06 0.06862817E+02 0.03386842E+02 0.03474982E-01-0.06354696E-04 3 + 0.06968581E-07-0.02506588E-10-0.03020811E+06 0.02590233E+02 4 +H2O2 120186H 2O 2 G 0300.00 5000.00 1000.00 1 + 0.04573167E+02 0.04336136E-01-0.01474689E-04 0.02348904E-08-0.01431654E-12 2 +-0.01800696E+06 0.05011370E+01 0.03388754E+02 0.06569226E-01-0.01485013E-05 3 +-0.04625806E-07 0.02471515E-10-0.01766315E+06 0.06785363E+02 4 +HCO 121286H 1C 1O 1 G 0300.00 5000.00 1000.00 1 + 0.03557271E+02 0.03345573E-01-0.01335006E-04 0.02470573E-08-0.01713851E-12 2 + 0.03916324E+05 0.05552299E+02 0.02898330E+02 0.06199147E-01-0.09623084E-04 3 + 0.01089825E-06-0.04574885E-10 0.04159922E+05 0.08983614E+02 4 +O 120186O 1 G 0300.00 5000.00 1000.00 1 + 0.02542060E+02-0.02755062E-03-0.03102803E-07 0.04551067E-10-0.04368052E-14 2 + 0.02923080E+06 0.04920308E+02 0.02946429E+02-0.01638166E-01 0.02421032E-04 3 +-0.01602843E-07 0.03890696E-11 0.02914764E+06 0.02963995E+02 4 +O2 121386O 2 G 0300.00 5000.00 1000.00 1 + 0.03697578E+02 0.06135197E-02-0.01258842E-05 0.01775281E-09-0.01136435E-13 2 +-0.01233930E+05 0.03189166E+02 0.03212936E+02 0.01127486E-01-0.05756150E-05 3 + 0.01313877E-07-0.08768554E-11-0.01005249E+05 0.06034738E+02 4 +N2 121286N 2 G 0300.00 5000.00 1000.00 1 + 0.02926640E+02 0.01487977E-01-0.05684761E-05 0.01009704E-08-0.06753351E-13 2 +-0.09227977E+04 0.05980528E+02 0.03298677E+02 0.01408240E-01-0.03963222E-04 3 + 0.05641515E-07-0.02444855E-10-0.01020900E+05 0.03950372E+02 4 +OH S 9/01O 1H 1 0 0G 200.000 6000.000 1000. 1 + 2.86472886E+00 1.05650448E-03-2.59082758E-07 3.05218674E-11-1.33195876E-15 2 + 3.68362875E+03 5.70164073E+00 4.12530561E+00-3.22544939E-03 6.52764691E-06 3 +-5.79853643E-09 2.06237379E-12 3.34630913E+03-6.90432960E-01 4.51532273E+03 4 +END diff --git a/Support/ceptr/Kolla/tran.dat b/Support/ceptr/Kolla/tran.dat new file mode 100644 index 000000000..aba301c02 --- /dev/null +++ b/Support/ceptr/Kolla/tran.dat @@ -0,0 +1,319 @@ +! +! Transport data file to complement +! skeletal Mechanism for CO/H2 oxidation +! by Evatt R. Hawkes and Ramanan Sankaran +! +! The transport data were obtained from the authors of the complete +! C1-mechanism from which our skeletal mechanism was reduced, and were not +! altered. +! +! The complete C1-mechanism is found in: +! +! http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip +! +! J. Li, PhD Thesis, +! Mechanical and Aerospace Engineering Department, +! Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. +! +! At the time of writing, a publication to IJCK is in preparation +! by the authors of the complete mechanism. +! +! +AR 0 136.500 3.330 0.000 0.000 0.000 +AS 0 1045.500 4.580 0.000 0.000 0.000 ! MEC +ASH 1 199.300 4.215 0.000 0.000 1.000 ! MEC +ASH2 2 229.600 4.180 0.000 0.000 1.000 ! MEC +C 0 71.400 3.298 0.000 0.000 0.000 ! * +C2 1 97.530 3.621 0.000 1.760 4.000 +C2O 1 232.400 3.828 0.000 0.000 1.000 ! * +CN2 1 232.400 3.828 0.000 0.000 1.000 ! OIS +C2H 1 265.300 3.721 0.000 0.000 2.500 ! NMM +C2H2 1 265.300 3.721 0.000 0.000 2.500 ! NMM +C2H2OH 2 224.700 4.162 0.000 0.000 1.000 ! * +C2H3 2 265.300 3.721 0.000 0.000 1.000 ! NMM +C2H4 2 238.400 3.496 0.000 0.000 1.500 ! NMM +C2H5 2 247.500 4.350 0.000 0.000 1.500 ! NMM +C2H5OH 2 470.600 4.410 0.000 0.000 1.500 ! NMM +CH3CHOH 2 470.600 4.410 0.000 0.000 1.500 +CH3CH2O 2 470.600 4.410 0.000 0.000 1.500 ! NMM +C2H4OH 2 470.600 4.410 0.000 0.000 1.500 +PC2H4OH 2 470.600 4.410 0.000 0.000 1.500 ! NMM +SC2H4OH 2 470.600 4.410 0.000 0.000 1.500 ! NMM +HCOOH 2 470.600 4.410 0.000 0.000 1.500 +C2H6 2 247.500 4.350 0.000 0.000 1.500 ! NMM +C2N 1 232.400 3.828 0.000 0.000 1.000 ! OIS +C2N2 1 349.000 4.361 0.000 0.000 1.000 ! OIS +C3H2 2 209.000 4.100 0.000 0.000 1.000 ! * +C3H2(S) 2 209.000 4.100 0.000 0.000 1.000 ! * +C3H3 1 324.800 4.290 0.000 0.000 1.000 ! NMM +C4H3 1 357.000 4.720 0.000 0.000 1.000 ! NMM +C3H4O 2 443.200 4.120 0.000 0.000 1.000 ! NMM +ACETONE 2 443.200 4.120 0.000 0.000 1.000 +CH2CHCH2O 2 443.200 4.120 0.000 0.000 1.000 +HOC2H4O2 2 443.200 4.120 0.000 0.000 1.000 +CH3COCH2 2 443.200 4.120 0.000 0.000 1.000 +CHCHCHO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +HCCCHO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +HCCCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +H2CCHCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +CH3CCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +CH3CHCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +CH2CHCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +C2H3CO 2 443.200 4.120 0.000 0.000 1.000 ! NMM +C2H5CHO 2 424.600 4.820 0.000 0.000 1.000 ! NMM +CH2CH2CHO 2 424.600 4.820 0.000 0.000 1.000 ! NMM +CH2CHCHO 2 424.600 4.820 0.000 0.000 1.000 +C2H5CO 2 424.600 4.820 0.000 0.000 1.000 ! NMM +CH3COCH3 2 435.500 4.860 0.000 0.000 1.000 ! NMM +CH3COCH2 2 435.500 4.860 0.000 0.000 1.000 ! NMM +AC3H4 1 324.800 4.290 0.000 0.000 1.000 ! NMM +PC3H4 1 324.800 4.290 0.000 0.000 1.000 ! NMM +C3H4C 2 324.800 4.290 0.000 0.000 1.000 ! NMM +C3H6 2 307.800 4.140 0.000 0.000 1.000 ! NMM +C3H6OH 2 487.900 4.820 0.000 0.000 1.000 ! NMM +C3H6O 2 411.000 4.820 0.000 0.000 1.000 ! NMM +C3H5O 2 411.000 4.820 0.000 0.000 1.000 ! NMM +C3H7 2 303.400 4.810 0.000 0.000 1.000 ! NMM +C4H6 2 357.000 4.720 0.000 0.000 1.000 ! NMM +IC3H7 2 303.400 4.810 0.000 0.000 1.000 ! NMM +NC3H7 2 303.400 4.810 0.000 0.000 1.000 ! NMM +C3H8 2 303.400 4.810 0.000 0.000 1.000 ! NMM +C4H 1 357.000 4.720 0.000 0.000 1.000 ! NMM +C4H2 1 357.000 4.720 0.000 0.000 1.000 ! NMM +C4H2OH 2 224.700 4.162 0.000 0.000 1.000 ! * +CH3CHCCH 2 355.000 4.650 0.000 0.000 1.000 ! NMM +IC4H7 2 355.000 4.650 0.000 0.000 1.000 ! NMM +C4H7 2 355.000 4.650 0.000 0.000 1.000 ! NMM +C4H8 2 355.000 4.650 0.000 0.000 1.000 ! NMM +C4H8-1 2 355.000 4.650 0.000 0.000 1.000 ! NMM +C4H8-2 2 355.000 4.650 0.000 0.000 1.000 ! NMM +IC4H8 2 355.000 4.650 0.000 0.000 1.000 ! NMM +PC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM +C4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM +SC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM +TC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM +IC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM +C4H10 2 352.000 5.240 0.000 0.000 1.000 ! NMM +IC4H10 2 352.000 5.240 0.000 0.000 1.000 ! NMM +C5H2 1 408.000 5.200 0.000 0.000 1.000 ! NMM +C5H3 1 408.000 5.200 0.000 0.000 1.000 ! NMM +C5H5 1 408.000 5.200 0.000 0.000 1.000 ! NMM +C5H6 1 408.000 5.200 0.000 0.000 1.000 ! NMM +C5H7 2 408.000 5.200 0.000 0.000 1.000 ! NMM +CYC5H7 2 408.000 5.200 0.000 0.000 1.000 ! +C5H8 2 408.000 5.200 0.000 0.000 1.000 ! NMM +C6H2 1 408.000 5.200 0.000 0.000 1.000 ! NMM +C6H4 2 412.300 5.349 0.000 0.000 1.000 ! JAM +C6H5 2 412.300 5.349 0.000 0.000 1.000 ! JAM +C6H5(L) 2 412.300 5.349 0.000 0.000 1.000 ! JAM +C6H5OH 2 450.000 5.500 0.000 0.000 1.000 ! NMM +C6H5O 2 450.000 5.500 0.000 0.000 1.000 ! JAM +C6H4O2 2 450.000 5.500 0.000 0.000 1.000 +C5H4O 2 450.000 5.500 0.000 0.000 1.000 ! NMM +C5H4OH 2 450.000 5.500 0.000 0.000 1.000 ! NMM +C5H5O 2 450.000 5.500 0.000 0.000 1.000 ! NMM +C5H5OH 2 450.000 5.500 0.000 0.000 1.000 ! NMM +C6H5C2H 2 468.500 5.230 0.000 0.000 1.000 ! NMM +LC6H5 2 426.300 5.510 0.000 0.000 1.000 +C6H6 2 468.500 5.230 0.000 10.30 1.000 ! NMM +C6H7 2 468.500 5.230 0.000 0.000 1.000 ! NMM +CYC6H7 2 468.500 5.230 0.000 0.000 1.000 ! NMM +CYC6H8 2 468.500 5.230 0.000 0.000 1.000 ! NMM +C6H5CH2 2 495.300 5.680 0.000 0.000 1.000 ! NMM +C6H5CH3 2 495.300 5.680 0.430 12.30 1.000 ! NMM +C6H5CO 2 622.400 5.530 0.000 0.000 1.000 ! NMM +C6H5CHO 2 622.400 5.530 0.000 0.000 1.000 ! NMM +C6H5CH2OH 2 622.400 5.530 0.000 0.000 1.000 ! NMM +OC6H4CH3 2 621.100 5.640 0.000 0.000 1.000 ! NMM +HOC6H4CH3 2 621.100 5.640 0.000 0.000 1.000 ! NMM +XYLYLENE 2 523.600 6.182 0.000 0.000 1.000 +XYLYLRAD 2 523.600 6.182 0.000 0.000 1.000 +C6H5C2H5 2 523.600 5.960 0.000 0.000 1.000 ! NMM +C6H9 2 426.300 5.510 0.000 0.000 1.000 ! NMM +C6H10 2 426.300 5.510 0.000 0.000 1.000 ! NMM +C8H14 2 494.000 6.170 0.000 0.000 1.000 ! NMM +IC8H14 2 494.000 6.170 0.000 0.000 1.000 ! NMM +C6H5C2H3 2 546.200 6.000 0.130 15.00 1.000 ! NMM +C6H5CHCH 2 546.200 6.000 0.000 0.000 1.000 ! NMM +C6H5CCH2 2 546.200 6.000 0.000 0.000 1.000 +C6H5C2H 2 534.300 5.710 0.770 0.000 1.000 ! NMM +C6H4C2H3 2 546.200 6.000 0.000 0.000 1.000 ! NMM +C6H4C2H 2 534.300 5.710 0.000 0.000 1.000 ! NMM +C6H5CCO 2 588.200 5.940 0.000 0.000 1.0001 +C10H7 2 630.400 6.180 0.000 0.000 1.000 ! NMM +C10H7O 2 630.400 6.180 0.000 0.000 1.000 ! NMM +C10H8 2 630.400 6.180 0.000 16.50 1.000 ! NMM +C10H9 2 630.400 6.180 0.000 0.000 1.000 ! NMM +C10H10 2 630.400 6.180 0.000 0.000 1.000 ! NMM +C10H7CH2 2 660.00 6.350 0.000 0.000 1.000 ! NMM +C10H7OH 2 663.45 6.362 0.000 0.000 1.000 +C10H7CH3 2 660.0 6.350 0.000 0.000 1.000 ! NMM +FLRNTHN 2 812.3 7.170 0.000 0.000 1.000 ! NMM +ACEPHEN 2 812.3 7.170 0.000 0.000 1.000 +ANTHRACN 2 772.0 6.960 0.000 25.40 1.000 +CH3INDENE 2 625.0 6.150 0.000 0.000 1.000 +CH3INDENYL 2 625.0 6.150 0.000 0.000 1.000 +PHNTHRN 2 772.0 6.960 0.000 38.80 1.000 +PYRENE 2 834.9 7.240 0.000 0.000 1.000 ! NMM +PYRENYL 2 834.9 7.240 0.000 0.000 1.000 ! NMM +DHPYRENE 2 834.9 7.240 0.000 0.000 1.000 +BENZOAP 2 832.5 7.550 1.400 0.000 1.000 ! NMM +BENZOGHI 2 832.5 7.550 0.000 0.000 1.000 +CPENTACD 2 832.5 7.550 0.000 0.000 1.000 +INDENE 2 588.6 5.960 0.650 0.000 1.000 ! NMM +INDENYL 2 588.6 5.960 0.000 0.000 1.000 ! NMM +CH3FLRNE 2 712.6 6.890 0.000 0.000 1.000 +CH3FLRNL 2 712.6 6.890 0.000 0.000 1.000 +FLRENE 2 712.6 6.890 0.000 0.000 1.000 +BIBENZYL 2 783.800 6.640 0.000 0.000 1.000 ! NMM +STILBENE 2 772.0 6.960 0.000 0.000 1.000 ! NMM +STILBNRD 2 772.0 6.960 0.000 0.000 1.000 ! NMM +ANTHRACN 2 772.0 6.960 0.000 0.000 1.000 ! NMM +DHANTHRN 2 772.0 6.960 0.000 0.000 1.000 +CH 1 80.000 2.750 0.000 0.000 0.000 +CH2 1 144.000 3.800 0.000 0.000 0.000 +CH2(S) 1 144.000 3.800 0.000 0.000 0.000 +CH2CHCCH 2 373.700 4.790 0.000 0.000 1.000 ! NMM +CH2CHCCH2 2 373.700 4.790 0.000 0.000 1.000 ! NMM +CH3CCCH2 2 357.100 4.720 0.000 0.000 1.000 +CH3CHCCH2 2 357.100 4.720 0.000 0.000 1.000 +CH2CH2CCH 2 373.700 4.790 0.000 0.000 1.000 ! NMM +CH2CHCH2 2 316.000 4.220 0.000 0.000 1.000 ! NMM +AC3H5 2 316.000 4.220 0.000 0.000 1.000 +PC3H5 2 316.000 4.220 0.000 0.000 1.000 +CH2CHCHCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM +CH2CHCHCH2 2 357.100 4.720 0.000 0.000 1.000 ! NMM +CH2CO 2 436.000 3.970 0.000 0.000 2.000 +CH2O 2 498.000 3.590 0.000 0.000 2.000 +HCOH 2 498.000 3.590 0.000 0.000 1.000 +H2CO 2 498.000 3.590 0.000 0.000 2.000 +CH2OH 2 417.000 3.690 1.700 0.000 2.000 +CH2HCO 2 436.000 3.970 0.000 0.000 2.000 +CHOCHO 1 440.200 4.010 0.000 0.000 2.000 ! NMM +CHOCO 1 440.200 4.010 0.000 0.000 2.000 ! NMM +CH3 1 144.000 3.800 0.000 0.000 0.000 +CH3CC 2 252.000 4.760 0.000 0.000 1.000 ! JAM +CH3CHCCH 2 373.700 4.790 0.000 0.000 1.000 ! NMM +CH3CCCH2 2 357.100 4.720 0.000 0.000 1.000 ! NMM +CH3CCCH3 2 357.100 4.720 0.000 0.000 1.000 ! NMM +CH3CCH2 2 316.000 4.220 0.000 0.000 1.000 ! NMM +TC3H5 2 316.000 4.220 0.000 0.000 1.000 +CH3CHCH 2 316.000 4.220 0.000 0.000 1.000 ! NMM +SC3H5 2 316.000 4.220 0.000 0.000 1.000 +CH3CH2CCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM +CH3HCO 2 436.000 3.970 0.000 0.000 2.000 +CH3CO 2 436.000 3.970 0.000 0.000 2.000 +CH3O 2 417.000 3.690 1.700 0.000 2.000 +CH3OH 2 481.800 3.626 0.000 0.000 1.000 ! SVE +CH4 2 141.400 3.746 0.000 2.600 13.000 +CH4O 2 417.000 3.690 1.700 0.000 2.000 +CN 1 75.000 3.856 0.000 0.000 1.000 ! OIS +CNC 1 232.400 3.828 0.000 0.000 1.000 ! OIS +CNN 1 232.400 3.828 0.000 0.000 1.000 ! OIS +CO 1 98.100 3.650 0.000 1.950 1.800 +CO2 1 244.000 3.763 0.000 2.650 2.100 +F 0 80.000 2.750 0.000 0.000 0.000 +F2 1 125.700 3.301 0.000 1.600 3.800 +H 0 145.000 2.050 0.000 0.000 0.000 +GAH 1 335.500 4.240 0.000 0.000 1.000 ! MEC +H2C4O 2 357.000 5.180 0.000 0.000 1.000 ! JAM +H2 1 38.000 2.920 0.000 0.790 280.000 +H2CCC 2 265.300 3.721 0.000 0.000 1.000 ! * +H2CCC(S) 2 265.300 3.721 0.000 0.000 1.000 ! * +H2CCCH 2 252.000 4.760 0.000 0.000 1.000 ! JAM +H2CCCCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM +H2CCCCH2 2 357.100 4.720 0.000 0.000 1.000 ! NMM +H2CCCCCH 1 408.000 5.200 0.000 0.000 1.000 ! NMM +H2CN 1 569.000 3.630 0.000 0.000 1.000 ! OS/JM +H2NO 2 116.700 3.492 0.000 0.000 1.000 ! JAM +H2O 2 572.400 2.605 1.844 0.000 4.000 +H2O2 2 107.400 3.458 0.000 0.000 3.800 +H2S 2 301.000 3.600 0.000 0.000 1.000 ! OIS +HC2N2 1 349.000 4.361 0.000 0.000 1.000 ! OIS +HCCHCCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM +HCCO 2 150.000 2.500 0.000 0.000 1.000 ! * +HCCOH 2 436.000 3.970 0.000 0.000 2.000 +HCCCHCCH 1 408.000 5.200 0.000 0.000 1.000 ! NMM +HCN 1 569.000 3.630 0.000 0.000 1.000 ! OIS +HCO 2 498.000 3.590 0.000 0.000 0.000 +HCO+ 1 498.000 3.590 0.000 0.000 0.000 +HE 0 10.200 2.576 0.000 0.000 0.000 ! * +HF 1 330.000 3.148 1.920 2.460 1.000 ! SV/MEC +HF0 1 352.000 2.490 1.730 0.000 5.000 +HF1 1 352.000 2.490 1.730 0.000 5.000 +HF2 1 352.000 2.490 1.730 0.000 5.000 +HF3 1 352.000 2.490 1.730 0.000 5.000 +HF4 1 352.000 2.490 1.730 0.000 5.000 +HF5 1 352.000 2.490 1.730 0.000 5.000 +HF6 1 352.000 2.490 1.730 0.000 5.000 +HF7 1 352.000 2.490 1.730 0.000 5.000 +HF8 1 352.000 2.490 1.730 0.000 5.000 +HCNO 2 232.400 3.828 0.000 0.000 1.000 ! JAM +HOCN 2 232.400 3.828 0.000 0.000 1.000 ! JAM +HNCO 2 232.400 3.828 0.000 0.000 1.000 ! OIS +HNNO 2 232.400 3.828 0.000 0.000 1.000 ! * +HNO 2 116.700 3.492 0.000 0.000 1.000 ! * +HNOH 2 116.700 3.492 0.000 0.000 1.000 ! JAM +HO2 2 107.400 3.458 0.000 0.000 1.000 ! * +HSO2 2 252.000 4.290 0.000 0.000 1.000 ! OIS +N 0 71.400 3.298 0.000 0.000 0.000 ! * +N2 1 97.530 3.621 0.000 1.760 4.000 +N2H2 2 71.400 3.798 0.000 0.000 1.000 ! * +N2H3 2 200.000 3.900 0.000 0.000 1.000 ! * +N2H4 2 205.000 4.230 0.000 4.260 1.500 +N2O 1 232.400 3.828 0.000 0.000 1.000 ! * +NCN 1 232.400 3.828 0.000 0.000 1.000 ! OIS +NCO 1 232.400 3.828 0.000 0.000 1.000 ! OIS +NH 1 80.000 2.650 0.000 0.000 4.000 +NH2 2 80.000 2.650 0.000 2.260 4.000 +NH3 2 481.000 2.920 1.470 0.000 10.000 +NNH 2 71.400 3.798 0.000 0.000 1.000 ! * +NO 1 97.530 3.621 0.000 1.760 4.000 +NCNO 2 232.400 3.828 0.000 0.000 1.000 ! OIS +NO2 2 200.000 3.500 0.000 0.000 1.000 ! * +O 0 80.000 2.750 0.000 0.000 0.000 +O2 1 107.400 3.458 0.000 1.600 3.800 +O3 2 180.000 4.100 0.000 0.000 2.000 +OH 1 80.000 2.750 0.000 0.000 0.000 +S 0 847.000 3.839 0.000 0.000 0.000 ! OIS +S2 1 847.000 3.900 0.000 0.000 1.000 ! OIS +SH 1 847.000 3.900 0.000 0.000 1.000 ! OIS +SO 1 301.000 3.993 0.000 0.000 1.000 ! OIS +SO2 2 252.000 4.290 0.000 0.000 1.000 ! OIS +SO3 2 378.400 4.175 0.000 0.000 1.000 ! OIS +SIH4 2 207.6 4.084 0.000 0.000 1.000 ! MEC +SIH3 2 170.3 3.943 0.000 0.000 1.000 ! MEC +SIH2 2 133.1 3.803 0.000 0.000 1.000 ! MEC +SIH 1 95.8 3.662 0.000 0.000 1.000 ! MEC +SI 0 3036. 2.910 0.000 0.000 0.000 ! MEC +SI2H6 2 301.3 4.828 0.000 0.000 1.000 ! MEC +SI2H5 2 306.9 4.717 0.000 0.000 1.000 ! MEC +SI2H4 2 312.6 4.601 0.000 0.000 1.000 ! MEC +SI2H3 2 318.2 4.494 0.000 0.000 1.000 ! MEC +SI2H2 2 323.8 4.383 0.000 0.000 1.000 ! MEC +SI2 1 3036. 3.280 0.000 0.000 1.000 ! MEC +SI3 2 3036. 3.550 0.000 0.000 1.000 ! MEC +SIF3 2 309.6 4.359 0.000 0.000 1.000 ! MEC +SIF3NH2 2 231.0 4.975 0.000 0.000 1.000 ! MEC +SIF4 2 171.9 4.880 0.000 0.000 1.000 ! SVE +SIHF3 2 180.8 4.681 0.000 0.000 1.000 ! MEC +H2SISIH2 2 312.6 4.601 0.000 0.000 1.000 ! MEC +H3SISIH 2 312.6 4.601 0.000 0.000 1.000 ! MEC +SI3H8 2 331.2 5.562 0.000 0.000 1.000 ! MEC +ASH3 2 259.8 4.145 0.000 0.000 1.000 ! MEC +AS2 1 1045.5 5.510 0.000 0.000 1.000 ! MEC +GAME3 2 378.2 5.52 0.000 0.000 1.000 ! MEC +GAME2 2 675.8 5.22 0.000 0.000 1.000 ! MEC +GAME 2 972.7 4.92 0.000 0.000 1.000 ! MEC +GA 0 2961.8 4.62 0.000 0.000 0.000 ! MEC +K 0 850. 4.25 0.000 0.000 1.000 ! SINGH +KOH 2 1213. 4.52 0.000 0.000 1.000 ! SINGH +KO2 2 1213. 4.69 0.000 0.000 1.000 ! SINGH +KH 1 93.3 3.542 0.000 0.000 1.000 ! SINGH +K+ 0 850. 4.25 0.000 0.000 1.000 ! SINGH +E 0 850. 425. 0.000 0.000 1.000 ! SINGH +KCL 1 1989. 4.186 0.000 0.000 1.000 ! SINGH +CL 0 130.8 3.613 0.000 0.000 1.000 ! SINGH +CL- 0 130.8 3.613 0.000 0.000 1.000 ! SINGH +HCL 1 344.7 3.339 1.084 0.000 1.000 ! SINGH +KO 1 383.0 3.812 0.000 0.000 1.000 ! SINGH From 024c25a5d304e7af6ba5af1500616ae143c8500d Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 15 Jan 2024 15:49:48 +0530 Subject: [PATCH 03/20] Modified the preprocessor directives mechanism.H now explicitly incorporates surface information --- Support/ceptr/Kolla/mechanism.H | 17 +++++++-- Support/ceptr/ceptr/converter.py | 61 +++++++++++++++++++++++++++----- 2 files changed, 66 insertions(+), 12 deletions(-) diff --git a/Support/ceptr/Kolla/mechanism.H b/Support/ceptr/Kolla/mechanism.H index 2086a5e83..1c01eacfc 100644 --- a/Support/ceptr/Kolla/mechanism.H +++ b/Support/ceptr/Kolla/mechanism.H @@ -25,10 +25,21 @@ #define HCO_ID 10 #define N2_ID 11 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 12 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 12 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 29 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS +#define NUM_SPECIES NUM_GAS_SPECIES + NUM_SURFACE_SPECIES +#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS + #define NUM_IONS 0 -#define NUM_REACTIONS 29 #define NUM_FIT 4 diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 4d9ab63ef..e5d03624d 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -632,20 +632,36 @@ def mechanism_cpp_declarations(self, fstream): def mechanism_header_includes(self, fstream): """Write the mechanism header includes.""" + n_hom_b_elem = len(self.mechanism.element_names) + n_hom_species = len(self.species_info.nonqssa_species_list) + n_hom_reactions = self.mechanism.n_reactions + site_density = n_het_b_elem = n_het_species = n_het_reactions = 0 + + all_species_list = self.species_info.nonqssa_species_list + cw.writer(fstream) cw.writer(fstream, "#include ") cw.writer(fstream, "#include ") cw.writer(fstream) cw.writer(fstream, "/* Elements") - nb_elem = 0 + for elem in self.mechanism.element_names: cw.writer(fstream, f"{self.mechanism.element_index(elem)} {elem}") - nb_elem += 1 + + if not isinstance(self.interface, type(None)): + n_het_species = self.interface.n_species + n_het_reactions = self.interface.n_reactions + all_species_list += self.interface.species_names + for elem in self.interface.element_names: + if elem not in self.mechanism.element_names: + cw.writer(fstream, f"{n_hom_b_elem+n_het_b_elem} {elem}") + n_het_b_elem += 1 cw.writer(fstream, "*/") cw.writer(fstream) cw.writer(fstream, cw.comment("Species")) nb_ions = 0 - for species in self.species_info.nonqssa_species_list: + + for species in all_species_list: s = cf.format_species(species) cw.writer( fstream, @@ -653,13 +669,40 @@ def mechanism_header_includes(self, fstream): ) if s[-1] == "n" or s[-1] == "p" or s == "E": nb_ions += 1 + + qssa_str = "QSSA_" if self.species_info.n_qssa_species > 0 else "" + + cw.writer(fstream) + cw.writer(fstream, f"#define NUM_GAS_ELEMENTS {n_hom_b_elem}" + + cw.comment("Elements in the homogeneous phase")) + cw.writer(fstream, f"#define NUM_{qssa_str}GAS_SPECIES {n_hom_species}" + + cw.comment("Species in the homogeneous phase")) + cw.writer(fstream, f"#define NUM_GAS_REACTIONS {n_hom_reactions}" + + cw.comment("Reactions in the homogeneous phase")) + + if not isinstance(self.interface, type(None)): + site_density = self.interface.site_density + site_density *= 0.1# convert from Kmol/m**2 to mol/cm**2 + + cw.writer(fstream) + cw.writer(fstream, f"#define SITE_DENSITY {site_density:E}" + + cw.comment("mol/cm^2")) + cw.writer(fstream) + cw.writer(fstream, f"#define NUM_SURFACE_ELEMENTS {n_het_b_elem}"+ + cw.comment("Additional elements in heterogeneous phase")) + cw.writer(fstream, f"#define NUM_SURFACE_SPECIES {n_het_species}" + + cw.comment("Species in the heterogeneous phase")) + cw.writer(fstream, f"#define NUM_SURFACE_REACTIONS {n_het_reactions}" + + cw.comment("Reactions in the heterogeneous phase")) + cw.writer(fstream) + + cw.writer(fstream, + f"#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS") + cw.writer(fstream, + f"#define NUM_SPECIES NUM_GAS_SPECIES + NUM_SURFACE_SPECIES") + cw.writer(fstream, + f"#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS") cw.writer(fstream) - cw.writer(fstream, f"#define NUM_ELEMENTS {nb_elem}") - cw.writer(fstream, f"#define NUM_SPECIES {self.species_info.n_species}") cw.writer(fstream, f"#define NUM_IONS {nb_ions}") - cw.writer( - fstream, - f"#define NUM_REACTIONS {len(self.mechanism.reactions())}", - ) cw.writer(fstream) cw.writer(fstream, "#define NUM_FIT 4") From 2494a380f6223cb9faf69c3323e38565f2e5cf81 Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 15 Jan 2024 16:16:40 +0530 Subject: [PATCH 04/20] Added surface species information to species_info.py and the set_species method in converter.py --- Support/ceptr/ceptr/converter.py | 35 ++++++++++++++++++++++++++--- Support/ceptr/ceptr/species_info.py | 3 +++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index e5d03624d..8b0c646d1 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -33,6 +33,8 @@ def __init__( qss_format_input=None, qss_symbolic_jacobian=False, ): + self.mechIsAHetMech = chemistry == "heterogeneous" + self.mechanism = mechanism self.interface = interface @@ -41,7 +43,11 @@ def __init__( # Symbolic computations self.qss_symbolic_jacobian = qss_symbolic_jacobian - self.mechpath = pathlib.Path(self.mechanism.source) + if self.mechIsAHetMech: + self.mechpath = pathlib.Path(self.interface.source) + else: + self.mechpath = pathlib.Path(self.mechanism.source) + self.rootname = "mechanism" self.hdrname = self.mechpath.parents[0] / f"{self.rootname}.H" self.cppname = self.mechpath.parents[0] / f"{self.rootname}.cpp" @@ -81,7 +87,8 @@ def __init__( def set_species(self): """Set the species.""" # Fill species counters - self.species_info.n_all_species = self.mechanism.n_species + self.species_info.n_gas_species = self.mechanism.n_species + try: self.species_info.n_qssa_species = self.mechanism.input_data[ "n_qssa_species" @@ -90,9 +97,13 @@ def set_species(self): self.species_info.n_qssa_species = 0 self.species_info.n_species = ( - self.species_info.n_all_species - self.species_info.n_qssa_species + self.species_info.n_gas_species - self.species_info.n_qssa_species ) + self.species_info.n_all_species = self.species_info.n_species + if self.mechIsAHetMech: + self.species_info.n_all_species += self.interface.n_species + # get the unsorted self.qssa_species_list qssa_list_tmp = [] try: @@ -169,6 +180,24 @@ def set_species(self): ], "d", ) + + if self.mechIsAHetMech: + # Initialize gas-solid interface species + self.species_info.n_surface_species = self.interface.n_species + for id, species in enumerate(self.interface.species()): + weight = 0.0 + for elem, coef in species.composition.items(): + aw = self.interface.atomic_weight(elem) + weight += coef * aw + tempsp = csi.SpeciesDb( + id, sorted_idx, species.name, weight, species.charge + ) + self.species_info.all_species.append(tempsp) + self.species_info.surface_species_list.append(species.name) + self.species_info.ordered_idx_map[species.name] = sorted_idx + self.species_info.mech_idx_map[species.name] = id + sorted_idx += 1 + if self.species_info.n_qssa_species > 0: print("Full species list with transported first and QSSA last:") for all_species in self.species_info.all_species: diff --git a/Support/ceptr/ceptr/species_info.py b/Support/ceptr/ceptr/species_info.py index b9193eed3..d1dde08ef 100644 --- a/Support/ceptr/ceptr/species_info.py +++ b/Support/ceptr/ceptr/species_info.py @@ -47,6 +47,9 @@ def __init__(self): # number of non QSSA species self.n_species = 0 + # list of surface species + self.surface_species_list = list() + # all Species self.all_species = [] self.all_species_list = [] From 94bbd13d5af9f8411c05304e3a25c909552fb82a Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 15 Jan 2024 16:25:28 +0530 Subject: [PATCH 05/20] Modified formatter to replace '(' with '_' Essentially surface species, e.g. H(S), are now being defined as H_S_ID instead of HS_ID --- Support/ceptr/ceptr/formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/ceptr/ceptr/formatter.py b/Support/ceptr/ceptr/formatter.py index 8fa13931f..fe0f25e30 100644 --- a/Support/ceptr/ceptr/formatter.py +++ b/Support/ceptr/ceptr/formatter.py @@ -12,7 +12,7 @@ def format_species(species): # Excited species s = s.replace("*", "D") # Parenthesis - s = s.replace("(", "").replace(")", "") + s = s.replace("(", "_").replace(")", "") # Dash s = s.replace("-", "") return s From a5fa996961c8a043a8d457b464864556715efb86 Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Tue, 16 Jan 2024 21:15:02 +0530 Subject: [PATCH 06/20] Added indexing for additional heterogeneous reactions --- Support/ceptr/ceptr/converter.py | 14 +++++++++- Support/ceptr/ceptr/reaction_info.py | 40 +++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 8b0c646d1..42af933dc 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -54,9 +54,21 @@ def __init__( self.species_info = csi.SpeciesInfo() self.set_species() + + # indexing of homogeneous reactions + # The first 3 (troe, sri, lindemann) are fallout reactions + # followed by three-body, simple and other "weird" reactions # 0/ntroe/nsri/nlindem/nTB/nSimple/nWeird # 0/1 /2 /3 /4 /5 /6 - self.reaction_info = cri.sort_reactions(self.mechanism) + + # indexing of heterogeneous reactions + # All the reactions are simple reactions and are either + # "Interface" or "Sticking" reactions + # within the interface reactions three sub-types exist: + # Elementary, Surface-Coverage Modified and FORD + # 6/interface/sticking + # 6/7 /8 + self.reaction_info = cri.sort_reactions(self.mechanism, self.interface) # QSS -- sort reactions/networks/check validity of QSSs if self.species_info.n_qssa_species > 0: print("QSSA information") diff --git a/Support/ceptr/ceptr/reaction_info.py b/Support/ceptr/ceptr/reaction_info.py index a92575bda..ed5276e18 100644 --- a/Support/ceptr/ceptr/reaction_info.py +++ b/Support/ceptr/ceptr/reaction_info.py @@ -9,7 +9,7 @@ class ReactionInfo: """Information on reactions.""" - def __init__(self, mechanism): + def __init__(self, mechanism, interface): """Initialize the reaction information.""" self.n_reactions = mechanism.n_reactions self.rs = [] @@ -27,10 +27,12 @@ def __init__(self, mechanism): self.n_qssa_reactions = 0 self.qfqr_co_idx_map = [] + if not isinstance(interface, type(None)): + self.rs_unsorted += interface.reactions() -def sort_reactions(mechanism): +def sort_reactions(mechanism, interface): """Sort reactions.""" - reaction_info = ReactionInfo(mechanism) + reaction_info = ReactionInfo(mechanism, interface) i = 0 # troe @@ -69,9 +71,15 @@ def sort_reactions(mechanism): i += 1 reaction_info.index.append(i) - # simplest case + # simplest case (Arrhenius reactions) for k, r in enumerate(reaction_info.rs_unsorted): if r not in reaction_info.rs: + # skip all interface-Arrhenius and sticking-Arrhenius heterogeneous reactions + # heterogeneous reactions are added after all the homogeneous reactions + if any([r.reaction_type == "interface-Arrhenius", + r.reaction_type == "sticking-Arrhenius"]): + continue + if r.third_body is None: reaction_info.idxmap[k] = i reaction_info.rs.append(r) @@ -81,11 +89,35 @@ def sort_reactions(mechanism): # everything else for k, r in enumerate(reaction_info.rs_unsorted): if r not in reaction_info.rs: + # skip all interface-Arrhenius and sticking-Arrhenius heterogeneous reactions + # heterogeneous reactions are added after all the homogeneous reactions + if any([r.reaction_type == "interface-Arrhenius", + r.reaction_type == "sticking-Arrhenius"]): + continue + reaction_info.idxmap[k] = i reaction_info.rs.append(r) i += 1 reaction_info.index.append(i) + # surface reactions + if not isinstance(interface, type(None)): + for k, r in enumerate(reaction_info.rs_unsorted): + if r not in reaction_info.rs: + if r.reaction_type == "interface-Arrhenius": + reaction_info.idxmap[k] = i + reaction_info.rs.append(r) + i += 1 + reaction_info.index.append(i) + + for k, r in enumerate(reaction_info.rs_unsorted): + if r not in reaction_info.rs: + if r.reaction_type == "sticking-Arrhenius": + reaction_info.idxmap[k] = i + reaction_info.rs.append(r) + i += 1 + reaction_info.index.append(i) + reaction_info.is_sorted = True return reaction_info From 41ea734296904e6452832b29029be4d67c6c747d Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Tue, 16 Jan 2024 21:31:03 +0530 Subject: [PATCH 07/20] Modified the reaction_info rmap and get_rmap methods to use NUM_REACTIONS instead of getting n_reactions --- Support/ceptr/Kolla/mechanism.cpp | 8 ++++---- Support/ceptr/ceptr/converter.py | 4 ++-- Support/ceptr/ceptr/reaction_info.py | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Support/ceptr/Kolla/mechanism.cpp b/Support/ceptr/Kolla/mechanism.cpp index 8cfa257c1..3751157fc 100644 --- a/Support/ceptr/Kolla/mechanism.cpp +++ b/Support/ceptr/Kolla/mechanism.cpp @@ -1,13 +1,13 @@ #include "mechanism.H" -const int rmap[29] = {8, 15, 21, 4, 5, 6, 7, 25, 0, 1, - 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, - 18, 19, 20, 22, 23, 24, 26, 27, 28}; +const int rmap[NUM_REACTIONS] = {8, 15, 21, 4, 5, 6, 7, 25, 0, 1, + 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, + 18, 19, 20, 22, 23, 24, 26, 27, 28}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 29; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 42af933dc..e17b48aab 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -229,8 +229,8 @@ def writer(self): with open(self.hdrname, "w") as hdr, open(self.cppname, "w") as cpp: # This is for the cpp file cw.writer(cpp, self.mechanism_cpp_includes()) - cri.rmap(cpp, self.mechanism, self.reaction_info) - cri.get_rmap(cpp, self.mechanism) + cri.rmap(cpp, self.reaction_info) + cri.get_rmap(cpp, self.reaction_info) cck.ckinu(cpp, self.mechanism, self.species_info, self.reaction_info) cck.ckkfkr(cpp, self.mechanism, self.species_info) cp.progress_rate_fr( diff --git a/Support/ceptr/ceptr/reaction_info.py b/Support/ceptr/ceptr/reaction_info.py index ed5276e18..7647b9311 100644 --- a/Support/ceptr/ceptr/reaction_info.py +++ b/Support/ceptr/ceptr/reaction_info.py @@ -30,6 +30,8 @@ def __init__(self, mechanism, interface): if not isinstance(interface, type(None)): self.rs_unsorted += interface.reactions() + self.hasRxns = len(self.rs_unsorted) > 0 + def sort_reactions(mechanism, interface): """Sort reactions.""" reaction_info = ReactionInfo(mechanism, interface) @@ -123,31 +125,29 @@ def sort_reactions(mechanism, interface): return reaction_info -def rmap(fstream, mechanism, reaction_info): +def rmap(fstream, reaction_info): """Write reverse reaction map.""" rmap = reaction_info.idxmap.keys() - n_reactions = mechanism.n_reactions str_rmap = ",".join(str(x) for x in rmap) - if n_reactions > 0: - cw.writer(fstream, f"const int rmap[{n_reactions}] = {{{str_rmap}}};") + if reaction_info.hasRxns: + cw.writer(fstream, f"const int rmap[NUM_REACTIONS] = {{{str_rmap}}};") -def get_rmap(fstream, mechanism): +def get_rmap(fstream, reaction_info): """Write function for reverse reaction map.""" - n_reactions = mechanism.n_reactions cw.writer(fstream) cw.writer(fstream, cw.comment("Returns 0-based map of reaction order")) cw.writer(fstream, "void GET_RMAP" + cc.sym) - if n_reactions > 0: + if reaction_info.hasRxns: cw.writer(fstream, "(int * _rmap)") else: cw.writer(fstream, "(int * /*_rmap*/)") cw.writer(fstream, "{") - if n_reactions > 0: - cw.writer(fstream, f"for (int j=0; j<{n_reactions}; ++j)") + if reaction_info.hasRxns: + cw.writer(fstream, f"for (int j=0; j Date: Wed, 17 Jan 2024 15:37:04 +0530 Subject: [PATCH 08/20] Fixed NUM_SPECIES preprocessor directive for qssa mechanisms --- Support/ceptr/ceptr/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index e17b48aab..5bd65fa8c 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -740,7 +740,7 @@ def mechanism_header_includes(self, fstream): cw.writer(fstream, f"#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS") cw.writer(fstream, - f"#define NUM_SPECIES NUM_GAS_SPECIES + NUM_SURFACE_SPECIES") + f"#define NUM_SPECIES NUM_{qssa_str}GAS_SPECIES + NUM_SURFACE_SPECIES") cw.writer(fstream, f"#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS") cw.writer(fstream) From 4e11558d884581ca6a1208bb242cc70c809b6e95 Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Fri, 19 Jan 2024 15:49:52 +0530 Subject: [PATCH 09/20] Included Modifications based on PR review ceptr.py: chemistry argument is not required and defaults to homogeneous reaction_info: improved verbosity & rewrote isinstance based conditions converter.py: used ternary operator, list comprehension & merged site density definition to one line Also conformed to black and flake8 formatting --- Support/ceptr/ceptr/ceptr.py | 54 ++++++++++------- Support/ceptr/ceptr/converter.py | 89 +++++++++++++++++----------- Support/ceptr/ceptr/reaction_info.py | 24 ++++---- 3 files changed, 101 insertions(+), 66 deletions(-) diff --git a/Support/ceptr/ceptr/ceptr.py b/Support/ceptr/ceptr/ceptr.py index 6cffda3e0..02d7f594a 100644 --- a/Support/ceptr/ceptr/ceptr.py +++ b/Support/ceptr/ceptr/ceptr.py @@ -43,20 +43,22 @@ def convert( qss_symbolic_jac, chemistry, gas_name, - interface_name + interface_name, ): """Convert a mechanism file.""" print(f"""Converting file {fname}""") - mechanismIsHomogeneous = chemistry == "homogeneous" - if not mechanismIsHomogeneous: + mechanism_is_homogeneous = chemistry == "homogeneous" + if not mechanism_is_homogeneous: print(f"""\tHomogeneous phase name is '{gas_name}'""") print(f"""\tGas-solid interface name is '{interface_name}'""") - interface = None if mechanismIsHomogeneous else\ - ct.Interface(fname, interface_name) - mechanism = ct.Solution(fname) if mechanismIsHomogeneous else\ - interface.adjacent[gas_name] + interface = ( + None if mechanism_is_homogeneous else ct.Interface(fname, interface_name) + ) + mechanism = ( + ct.Solution(fname) if mechanism_is_homogeneous else interface.adjacent[gas_name] + ) conv = converter.Converter( mechanism, @@ -120,21 +122,30 @@ def main(): "-lq", "--lst_qss", help="QSS mechanism directory file list", type=str ) - group2 = parser.add_mutually_exclusive_group(required=True) - group2.add_argument("-c", "--chemistry", type=str, - help="Information regarding whether the supplied"+\ - " Mechanism file specified Homogeneous or"+\ - " heterogeneous chemistry") + parser.add_argument( + "-c", + "--chemistry", + choices=["homogeneous", "heterogeneous"], + help="Information regarding whether the supplied" + + " Mechanism file specified Homogeneous or" + + " heterogeneous chemistry", + type=str, + default="homogeneous", + ) + parser.add_argument( "--gas_name", type=str, - default = "gas", - help="Name of the homogeneous phase in the mechanism file") + default="gas", + help="Name of the homogeneous phase in the mechanism file", + ) + parser.add_argument( "--interface_name", type=str, - default = None, - help="Name of the gas-solid interface in the mechanism file") + default=None, + help="Name of the gas-solid interface in the mechanism file", + ) parser.add_argument( "--qss_format_input", @@ -164,13 +175,10 @@ def main(): args = parser.parse_args() - # sanity checks - assert args.chemistry in ['homogeneous', 'heterogeneous'],\ - """Invalid chemistry specifier.\nThe required -c/--chemistry argument should be either\n"homogeneous" or "heterogeneous." """ - if args.chemistry == "heterogeneous": - assert not isinstance(args.interface_name, type(None)),\ - f"""Missing --interface_name argument\nPlease specify the name of the gas-solid interface mentioned in {args.fname}""" + assert ( + args.interface_name is not None + ), f"""Missing --interface_name argument.See 'phases' in {args.fname}""" if args.fname: convert( @@ -180,7 +188,7 @@ def main(): args.qss_symbolic_jacobian, args.chemistry, args.gas_name, - args.interface_name + args.interface_name, ) elif args.lst: convert_lst( diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 5bd65fa8c..5bb766ead 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -43,10 +43,11 @@ def __init__( # Symbolic computations self.qss_symbolic_jacobian = qss_symbolic_jacobian - if self.mechIsAHetMech: - self.mechpath = pathlib.Path(self.interface.source) - else: - self.mechpath = pathlib.Path(self.mechanism.source) + self.mechpath = ( + pathlib.Path(self.interface.source) + if self.mechIsAHetMech + else pathlib.Path(self.mechanism.source) + ) self.rootname = "mechanism" self.hdrname = self.mechpath.parents[0] / f"{self.rootname}.H" @@ -197,13 +198,13 @@ def set_species(self): # Initialize gas-solid interface species self.species_info.n_surface_species = self.interface.n_species for id, species in enumerate(self.interface.species()): - weight = 0.0 - for elem, coef in species.composition.items(): - aw = self.interface.atomic_weight(elem) - weight += coef * aw + weight = sum( + c * self.interface.atomic_weight(e) + for e, c in species.composition.items() + ) tempsp = csi.SpeciesDb( - id, sorted_idx, species.name, weight, species.charge - ) + id, sorted_idx, species.name, weight, species.charge + ) self.species_info.all_species.append(tempsp) self.species_info.surface_species_list.append(species.name) self.species_info.ordered_idx_map[species.name] = sorted_idx @@ -678,7 +679,7 @@ def mechanism_header_includes(self, fstream): n_hom_reactions = self.mechanism.n_reactions site_density = n_het_b_elem = n_het_species = n_het_reactions = 0 - all_species_list = self.species_info.nonqssa_species_list + all_species_list = self.species_info.nonqssa_species_list cw.writer(fstream) cw.writer(fstream, "#include ") @@ -714,35 +715,57 @@ def mechanism_header_includes(self, fstream): qssa_str = "QSSA_" if self.species_info.n_qssa_species > 0 else "" cw.writer(fstream) - cw.writer(fstream, f"#define NUM_GAS_ELEMENTS {n_hom_b_elem}" + - cw.comment("Elements in the homogeneous phase")) - cw.writer(fstream, f"#define NUM_{qssa_str}GAS_SPECIES {n_hom_species}" + - cw.comment("Species in the homogeneous phase")) - cw.writer(fstream, f"#define NUM_GAS_REACTIONS {n_hom_reactions}" + - cw.comment("Reactions in the homogeneous phase")) + cw.writer( + fstream, + f"#define NUM_GAS_ELEMENTS {n_hom_b_elem}" + + cw.comment("Elements in the homogeneous phase"), + ) + cw.writer( + fstream, + f"#define NUM_{qssa_str}GAS_SPECIES {n_hom_species}" + + cw.comment("Species in the homogeneous phase"), + ) + cw.writer( + fstream, + f"#define NUM_GAS_REACTIONS {n_hom_reactions}" + + cw.comment("Reactions in the homogeneous phase"), + ) if not isinstance(self.interface, type(None)): - site_density = self.interface.site_density - site_density *= 0.1# convert from Kmol/m**2 to mol/cm**2 + site_density = 0.1 * self.interface.site_density # Kmol/m**2 to mol/cm**2 cw.writer(fstream) - cw.writer(fstream, f"#define SITE_DENSITY {site_density:E}" - + cw.comment("mol/cm^2")) + cw.writer( + fstream, f"#define SITE_DENSITY {site_density:E}" + cw.comment("mol/cm^2") + ) cw.writer(fstream) - cw.writer(fstream, f"#define NUM_SURFACE_ELEMENTS {n_het_b_elem}"+ - cw.comment("Additional elements in heterogeneous phase")) - cw.writer(fstream, f"#define NUM_SURFACE_SPECIES {n_het_species}" + - cw.comment("Species in the heterogeneous phase")) - cw.writer(fstream, f"#define NUM_SURFACE_REACTIONS {n_het_reactions}" + - cw.comment("Reactions in the heterogeneous phase")) + cw.writer( + fstream, + f"#define NUM_SURFACE_ELEMENTS {n_het_b_elem}" + + cw.comment("Additional elements in heterogeneous phase"), + ) + cw.writer( + fstream, + f"#define NUM_SURFACE_SPECIES {n_het_species}" + + cw.comment("Species in the heterogeneous phase"), + ) + cw.writer( + fstream, + f"#define NUM_SURFACE_REACTIONS {n_het_reactions}" + + cw.comment("Reactions in the heterogeneous phase"), + ) cw.writer(fstream) - cw.writer(fstream, - f"#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS") - cw.writer(fstream, - f"#define NUM_SPECIES NUM_{qssa_str}GAS_SPECIES + NUM_SURFACE_SPECIES") - cw.writer(fstream, - f"#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS") + cw.writer( + fstream, "#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS" + ) + cw.writer( + fstream, + f"#define NUM_SPECIES NUM_{qssa_str}GAS_SPECIES + NUM_SURFACE_SPECIES", + ) + cw.writer( + fstream, "#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS" + ) cw.writer(fstream) cw.writer(fstream, f"#define NUM_IONS {nb_ions}") cw.writer(fstream) diff --git a/Support/ceptr/ceptr/reaction_info.py b/Support/ceptr/ceptr/reaction_info.py index 7647b9311..582a33d3c 100644 --- a/Support/ceptr/ceptr/reaction_info.py +++ b/Support/ceptr/ceptr/reaction_info.py @@ -27,10 +27,10 @@ def __init__(self, mechanism, interface): self.n_qssa_reactions = 0 self.qfqr_co_idx_map = [] - if not isinstance(interface, type(None)): + if interface is not None: self.rs_unsorted += interface.reactions() - self.hasRxns = len(self.rs_unsorted) > 0 + self.has_reactions = len(self.rs_unsorted) > 0 def sort_reactions(mechanism, interface): """Sort reactions.""" @@ -78,8 +78,10 @@ def sort_reactions(mechanism, interface): if r not in reaction_info.rs: # skip all interface-Arrhenius and sticking-Arrhenius heterogeneous reactions # heterogeneous reactions are added after all the homogeneous reactions - if any([r.reaction_type == "interface-Arrhenius", - r.reaction_type == "sticking-Arrhenius"]): + if any([ + r.reaction_type == "interface-Arrhenius", + r.reaction_type == "sticking-Arrhenius", + ]): continue if r.third_body is None: @@ -93,8 +95,10 @@ def sort_reactions(mechanism, interface): if r not in reaction_info.rs: # skip all interface-Arrhenius and sticking-Arrhenius heterogeneous reactions # heterogeneous reactions are added after all the homogeneous reactions - if any([r.reaction_type == "interface-Arrhenius", - r.reaction_type == "sticking-Arrhenius"]): + if any([ + r.reaction_type == "interface-Arrhenius", + r.reaction_type == "sticking-Arrhenius", + ]): continue reaction_info.idxmap[k] = i @@ -103,7 +107,7 @@ def sort_reactions(mechanism, interface): reaction_info.index.append(i) # surface reactions - if not isinstance(interface, type(None)): + if interface is not None: for k, r in enumerate(reaction_info.rs_unsorted): if r not in reaction_info.rs: if r.reaction_type == "interface-Arrhenius": @@ -129,7 +133,7 @@ def rmap(fstream, reaction_info): """Write reverse reaction map.""" rmap = reaction_info.idxmap.keys() str_rmap = ",".join(str(x) for x in rmap) - if reaction_info.hasRxns: + if reaction_info.has_reactions: cw.writer(fstream, f"const int rmap[NUM_REACTIONS] = {{{str_rmap}}};") @@ -139,14 +143,14 @@ def get_rmap(fstream, reaction_info): cw.writer(fstream, cw.comment("Returns 0-based map of reaction order")) cw.writer(fstream, "void GET_RMAP" + cc.sym) - if reaction_info.hasRxns: + if reaction_info.has_reactions: cw.writer(fstream, "(int * _rmap)") else: cw.writer(fstream, "(int * /*_rmap*/)") cw.writer(fstream, "{") - if reaction_info.hasRxns: + if reaction_info.has_reactions: cw.writer(fstream, f"for (int j=0; j Date: Fri, 19 Jan 2024 16:15:47 +0530 Subject: [PATCH 10/20] Removed not isinstance condition missed in earlier commit --- Support/ceptr/ceptr/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 5bb766ead..92a55ee32 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -690,7 +690,7 @@ def mechanism_header_includes(self, fstream): for elem in self.mechanism.element_names: cw.writer(fstream, f"{self.mechanism.element_index(elem)} {elem}") - if not isinstance(self.interface, type(None)): + if self.interface is not None: n_het_species = self.interface.n_species n_het_reactions = self.interface.n_reactions all_species_list += self.interface.species_names From 92d584e63102e2e75eb5eda5730da24b73aee2ba Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Sat, 20 Jan 2024 13:22:11 +0530 Subject: [PATCH 11/20] Modifications based on PR review round 2 converter.py: used ternary operator for Converter.species_info.n_all_species reaction_info.py: improved readability of if conditions using and/or keywords --- Support/ceptr/ceptr/converter.py | 8 +++--- Support/ceptr/ceptr/reaction_info.py | 37 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 92a55ee32..13788214b 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -113,9 +113,11 @@ def set_species(self): self.species_info.n_gas_species - self.species_info.n_qssa_species ) - self.species_info.n_all_species = self.species_info.n_species - if self.mechIsAHetMech: - self.species_info.n_all_species += self.interface.n_species + self.species_info.n_all_species = ( + self.species_info.n_species + self.interface.n_species + if self.mechIsAHetMech + else self.species_info.n_species + ) # get the unsorted self.qssa_species_list qssa_list_tmp = [] diff --git a/Support/ceptr/ceptr/reaction_info.py b/Support/ceptr/ceptr/reaction_info.py index 582a33d3c..dbbc32a3f 100644 --- a/Support/ceptr/ceptr/reaction_info.py +++ b/Support/ceptr/ceptr/reaction_info.py @@ -32,6 +32,7 @@ def __init__(self, mechanism, interface): self.has_reactions = len(self.rs_unsorted) > 0 + def sort_reactions(mechanism, interface): """Sort reactions.""" reaction_info = ReactionInfo(mechanism, interface) @@ -78,10 +79,10 @@ def sort_reactions(mechanism, interface): if r not in reaction_info.rs: # skip all interface-Arrhenius and sticking-Arrhenius heterogeneous reactions # heterogeneous reactions are added after all the homogeneous reactions - if any([ - r.reaction_type == "interface-Arrhenius", - r.reaction_type == "sticking-Arrhenius", - ]): + if ( + r.reaction_type == "interface-Arrhenius" + or r.reaction_type == "sticking-Arrhenius" + ): continue if r.third_body is None: @@ -95,10 +96,10 @@ def sort_reactions(mechanism, interface): if r not in reaction_info.rs: # skip all interface-Arrhenius and sticking-Arrhenius heterogeneous reactions # heterogeneous reactions are added after all the homogeneous reactions - if any([ - r.reaction_type == "interface-Arrhenius", - r.reaction_type == "sticking-Arrhenius", - ]): + if ( + r.reaction_type == "interface-Arrhenius" + or r.reaction_type == "sticking-Arrhenius" + ): continue reaction_info.idxmap[k] = i @@ -109,19 +110,17 @@ def sort_reactions(mechanism, interface): # surface reactions if interface is not None: for k, r in enumerate(reaction_info.rs_unsorted): - if r not in reaction_info.rs: - if r.reaction_type == "interface-Arrhenius": - reaction_info.idxmap[k] = i - reaction_info.rs.append(r) - i += 1 + if r not in reaction_info.rs and r.reaction_type == "interface-Arrhenius": + reaction_info.idxmap[k] = i + reaction_info.rs.append(r) + i += 1 reaction_info.index.append(i) for k, r in enumerate(reaction_info.rs_unsorted): - if r not in reaction_info.rs: - if r.reaction_type == "sticking-Arrhenius": - reaction_info.idxmap[k] = i - reaction_info.rs.append(r) - i += 1 + if r not in reaction_info.rs and r.reaction_type == "sticking-Arrhenius": + reaction_info.idxmap[k] = i + reaction_info.rs.append(r) + i += 1 reaction_info.index.append(i) reaction_info.is_sorted = True @@ -151,7 +150,7 @@ def get_rmap(fstream, reaction_info): cw.writer(fstream, "{") if reaction_info.has_reactions: - cw.writer(fstream, f"for (int j=0; j Date: Sat, 20 Jan 2024 13:33:11 +0530 Subject: [PATCH 12/20] Followed formatting, updated qssa.py sort_reaction call --- Support/ceptr/ceptr/qssa.py | 8 +++--- Support/ceptr/ceptr/symbolic_math.py | 38 +++++++++++----------------- Support/ceptr/ceptr/utilities.py | 24 +++++++++--------- 3 files changed, 31 insertions(+), 39 deletions(-) diff --git a/Support/ceptr/ceptr/qssa.py b/Support/ceptr/ceptr/qssa.py index b1d821187..46455fc78 100644 --- a/Support/ceptr/ceptr/qssa.py +++ b/Support/ceptr/ceptr/qssa.py @@ -15,7 +15,7 @@ def process_qss(fname, nqssa, visualize, method): """Apply QSSA reduction to single Cantera yaml file.""" # Load mechanism mechanism = ct.Solution(fname) - reaction_info = cri.sort_reactions(mechanism) + reaction_info = cri.sort_reactions(mechanism, interface=None) mechpath = pathlib.Path(mechanism.source) qssaname = mechpath.parents[0] / "qssa.yaml" @@ -72,9 +72,9 @@ def process_qss(fname, nqssa, visualize, method): raise ValueError("Failure to generate QSSA mechanism.") qssa.update_user_header({"description": f"QSSA of {mechanism.name}"}) - qssa.update_user_data({ - "qssa_species": qssa_species, "n_qssa_species": len(qssa_species) - }) + qssa.update_user_data( + {"qssa_species": qssa_species, "n_qssa_species": len(qssa_species)} + ) forward_to_remove_idx = [] if forward_to_remove: for fr in forward_to_remove: diff --git a/Support/ceptr/ceptr/symbolic_math.py b/Support/ceptr/ceptr/symbolic_math.py index 740f12151..9c6d768b0 100644 --- a/Support/ceptr/ceptr/symbolic_math.py +++ b/Support/ceptr/ceptr/symbolic_math.py @@ -196,30 +196,22 @@ def convert_to_cpp(self, sym_smp): if self.remove_pow: # Positive exponents - user_functions["Pow"].append( - ( - lambda b, e: (e.is_Integer or e.is_Float) - and ( - abs(e - 1) < 1e-16 or abs(e - 2) < 1e-16 or abs(e - 3) < 1e-16 - ), - lambda b, e: "(" + "*".join(["(" + b + ")"] * int(float(e))) + ")", - ) - ) + user_functions["Pow"].append(( + lambda b, e: (e.is_Integer or e.is_Float) + and (abs(e - 1) < 1e-16 or abs(e - 2) < 1e-16 or abs(e - 3) < 1e-16), + lambda b, e: "(" + "*".join(["(" + b + ")"] * int(float(e))) + ")", + )) # Negative exponents - user_functions["Pow"].append( - ( - lambda b, e: (e.is_Integer or e.is_Float) - and ( - abs(e + 1) < 1e-16 or abs(e + 2) < 1e-16 or abs(e + 3) < 1e-16 - ), - lambda b, e: "(" - + "1.0/" - + "(" - + "*".join(["(" + b + ")"] * int(-float(e))) - + ")" - + ")", - ) - ) + user_functions["Pow"].append(( + lambda b, e: (e.is_Integer or e.is_Float) + and (abs(e + 1) < 1e-16 or abs(e + 2) < 1e-16 or abs(e + 3) < 1e-16), + lambda b, e: "(" + + "1.0/" + + "(" + + "*".join(["(" + b + ")"] * int(-float(e))) + + ")" + + ")", + )) if self.remove_pow10: user_functions["Pow"].append( diff --git a/Support/ceptr/ceptr/utilities.py b/Support/ceptr/ceptr/utilities.py index 829c93dd7..555dfab75 100644 --- a/Support/ceptr/ceptr/utilities.py +++ b/Support/ceptr/ceptr/utilities.py @@ -215,9 +215,9 @@ def fkc_conv_inv(self, mechanism, reaction, syms=None): if record_symbolic_operations: conversion_smp *= syms.refCinv_smp * syms.refCinv_smp else: - conversion = "*".join([ - f"pow(std::max(refCinv, {sc_cutoff(dim)}), {dim:f})" - ]) + conversion = "*".join( + [f"pow(std::max(refCinv, {sc_cutoff(dim)}), {dim:f})"] + ) if record_symbolic_operations: conversion_smp *= syms.refCinv_smp**dim else: @@ -229,9 +229,9 @@ def fkc_conv_inv(self, mechanism, reaction, syms=None): if dim.is_integer(): conversion = "*".join(["refC"] * int(dim)) else: - conversion = "*".join([ - f"pow(std::max(refC, {sc_cutoff(abs(dim))}), {abs(dim):f})" - ]) + conversion = "*".join( + [f"pow(std::max(refC, {sc_cutoff(abs(dim))}), {abs(dim):f})"] + ) if record_symbolic_operations: conversion_smp *= syms.refC_smp**dim @@ -263,9 +263,9 @@ def kc_conv(mechanism, reaction): if dim.is_integer(): conversion = "*".join(["refC"] * int(dim)) else: - conversion = "*".join([ - f"pow(std::max(refC, {sc_cutoff(dim)}),{dim:f})" - ]) + conversion = "*".join( + [f"pow(std::max(refC, {sc_cutoff(dim)}),{dim:f})"] + ) else: if dim == -1.0: conversion = "*".join(["refCinv"]) @@ -273,9 +273,9 @@ def kc_conv(mechanism, reaction): if dim.is_integer(): conversion = "*".join(["refCinv"] * int(dim)) else: - conversion = "*".join([ - f"pow(std::max(refCinv, {sc_cutoff(abs(dim))}),{abs(dim):f})" - ]) + conversion = "*".join( + [f"pow(std::max(refCinv, {sc_cutoff(abs(dim))}),{abs(dim):f})"] + ) return conversion From c567fb05abb191c4d9661905a165b37b62703854 Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Sat, 20 Jan 2024 16:15:13 +0530 Subject: [PATCH 13/20] Used new Converter API for test_ceptr.py --- Support/ceptr/tests/test_ceptr.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Support/ceptr/tests/test_ceptr.py b/Support/ceptr/tests/test_ceptr.py index 2c93c196a..dea1dd9d6 100644 --- a/Support/ceptr/tests/test_ceptr.py +++ b/Support/ceptr/tests/test_ceptr.py @@ -25,7 +25,9 @@ def test_air(): mech_path = mechanism_path("air") fname = mech_path / "mechanism.yaml" mechanism = ct.Solution(fname) - conv = converter.Converter(mechanism) + interface = None + chemistry = "homogeneous" + conv = converter.Converter(mechanism, interface, chemistry) conv.writer() conv.formatter() @@ -35,7 +37,9 @@ def test_lidryer(): mech_path = mechanism_path("LiDryer") fname = mech_path / "mechanism.yaml" mechanism = ct.Solution(fname) - conv = converter.Converter(mechanism) + interface = None + chemistry = "homogeneous" + conv = converter.Converter(mechanism, interface, chemistry) conv.writer() conv.formatter() @@ -45,6 +49,8 @@ def test_dodecane_lu(): mech_path = mechanism_path("dodecane_lu") fname = mech_path / "mechanism.yaml" mechanism = ct.Solution(fname) - conv = converter.Converter(mechanism) + interface = None + chemistry = "homogeneous" + conv = converter.Converter(mechanism, interface, chemistry) conv.writer() conv.formatter() From c8ce2c4c10f0c6a4e3dbcdc0bc500573b512e9ff Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Thu, 1 Feb 2024 12:07:53 +0530 Subject: [PATCH 14/20] Removed the Kolla mechanism from the ceptr subdirectory --- Support/ceptr/Kolla/ARC/getrates.f | 428 -- Support/ceptr/Kolla/Make.package | 9 - Support/ceptr/Kolla/README.md | 8 - Support/ceptr/Kolla/chem.cti | 445 -- Support/ceptr/Kolla/convert.sh | 5 - Support/ceptr/Kolla/mechanism.H | 7909 ---------------------------- Support/ceptr/Kolla/mechanism.cpp | 489 -- Support/ceptr/Kolla/mechanism.inp | 239 - Support/ceptr/Kolla/mechanism.yaml | 437 -- Support/ceptr/Kolla/therm.dat | 51 - Support/ceptr/Kolla/tran.dat | 319 -- 11 files changed, 10339 deletions(-) delete mode 100644 Support/ceptr/Kolla/ARC/getrates.f delete mode 100644 Support/ceptr/Kolla/Make.package delete mode 100644 Support/ceptr/Kolla/README.md delete mode 100644 Support/ceptr/Kolla/chem.cti delete mode 100755 Support/ceptr/Kolla/convert.sh delete mode 100644 Support/ceptr/Kolla/mechanism.H delete mode 100644 Support/ceptr/Kolla/mechanism.cpp delete mode 100644 Support/ceptr/Kolla/mechanism.inp delete mode 100644 Support/ceptr/Kolla/mechanism.yaml delete mode 100644 Support/ceptr/Kolla/therm.dat delete mode 100644 Support/ceptr/Kolla/tran.dat diff --git a/Support/ceptr/Kolla/ARC/getrates.f b/Support/ceptr/Kolla/ARC/getrates.f deleted file mode 100644 index 81f86cf65..000000000 --- a/Support/ceptr/Kolla/ARC/getrates.f +++ /dev/null @@ -1,428 +0,0 @@ -c**************************************************************************** -c ... DO NOT EDIT. AUTOMATICALLY GENERATED FILE. -c**************************************************************************** -c ... -c ... CKWYP-compatible GETRATES: return molar production rates for all -c ... species given pressure (P), temperature (T), and mass fractions (Y). -c ... -c ... Generated by cgetrates 1.0b -c ... -c**************************************************************************** - - subroutine getrates(P,T,Y,ICKWRK,RCKWRK,WSPL) - - use thermchem_m, only : gibbsEnrg_all_dimT !HK - use chemkin_m, only : molwt_c !HK - - implicit none - - integer NSMax ! maximum number of species - parameter (NSMax = 1000) - integer NRMax ! maximum number of reactions - parameter (NRMax = 5000) - - real PA ! atm. pressure; dyne/cm^2 - parameter (PA = 1.013250d+06) - real R0 ! gas constant; erg/(mol K) - parameter (R0 = 8.314510d+07) - real R0c ! gas constant; cal/(mol K) - parameter (R0c = 1.9872155832) - real DLn10 ! log(10) - parameter (DLn10 = 2.3025850929940459d0) - - integer ICKWRK(*) ! ... - real RCKWRK(*) ! ... - real P ! pressure - real T ! temperature (K) - real Y(NSMax) ! ... - real WSPL(NSMax) ! ... - - real FCent ! ... - real FDenom ! ... - real FLogPR ! ... - real FQuan ! ... - real CTOT ! ... - real OPRT ! ... - real ORTC ! ... - real OTC ! ... - real PR ! ... - real PRT ! ... - real RC ! ... - real RR_F ! forward reaction rate - real RR_R ! reverse reaction rate - real RR_K0 ! ... - real RR_KInf ! ... - real TC ! ... - real THBCTEMP ! ... - real VLNPRT ! ... - real VLNTEMP ! ... - real XIK ! ... - - real CGSPL(NSMax) ! ... - real CSPL(NSMax) ! ... - real ROPL(NRMax) ! ... - - real or0tc ! HK - - integer KSP ! ... - integer I ! loop index - - intrinsic exp, log - external CKRHOY, CKYTCP - - dimension thbctemp(4) - - integer NC_H2, NC_O2, NC_O, NC_OH, NC_H2O, NC_H, NC_HO2, NC_H2O2 - integer NC_CO, NC_CO2, NC_HCO, NC_N2 - - parameter (NC_H2 = 1) - parameter (NC_O2 = 2) - parameter (NC_O = 3) - parameter (NC_OH = 4) - parameter (NC_H2O = 5) - parameter (NC_H = 6) - parameter (NC_HO2 = 7) - parameter (NC_H2O2 = 8) - parameter (NC_CO = 9) - parameter (NC_CO2 = 10) - parameter (NC_HCO = 11) - parameter (NC_N2 = 12) - - integer NS ! number of species - parameter (NS = 12) - -c---------------------------------------------------------------------------- -c ... loop over all cells - -c$doacross local(i,j,tc,rc,otc,vlntemp,cgspl,ksp,wspl,cspl,rr_f,rr_r, -c$& xik,ctot,ropl,pr,fcent,thbctemp,rr_k0,rr_kinf,flogpr, -c$& fdenom,fquan,prt,vlnprt), -c$& share(m,n,temp,rho,temp1tab,odtab,ns,cgsptab,ys,ospwt,spwt, -c$& temptab,wchem,tempref) - -cmic$ do all -cmic$* private(xik,ctot,ropl,pr,fcent,thbctemp,rr_k0,rr_kinf,flogpr) -cmic$* private(i,j,tc,rc,otc,vlntemp,cgspl,ksp,wspl,cspl,rr_f,rr_r) -cmic$* private(fdenom,fquan,prt,vlnprt) -cmic$* shared(m,n,temp,rho,temp1tab,odtab,ns,cgsptab,ys,ospwt,spwt) -cmic$* shared(temptab,wchem,tempref) - -c---------------------------------------------------------------------------- - - TC = T - - call CKRHOY(P,T,Y,ICKWRK,RCKWRK,RC) - - otc = 1.0 / tc - ortc = 1.0 / (tc * R0c) - vlntemp = log(TC) - or0tc = 1.0/(R0 * TC) - prt = PA *or0tc -! prt = PA / (R0 * TC) - oprt = 1.0 / prt - vlnprt = log(prt) - -c ... get gibbs free energies - -c inlined -c call getcgsp(i,j,cgspl) - -c call CKGML(T,ICKWRK,RCKWRK,CGSPL) -c do I=1,NS -c CGSPL(I) = CGSPL(I) / R0 -c end do -c evatt - this is faster - call gibbsEnrg_all_dimT(T, cgspl(:)) - -c ... initialize - -c do ksp=1,ns -c cspl(ksp) = rc*ys(i,j,ksp)*ospwt(ksp) ! concentrations -c end do - -c call CKYTCP(P,T,Y,ICKWRK,RCKWRK,CSPL) -c evatt - this is faster - cspl(1:ns) = y(1:ns)*molwt_c(1:ns) - rc = p*or0tc/sum(cspl(1:ns)) - cspl(1:ns) = rc*cspl(1:ns) - -c prt = pa / (r0 * tc) -c vlnprt = log(prt) -c---------------------------------------- -c ... calculate third-body concentrations - - ctot = 0.0 - do ksp = 1, ns - ctot = ctot + cspl(ksp) - end do - thbctemp(2) = ctot + 1.5d+000*cspl(NC_H2) + 1.1d+001*cspl(NC_H2O) - & + 8.999999999999999d-001*cspl(NC_CO) + 2.8d+000*cspl(NC_CO2) - thbctemp(3) = ctot + cspl(NC_H2) - 2.2d-001*cspl(NC_O2) + 1.0d+001 - & *cspl(NC_H2O) + 8.999999999999999d-001*cspl(NC_CO) + 2.8d+000* - & cspl(NC_CO2) - thbctemp(4) = ctot + 1.5d+000*cspl(NC_H2) + 5.0d+000*cspl(NC_H2O) - & + 8.999999999999999d-001*cspl(NC_CO) + 2.8d+000*cspl(NC_CO2) - -c---------------------------------------------------- -c ... loop over all rxns to evaluate rate-of-progress - -c 1) O2 + H <=> OH + O - rr_f = 3.547d+015 * exp(-4.06d-001*vlntemp - 1.6599d+004*ortc) - xik = -cgspl(NC_O2) - cgspl(NC_H) + cgspl(NC_OH) + cgspl(NC_O) - rr_r = rr_f * exp(xik*otc) - ropl(1) = rr_f*cspl(NC_O2)*cspl(NC_H) - rr_r*cspl(NC_OH) - & *cspl(NC_O) - -c 2) H2 + O <=> OH + H - rr_f = 5.08d+004 * exp(2.67d+000*vlntemp - 6.29d+003*ortc) - xik = -cgspl(NC_H2) - cgspl(NC_O) + cgspl(NC_OH) + cgspl(NC_H) - rr_r = rr_f * exp(xik*otc) - ropl(2) = rr_f*cspl(NC_H2)*cspl(NC_O) - rr_r*cspl(NC_OH) - & *cspl(NC_H) - -c 3) OH + H2 <=> H + H2O - rr_f = 2.16d+008 * exp(1.51d+000*vlntemp - 3.43d+003*ortc) - xik = -cgspl(NC_OH) - cgspl(NC_H2) + cgspl(NC_H) + cgspl(NC_H2O) - rr_r = rr_f * exp(xik*otc) - ropl(3) = rr_f*cspl(NC_OH)*cspl(NC_H2) - rr_r*cspl(NC_H) - & *cspl(NC_H2O) - -c 4) H2O + O <=> 2 OH - rr_f = 2.97d+006 * exp(2.02d+000*vlntemp - 1.34d+004*ortc) - xik = -cgspl(NC_H2O) - cgspl(NC_O) + 2.0 * cgspl(NC_OH) - rr_r = rr_f * exp(xik*otc) - ropl(4) = rr_f*cspl(NC_H2O)*cspl(NC_O) - rr_r*cspl(NC_OH) - & *cspl(NC_OH) - -c 5) H2 + M <=> 2 H + M - rr_f = 4.577d+019 * exp(-1.4d+000*vlntemp - 1.0438d+005*ortc) - xik = -cgspl(NC_H2) + 2.0 * cgspl(NC_H) - rr_r = rr_f * exp(xik*otc) * oprt - ropl(5) = rr_f*cspl(NC_H2) - rr_r*cspl(NC_H)*cspl(NC_H) - ropl(5) = ropl(5) * thbctemp(2) - -c 6) 2 O + M <=> O2 + M - rr_f = 6.165d+015 * exp(-5.0d-001*vlntemp) - xik = -2.0 * cgspl(NC_O) + cgspl(NC_O2) - rr_r = rr_f * exp(xik*otc) * prt - ropl(6) = rr_f*cspl(NC_O)*cspl(NC_O) - rr_r*cspl(NC_O2) - ropl(6) = ropl(6) * thbctemp(2) - -c 7) H + O + M <=> OH + M - rr_f = 4.714d+018 * otc - xik = -cgspl(NC_H) - cgspl(NC_O) + cgspl(NC_OH) - rr_r = rr_f * exp(xik*otc) * prt - ropl(7) = rr_f*cspl(NC_H)*cspl(NC_O) - rr_r*cspl(NC_OH) - ropl(7) = ropl(7) * thbctemp(2) - -c 8) OH + H + M <=> H2O + M - rr_f = 3.8d+022 * otc * otc - xik = -cgspl(NC_OH) - cgspl(NC_H) + cgspl(NC_H2O) - rr_r = rr_f * exp(xik*otc) * prt - ropl(8) = rr_f*cspl(NC_OH)*cspl(NC_H) - rr_r*cspl(NC_H2O) - ropl(8) = ropl(8) * thbctemp(2) - -c 9) O2 + H (+M) <=> HO2 (+M) - rr_k0 = 6.366d+020 * exp(-1.72d+000*vlntemp - 5.248d+002*ortc) - rr_kinf = 1.475d+012 * exp(6.0d-001*vlntemp) - pr = rr_k0 / rr_kinf * thbctemp(3) -c evatt - fcent always log10(0.8) -c fcent = log10(2.0d-001 * exp(-9.999999999999999d+029 * tc) + -c & 8.0d-001 * exp(-9.999999999999999d-031 * tc)) - fcent = -9.691001300e-02 - flogpr = log10(pr) - 0.4 - 0.67 * fcent - fdenom = 0.75 - 1.27 * fcent - 0.14 * flogpr - fquan = flogpr / fdenom - fquan = fcent / (1.0 + fquan * fquan) - rr_f = rr_kinf * pr/(1.0 + pr) * exp(fquan*dln10) - xik = -cgspl(NC_O2) - cgspl(NC_H) + cgspl(NC_HO2) - rr_r = rr_f * exp(xik*otc) * prt - ropl(9) = rr_f*cspl(NC_O2)*cspl(NC_H) - rr_r*cspl(NC_HO2) - -c 10) H + HO2 <=> O2 + H2 - rr_f = 1.66d+013 * exp(-8.23d+002*ortc) - xik = -cgspl(NC_H) - cgspl(NC_HO2) + cgspl(NC_O2) + cgspl(NC_H2) - rr_r = rr_f * exp(xik*otc) - ropl(10) = rr_f*cspl(NC_H)*cspl(NC_HO2) - rr_r*cspl(NC_O2) - & *cspl(NC_H2) - -c 11) H + HO2 <=> 2 OH - rr_f = 7.079d+013 * exp(-2.95d+002*ortc) - xik = -cgspl(NC_H) - cgspl(NC_HO2) + 2.0 * cgspl(NC_OH) - rr_r = rr_f * exp(xik*otc) - ropl(11) = rr_f*cspl(NC_H)*cspl(NC_HO2) - rr_r*cspl(NC_OH) - & *cspl(NC_OH) - -c 12) O + HO2 <=> OH + O2 - rr_f = 3.25d+013 - xik = -cgspl(NC_O) - cgspl(NC_HO2) + cgspl(NC_OH) + cgspl(NC_O2) - rr_r = rr_f * exp(xik*otc) - ropl(12) = rr_f*cspl(NC_O)*cspl(NC_HO2) - rr_r*cspl(NC_OH) - & *cspl(NC_O2) - -c 13) OH + HO2 <=> O2 + H2O - rr_f = 2.89d+013 * exp(4.97d+002*ortc) - xik = -cgspl(NC_OH) - cgspl(NC_HO2) + cgspl(NC_O2) + cgspl(NC_H2O) - & - rr_r = rr_f * exp(xik*otc) - ropl(13) = rr_f*cspl(NC_OH)*cspl(NC_HO2) - rr_r*cspl(NC_O2) - & *cspl(NC_H2O) - -c 14, 15) 2 HO2 <=> O2 + H2O2 - rr_f = 4.2d+014 * exp(-1.1982d+004*ortc) - rr_f = rr_f + 1.3d+011 * exp(1.6293d+003*ortc) - xik = -2.0 * cgspl(NC_HO2) + cgspl(NC_O2) + cgspl(NC_H2O2) - rr_r = rr_f * exp(xik*otc) - ropl(14) = rr_f*cspl(NC_HO2)*cspl(NC_HO2) - rr_r*cspl(NC_O2) - & *cspl(NC_H2O2) - -c 16) H2O2 (+M) <=> 2 OH (+M) - rr_k0 = 1.202d+017 * exp(-4.55d+004*ortc) - rr_kinf = 2.951d+014 * exp(-4.843d+004*ortc) - pr = rr_k0 / rr_kinf * thbctemp(2) -c evatt - this is always equal to log10(0.5) -c fcent = log10(5.0d-001 * exp(-9.999999999999999d+029 * tc) + -c & 5.0d-001 * exp(-9.999999999999999d-031 * tc)) - fcent = -3.0102999566398e-01 - flogpr = log10(pr) - 0.4 - 0.67 * fcent - fdenom = 0.75 - 1.27 * fcent - 0.14 * flogpr - fquan = flogpr / fdenom - fquan = fcent / (1.0 + fquan * fquan) - rr_f = rr_kinf * pr/(1.0 + pr) * exp(fquan*dln10) - xik = -cgspl(NC_H2O2) + 2.0 * cgspl(NC_OH) - rr_r = rr_f * exp(xik*otc) * oprt - ropl(16) = rr_f*cspl(NC_H2O2) - rr_r*cspl(NC_OH)*cspl(NC_OH) - -c 17) H + H2O2 <=> OH + H2O - rr_f = 2.41d+013 * exp(-3.97d+003*ortc) - xik = -cgspl(NC_H) - cgspl(NC_H2O2) + cgspl(NC_OH) + cgspl(NC_H2O) - & - rr_r = rr_f * exp(xik*otc) - ropl(17) = rr_f*cspl(NC_H)*cspl(NC_H2O2) - rr_r*cspl(NC_OH) - & *cspl(NC_H2O) - -c 18) H + H2O2 <=> H2 + HO2 - rr_f = 4.82d+013 * exp(-7.95d+003*ortc) - xik = -cgspl(NC_H) - cgspl(NC_H2O2) + cgspl(NC_H2) + cgspl(NC_HO2) - & - rr_r = rr_f * exp(xik*otc) - ropl(18) = rr_f*cspl(NC_H)*cspl(NC_H2O2) - rr_r*cspl(NC_H2) - & *cspl(NC_HO2) - -c 19) O + H2O2 <=> HO2 + OH - rr_f = 9.55d+006 * tc * tc * exp(-3.97d+003*ortc) - xik = -cgspl(NC_O) - cgspl(NC_H2O2) + cgspl(NC_HO2) + cgspl(NC_OH) - & - rr_r = rr_f * exp(xik*otc) - ropl(19) = rr_f*cspl(NC_O)*cspl(NC_H2O2) - rr_r*cspl(NC_HO2) - & *cspl(NC_OH) - -c 20, 21) OH + H2O2 <=> H2O + HO2 - rr_f = 1.0d+012 - rr_f = rr_f + 5.8d+014 * exp(-9.557d+003*ortc) - xik = -cgspl(NC_OH) - cgspl(NC_H2O2) + cgspl(NC_H2O) + - & cgspl(NC_HO2) - rr_r = rr_f * exp(xik*otc) - ropl(20) = rr_f*cspl(NC_OH)*cspl(NC_H2O2) - rr_r*cspl(NC_H2O) - & *cspl(NC_HO2) - -c 22) O + CO (+M) <=> CO2 (+M) - rr_k0 = 1.55d+024 * exp(-2.79d+000*vlntemp - 4.191d+003*ortc) - rr_kinf = 1.8d+010 * exp(-2.384d+003*ortc) - pr = rr_k0 / rr_kinf * thbctemp(2) - rr_f = rr_kinf * pr/(1.0 + pr) - xik = -cgspl(NC_O) - cgspl(NC_CO) + cgspl(NC_CO2) - rr_r = rr_f * exp(xik*otc) * prt - ropl(22) = rr_f*cspl(NC_O)*cspl(NC_CO) - rr_r*cspl(NC_CO2) - -c 23) O2 + CO <=> O + CO2 - rr_f = 2.53d+012 * exp(-4.77d+004*ortc) - xik = -cgspl(NC_O2) - cgspl(NC_CO) + cgspl(NC_O) + cgspl(NC_CO2) - rr_r = rr_f * exp(xik*otc) - ropl(23) = rr_f*cspl(NC_O2)*cspl(NC_CO) - rr_r*cspl(NC_O) - & *cspl(NC_CO2) - -c 24) HO2 + CO <=> OH + CO2 - rr_f = 3.01d+013 * exp(-2.3d+004*ortc) - xik = -cgspl(NC_HO2) - cgspl(NC_CO) + cgspl(NC_OH) + cgspl(NC_CO2) - & - rr_r = rr_f * exp(xik*otc) - ropl(24) = rr_f*cspl(NC_HO2)*cspl(NC_CO) - rr_r*cspl(NC_OH) - & *cspl(NC_CO2) - -c 25) OH + CO <=> H + CO2 - rr_f = 2.229d+005 * exp(1.89d+000*vlntemp + 1.1587d+003*ortc) - xik = -cgspl(NC_OH) - cgspl(NC_CO) + cgspl(NC_H) + cgspl(NC_CO2) - rr_r = rr_f * exp(xik*otc) - ropl(25) = rr_f*cspl(NC_OH)*cspl(NC_CO) - rr_r*cspl(NC_H) - & *cspl(NC_CO2) - -c 26) HCO + M <=> CO + H + M - rr_f = 4.7485d+011 * exp(6.59d-001*vlntemp - 1.4874d+004*ortc) - xik = -cgspl(NC_HCO) + cgspl(NC_CO) + cgspl(NC_H) - rr_r = rr_f * exp(xik*otc) * oprt - ropl(26) = rr_f*cspl(NC_HCO) - rr_r*cspl(NC_CO)*cspl(NC_H) - ropl(26) = ropl(26) * thbctemp(4) - -c 27) O2 + HCO <=> HO2 + CO - rr_f = 7.58d+012 * exp(-4.1d+002*ortc) - xik = -cgspl(NC_O2) - cgspl(NC_HCO) + cgspl(NC_HO2) + cgspl(NC_CO) - & - rr_r = rr_f * exp(xik*otc) - ropl(27) = rr_f*cspl(NC_O2)*cspl(NC_HCO) - rr_r*cspl(NC_HO2) - & *cspl(NC_CO) - -c 28) H + HCO <=> H2 + CO - rr_f = 7.23d+013 - xik = -cgspl(NC_H) - cgspl(NC_HCO) + cgspl(NC_H2) + cgspl(NC_CO) - rr_r = rr_f * exp(xik*otc) - ropl(28) = rr_f*cspl(NC_H)*cspl(NC_HCO) - rr_r*cspl(NC_H2) - & *cspl(NC_CO) - -c 29) O + HCO <=> H + CO2 - rr_f = 3.0d+013 - xik = -cgspl(NC_O) - cgspl(NC_HCO) + cgspl(NC_H) + cgspl(NC_CO2) - rr_r = rr_f * exp(xik*otc) - ropl(29) = rr_f*cspl(NC_O)*cspl(NC_HCO) - rr_r*cspl(NC_H) - & *cspl(NC_CO2) - -c----------------------------------------------------- -c ... evaluate contributions to reactants and products - -c 1. H2 - wspl(NC_H2) = -ropl(2)-ropl(3)-ropl(5)+ropl(10)+ropl(18)+ropl(28) -c 2. O2 - wspl(NC_O2) = -ropl(1)+ropl(6)-ropl(9)+ropl(10)+ropl(12)+ropl(13) - & +ropl(14)-ropl(23)-ropl(27) -c 3. O - wspl(NC_O) = ropl(1)-ropl(2)-ropl(4)-2.0*ropl(6)-ropl(7)-ropl(12) - & -ropl(19)-ropl(22)+ropl(23)-ropl(29) -c 4. OH - wspl(NC_OH) = ropl(1)+ropl(2)-ropl(3)+2.0*ropl(4)+ropl(7)-ropl(8) - & +2.0*ropl(11)+ropl(12)-ropl(13)+2.0*ropl(16)+ropl(17)+ropl(19) - & -ropl(20)+ropl(24)-ropl(25) -c 5. H2O - wspl(NC_H2O) = ropl(3)-ropl(4)+ropl(8)+ropl(13)+ropl(17)+ropl(20) -c 6. H - wspl(NC_H) = -ropl(1)+ropl(2)+ropl(3)+2.0*ropl(5)-ropl(7)-ropl(8) - & -ropl(9)-ropl(10)-ropl(11)-ropl(17)-ropl(18)+ropl(25)+ropl(26) - & -ropl(28)+ropl(29) -c 7. HO2 - wspl(NC_HO2) = ropl(9)-ropl(10)-ropl(11)-ropl(12)-ropl(13) - & -2.0*ropl(14)+ropl(18)+ropl(19)+ropl(20)-ropl(24)+ropl(27) -c 8. H2O2 - wspl(NC_H2O2) = ropl(14)-ropl(16)-ropl(17)-ropl(18)-ropl(19) - & -ropl(20) -c 9. CO - wspl(NC_CO) = -ropl(22)-ropl(23)-ropl(24)-ropl(25)+ropl(26) - & +ropl(27)+ropl(28) -c 10. CO2 - wspl(NC_CO2) = ropl(22)+ropl(23)+ropl(24)+ropl(25)+ropl(29) -c 11. HCO - wspl(NC_HCO) = -ropl(26)-ropl(27)-ropl(28)-ropl(29) -c 12. N2 - wspl(NC_N2) = 0.0 - - return - end - diff --git a/Support/ceptr/Kolla/Make.package b/Support/ceptr/Kolla/Make.package deleted file mode 100644 index 24c663c9a..000000000 --- a/Support/ceptr/Kolla/Make.package +++ /dev/null @@ -1,9 +0,0 @@ -CEXE_headers+=mechanism.H - -CEXE_sources+=mechanism.cpp - -LIBRARIES += - -INCLUDE_LOCATIONS += $(CHEM_DIR) - -VPATH_LOCATIONS += $(CHEM_DIR)/PMFs diff --git a/Support/ceptr/Kolla/README.md b/Support/ceptr/Kolla/README.md deleted file mode 100644 index c96577b75..000000000 --- a/Support/ceptr/Kolla/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Analytically Reduced Mechanisms -!!This mechanism is the skeletal version. !! - -There is a fortran routine to reduce it even more to an ARC. However in that case the species production rates -should NOT be evaluated via the reactions provided in the chemkin reaction data file. - -Note that if a .cpp file is generated at this point, -it will implement the skeletal version of the reduced mechanism and it will not use the *.f routine. diff --git a/Support/ceptr/Kolla/chem.cti b/Support/ceptr/Kolla/chem.cti deleted file mode 100644 index 2949b06cf..000000000 --- a/Support/ceptr/Kolla/chem.cti +++ /dev/null @@ -1,445 +0,0 @@ -""" - Mechanism for CO/H2 oxidation by Hemanth Kolla - based on the skeletal mechanism of Evatt R. Hawkes and Ramanan Sankaran - - Only difference from skeletal mechanism is the inclusion of H2O2 and - the reactions corresponding to its formation and consumption - - The skeletal mechanism is derived from a detailed C1 mechanism by J. Li - - Original notes on the skeletal mechanism and the detailed mechanisms follow - - ------------------------------------------------------------------------------ - Skeletal Mechanism for CO/H2 oxidation - by Evatt R. Hawkes and Ramanan Sankaran - - Reduced from complete C1 Mechanism that is published in: - - J. Li, PhD Thesis, - Mechanical and Aerospace Engineering Department, - Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. - - http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip - - At the time of writing, a publication to IJCK is in preparation - by the authors of the complete mechanism. - - This mechanism was reduced specifically for the purpose of the - Direct Numerical Simulations performed in - Hawkes, E.R., Sankaran, R., Sutherland, J.C., and Chen, J.H. (2006) - Proc. Combust. Inst. 31, to appear. - - It was validated by comparison with the full mechanism in several cases: - 1. freely propagating premixed flames in a range of equivalence ratios, - 2. opposed-flow non-premixed flames in a range of strains up to extinction, - 3. homogeneous ignition calculations for mixtures of fuel and oxidizer streams - and equilibrium products, - 4. two-dimensional DNS featuring extinction and local reignition. - In all cases the agreement was excellent. - - However, the mechanism is validated ONLY for the specific conditions of the - DNS and is not expected to be valid in general. - - The following changes (only) were made to the complete mechanism: - 1) Only the species H2 O2 O OH H2O H HO2 CO CO2 HCO N2 were retained. - All other species and reactions involving these species were removed. Note - this includes all C containing species other than those essential for CO - oxidation: CO, CO2 and HCO. For the atmospheric pressure of the simulation, - H2O2 was also found to be unimportant and was removed. - 2) It was found HCO has only a minor importance, and its reaction rates were - dominated by a few key reactions. These reactions (below) were retained - and all others neglected. - - Steady state assumptions were investigated and found to be reasonably accurate - for fully burning conditions but it was found they increased stiffness, hence - they were not employed. For reference, a steady state approximation for HCO - and HO2 may be expected to perform reasonably well if the added stiffness can - be tackled. However, note the HO2 steady state assumption will degrade the - prediction of ignition at longer ignition delay times. - - --------------------------------------------------------------------------------- - - Notes on the original mechanism by its authors: - - Authors: J. Li, Z. Zhao, A. Kazakov, F.L. Dryer, - Address: Dept. of Mechanical and Aerospace Engineering, - Princeton University, Princeton, NJ 08544 - - This C1 mechanism is based on the CH3OH mechanism of Held and Dryer (IJCK,1998, 30, 805) - with following important revision: - 1. H2/O2 subset is updated to that of Li et al. (IJCK, in press, 2004) - 2. CO + OH = CO2 + H is optimized to fit the literature experimental result - 3. HCO + M = H + CO + M is optimized to fit the literature experimental result - 4. CH3 + HO2 = CH3O + OH is modified to match Scire's value at 1000 K - 5. CH3 + HO2 = CH4 + H is taken from Scire (IJCK, 2001, 33, 75) - 6. CH3 + O2 = CH2O + OH is taken from Scire (2002, Ph.D. thesis) - 7. CH2O + HO2 = HCO + H2O2 is from Eiteneer et al. (JPC A. 1998, 102, 5196) - 8. CH2O + H = HCO + H2 is from Irdam et al. (IJCK 1993, 25, 285) - 9. CH2O + M reactions are from Friedrichs et al.(IJCK 2004, 36, 157) - 10. CH3OH decomposition reactions are taken from GRI-3.0 (1999) - 11. CH2OH + HCO = CH2O + CH2O is taken from Friedrichs et al. (IJCK, 2004, 36, 157) - 12. CH2OH + HCO = CH3OH + CO is changed to keep the branching ratio with the above reaction - 13. HCOOH reactions are not included since it is not important and has large uncertainties - 14. dHf of OH is adjusted to 8.91 kcal/mol (Ruscic et al. JPC A. 2002, 106, 2727) - 15. thermochemical data of CH2OH is fit to Johnson & Hudgens' table (JPC 1996, 100, 19874) - - -""" - -units(length='cm', time='s', quantity='mol', act_energy='cal/mol') - -ideal_gas(name='gas', - elements="C H O N", - species="""H2 O2 O OH H2O H HO2 H2O2 CO - CO2 HCO N2""", - reactions='all', - transport='Mix', - initial_state=state(temperature=300.0, pressure=OneAtm)) - -#------------------------------------------------------------------------------- -# Species data -#------------------------------------------------------------------------------- - -species(name=u'H2', - atoms='H:2', - thermo=(NASA([300.00, 1000.00], - [ 3.29812400E+00, 8.24944200E-04, -8.14301500E-07, - -9.47543400E-11, 4.13487200E-13, -1.01252100E+03, - -3.29409400E+00]), - NASA([1000.00, 5000.00], - [ 2.99142300E+00, 7.00064400E-04, -5.63382900E-08, - -9.23157800E-12, 1.58275200E-15, -8.35034000E+02, - -1.35511000E+00])), - transport=gas_transport(geom='linear', - diam=2.92, - well_depth=38.0, - polar=0.79, - rot_relax=280.0), - note=u'121286') - -species(name=u'O2', - atoms='O:2', - thermo=(NASA([300.00, 1000.00], - [ 3.21293600E+00, 1.12748600E-03, -5.75615000E-07, - 1.31387700E-09, -8.76855400E-13, -1.00524900E+03, - 6.03473800E+00]), - NASA([1000.00, 5000.00], - [ 3.69757800E+00, 6.13519700E-04, -1.25884200E-07, - 1.77528100E-11, -1.13643500E-15, -1.23393000E+03, - 3.18916600E+00])), - transport=gas_transport(geom='linear', - diam=3.458, - well_depth=107.4, - polar=1.6, - rot_relax=3.8), - note=u'121386') - -species(name=u'O', - atoms='O:1', - thermo=(NASA([300.00, 1000.00], - [ 2.94642900E+00, -1.63816600E-03, 2.42103200E-06, - -1.60284300E-09, 3.89069600E-13, 2.91476400E+04, - 2.96399500E+00]), - NASA([1000.00, 5000.00], - [ 2.54206000E+00, -2.75506200E-05, -3.10280300E-09, - 4.55106700E-12, -4.36805200E-16, 2.92308000E+04, - 4.92030800E+00])), - transport=gas_transport(geom='atom', - diam=2.75, - well_depth=80.0), - note=u'120186') - -species(name=u'OH', - atoms='H:1 O:1', - thermo=(NASA([200.00, 1000.00], - [ 4.12530561E+00, -3.22544939E-03, 6.52764691E-06, - -5.79853643E-09, 2.06237379E-12, 3.34630913E+03, - -6.90432960E-01]), - NASA([1000.00, 6000.00], - [ 2.86472886E+00, 1.05650448E-03, -2.59082758E-07, - 3.05218674E-11, -1.33195876E-15, 3.68362875E+03, - 5.70164073E+00])), - transport=gas_transport(geom='linear', - diam=2.75, - well_depth=80.0), - note=u'S9/01') - -species(name=u'H2O', - atoms='H:2 O:1', - thermo=(NASA([300.00, 1000.00], - [ 3.38684200E+00, 3.47498200E-03, -6.35469600E-06, - 6.96858100E-09, -2.50658800E-12, -3.02081100E+04, - 2.59023300E+00]), - NASA([1000.00, 5000.00], - [ 2.67214600E+00, 3.05629300E-03, -8.73026000E-07, - 1.20099600E-10, -6.39161800E-15, -2.98992100E+04, - 6.86281700E+00])), - transport=gas_transport(geom='nonlinear', - diam=2.605, - well_depth=572.4, - dipole=1.844, - rot_relax=4.0), - note=u'20387') - -species(name=u'H', - atoms='H:1', - thermo=(NASA([300.00, 1000.00], - [ 2.50000000E+00, 0.00000000E+00, 0.00000000E+00, - 0.00000000E+00, 0.00000000E+00, 2.54716300E+04, - -4.60117600E-01]), - NASA([1000.00, 5000.00], - [ 2.50000000E+00, 0.00000000E+00, 0.00000000E+00, - 0.00000000E+00, 0.00000000E+00, 2.54716300E+04, - -4.60117600E-01])), - transport=gas_transport(geom='atom', - diam=2.05, - well_depth=145.0), - note=u'120186') - -species(name=u'HO2', - atoms='H:1 O:2', - thermo=(NASA([200.00, 1000.00], - [ 4.30179801E+00, -4.74912051E-03, 2.11582891E-05, - -2.42763894E-08, 9.29225124E-12, 2.94808040E+02, - 3.71666245E+00]), - NASA([1000.00, 3500.00], - [ 4.01721090E+00, 2.23982013E-03, -6.33658150E-07, - 1.14246370E-10, -1.07908535E-14, 1.11856713E+02, - 3.78510215E+00])), - transport=gas_transport(geom='nonlinear', - diam=3.458, - well_depth=107.4, - rot_relax=1.0), - note=u'L5/89') - -species(name=u'H2O2', - atoms='H:2 O:2', - thermo=(NASA([300.00, 1000.00], - [ 3.38875400E+00, 6.56922600E-03, -1.48501300E-07, - -4.62580600E-09, 2.47151500E-12, -1.76631500E+04, - 6.78536300E+00]), - NASA([1000.00, 5000.00], - [ 4.57316700E+00, 4.33613600E-03, -1.47468900E-06, - 2.34890400E-10, -1.43165400E-14, -1.80069600E+04, - 5.01137000E-01])), - transport=gas_transport(geom='nonlinear', - diam=3.458, - well_depth=107.4, - rot_relax=3.8), - note=u'120186') - -species(name=u'CO', - atoms='C:1 O:1', - thermo=(NASA([300.00, 1000.00], - [ 3.26245200E+00, 1.51194100E-03, -3.88175500E-06, - 5.58194400E-09, -2.47495100E-12, -1.43105400E+04, - 4.84889700E+00]), - NASA([1000.00, 5000.00], - [ 3.02507800E+00, 1.44268900E-03, -5.63082800E-07, - 1.01858100E-10, -6.91095200E-15, -1.42683500E+04, - 6.10821800E+00])), - transport=gas_transport(geom='linear', - diam=3.65, - well_depth=98.1, - polar=1.95, - rot_relax=1.8), - note=u'121286') - -species(name=u'CO2', - atoms='C:1 O:2', - thermo=(NASA([300.00, 1000.00], - [ 2.27572500E+00, 9.92207200E-03, -1.04091100E-05, - 6.86668700E-09, -2.11728000E-12, -4.83731400E+04, - 1.01884900E+01]), - NASA([1000.00, 5000.00], - [ 4.45362300E+00, 3.14016900E-03, -1.27841100E-06, - 2.39399700E-10, -1.66903300E-14, -4.89669600E+04, - -9.55395900E-01])), - transport=gas_transport(geom='linear', - diam=3.763, - well_depth=244.0, - polar=2.65, - rot_relax=2.1), - note=u'121286') - -species(name=u'HCO', - atoms='H:1 C:1 O:1', - thermo=(NASA([300.00, 1000.00], - [ 2.89833000E+00, 6.19914700E-03, -9.62308400E-06, - 1.08982500E-08, -4.57488500E-12, 4.15992200E+03, - 8.98361400E+00]), - NASA([1000.00, 5000.00], - [ 3.55727100E+00, 3.34557300E-03, -1.33500600E-06, - 2.47057300E-10, -1.71385100E-14, 3.91632400E+03, - 5.55229900E+00])), - transport=gas_transport(geom='nonlinear', - diam=3.59, - well_depth=498.0), - note=u'121286') - -species(name=u'N2', - atoms='N:2', - thermo=(NASA([300.00, 1000.00], - [ 3.29867700E+00, 1.40824000E-03, -3.96322200E-06, - 5.64151500E-09, -2.44485500E-12, -1.02090000E+03, - 3.95037200E+00]), - NASA([1000.00, 5000.00], - [ 2.92664000E+00, 1.48797700E-03, -5.68476100E-07, - 1.00970400E-10, -6.75335100E-15, -9.22797700E+02, - 5.98052800E+00])), - transport=gas_transport(geom='linear', - diam=3.621, - well_depth=97.53, - polar=1.76, - rot_relax=4.0), - note=u'121286') - -#------------------------------------------------------------------------------- -# Reaction data -#------------------------------------------------------------------------------- -# ************ H2-O2 Chain Reactions ********************** -# Hessler, J. Phys. Chem. A, 102:4517 (1998) - -# Reaction 1 -reaction('H + O2 <=> O + OH', [3.547000e+15, -0.406, 16599.0]) -# Sutherland et al., 21st Symposium, p. 929 (1986) - -# Reaction 2 -reaction('O + H2 <=> H + OH', [5.080000e+04, 2.67, 6290.0]) -# Michael and Sutherland, J. Phys. Chem. 92:3853 (1988) - -# Reaction 3 -reaction('H2 + OH <=> H2O + H', [2.160000e+08, 1.51, 3430.0]) -# Sutherland et al., 23rd Symposium, p. 51 (1990) - -# Reaction 4 -reaction('O + H2O <=> OH + OH', [2.970000e+06, 2.02, 13400.0]) -# *************** H2-O2 Dissociation Reactions ****************** -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - -# Reaction 5 -three_body_reaction('H2 + M <=> H + H + M', [4.577000e+19, -1.4, 104380.0], - efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - -# Reaction 6 -three_body_reaction('O + O + M <=> O2 + M', [6.165000e+15, -0.5, 0.0], - efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - -# Reaction 7 -three_body_reaction('O + H + M <=> OH + M', [4.714000e+18, -1.0, 0.0], - efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -# H+OH+M=H2O+M 2.212E+22 -2.00 0.000E+00 - -# Reaction 8 -three_body_reaction('H + OH + M <=> H2O + M', [3.800000e+22, -2.0, 0.0], - efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') -# ************** Formation and Consumption of HO2****************** -# Cobos et al., J. Phys. Chem. 89:342 (1985) for kinf -# Michael, et al., J. Phys. Chem. A, 106:5297 (2002) for k0 -# ****************************************************************************** -# MAIN BATH GAS IS N2 (comment this reaction otherwise) - -# Reaction 9 -falloff_reaction('H + O2 (+ M) <=> HO2 (+ M)', - kf=[1.475000e+12, 0.6, 0.0], - kf0=[6.366000e+20, -1.72, 524.8], - efficiencies='H2:2.0 H2O:11.0 CO2:3.8 CO:1.9 O2:0.78', - falloff=Troe(A=0.8, T3=1e-30, T1=1e+30)) -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] - -# Reaction 10 -reaction('HO2 + H <=> H2 + O2', [1.660000e+13, 0.0, 823.0]) -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] - -# Reaction 11 -reaction('HO2 + H <=> OH + OH', [7.079000e+13, 0.0, 295.0]) -# Baulch et al., J. Phys. Chem. Ref Data, 21:411 (1992) - -# Reaction 12 -reaction('HO2 + O <=> O2 + OH', [3.250000e+13, 0.0, 0.0]) -# Keyser, J. Phys. Chem. 92:1193 (1988) - -# Reaction 13 -reaction('HO2 + OH <=> H2O + O2', [2.890000e+13, 0.0, -497.0]) -# ***************Formation and Consumption of H2O2****************** -# Hippler et al., J. Chem. Phys. 93:1755 (1990) - -# Reaction 14 -reaction('HO2 + HO2 <=> H2O2 + O2', [4.200000e+14, 0.0, 11982.0], - options='duplicate') - -# Reaction 15 -reaction('HO2 + HO2 <=> H2O2 + O2', [1.300000e+11, 0.0, -1629.3], - options='duplicate') -# Brouwer et al., J. Chem. Phys. 86:6171 (1987) for kinf -# Warnatz, J. in Combustion chemistry (1984) for k0 - -# Reaction 16 -falloff_reaction('H2O2 (+ M) <=> OH + OH (+ M)', - kf=[2.951000e+14, 0.0, 48430.0], - kf0=[1.202000e+17, 0.0, 45500.0], - efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9', - falloff=Troe(A=0.5, T3=1e-30, T1=1e+30)) -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - -# Reaction 17 -reaction('H2O2 + H <=> H2O + OH', [2.410000e+13, 0.0, 3970.0]) -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - -# Reaction 18 -reaction('H2O2 + H <=> HO2 + H2', [4.820000e+13, 0.0, 7950.0]) -# Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - -# Reaction 19 -reaction('H2O2 + O <=> OH + HO2', [9.550000e+06, 2.0, 3970.0]) -# Hippler and Troe, J. Chem. Phys. Lett. 192:333 (1992) - -# Reaction 20 -reaction('H2O2 + OH <=> HO2 + H2O', [1.000000e+12, 0.0, 0.0], - options='duplicate') - -# Reaction 21 -reaction('H2O2 + OH <=> HO2 + H2O', [5.800000e+14, 0.0, 9557.0], - options='duplicate') -# ************** CO/HCO REACTIONS ***************** -# Troe, 15th Symposium - -# Reaction 22 -falloff_reaction('CO + O (+ M) <=> CO2 (+ M)', - kf=[1.800000e+10, 0.0, 2384.0], - kf0=[1.550000e+24, -2.79, 4191.0], - efficiencies='H2:2.5 H2O:12.0 CO2:3.8 CO:1.9') -# Fit of Westmoreland, AiChe J., 1986, rel. to N2 - Tim adjusted from MTA's -# rate constant, which was rel to Ar. -# Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) - -# Reaction 23 -reaction('CO + O2 <=> CO2 + O', [2.530000e+12, 0.0, 47700.0]) -# This rate constant is modified per an updated value for HO2+HO2=H2O2+OH - -# Reaction 24 -reaction('CO + HO2 <=> CO2 + OH', [3.010000e+13, 0.0, 23000.0]) -# This study (2004) by matching literature experiment results - -# Reaction 25 -reaction('CO + OH <=> CO2 + H', [2.229000e+05, 1.89, -1158.7]) -# This study (2004) by matching literature experiment results - -# Reaction 26 -three_body_reaction('HCO + M <=> H + CO + M', [4.748500e+11, 0.659, 14874.0], - efficiencies='H2:2.5 H2O:6.0 CO2:3.8 CO:1.9') -# Timonen et al., JPC, 92:651 (1988) - -# Reaction 27 -reaction('HCO + O2 <=> CO + HO2', [7.580000e+12, 0.0, 410.0]) -# Timonen et al., JPC, 91:692 (1987) - -# Reaction 28 -reaction('HCO + H <=> CO + H2', [7.230000e+13, 0.0, 0.0]) -# All reactions from Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) - -# Reaction 29 -reaction('HCO + O <=> CO2 + H', [3.000000e+13, 0.0, 0.0]) diff --git a/Support/ceptr/Kolla/convert.sh b/Support/ceptr/Kolla/convert.sh deleted file mode 100755 index 488208f39..000000000 --- a/Support/ceptr/Kolla/convert.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -MECH_HOME="$(pwd)" -MECH_FILE="${MECH_HOME}/mechanism.yaml" -bash ../converter.sh -f "${MECH_FILE}" diff --git a/Support/ceptr/Kolla/mechanism.H b/Support/ceptr/Kolla/mechanism.H deleted file mode 100644 index 1c01eacfc..000000000 --- a/Support/ceptr/Kolla/mechanism.H +++ /dev/null @@ -1,7909 +0,0 @@ -#ifndef MECHANISM_H -#define MECHANISM_H - -#include -#include - -/* Elements -0 C -1 H -2 O -3 N -*/ - -// Species -#define H2_ID 0 -#define O2_ID 1 -#define O_ID 2 -#define OH_ID 3 -#define H2O_ID 4 -#define H_ID 5 -#define HO2_ID 6 -#define H2O2_ID 7 -#define CO_ID 8 -#define CO2_ID 9 -#define HCO_ID 10 -#define N2_ID 11 - -#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase -#define NUM_GAS_SPECIES 12 // Species in the homogeneous phase -#define NUM_GAS_REACTIONS 29 // Reactions in the homogeneous phase - -#define SITE_DENSITY 0.000000E+00 // mol/cm^2 - -#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase -#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase -#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase - -#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS -#define NUM_SPECIES NUM_GAS_SPECIES + NUM_SURFACE_SPECIES -#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS - -#define NUM_IONS 0 - -#define NUM_FIT 4 - -// ALWAYS on CPU stuff -- can have different def depending on if we are CPU or -// GPU based. Defined in mechanism.cpp -void atomicWeight(amrex::Real* awt); -// MISC -void CKAWT(amrex::Real* awt); -void CKNCF(int* ncf); -void CKSYME_STR(amrex::Vector& ename); -void CKSYMS_STR(amrex::Vector& kname); -void GET_RMAP(int* _rmap); -void CKINU(const int i, int& nspec, int* ki, int* nu); -void CKKFKR( - const amrex::Real P, - const amrex::Real T, - const amrex::Real* x, - amrex::Real* q_f, - amrex::Real* q_r); -void progressRateFR( - amrex::Real* q_f, amrex::Real* q_r, amrex::Real* sc, amrex::Real T); -// SPARSE INFORMATION -void SPARSITY_INFO(int* nJdata, const int* consP, int NCELLS); -void SPARSITY_INFO_SYST(int* nJdata, const int* consP, int NCELLS); -void SPARSITY_INFO_SYST_SIMPLIFIED(int* nJdata, const int* consP); -void -SPARSITY_PREPROC_CSC(int* rowVals, int* colPtrs, const int* consP, int NCELLS); -void SPARSITY_PREPROC_CSR( - int* colVals, int* rowPtrs, const int* consP, int NCELLS, int base); -void SPARSITY_PREPROC_SYST_CSR( - int* colVals, int* rowPtrs, const int* consP, int NCELLS, int base); -void SPARSITY_PREPROC_SYST_SIMPLIFIED_CSC( - int* rowVals, int* colPtrs, int* indx, const int* consP); -void SPARSITY_PREPROC_SYST_SIMPLIFIED_CSR( - int* colVals, int* rowPtr, const int* consP, int base); - -// A few mechanism parameters -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKINDX(int& mm, int& kk, int& ii, int& nfit) -{ - mm = 4; - kk = 12; - ii = 29; - nfit = -1; // Why do you need this anyway ? -} - -// inverse molecular weights -#ifdef AMREX_USE_GPU -AMREX_GPU_CONSTANT const amrex::Real global_imw[12] = { - 0.4960317460317460, // H2 - 0.0312519532470779, // O2 - 0.0625039064941559, // O - 0.0587993179279120, // OH - 0.0555092978073827, // H2O - 0.9920634920634921, // H - 0.0302975216627280, // HO2 - 0.0293996589639560, // H2O2 - 0.0357015351660121, // CO - 0.0227226249176305, // CO2 - 0.0344613688055690, // HCO - 0.0356964374955379, // N2 -}; -#endif -const amrex::Real h_global_imw[12] = { - 0.4960317460317460, // H2 - 0.0312519532470779, // O2 - 0.0625039064941559, // O - 0.0587993179279120, // OH - 0.0555092978073827, // H2O - 0.9920634920634921, // H - 0.0302975216627280, // HO2 - 0.0293996589639560, // H2O2 - 0.0357015351660121, // CO - 0.0227226249176305, // CO2 - 0.0344613688055690, // HCO - 0.0356964374955379, // N2 -}; - -// molecular weights -#ifdef AMREX_USE_GPU -AMREX_GPU_CONSTANT const amrex::Real global_mw[12] = { - 2.016000, // H2 - 31.998000, // O2 - 15.999000, // O - 17.007000, // OH - 18.015000, // H2O - 1.008000, // H - 33.006000, // HO2 - 34.014000, // H2O2 - 28.010000, // CO - 44.009000, // CO2 - 29.018000, // HCO - 28.014000, // N2 -}; -#endif -const amrex::Real h_global_mw[12] = { - 2.016000, // H2 - 31.998000, // O2 - 15.999000, // O - 17.007000, // OH - 18.015000, // H2O - 1.008000, // H - 33.006000, // HO2 - 34.014000, // H2O2 - 28.010000, // CO - 44.009000, // CO2 - 29.018000, // HCO - 28.014000, // N2 -}; - -// inverse molecular weights -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -get_imw(amrex::Real* imw_new) -{ - imw_new[0] = 0.4960317460317460; // H2 - imw_new[1] = 0.0312519532470779; // O2 - imw_new[2] = 0.0625039064941559; // O - imw_new[3] = 0.0587993179279120; // OH - imw_new[4] = 0.0555092978073827; // H2O - imw_new[5] = 0.9920634920634921; // H - imw_new[6] = 0.0302975216627280; // HO2 - imw_new[7] = 0.0293996589639560; // H2O2 - imw_new[8] = 0.0357015351660121; // CO - imw_new[9] = 0.0227226249176305; // CO2 - imw_new[10] = 0.0344613688055690; // HCO - imw_new[11] = 0.0356964374955379; // N2 -} - -// inverse molecular weight -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real -imw(const int n) -{ -#if AMREX_DEVICE_COMPILE - return global_imw[n]; -#else - return h_global_imw[n]; -#endif -} -// molecular weights -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -get_mw(amrex::Real* mw_new) -{ - mw_new[0] = 2.016000; // H2 - mw_new[1] = 31.998000; // O2 - mw_new[2] = 15.999000; // O - mw_new[3] = 17.007000; // OH - mw_new[4] = 18.015000; // H2O - mw_new[5] = 1.008000; // H - mw_new[6] = 33.006000; // HO2 - mw_new[7] = 34.014000; // H2O2 - mw_new[8] = 28.010000; // CO - mw_new[9] = 44.009000; // CO2 - mw_new[10] = 29.018000; // HCO - mw_new[11] = 28.014000; // N2 -} - -// molecular weight -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real -mw(const int n) -{ -#if AMREX_DEVICE_COMPILE - return global_mw[n]; -#else - return h_global_mw[n]; -#endif -} - -// Returns R, Rc, Patm -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKRP(amrex::Real& ru, amrex::Real& ruc, amrex::Real& pa) -{ - ru = 8.31446261815324e+07; - ruc = 1.98721558317399615845; - pa = 1.01325e+06; -} - -// compute Cv/R at the given temperature -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -cv_R(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - - // species with no change across T - // species 5: H - species[5] = +1.50000000e+00; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = +2.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - - 9.47543400e-11 * T3 + 4.13487200e-13 * T4; - // species 1: O2 - species[1] = +2.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + - 1.31387700e-09 * T3 - 8.76855400e-13 * T4; - // species 2: O - species[2] = +1.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - - 1.60284300e-09 * T3 + 3.89069600e-13 * T4; - // species 3: OH - species[3] = +3.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - - 5.79853643e-09 * T3 + 2.06237379e-12 * T4; - // species 4: H2O - species[4] = +2.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + - 6.96858100e-09 * T3 - 2.50658800e-12 * T4; - // species 6: HO2 - species[6] = +3.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - - 2.42763894e-08 * T3 + 9.29225124e-12 * T4; - // species 7: H2O2 - species[7] = +2.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - - 4.62580600e-09 * T3 + 2.47151500e-12 * T4; - // species 8: CO - species[8] = +2.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + - 5.58194400e-09 * T3 - 2.47495100e-12 * T4; - // species 9: CO2 - species[9] = +1.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + - 6.86668700e-09 * T3 - 2.11728000e-12 * T4; - // species 10: HCO - species[10] = +1.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + - 1.08982500e-08 * T3 - 4.57488500e-12 * T4; - // species 11: N2 - species[11] = +2.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + - 5.64151500e-09 * T3 - 2.44485500e-12 * T4; - } else { - // species 0: H2 - species[0] = +1.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - - 9.23157800e-12 * T3 + 1.58275200e-15 * T4; - // species 1: O2 - species[1] = +2.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + - 1.77528100e-11 * T3 - 1.13643500e-15 * T4; - // species 2: O - species[2] = +1.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + - 4.55106700e-12 * T3 - 4.36805200e-16 * T4; - // species 3: OH - species[3] = +1.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + - 3.05218674e-11 * T3 - 1.33195876e-15 * T4; - // species 4: H2O - species[4] = +1.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + - 1.20099600e-10 * T3 - 6.39161800e-15 * T4; - // species 6: HO2 - species[6] = +3.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + - 1.14246370e-10 * T3 - 1.07908535e-14 * T4; - // species 7: H2O2 - species[7] = +3.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + - 2.34890400e-10 * T3 - 1.43165400e-14 * T4; - // species 8: CO - species[8] = +2.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + - 1.01858100e-10 * T3 - 6.91095200e-15 * T4; - // species 9: CO2 - species[9] = +3.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + - 2.39399700e-10 * T3 - 1.66903300e-14 * T4; - // species 10: HCO - species[10] = +2.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + - 2.47057300e-10 * T3 - 1.71385100e-14 * T4; - // species 11: N2 - species[11] = +1.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + - 1.00970400e-10 * T3 - 6.75335100e-15 * T4; - } -} - -// compute Cp/R at the given temperature -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -cp_R(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - - // species with no change across T - // species 5: H - species[5] = +2.50000000e+00; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = +3.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - - 9.47543400e-11 * T3 + 4.13487200e-13 * T4; - // species 1: O2 - species[1] = +3.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + - 1.31387700e-09 * T3 - 8.76855400e-13 * T4; - // species 2: O - species[2] = +2.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - - 1.60284300e-09 * T3 + 3.89069600e-13 * T4; - // species 3: OH - species[3] = +4.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - - 5.79853643e-09 * T3 + 2.06237379e-12 * T4; - // species 4: H2O - species[4] = +3.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + - 6.96858100e-09 * T3 - 2.50658800e-12 * T4; - // species 6: HO2 - species[6] = +4.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - - 2.42763894e-08 * T3 + 9.29225124e-12 * T4; - // species 7: H2O2 - species[7] = +3.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - - 4.62580600e-09 * T3 + 2.47151500e-12 * T4; - // species 8: CO - species[8] = +3.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + - 5.58194400e-09 * T3 - 2.47495100e-12 * T4; - // species 9: CO2 - species[9] = +2.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + - 6.86668700e-09 * T3 - 2.11728000e-12 * T4; - // species 10: HCO - species[10] = +2.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + - 1.08982500e-08 * T3 - 4.57488500e-12 * T4; - // species 11: N2 - species[11] = +3.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + - 5.64151500e-09 * T3 - 2.44485500e-12 * T4; - } else { - // species 0: H2 - species[0] = +2.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - - 9.23157800e-12 * T3 + 1.58275200e-15 * T4; - // species 1: O2 - species[1] = +3.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + - 1.77528100e-11 * T3 - 1.13643500e-15 * T4; - // species 2: O - species[2] = +2.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + - 4.55106700e-12 * T3 - 4.36805200e-16 * T4; - // species 3: OH - species[3] = +2.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + - 3.05218674e-11 * T3 - 1.33195876e-15 * T4; - // species 4: H2O - species[4] = +2.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + - 1.20099600e-10 * T3 - 6.39161800e-15 * T4; - // species 6: HO2 - species[6] = +4.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + - 1.14246370e-10 * T3 - 1.07908535e-14 * T4; - // species 7: H2O2 - species[7] = +4.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + - 2.34890400e-10 * T3 - 1.43165400e-14 * T4; - // species 8: CO - species[8] = +3.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + - 1.01858100e-10 * T3 - 6.91095200e-15 * T4; - // species 9: CO2 - species[9] = +4.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + - 2.39399700e-10 * T3 - 1.66903300e-14 * T4; - // species 10: HCO - species[10] = +3.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + - 2.47057300e-10 * T3 - 1.71385100e-14 * T4; - // species 11: N2 - species[11] = +2.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + - 1.00970400e-10 * T3 - 6.75335100e-15 * T4; - } -} - -// compute the g/(RT) at the given temperature -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -gibbs(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real invT = 1.0 / T; - const amrex::Real logT = log(T); - - // species with no change across T - // species 5: H - species[5] = +2.547163000000000e+04 * invT + 2.960117600000000e+00 - - 2.500000000000000e+00 * logT; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = -1.012521000000000e+03 * invT + 6.592218000000000e+00 - - 3.298124000000000e+00 * logT - 4.124721000000000e-04 * T + - 1.357169166666667e-07 * T2 + 7.896194999999999e-12 * T3 - - 2.067436000000000e-14 * T4; - // species 1: O2 - species[1] = -1.005249000000000e+03 * invT - 2.821802000000000e+00 - - 3.212936000000000e+00 * logT - 5.637430000000000e-04 * T + - 9.593583333333333e-08 * T2 - 1.094897500000000e-10 * T3 + - 4.384277000000000e-14 * T4; - // species 2: O - species[2] = +2.914764000000000e+04 * invT - 1.756599999999997e-02 - - 2.946429000000000e+00 * logT + 8.190830000000000e-04 * T - - 4.035053333333333e-07 * T2 + 1.335702500000000e-10 * T3 - - 1.945348000000000e-14 * T4; - // species 3: OH - species[3] = +3.346309130000000e+03 * invT + 4.815738570000000e+00 - - 4.125305610000000e+00 * logT + 1.612724695000000e-03 * T - - 1.087941151666667e-06 * T2 + 4.832113691666666e-10 * T3 - - 1.031186895000000e-13 * T4; - // species 4: H2O - species[4] = -3.020811000000000e+04 * invT + 7.966090000000001e-01 - - 3.386842000000000e+00 * logT - 1.737491000000000e-03 * T + - 1.059116000000000e-06 * T2 - 5.807150833333333e-10 * T3 + - 1.253294000000000e-13 * T4; - // species 6: HO2 - species[6] = +2.948080400000000e+02 * invT + 5.851355599999999e-01 - - 4.301798010000000e+00 * logT + 2.374560255000000e-03 * T - - 3.526381516666666e-06 * T2 + 2.023032450000000e-09 * T3 - - 4.646125620000001e-13 * T4; - // species 7: H2O2 - species[7] = -1.766315000000000e+04 * invT - 3.396609000000000e+00 - - 3.388754000000000e+00 * logT - 3.284613000000000e-03 * T + - 2.475021666666666e-08 * T2 + 3.854838333333333e-10 * T3 - - 1.235757500000000e-13 * T4; - // species 8: CO - species[8] = -1.431054000000000e+04 * invT - 1.586445000000000e+00 - - 3.262452000000000e+00 * logT - 7.559705000000000e-04 * T + - 6.469591666666667e-07 * T2 - 4.651620000000000e-10 * T3 + - 1.237475500000000e-13 * T4; - // species 9: CO2 - species[9] = -4.837314000000000e+04 * invT - 7.912765000000000e+00 - - 2.275725000000000e+00 * logT - 4.961036000000000e-03 * T + - 1.734851666666667e-06 * T2 - 5.722239166666667e-10 * T3 + - 1.058640000000000e-13 * T4; - // species 10: HCO - species[10] = +4.159922000000000e+03 * invT - 6.085284000000000e+00 - - 2.898330000000000e+00 * logT - 3.099573500000000e-03 * T + - 1.603847333333333e-06 * T2 - 9.081875000000000e-10 * T3 + - 2.287442500000000e-13 * T4; - // species 11: N2 - species[11] = -1.020900000000000e+03 * invT - 6.516950000000001e-01 - - 3.298677000000000e+00 * logT - 7.041200000000000e-04 * T + - 6.605369999999999e-07 * T2 - 4.701262500000001e-10 * T3 + - 1.222427500000000e-13 * T4; - } else { - // species 0: H2 - species[0] = -8.350340000000000e+02 * invT + 4.346533000000000e+00 - - 2.991423000000000e+00 * logT - 3.500322000000000e-04 * T + - 9.389715000000000e-09 * T2 + 7.692981666666667e-13 * T3 - - 7.913760000000000e-17 * T4; - // species 1: O2 - species[1] = -1.233930000000000e+03 * invT + 5.084119999999999e-01 - - 3.697578000000000e+00 * logT - 3.067598500000000e-04 * T + - 2.098070000000000e-08 * T2 - 1.479400833333333e-12 * T3 + - 5.682175000000001e-17 * T4; - // species 2: O - species[2] = +2.923080000000000e+04 * invT - 2.378248000000000e+00 - - 2.542060000000000e+00 * logT + 1.377531000000000e-05 * T + - 5.171338333333333e-10 * T2 - 3.792555833333334e-13 * T3 + - 2.184026000000000e-17 * T4; - // species 3: OH - species[3] = +3.683628750000000e+03 * invT - 2.836911870000000e+00 - - 2.864728860000000e+00 * logT - 5.282522400000000e-04 * T + - 4.318045966666667e-08 * T2 - 2.543488950000000e-12 * T3 + - 6.659793800000000e-17 * T4; - // species 4: H2O - species[4] = -2.989921000000000e+04 * invT - 4.190671000000000e+00 - - 2.672146000000000e+00 * logT - 1.528146500000000e-03 * T + - 1.455043333333333e-07 * T2 - 1.000830000000000e-11 * T3 + - 3.195809000000000e-16 * T4; - // species 6: HO2 - species[6] = +1.118567130000000e+02 * invT + 2.321087500000001e-01 - - 4.017210900000000e+00 * logT - 1.119910065000000e-03 * T + - 1.056096916666667e-07 * T2 - 9.520530833333334e-12 * T3 + - 5.395426750000000e-16 * T4; - // species 7: H2O2 - species[7] = -1.800696000000000e+04 * invT + 4.072030000000000e+00 - - 4.573167000000000e+00 * logT - 2.168068000000000e-03 * T + - 2.457815000000000e-07 * T2 - 1.957420000000000e-11 * T3 + - 7.158270000000000e-16 * T4; - // species 8: CO - species[8] = -1.426835000000000e+04 * invT - 3.083140000000000e+00 - - 3.025078000000000e+00 * logT - 7.213445000000000e-04 * T + - 9.384713333333334e-08 * T2 - 8.488174999999999e-12 * T3 + - 3.455476000000000e-16 * T4; - // species 9: CO2 - species[9] = -4.896696000000000e+04 * invT + 5.409018900000000e+00 - - 4.453623000000000e+00 * logT - 1.570084500000000e-03 * T + - 2.130685000000000e-07 * T2 - 1.994997500000000e-11 * T3 + - 8.345165000000000e-16 * T4; - // species 10: HCO - species[10] = +3.916324000000000e+03 * invT - 1.995028000000000e+00 - - 3.557271000000000e+00 * logT - 1.672786500000000e-03 * T + - 2.225010000000000e-07 * T2 - 2.058810833333333e-11 * T3 + - 8.569255000000000e-16 * T4; - // species 11: N2 - species[11] = -9.227977000000000e+02 * invT - 3.053888000000000e+00 - - 2.926640000000000e+00 * logT - 7.439885000000000e-04 * T + - 9.474601666666666e-08 * T2 - 8.414199999999999e-12 * T3 + - 3.376675500000000e-16 * T4; - } -} - -// compute the a/(RT) at the given temperature -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -helmholtz(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real invT = 1.0 / T; - const amrex::Real logT = log(T); - - // species with no change across T - // species 5: H - species[5] = +2.54716300e+04 * invT + 1.96011760e+00 - 2.50000000e+00 * logT; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = -1.01252100e+03 * invT + 5.59221800e+00 - - 3.29812400e+00 * logT - 4.12472100e-04 * T + - 1.35716917e-07 * T2 + 7.89619500e-12 * T3 - - 2.06743600e-14 * T4; - // species 1: O2 - species[1] = -1.00524900e+03 * invT - 3.82180200e+00 - - 3.21293600e+00 * logT - 5.63743000e-04 * T + - 9.59358333e-08 * T2 - 1.09489750e-10 * T3 + - 4.38427700e-14 * T4; - // species 2: O - species[2] = +2.91476400e+04 * invT - 1.01756600e+00 - - 2.94642900e+00 * logT + 8.19083000e-04 * T - - 4.03505333e-07 * T2 + 1.33570250e-10 * T3 - - 1.94534800e-14 * T4; - // species 3: OH - species[3] = +3.34630913e+03 * invT + 3.81573857e+00 - - 4.12530561e+00 * logT + 1.61272470e-03 * T - - 1.08794115e-06 * T2 + 4.83211369e-10 * T3 - - 1.03118689e-13 * T4; - // species 4: H2O - species[4] = -3.02081100e+04 * invT - 2.03391000e-01 - - 3.38684200e+00 * logT - 1.73749100e-03 * T + - 1.05911600e-06 * T2 - 5.80715083e-10 * T3 + - 1.25329400e-13 * T4; - // species 6: HO2 - species[6] = +2.94808040e+02 * invT - 4.14864440e-01 - - 4.30179801e+00 * logT + 2.37456025e-03 * T - - 3.52638152e-06 * T2 + 2.02303245e-09 * T3 - - 4.64612562e-13 * T4; - // species 7: H2O2 - species[7] = -1.76631500e+04 * invT - 4.39660900e+00 - - 3.38875400e+00 * logT - 3.28461300e-03 * T + - 2.47502167e-08 * T2 + 3.85483833e-10 * T3 - - 1.23575750e-13 * T4; - // species 8: CO - species[8] = -1.43105400e+04 * invT - 2.58644500e+00 - - 3.26245200e+00 * logT - 7.55970500e-04 * T + - 6.46959167e-07 * T2 - 4.65162000e-10 * T3 + - 1.23747550e-13 * T4; - // species 9: CO2 - species[9] = -4.83731400e+04 * invT - 8.91276500e+00 - - 2.27572500e+00 * logT - 4.96103600e-03 * T + - 1.73485167e-06 * T2 - 5.72223917e-10 * T3 + - 1.05864000e-13 * T4; - // species 10: HCO - species[10] = +4.15992200e+03 * invT - 7.08528400e+00 - - 2.89833000e+00 * logT - 3.09957350e-03 * T + - 1.60384733e-06 * T2 - 9.08187500e-10 * T3 + - 2.28744250e-13 * T4; - // species 11: N2 - species[11] = -1.02090000e+03 * invT - 1.65169500e+00 - - 3.29867700e+00 * logT - 7.04120000e-04 * T + - 6.60537000e-07 * T2 - 4.70126250e-10 * T3 + - 1.22242750e-13 * T4; - } else { - // species 0: H2 - species[0] = -8.35034000e+02 * invT + 3.34653300e+00 - - 2.99142300e+00 * logT - 3.50032200e-04 * T + - 9.38971500e-09 * T2 + 7.69298167e-13 * T3 - - 7.91376000e-17 * T4; - // species 1: O2 - species[1] = -1.23393000e+03 * invT - 4.91588000e-01 - - 3.69757800e+00 * logT - 3.06759850e-04 * T + - 2.09807000e-08 * T2 - 1.47940083e-12 * T3 + - 5.68217500e-17 * T4; - // species 2: O - species[2] = +2.92308000e+04 * invT - 3.37824800e+00 - - 2.54206000e+00 * logT + 1.37753100e-05 * T + - 5.17133833e-10 * T2 - 3.79255583e-13 * T3 + - 2.18402600e-17 * T4; - // species 3: OH - species[3] = +3.68362875e+03 * invT - 3.83691187e+00 - - 2.86472886e+00 * logT - 5.28252240e-04 * T + - 4.31804597e-08 * T2 - 2.54348895e-12 * T3 + - 6.65979380e-17 * T4; - // species 4: H2O - species[4] = -2.98992100e+04 * invT - 5.19067100e+00 - - 2.67214600e+00 * logT - 1.52814650e-03 * T + - 1.45504333e-07 * T2 - 1.00083000e-11 * T3 + - 3.19580900e-16 * T4; - // species 6: HO2 - species[6] = +1.11856713e+02 * invT - 7.67891250e-01 - - 4.01721090e+00 * logT - 1.11991006e-03 * T + - 1.05609692e-07 * T2 - 9.52053083e-12 * T3 + - 5.39542675e-16 * T4; - // species 7: H2O2 - species[7] = -1.80069600e+04 * invT + 3.07203000e+00 - - 4.57316700e+00 * logT - 2.16806800e-03 * T + - 2.45781500e-07 * T2 - 1.95742000e-11 * T3 + - 7.15827000e-16 * T4; - // species 8: CO - species[8] = -1.42683500e+04 * invT - 4.08314000e+00 - - 3.02507800e+00 * logT - 7.21344500e-04 * T + - 9.38471333e-08 * T2 - 8.48817500e-12 * T3 + - 3.45547600e-16 * T4; - // species 9: CO2 - species[9] = -4.89669600e+04 * invT + 4.40901890e+00 - - 4.45362300e+00 * logT - 1.57008450e-03 * T + - 2.13068500e-07 * T2 - 1.99499750e-11 * T3 + - 8.34516500e-16 * T4; - // species 10: HCO - species[10] = +3.91632400e+03 * invT - 2.99502800e+00 - - 3.55727100e+00 * logT - 1.67278650e-03 * T + - 2.22501000e-07 * T2 - 2.05881083e-11 * T3 + - 8.56925500e-16 * T4; - // species 11: N2 - species[11] = -9.22797700e+02 * invT - 4.05388800e+00 - - 2.92664000e+00 * logT - 7.43988500e-04 * T + - 9.47460167e-08 * T2 - 8.41420000e-12 * T3 + - 3.37667550e-16 * T4; - } -} - -// compute the e/(RT) at the given temperature -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -speciesInternalEnergy(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real invT = 1.0 / T; - - // species with no change across T - // species 5: H - species[5] = +1.50000000e+00 + 2.54716300e+04 * invT; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = +2.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - - 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - - 1.01252100e+03 * invT; - // species 1: O2 - species[1] = +2.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + - 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - - 1.00524900e+03 * invT; - // species 2: O - species[2] = +1.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - - 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + - 2.91476400e+04 * invT; - // species 3: OH - species[3] = +3.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - - 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + - 3.34630913e+03 * invT; - // species 4: H2O - species[4] = +2.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + - 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - - 3.02081100e+04 * invT; - // species 6: HO2 - species[6] = +3.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - - 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + - 2.94808040e+02 * invT; - // species 7: H2O2 - species[7] = +2.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - - 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - - 1.76631500e+04 * invT; - // species 8: CO - species[8] = +2.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + - 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - - 1.43105400e+04 * invT; - // species 9: CO2 - species[9] = +1.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + - 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - - 4.83731400e+04 * invT; - // species 10: HCO - species[10] = +1.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + - 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + - 4.15992200e+03 * invT; - // species 11: N2 - species[11] = +2.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + - 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - - 1.02090000e+03 * invT; - } else { - // species 0: H2 - species[0] = +1.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - - 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - - 8.35034000e+02 * invT; - // species 1: O2 - species[1] = +2.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + - 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - - 1.23393000e+03 * invT; - // species 2: O - species[2] = +1.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + - 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + - 2.92308000e+04 * invT; - // species 3: OH - species[3] = +1.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + - 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + - 3.68362875e+03 * invT; - // species 4: H2O - species[4] = +1.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + - 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - - 2.98992100e+04 * invT; - // species 6: HO2 - species[6] = +3.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + - 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + - 1.11856713e+02 * invT; - // species 7: H2O2 - species[7] = +3.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + - 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - - 1.80069600e+04 * invT; - // species 8: CO - species[8] = +2.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + - 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - - 1.42683500e+04 * invT; - // species 9: CO2 - species[9] = +3.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + - 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - - 4.89669600e+04 * invT; - // species 10: HCO - species[10] = +2.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + - 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + - 3.91632400e+03 * invT; - // species 11: N2 - species[11] = +1.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + - 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - - 9.22797700e+02 * invT; - } -} - -// compute the h/(RT) at the given temperature (Eq 20) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -speciesEnthalpy(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real invT = 1.0 / T; - - // species with no change across T - // species 5: H - species[5] = +2.50000000e+00 + 2.54716300e+04 * invT; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = +3.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - - 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - - 1.01252100e+03 * invT; - // species 1: O2 - species[1] = +3.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + - 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - - 1.00524900e+03 * invT; - // species 2: O - species[2] = +2.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - - 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + - 2.91476400e+04 * invT; - // species 3: OH - species[3] = +4.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - - 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + - 3.34630913e+03 * invT; - // species 4: H2O - species[4] = +3.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + - 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - - 3.02081100e+04 * invT; - // species 6: HO2 - species[6] = +4.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - - 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + - 2.94808040e+02 * invT; - // species 7: H2O2 - species[7] = +3.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - - 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - - 1.76631500e+04 * invT; - // species 8: CO - species[8] = +3.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + - 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - - 1.43105400e+04 * invT; - // species 9: CO2 - species[9] = +2.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + - 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - - 4.83731400e+04 * invT; - // species 10: HCO - species[10] = +2.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + - 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + - 4.15992200e+03 * invT; - // species 11: N2 - species[11] = +3.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + - 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - - 1.02090000e+03 * invT; - } else { - // species 0: H2 - species[0] = +2.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - - 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - - 8.35034000e+02 * invT; - // species 1: O2 - species[1] = +3.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + - 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - - 1.23393000e+03 * invT; - // species 2: O - species[2] = +2.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + - 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + - 2.92308000e+04 * invT; - // species 3: OH - species[3] = +2.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + - 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + - 3.68362875e+03 * invT; - // species 4: H2O - species[4] = +2.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + - 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - - 2.98992100e+04 * invT; - // species 6: HO2 - species[6] = +4.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + - 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + - 1.11856713e+02 * invT; - // species 7: H2O2 - species[7] = +4.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + - 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - - 1.80069600e+04 * invT; - // species 8: CO - species[8] = +3.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + - 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - - 1.42683500e+04 * invT; - // species 9: CO2 - species[9] = +4.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + - 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - - 4.89669600e+04 * invT; - // species 10: HCO - species[10] = +3.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + - 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + - 3.91632400e+03 * invT; - // species 11: N2 - species[11] = +2.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + - 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - - 9.22797700e+02 * invT; - } -} - -// compute the S/R at the given temperature (Eq 21) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -speciesEntropy(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real logT = log(T); - - // species with no change across T - // species 5: H - species[5] = +2.50000000e+00 * logT - 4.60117600e-01; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = +3.29812400e+00 * logT + 8.24944200e-04 * T - - 4.07150750e-07 * T2 - 3.15847800e-11 * T3 + - 1.03371800e-13 * T4 - 3.29409400e+00; - // species 1: O2 - species[1] = +3.21293600e+00 * logT + 1.12748600e-03 * T - - 2.87807500e-07 * T2 + 4.37959000e-10 * T3 - - 2.19213850e-13 * T4 + 6.03473800e+00; - // species 2: O - species[2] = +2.94642900e+00 * logT - 1.63816600e-03 * T + - 1.21051600e-06 * T2 - 5.34281000e-10 * T3 + - 9.72674000e-14 * T4 + 2.96399500e+00; - // species 3: OH - species[3] = +4.12530561e+00 * logT - 3.22544939e-03 * T + - 3.26382346e-06 * T2 - 1.93284548e-09 * T3 + - 5.15593447e-13 * T4 - 6.90432960e-01; - // species 4: H2O - species[4] = +3.38684200e+00 * logT + 3.47498200e-03 * T - - 3.17734800e-06 * T2 + 2.32286033e-09 * T3 - - 6.26647000e-13 * T4 + 2.59023300e+00; - // species 6: HO2 - species[6] = +4.30179801e+00 * logT - 4.74912051e-03 * T + - 1.05791445e-05 * T2 - 8.09212980e-09 * T3 + - 2.32306281e-12 * T4 + 3.71666245e+00; - // species 7: H2O2 - species[7] = +3.38875400e+00 * logT + 6.56922600e-03 * T - - 7.42506500e-08 * T2 - 1.54193533e-09 * T3 + - 6.17878750e-13 * T4 + 6.78536300e+00; - // species 8: CO - species[8] = +3.26245200e+00 * logT + 1.51194100e-03 * T - - 1.94087750e-06 * T2 + 1.86064800e-09 * T3 - - 6.18737750e-13 * T4 + 4.84889700e+00; - // species 9: CO2 - species[9] = +2.27572500e+00 * logT + 9.92207200e-03 * T - - 5.20455500e-06 * T2 + 2.28889567e-09 * T3 - - 5.29320000e-13 * T4 + 1.01884900e+01; - // species 10: HCO - species[10] = +2.89833000e+00 * logT + 6.19914700e-03 * T - - 4.81154200e-06 * T2 + 3.63275000e-09 * T3 - - 1.14372125e-12 * T4 + 8.98361400e+00; - // species 11: N2 - species[11] = +3.29867700e+00 * logT + 1.40824000e-03 * T - - 1.98161100e-06 * T2 + 1.88050500e-09 * T3 - - 6.11213750e-13 * T4 + 3.95037200e+00; - } else { - // species 0: H2 - species[0] = +2.99142300e+00 * logT + 7.00064400e-04 * T - - 2.81691450e-08 * T2 - 3.07719267e-12 * T3 + - 3.95688000e-16 * T4 - 1.35511000e+00; - // species 1: O2 - species[1] = +3.69757800e+00 * logT + 6.13519700e-04 * T - - 6.29421000e-08 * T2 + 5.91760333e-12 * T3 - - 2.84108750e-16 * T4 + 3.18916600e+00; - // species 2: O - species[2] = +2.54206000e+00 * logT - 2.75506200e-05 * T - - 1.55140150e-09 * T2 + 1.51702233e-12 * T3 - - 1.09201300e-16 * T4 + 4.92030800e+00; - // species 3: OH - species[3] = +2.86472886e+00 * logT + 1.05650448e-03 * T - - 1.29541379e-07 * T2 + 1.01739558e-11 * T3 - - 3.32989690e-16 * T4 + 5.70164073e+00; - // species 4: H2O - species[4] = +2.67214600e+00 * logT + 3.05629300e-03 * T - - 4.36513000e-07 * T2 + 4.00332000e-11 * T3 - - 1.59790450e-15 * T4 + 6.86281700e+00; - // species 6: HO2 - species[6] = +4.01721090e+00 * logT + 2.23982013e-03 * T - - 3.16829075e-07 * T2 + 3.80821233e-11 * T3 - - 2.69771337e-15 * T4 + 3.78510215e+00; - // species 7: H2O2 - species[7] = +4.57316700e+00 * logT + 4.33613600e-03 * T - - 7.37344500e-07 * T2 + 7.82968000e-11 * T3 - - 3.57913500e-15 * T4 + 5.01137000e-01; - // species 8: CO - species[8] = +3.02507800e+00 * logT + 1.44268900e-03 * T - - 2.81541400e-07 * T2 + 3.39527000e-11 * T3 - - 1.72773800e-15 * T4 + 6.10821800e+00; - // species 9: CO2 - species[9] = +4.45362300e+00 * logT + 3.14016900e-03 * T - - 6.39205500e-07 * T2 + 7.97999000e-11 * T3 - - 4.17258250e-15 * T4 - 9.55395900e-01; - // species 10: HCO - species[10] = +3.55727100e+00 * logT + 3.34557300e-03 * T - - 6.67503000e-07 * T2 + 8.23524333e-11 * T3 - - 4.28462750e-15 * T4 + 5.55229900e+00; - // species 11: N2 - species[11] = +2.92664000e+00 * logT + 1.48797700e-03 * T - - 2.84238050e-07 * T2 + 3.36568000e-11 * T3 - - 1.68833775e-15 * T4 + 5.98052800e+00; - } -} - -// compute d(Cp/R)/dT and d(Cv/R)/dT at the given temperature -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -dcvpRdT(amrex::Real* species, const amrex::Real T) -{ - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - - // species with no change across T - // species 5: H - species[5] = 0.0; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - species[0] = +8.24944200e-04 - 1.62860300e-06 * T - 2.84263020e-10 * T2 + - 1.65394880e-12 * T3; - // species 1: O2 - species[1] = +1.12748600e-03 - 1.15123000e-06 * T + 3.94163100e-09 * T2 - - 3.50742160e-12 * T3; - // species 2: O - species[2] = -1.63816600e-03 + 4.84206400e-06 * T - 4.80852900e-09 * T2 + - 1.55627840e-12 * T3; - // species 3: OH - species[3] = -3.22544939e-03 + 1.30552938e-05 * T - 1.73956093e-08 * T2 + - 8.24949516e-12 * T3; - // species 4: H2O - species[4] = +3.47498200e-03 - 1.27093920e-05 * T + 2.09057430e-08 * T2 - - 1.00263520e-11 * T3; - // species 6: HO2 - species[6] = -4.74912051e-03 + 4.23165782e-05 * T - 7.28291682e-08 * T2 + - 3.71690050e-11 * T3; - // species 7: H2O2 - species[7] = +6.56922600e-03 - 2.97002600e-07 * T - 1.38774180e-08 * T2 + - 9.88606000e-12 * T3; - // species 8: CO - species[8] = +1.51194100e-03 - 7.76351000e-06 * T + 1.67458320e-08 * T2 - - 9.89980400e-12 * T3; - // species 9: CO2 - species[9] = +9.92207200e-03 - 2.08182200e-05 * T + 2.06000610e-08 * T2 - - 8.46912000e-12 * T3; - // species 10: HCO - species[10] = +6.19914700e-03 - 1.92461680e-05 * T + 3.26947500e-08 * T2 - - 1.82995400e-11 * T3; - // species 11: N2 - species[11] = +1.40824000e-03 - 7.92644400e-06 * T + 1.69245450e-08 * T2 - - 9.77942000e-12 * T3; - } else { - // species 0: H2 - species[0] = +7.00064400e-04 - 1.12676580e-07 * T - 2.76947340e-11 * T2 + - 6.33100800e-15 * T3; - // species 1: O2 - species[1] = +6.13519700e-04 - 2.51768400e-07 * T + 5.32584300e-11 * T2 - - 4.54574000e-15 * T3; - // species 2: O - species[2] = -2.75506200e-05 - 6.20560600e-09 * T + 1.36532010e-11 * T2 - - 1.74722080e-15 * T3; - // species 3: OH - species[3] = +1.05650448e-03 - 5.18165516e-07 * T + 9.15656022e-11 * T2 - - 5.32783504e-15 * T3; - // species 4: H2O - species[4] = +3.05629300e-03 - 1.74605200e-06 * T + 3.60298800e-10 * T2 - - 2.55664720e-14 * T3; - // species 6: HO2 - species[6] = +2.23982013e-03 - 1.26731630e-06 * T + 3.42739110e-10 * T2 - - 4.31634140e-14 * T3; - // species 7: H2O2 - species[7] = +4.33613600e-03 - 2.94937800e-06 * T + 7.04671200e-10 * T2 - - 5.72661600e-14 * T3; - // species 8: CO - species[8] = +1.44268900e-03 - 1.12616560e-06 * T + 3.05574300e-10 * T2 - - 2.76438080e-14 * T3; - // species 9: CO2 - species[9] = +3.14016900e-03 - 2.55682200e-06 * T + 7.18199100e-10 * T2 - - 6.67613200e-14 * T3; - // species 10: HCO - species[10] = +3.34557300e-03 - 2.67001200e-06 * T + 7.41171900e-10 * T2 - - 6.85540400e-14 * T3; - // species 11: N2 - species[11] = +1.48797700e-03 - 1.13695220e-06 * T + 3.02911200e-10 * T2 - - 2.70134040e-14 * T3; - } -} - -// Returns the mean specific heat at CP (Eq. 33) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCPBL(const amrex::Real T, const amrex::Real x[], amrex::Real& cpbl) -{ - amrex::Real result = 0; - amrex::Real cpor[12]; // temporary storage - cp_R(cpor, T); - - // perform dot product - for (int id = 0; id < 12; ++id) { - result += x[id] * cpor[id]; - } - - cpbl = result * 8.31446261815324e+07; -} - -// Returns the mean specific heat at CP (Eq. 34) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCPBS(const amrex::Real T, const amrex::Real y[], amrex::Real& cpbs) -{ - amrex::Real result = 0.0; - - // compute Cp/R at the given temperature - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - - // species with no change across T - // species 5: H - result += y[5] * (+2.50000000e+00) * 0.9920634920634921; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - result += y[0] * - (+3.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - - 9.47543400e-11 * T3 + 4.13487200e-13 * T4) * - 0.4960317460317460; - // species 1: O2 - result += y[1] * - (+3.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + - 1.31387700e-09 * T3 - 8.76855400e-13 * T4) * - 0.0312519532470779; - // species 2: O - result += y[2] * - (+2.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - - 1.60284300e-09 * T3 + 3.89069600e-13 * T4) * - 0.0625039064941559; - // species 3: OH - result += y[3] * - (+4.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - - 5.79853643e-09 * T3 + 2.06237379e-12 * T4) * - 0.0587993179279120; - // species 4: H2O - result += y[4] * - (+3.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + - 6.96858100e-09 * T3 - 2.50658800e-12 * T4) * - 0.0555092978073827; - // species 6: HO2 - result += y[6] * - (+4.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - - 2.42763894e-08 * T3 + 9.29225124e-12 * T4) * - 0.0302975216627280; - // species 7: H2O2 - result += y[7] * - (+3.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - - 4.62580600e-09 * T3 + 2.47151500e-12 * T4) * - 0.0293996589639560; - // species 8: CO - result += y[8] * - (+3.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + - 5.58194400e-09 * T3 - 2.47495100e-12 * T4) * - 0.0357015351660121; - // species 9: CO2 - result += y[9] * - (+2.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + - 6.86668700e-09 * T3 - 2.11728000e-12 * T4) * - 0.0227226249176305; - // species 10: HCO - result += y[10] * - (+2.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + - 1.08982500e-08 * T3 - 4.57488500e-12 * T4) * - 0.0344613688055690; - // species 11: N2 - result += y[11] * - (+3.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + - 5.64151500e-09 * T3 - 2.44485500e-12 * T4) * - 0.0356964374955379; - } else { - // species 0: H2 - result += y[0] * - (+2.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - - 9.23157800e-12 * T3 + 1.58275200e-15 * T4) * - 0.4960317460317460; - // species 1: O2 - result += y[1] * - (+3.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + - 1.77528100e-11 * T3 - 1.13643500e-15 * T4) * - 0.0312519532470779; - // species 2: O - result += y[2] * - (+2.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + - 4.55106700e-12 * T3 - 4.36805200e-16 * T4) * - 0.0625039064941559; - // species 3: OH - result += y[3] * - (+2.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + - 3.05218674e-11 * T3 - 1.33195876e-15 * T4) * - 0.0587993179279120; - // species 4: H2O - result += y[4] * - (+2.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + - 1.20099600e-10 * T3 - 6.39161800e-15 * T4) * - 0.0555092978073827; - // species 6: HO2 - result += y[6] * - (+4.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + - 1.14246370e-10 * T3 - 1.07908535e-14 * T4) * - 0.0302975216627280; - // species 7: H2O2 - result += y[7] * - (+4.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + - 2.34890400e-10 * T3 - 1.43165400e-14 * T4) * - 0.0293996589639560; - // species 8: CO - result += y[8] * - (+3.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + - 1.01858100e-10 * T3 - 6.91095200e-15 * T4) * - 0.0357015351660121; - // species 9: CO2 - result += y[9] * - (+4.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + - 2.39399700e-10 * T3 - 1.66903300e-14 * T4) * - 0.0227226249176305; - // species 10: HCO - result += y[10] * - (+3.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + - 2.47057300e-10 * T3 - 1.71385100e-14 * T4) * - 0.0344613688055690; - // species 11: N2 - result += y[11] * - (+2.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + - 1.00970400e-10 * T3 - 6.75335100e-15 * T4) * - 0.0356964374955379; - } - - cpbs = result * 8.31446261815324e+07; -} - -// Returns the mean specific heat at CV (Eq. 35) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCVBL(const amrex::Real T, const amrex::Real x[], amrex::Real& cvbl) -{ - amrex::Real result = 0; - amrex::Real cvor[12]; // temporary storage - cv_R(cvor, T); - - // perform dot product - for (int id = 0; id < 12; ++id) { - result += x[id] * cvor[id]; - } - - cvbl = result * 8.31446261815324e+07; -} - -// Returns the mean specific heat at CV (Eq. 36) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCVBS(const amrex::Real T, const amrex::Real y[], amrex::Real& cvbs) -{ - amrex::Real result = 0.0; - // compute Cv/R at the given temperature - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - - // species with no change across T - // species 5: H - result += y[5] * (+1.50000000e+00) * 0.9920634920634921; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - result += y[0] * - (+2.29812400e+00 + 8.24944200e-04 * T - 8.14301500e-07 * T2 - - 9.47543400e-11 * T3 + 4.13487200e-13 * T4) * - 0.4960317460317460; - // species 1: O2 - result += y[1] * - (+2.21293600e+00 + 1.12748600e-03 * T - 5.75615000e-07 * T2 + - 1.31387700e-09 * T3 - 8.76855400e-13 * T4) * - 0.0312519532470779; - // species 2: O - result += y[2] * - (+1.94642900e+00 - 1.63816600e-03 * T + 2.42103200e-06 * T2 - - 1.60284300e-09 * T3 + 3.89069600e-13 * T4) * - 0.0625039064941559; - // species 3: OH - result += y[3] * - (+3.12530561e+00 - 3.22544939e-03 * T + 6.52764691e-06 * T2 - - 5.79853643e-09 * T3 + 2.06237379e-12 * T4) * - 0.0587993179279120; - // species 4: H2O - result += y[4] * - (+2.38684200e+00 + 3.47498200e-03 * T - 6.35469600e-06 * T2 + - 6.96858100e-09 * T3 - 2.50658800e-12 * T4) * - 0.0555092978073827; - // species 6: HO2 - result += y[6] * - (+3.30179801e+00 - 4.74912051e-03 * T + 2.11582891e-05 * T2 - - 2.42763894e-08 * T3 + 9.29225124e-12 * T4) * - 0.0302975216627280; - // species 7: H2O2 - result += y[7] * - (+2.38875400e+00 + 6.56922600e-03 * T - 1.48501300e-07 * T2 - - 4.62580600e-09 * T3 + 2.47151500e-12 * T4) * - 0.0293996589639560; - // species 8: CO - result += y[8] * - (+2.26245200e+00 + 1.51194100e-03 * T - 3.88175500e-06 * T2 + - 5.58194400e-09 * T3 - 2.47495100e-12 * T4) * - 0.0357015351660121; - // species 9: CO2 - result += y[9] * - (+1.27572500e+00 + 9.92207200e-03 * T - 1.04091100e-05 * T2 + - 6.86668700e-09 * T3 - 2.11728000e-12 * T4) * - 0.0227226249176305; - // species 10: HCO - result += y[10] * - (+1.89833000e+00 + 6.19914700e-03 * T - 9.62308400e-06 * T2 + - 1.08982500e-08 * T3 - 4.57488500e-12 * T4) * - 0.0344613688055690; - // species 11: N2 - result += y[11] * - (+2.29867700e+00 + 1.40824000e-03 * T - 3.96322200e-06 * T2 + - 5.64151500e-09 * T3 - 2.44485500e-12 * T4) * - 0.0356964374955379; - } else { - // species 0: H2 - result += y[0] * - (+1.99142300e+00 + 7.00064400e-04 * T - 5.63382900e-08 * T2 - - 9.23157800e-12 * T3 + 1.58275200e-15 * T4) * - 0.4960317460317460; - // species 1: O2 - result += y[1] * - (+2.69757800e+00 + 6.13519700e-04 * T - 1.25884200e-07 * T2 + - 1.77528100e-11 * T3 - 1.13643500e-15 * T4) * - 0.0312519532470779; - // species 2: O - result += y[2] * - (+1.54206000e+00 - 2.75506200e-05 * T - 3.10280300e-09 * T2 + - 4.55106700e-12 * T3 - 4.36805200e-16 * T4) * - 0.0625039064941559; - // species 3: OH - result += y[3] * - (+1.86472886e+00 + 1.05650448e-03 * T - 2.59082758e-07 * T2 + - 3.05218674e-11 * T3 - 1.33195876e-15 * T4) * - 0.0587993179279120; - // species 4: H2O - result += y[4] * - (+1.67214600e+00 + 3.05629300e-03 * T - 8.73026000e-07 * T2 + - 1.20099600e-10 * T3 - 6.39161800e-15 * T4) * - 0.0555092978073827; - // species 6: HO2 - result += y[6] * - (+3.01721090e+00 + 2.23982013e-03 * T - 6.33658150e-07 * T2 + - 1.14246370e-10 * T3 - 1.07908535e-14 * T4) * - 0.0302975216627280; - // species 7: H2O2 - result += y[7] * - (+3.57316700e+00 + 4.33613600e-03 * T - 1.47468900e-06 * T2 + - 2.34890400e-10 * T3 - 1.43165400e-14 * T4) * - 0.0293996589639560; - // species 8: CO - result += y[8] * - (+2.02507800e+00 + 1.44268900e-03 * T - 5.63082800e-07 * T2 + - 1.01858100e-10 * T3 - 6.91095200e-15 * T4) * - 0.0357015351660121; - // species 9: CO2 - result += y[9] * - (+3.45362300e+00 + 3.14016900e-03 * T - 1.27841100e-06 * T2 + - 2.39399700e-10 * T3 - 1.66903300e-14 * T4) * - 0.0227226249176305; - // species 10: HCO - result += y[10] * - (+2.55727100e+00 + 3.34557300e-03 * T - 1.33500600e-06 * T2 + - 2.47057300e-10 * T3 - 1.71385100e-14 * T4) * - 0.0344613688055690; - // species 11: N2 - result += y[11] * - (+1.92664000e+00 + 1.48797700e-03 * T - 5.68476100e-07 * T2 + - 1.00970400e-10 * T3 - 6.75335100e-15 * T4) * - 0.0356964374955379; - } - - cvbs = result * 8.31446261815324e+07; -} - -// Returns the mean enthalpy of the mixture in molar units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKHBML(const amrex::Real T, const amrex::Real x[], amrex::Real& hbml) -{ - amrex::Real result = 0; - amrex::Real hml[12]; // temporary storage - amrex::Real RT = 8.31446261815324e+07 * T; // R*T - speciesEnthalpy(hml, T); - - // perform dot product - for (int id = 0; id < 12; ++id) { - result += x[id] * hml[id]; - } - - hbml = result * RT; -} - -// Returns mean enthalpy of mixture in mass units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKHBMS(const amrex::Real T, const amrex::Real y[], amrex::Real& hbms) -{ - amrex::Real result = 0.0; - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real invT = 1.0 / T; - - // species with no change across T - // species 5: H - result += - y[5] * (+2.50000000e+00 + 2.54716300e+04 * invT) * 0.9920634920634921; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - result += - y[0] * - (+3.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - - 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - 1.01252100e+03 * invT) * - 0.4960317460317460; - // species 1: O2 - result += - y[1] * - (+3.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + - 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - 1.00524900e+03 * invT) * - 0.0312519532470779; - // species 2: O - result += - y[2] * - (+2.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - - 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + 2.91476400e+04 * invT) * - 0.0625039064941559; - // species 3: OH - result += - y[3] * - (+4.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - - 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + 3.34630913e+03 * invT) * - 0.0587993179279120; - // species 4: H2O - result += - y[4] * - (+3.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + - 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - 3.02081100e+04 * invT) * - 0.0555092978073827; - // species 6: HO2 - result += - y[6] * - (+4.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - - 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + 2.94808040e+02 * invT) * - 0.0302975216627280; - // species 7: H2O2 - result += - y[7] * - (+3.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - - 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - 1.76631500e+04 * invT) * - 0.0293996589639560; - // species 8: CO - result += - y[8] * - (+3.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + - 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - 1.43105400e+04 * invT) * - 0.0357015351660121; - // species 9: CO2 - result += - y[9] * - (+2.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + - 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - 4.83731400e+04 * invT) * - 0.0227226249176305; - // species 10: HCO - result += - y[10] * - (+2.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + - 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + 4.15992200e+03 * invT) * - 0.0344613688055690; - // species 11: N2 - result += - y[11] * - (+3.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + - 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - 1.02090000e+03 * invT) * - 0.0356964374955379; - } else { - // species 0: H2 - result += - y[0] * - (+2.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - - 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - 8.35034000e+02 * invT) * - 0.4960317460317460; - // species 1: O2 - result += - y[1] * - (+3.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + - 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - 1.23393000e+03 * invT) * - 0.0312519532470779; - // species 2: O - result += - y[2] * - (+2.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + - 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + 2.92308000e+04 * invT) * - 0.0625039064941559; - // species 3: OH - result += - y[3] * - (+2.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + - 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + 3.68362875e+03 * invT) * - 0.0587993179279120; - // species 4: H2O - result += - y[4] * - (+2.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + - 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - 2.98992100e+04 * invT) * - 0.0555092978073827; - // species 6: HO2 - result += - y[6] * - (+4.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + - 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + 1.11856713e+02 * invT) * - 0.0302975216627280; - // species 7: H2O2 - result += - y[7] * - (+4.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + - 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - 1.80069600e+04 * invT) * - 0.0293996589639560; - // species 8: CO - result += - y[8] * - (+3.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + - 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - 1.42683500e+04 * invT) * - 0.0357015351660121; - // species 9: CO2 - result += - y[9] * - (+4.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + - 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - 4.89669600e+04 * invT) * - 0.0227226249176305; - // species 10: HCO - result += - y[10] * - (+3.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + - 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + 3.91632400e+03 * invT) * - 0.0344613688055690; - // species 11: N2 - result += - y[11] * - (+2.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + - 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - 9.22797700e+02 * invT) * - 0.0356964374955379; - } - - const amrex::Real RT = 8.31446261815324e+07 * T; // R*T - - hbms = result * RT; -} - -// get mean internal energy in molar units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKUBML(const amrex::Real T, const amrex::Real x[], amrex::Real& ubml) -{ - amrex::Real result = 0; - amrex::Real uml[12]; // temporary energy array - amrex::Real RT = 8.31446261815324e+07 * T; // R*T - speciesInternalEnergy(uml, T); - - // perform dot product - for (int id = 0; id < 12; ++id) { - result += x[id] * uml[id]; - } - - ubml = result * RT; -} - -// get mean internal energy in mass units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKUBMS(const amrex::Real T, const amrex::Real y[], amrex::Real& ubms) -{ - amrex::Real result = 0.0; - const amrex::Real T2 = T * T; - const amrex::Real T3 = T * T * T; - const amrex::Real T4 = T * T * T * T; - const amrex::Real invT = 1.0 / T; - - // species with no change across T - // species 5: H - result += - y[5] * (+1.50000000e+00 + 2.54716300e+04 * invT) * 0.9920634920634921; - - // species with midpoint at T=1000 kelvin - if (T < 1000) { - // species 0: H2 - result += - y[0] * - (+2.29812400e+00 + 4.12472100e-04 * T - 2.71433833e-07 * T2 - - 2.36885850e-11 * T3 + 8.26974400e-14 * T4 - 1.01252100e+03 * invT) * - 0.4960317460317460; - // species 1: O2 - result += - y[1] * - (+2.21293600e+00 + 5.63743000e-04 * T - 1.91871667e-07 * T2 + - 3.28469250e-10 * T3 - 1.75371080e-13 * T4 - 1.00524900e+03 * invT) * - 0.0312519532470779; - // species 2: O - result += - y[2] * - (+1.94642900e+00 - 8.19083000e-04 * T + 8.07010667e-07 * T2 - - 4.00710750e-10 * T3 + 7.78139200e-14 * T4 + 2.91476400e+04 * invT) * - 0.0625039064941559; - // species 3: OH - result += - y[3] * - (+3.12530561e+00 - 1.61272470e-03 * T + 2.17588230e-06 * T2 - - 1.44963411e-09 * T3 + 4.12474758e-13 * T4 + 3.34630913e+03 * invT) * - 0.0587993179279120; - // species 4: H2O - result += - y[4] * - (+2.38684200e+00 + 1.73749100e-03 * T - 2.11823200e-06 * T2 + - 1.74214525e-09 * T3 - 5.01317600e-13 * T4 - 3.02081100e+04 * invT) * - 0.0555092978073827; - // species 6: HO2 - result += - y[6] * - (+3.30179801e+00 - 2.37456025e-03 * T + 7.05276303e-06 * T2 - - 6.06909735e-09 * T3 + 1.85845025e-12 * T4 + 2.94808040e+02 * invT) * - 0.0302975216627280; - // species 7: H2O2 - result += - y[7] * - (+2.38875400e+00 + 3.28461300e-03 * T - 4.95004333e-08 * T2 - - 1.15645150e-09 * T3 + 4.94303000e-13 * T4 - 1.76631500e+04 * invT) * - 0.0293996589639560; - // species 8: CO - result += - y[8] * - (+2.26245200e+00 + 7.55970500e-04 * T - 1.29391833e-06 * T2 + - 1.39548600e-09 * T3 - 4.94990200e-13 * T4 - 1.43105400e+04 * invT) * - 0.0357015351660121; - // species 9: CO2 - result += - y[9] * - (+1.27572500e+00 + 4.96103600e-03 * T - 3.46970333e-06 * T2 + - 1.71667175e-09 * T3 - 4.23456000e-13 * T4 - 4.83731400e+04 * invT) * - 0.0227226249176305; - // species 10: HCO - result += - y[10] * - (+1.89833000e+00 + 3.09957350e-03 * T - 3.20769467e-06 * T2 + - 2.72456250e-09 * T3 - 9.14977000e-13 * T4 + 4.15992200e+03 * invT) * - 0.0344613688055690; - // species 11: N2 - result += - y[11] * - (+2.29867700e+00 + 7.04120000e-04 * T - 1.32107400e-06 * T2 + - 1.41037875e-09 * T3 - 4.88971000e-13 * T4 - 1.02090000e+03 * invT) * - 0.0356964374955379; - } else { - // species 0: H2 - result += - y[0] * - (+1.99142300e+00 + 3.50032200e-04 * T - 1.87794300e-08 * T2 - - 2.30789450e-12 * T3 + 3.16550400e-16 * T4 - 8.35034000e+02 * invT) * - 0.4960317460317460; - // species 1: O2 - result += - y[1] * - (+2.69757800e+00 + 3.06759850e-04 * T - 4.19614000e-08 * T2 + - 4.43820250e-12 * T3 - 2.27287000e-16 * T4 - 1.23393000e+03 * invT) * - 0.0312519532470779; - // species 2: O - result += - y[2] * - (+1.54206000e+00 - 1.37753100e-05 * T - 1.03426767e-09 * T2 + - 1.13776675e-12 * T3 - 8.73610400e-17 * T4 + 2.92308000e+04 * invT) * - 0.0625039064941559; - // species 3: OH - result += - y[3] * - (+1.86472886e+00 + 5.28252240e-04 * T - 8.63609193e-08 * T2 + - 7.63046685e-12 * T3 - 2.66391752e-16 * T4 + 3.68362875e+03 * invT) * - 0.0587993179279120; - // species 4: H2O - result += - y[4] * - (+1.67214600e+00 + 1.52814650e-03 * T - 2.91008667e-07 * T2 + - 3.00249000e-11 * T3 - 1.27832360e-15 * T4 - 2.98992100e+04 * invT) * - 0.0555092978073827; - // species 6: HO2 - result += - y[6] * - (+3.01721090e+00 + 1.11991006e-03 * T - 2.11219383e-07 * T2 + - 2.85615925e-11 * T3 - 2.15817070e-15 * T4 + 1.11856713e+02 * invT) * - 0.0302975216627280; - // species 7: H2O2 - result += - y[7] * - (+3.57316700e+00 + 2.16806800e-03 * T - 4.91563000e-07 * T2 + - 5.87226000e-11 * T3 - 2.86330800e-15 * T4 - 1.80069600e+04 * invT) * - 0.0293996589639560; - // species 8: CO - result += - y[8] * - (+2.02507800e+00 + 7.21344500e-04 * T - 1.87694267e-07 * T2 + - 2.54645250e-11 * T3 - 1.38219040e-15 * T4 - 1.42683500e+04 * invT) * - 0.0357015351660121; - // species 9: CO2 - result += - y[9] * - (+3.45362300e+00 + 1.57008450e-03 * T - 4.26137000e-07 * T2 + - 5.98499250e-11 * T3 - 3.33806600e-15 * T4 - 4.89669600e+04 * invT) * - 0.0227226249176305; - // species 10: HCO - result += - y[10] * - (+2.55727100e+00 + 1.67278650e-03 * T - 4.45002000e-07 * T2 + - 6.17643250e-11 * T3 - 3.42770200e-15 * T4 + 3.91632400e+03 * invT) * - 0.0344613688055690; - // species 11: N2 - result += - y[11] * - (+1.92664000e+00 + 7.43988500e-04 * T - 1.89492033e-07 * T2 + - 2.52426000e-11 * T3 - 1.35067020e-15 * T4 - 9.22797700e+02 * invT) * - 0.0356964374955379; - } - - const amrex::Real RT = 8.31446261815324e+07 * T; // R*T - - ubms = result * RT; -} - -// get mixture entropy in molar units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKSBML( - const amrex::Real P, - const amrex::Real T, - const amrex::Real x[], - amrex::Real& sbml) -{ - amrex::Real result = 0; - // Log of normalized pressure in cgs units dynes/cm^2 by Patm - amrex::Real logPratio = log(P / 1013250.0); - amrex::Real sor[12]; // temporary storage - speciesEntropy(sor, T); - - // Compute Eq 42 - for (int id = 0; id < 12; ++id) { - result += x[id] * (sor[id] - log((x[id] + 1e-100)) - logPratio); - } - - sbml = result * 8.31446261815324e+07; -} - -// get mixture entropy in mass units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKSBMS( - const amrex::Real P, - const amrex::Real T, - const amrex::Real y[], - amrex::Real& sbms) -{ - amrex::Real result = 0; - // Log of normalized pressure in cgs units dynes/cm^2 by Patm - amrex::Real logPratio = log(P / 1013250.0); - amrex::Real sor[12]; // temporary storage - amrex::Real x[12]; // need a ytx conversion - amrex::Real YOW = 0; // See Eq 4, 6 in CK Manual - - // Compute inverse of mean molecular wt first - for (int i = 0; i < 12; i++) { - YOW += y[i] * imw(i); - } - // Now compute y to x conversion - x[0] = y[0] / (2.016000 * YOW); - x[1] = y[1] / (31.998000 * YOW); - x[2] = y[2] / (15.999000 * YOW); - x[3] = y[3] / (17.007000 * YOW); - x[4] = y[4] / (18.015000 * YOW); - x[5] = y[5] / (1.008000 * YOW); - x[6] = y[6] / (33.006000 * YOW); - x[7] = y[7] / (34.014000 * YOW); - x[8] = y[8] / (28.010000 * YOW); - x[9] = y[9] / (44.009000 * YOW); - x[10] = y[10] / (29.018000 * YOW); - x[11] = y[11] / (28.014000 * YOW); - speciesEntropy(sor, T); - // Perform computation in Eq 42 and 43 - for (int i = 0; i < 12; i++) { - result += x[i] * (sor[i] - log((x[i] + 1e-100)) - logPratio); - } - // Scale by R/W - sbms = result * 8.31446261815324e+07 * YOW; -} - -// get temperature given internal energy in mass units and mass fracs -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -GET_T_GIVEN_EY( - const amrex::Real e, const amrex::Real y[], amrex::Real& t, int& ierr) -{ -#ifdef CONVERGENCE - const int maxiter = 5000; - const amrex::Real tol = 1.e-12; -#else - const int maxiter = 200; - const amrex::Real tol = 1.e-6; -#endif - amrex::Real tmin = 90; // max lower bound for thermo def - amrex::Real tmax = 4000; // min upper bound for thermo def - amrex::Real e1, emin, emax, cv, t1, dt; - CKUBMS(tmin, y, emin); - CKUBMS(tmax, y, emax); - if (e < emin) { - // Linear Extrapolation below tmin - CKCVBS(tmin, y, cv); - t = tmin - (emin - e) / cv; - ierr = 1; - return; - } - if (e > emax) { - // Linear Extrapolation above tmax - CKCVBS(tmax, y, cv); - t = tmax - (emax - e) / cv; - ierr = 1; - return; - } - t1 = t; - if (t1 < tmin || t1 > tmax) { - t1 = tmin + (tmax - tmin) / (emax - emin) * (e - emin); - } - for (int i = 0; i < maxiter; ++i) { - CKUBMS(t1, y, e1); - CKCVBS(t1, y, cv); - dt = (e - e1) / cv; - if (dt > 100.) { - dt = 100.; - } else if (dt < -100.) { - dt = -100.; - } else if (fabs(dt) < tol) { - break; - } - t1 += dt; - } - t = t1; - ierr = 0; -} - -// get temperature given enthalpy in mass units and mass fracs -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -GET_T_GIVEN_HY( - const amrex::Real h, const amrex::Real y[], amrex::Real& t, int& ierr) -{ -#ifdef CONVERGENCE - const int maxiter = 5000; - const amrex::Real tol = 1.e-12; -#else - const int maxiter = 200; - const amrex::Real tol = 1.e-6; -#endif - amrex::Real tmin = 90; // max lower bound for thermo def - amrex::Real tmax = 4000; // min upper bound for thermo def - amrex::Real h1, hmin, hmax, cp, t1, dt; - CKHBMS(tmin, y, hmin); - CKHBMS(tmax, y, hmax); - if (h < hmin) { - // Linear Extrapolation below tmin - CKCPBS(tmin, y, cp); - t = tmin - (hmin - h) / cp; - ierr = 1; - return; - } - if (h > hmax) { - // Linear Extrapolation above tmax - CKCPBS(tmax, y, cp); - t = tmax - (hmax - h) / cp; - ierr = 1; - return; - } - t1 = t; - if (t1 < tmin || t1 > tmax) { - t1 = tmin + (tmax - tmin) / (hmax - hmin) * (h - hmin); - } - for (int i = 0; i < maxiter; ++i) { - CKHBMS(t1, y, h1); - CKCPBS(t1, y, cp); - dt = (h - h1) / cp; - if (dt > 100.) { - dt = 100.; - } else if (dt < -100.) { - dt = -100.; - } else if (fabs(dt) < tol) { - break; - } - t1 += dt; - } - t = t1; - ierr = 0; -} - -// Compute P = rhoRT/W(x) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKPX( - const amrex::Real rho, - const amrex::Real T, - const amrex::Real x[], - amrex::Real& P) -{ - amrex::Real XW = 0; // To hold mean molecular wt - XW += x[0] * 2.016000; // H2 - XW += x[1] * 31.998000; // O2 - XW += x[2] * 15.999000; // O - XW += x[3] * 17.007000; // OH - XW += x[4] * 18.015000; // H2O - XW += x[5] * 1.008000; // H - XW += x[6] * 33.006000; // HO2 - XW += x[7] * 34.014000; // H2O2 - XW += x[8] * 28.010000; // CO - XW += x[9] * 44.009000; // CO2 - XW += x[10] * 29.018000; // HCO - XW += x[11] * 28.014000; // N2 - P = rho * 8.31446261815324e+07 * T / XW; // P = rho*R*T/W -} - -// Compute P = rhoRT/W(y) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKPY( - const amrex::Real rho, - const amrex::Real T, - const amrex::Real y[], - amrex::Real& P) -{ - amrex::Real YOW = 0; // for computing mean MW - - for (int i = 0; i < 12; i++) { - YOW += y[i] * imw(i); - } - P = rho * 8.31446261815324e+07 * T * YOW; // P = rho*R*T/W -} - -// Compute P = rhoRT/W(c) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKPC( - const amrex::Real rho, - const amrex::Real T, - const amrex::Real c[], - amrex::Real& P) -{ - // See Eq 5 in CK Manual - amrex::Real W = 0; - amrex::Real sumC = 0; - W += c[0] * 2.016000; // H2 - W += c[1] * 31.998000; // O2 - W += c[2] * 15.999000; // O - W += c[3] * 17.007000; // OH - W += c[4] * 18.015000; // H2O - W += c[5] * 1.008000; // H - W += c[6] * 33.006000; // HO2 - W += c[7] * 34.014000; // H2O2 - W += c[8] * 28.010000; // CO - W += c[9] * 44.009000; // CO2 - W += c[10] * 29.018000; // HCO - W += c[11] * 28.014000; // N2 - - for (int id = 0; id < 12; ++id) { - sumC += c[id]; - } - P = rho * 8.31446261815324e+07 * T * sumC / W; // P = rho*R*T/W -} - -// Compute rho = PW(x)/RT -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKRHOX( - const amrex::Real P, - const amrex::Real T, - const amrex::Real x[], - amrex::Real& rho) -{ - amrex::Real XW = 0; // To hold mean molecular wt - XW += x[0] * 2.016000; // H2 - XW += x[1] * 31.998000; // O2 - XW += x[2] * 15.999000; // O - XW += x[3] * 17.007000; // OH - XW += x[4] * 18.015000; // H2O - XW += x[5] * 1.008000; // H - XW += x[6] * 33.006000; // HO2 - XW += x[7] * 34.014000; // H2O2 - XW += x[8] * 28.010000; // CO - XW += x[9] * 44.009000; // CO2 - XW += x[10] * 29.018000; // HCO - XW += x[11] * 28.014000; // N2 - rho = P * XW / (8.31446261815324e+07 * T); // rho = P*W/(R*T) -} - -// Compute rho = P*W(y)/RT -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKRHOY( - const amrex::Real P, - const amrex::Real T, - const amrex::Real y[], - amrex::Real& rho) -{ - amrex::Real YOW = 0; - - for (int i = 0; i < 12; i++) { - YOW += y[i] * imw(i); - } - - rho = P / (8.31446261815324e+07 * T * YOW); // rho = P*W/(R*T) -} - -// Compute rho = P*W(c)/(R*T) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKRHOC( - const amrex::Real P, - const amrex::Real T, - const amrex::Real c[], - amrex::Real& rho) -{ - // See Eq 5 in CK Manual - amrex::Real W = 0; - amrex::Real sumC = 0; - W += c[0] * 2.016000; // H2 - W += c[1] * 31.998000; // O2 - W += c[2] * 15.999000; // O - W += c[3] * 17.007000; // OH - W += c[4] * 18.015000; // H2O - W += c[5] * 1.008000; // H - W += c[6] * 33.006000; // HO2 - W += c[7] * 34.014000; // H2O2 - W += c[8] * 28.010000; // CO - W += c[9] * 44.009000; // CO2 - W += c[10] * 29.018000; // HCO - W += c[11] * 28.014000; // N2 - - for (int id = 0; id < 12; ++id) { - sumC += c[id]; - } - rho = P * W / (sumC * T * 8.31446261815324e+07); // rho = PW/(R*T) -} - -// get molecular weight for all species -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKWT(amrex::Real wt[]) -{ - get_mw(wt); -} - -// given y[species]: mass fractions -// s mean molecular weight (gm/mole) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKMMWY(const amrex::Real y[], amrex::Real& wtm) -{ - amrex::Real YOW = 0; - - for (int i = 0; i < 12; i++) { - YOW += y[i] * imw(i); - } - - wtm = 1.0 / YOW; -} - -// given x[species]: mole fractions -// returns mean molecular weight (gm/mole) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKMMWX(const amrex::Real x[], amrex::Real& wtm) -{ - amrex::Real XW = 0; // see Eq 4 in CK Manual - XW += x[0] * 2.016000; // H2 - XW += x[1] * 31.998000; // O2 - XW += x[2] * 15.999000; // O - XW += x[3] * 17.007000; // OH - XW += x[4] * 18.015000; // H2O - XW += x[5] * 1.008000; // H - XW += x[6] * 33.006000; // HO2 - XW += x[7] * 34.014000; // H2O2 - XW += x[8] * 28.010000; // CO - XW += x[9] * 44.009000; // CO2 - XW += x[10] * 29.018000; // HCO - XW += x[11] * 28.014000; // N2 - wtm = XW; -} - -// given c[species]: molar concentration -// returns mean molecular weight (gm/mole) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKMMWC(const amrex::Real c[], amrex::Real& wtm) -{ - // See Eq 5 in CK Manual - amrex::Real W = 0; - amrex::Real sumC = 0; - W += c[0] * 2.016000; // H2 - W += c[1] * 31.998000; // O2 - W += c[2] * 15.999000; // O - W += c[3] * 17.007000; // OH - W += c[4] * 18.015000; // H2O - W += c[5] * 1.008000; // H - W += c[6] * 33.006000; // HO2 - W += c[7] * 34.014000; // H2O2 - W += c[8] * 28.010000; // CO - W += c[9] * 44.009000; // CO2 - W += c[10] * 29.018000; // HCO - W += c[11] * 28.014000; // N2 - - for (int id = 0; id < 12; ++id) { - sumC += c[id]; - } - // CK provides no guard against division by zero - wtm = W / sumC; -} - -// get Cp/R as a function of T -// for all species (Eq 19) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCPOR(const amrex::Real T, amrex::Real cpor[]) -{ - cp_R(cpor, T); -} - -// get H/RT as a function of T -// for all species (Eq 20) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKHORT(const amrex::Real T, amrex::Real hort[]) -{ - speciesEnthalpy(hort, T); -} - -// get S/R as a function of T -// for all species (Eq 21) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKSOR(const amrex::Real T, amrex::Real sor[]) -{ - speciesEntropy(sor, T); -} - -// convert y[species] (mass fracs) to x[species] (mole fracs) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKYTX(const amrex::Real y[], amrex::Real x[]) -{ - amrex::Real YOW = 0; - - for (int i = 0; i < 12; i++) { - YOW += y[i] * imw(i); - } - - amrex::Real YOWINV = 1.0 / YOW; - - for (int i = 0; i < 12; i++) { - x[i] = y[i] * imw(i) * YOWINV; - } -} - -// convert y[species] (mass fracs) to c[species] (molar conc) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKYTCP( - const amrex::Real P, - const amrex::Real T, - const amrex::Real y[], - amrex::Real c[]) -{ - amrex::Real YOW = 0; - amrex::Real PWORT; - - // Compute inverse of mean molecular wt first - for (int i = 0; i < 12; i++) { - c[i] = y[i] * imw(i); - } - for (int i = 0; i < 12; i++) { - YOW += c[i]; - } - - // PW/RT (see Eq. 7) - PWORT = P / (YOW * 8.31446261815324e+07 * T); - // Now compute conversion - - for (int i = 0; i < 12; i++) { - c[i] = PWORT * y[i] * imw(i); - } -} - -// convert y[species] (mass fracs) to c[species] (molar conc) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKYTCR( - const amrex::Real rho, - amrex::Real /*T*/, - const amrex::Real y[], - amrex::Real c[]) -{ - - for (int i = 0; i < 12; i++) { - c[i] = rho * y[i] * imw(i); - } -} - -// convert x[species] (mole fracs) to y[species] (mass fracs) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKXTY(const amrex::Real x[], amrex::Real y[]) -{ - amrex::Real XW = 0; // See Eq 4, 9 in CK Manual - // Compute mean molecular wt first - XW += x[0] * 2.016000; // H2 - XW += x[1] * 31.998000; // O2 - XW += x[2] * 15.999000; // O - XW += x[3] * 17.007000; // OH - XW += x[4] * 18.015000; // H2O - XW += x[5] * 1.008000; // H - XW += x[6] * 33.006000; // HO2 - XW += x[7] * 34.014000; // H2O2 - XW += x[8] * 28.010000; // CO - XW += x[9] * 44.009000; // CO2 - XW += x[10] * 29.018000; // HCO - XW += x[11] * 28.014000; // N2 - // Now compute conversion - amrex::Real XWinv = 1.0 / XW; - y[0] = x[0] * 2.016000 * XWinv; - y[1] = x[1] * 31.998000 * XWinv; - y[2] = x[2] * 15.999000 * XWinv; - y[3] = x[3] * 17.007000 * XWinv; - y[4] = x[4] * 18.015000 * XWinv; - y[5] = x[5] * 1.008000 * XWinv; - y[6] = x[6] * 33.006000 * XWinv; - y[7] = x[7] * 34.014000 * XWinv; - y[8] = x[8] * 28.010000 * XWinv; - y[9] = x[9] * 44.009000 * XWinv; - y[10] = x[10] * 29.018000 * XWinv; - y[11] = x[11] * 28.014000 * XWinv; -} - -// convert x[species] (mole fracs) to c[species] (molar conc) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKXTCP( - const amrex::Real P, - const amrex::Real T, - const amrex::Real x[], - amrex::Real c[]) -{ - amrex::Real PORT = P / (8.31446261815324e+07 * T); // P/RT - - // Compute conversion, see Eq 10 - for (int id = 0; id < 12; ++id) { - c[id] = x[id] * PORT; - } -} - -// convert x[species] (mole fracs) to c[species] (molar conc) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKXTCR( - const amrex::Real rho, - const amrex::Real /*T*/, - const amrex::Real x[], - amrex::Real c[]) -{ - amrex::Real XW = 0; // See Eq 4, 11 in CK Manual - amrex::Real ROW; - // Compute mean molecular wt first - XW += x[0] * 2.016000; // H2 - XW += x[1] * 31.998000; // O2 - XW += x[2] * 15.999000; // O - XW += x[3] * 17.007000; // OH - XW += x[4] * 18.015000; // H2O - XW += x[5] * 1.008000; // H - XW += x[6] * 33.006000; // HO2 - XW += x[7] * 34.014000; // H2O2 - XW += x[8] * 28.010000; // CO - XW += x[9] * 44.009000; // CO2 - XW += x[10] * 29.018000; // HCO - XW += x[11] * 28.014000; // N2 - ROW = rho / XW; - - // Compute conversion, see Eq 11 - for (int id = 0; id < 12; ++id) { - c[id] = x[id] * ROW; - } -} - -// convert c[species] (molar conc) to x[species] (mole fracs) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCTX(const amrex::Real c[], amrex::Real x[]) -{ - amrex::Real sumC = 0; - - // compute sum of c - for (int id = 0; id < 12; ++id) { - sumC += c[id]; - } - - // See Eq 13 - amrex::Real sumCinv = 1.0 / sumC; - for (int id = 0; id < 12; ++id) { - x[id] = c[id] * sumCinv; - } -} - -// convert c[species] (molar conc) to y[species] (mass fracs) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCTY(const amrex::Real c[], amrex::Real y[]) -{ - amrex::Real CW = 0; // See Eq 12 in CK Manual - // compute denominator in eq 12 first - CW += c[0] * 2.016000; // H2 - CW += c[1] * 31.998000; // O2 - CW += c[2] * 15.999000; // O - CW += c[3] * 17.007000; // OH - CW += c[4] * 18.015000; // H2O - CW += c[5] * 1.008000; // H - CW += c[6] * 33.006000; // HO2 - CW += c[7] * 34.014000; // H2O2 - CW += c[8] * 28.010000; // CO - CW += c[9] * 44.009000; // CO2 - CW += c[10] * 29.018000; // HCO - CW += c[11] * 28.014000; // N2 - // Now compute conversion - amrex::Real CWinv = 1.0 / CW; - y[0] = c[0] * 2.016000 * CWinv; - y[1] = c[1] * 31.998000 * CWinv; - y[2] = c[2] * 15.999000 * CWinv; - y[3] = c[3] * 17.007000 * CWinv; - y[4] = c[4] * 18.015000 * CWinv; - y[5] = c[5] * 1.008000 * CWinv; - y[6] = c[6] * 33.006000 * CWinv; - y[7] = c[7] * 34.014000 * CWinv; - y[8] = c[8] * 28.010000 * CWinv; - y[9] = c[9] * 44.009000 * CWinv; - y[10] = c[10] * 29.018000 * CWinv; - y[11] = c[11] * 28.014000 * CWinv; -} - -// get specific heat at constant volume as a function -// of T for all species (molar units) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCVML(const amrex::Real T, amrex::Real cvml[]) -{ - cv_R(cvml, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - cvml[id] *= 8.31446261815324e+07; - } -} - -// get specific heat at constant pressure as a -// function of T for all species (molar units) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCPML(const amrex::Real T, amrex::Real cpml[]) -{ - cp_R(cpml, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - cpml[id] *= 8.31446261815324e+07; - } -} - -// get internal energy as a function -// of T for all species (molar units) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKUML(const amrex::Real T, amrex::Real uml[]) -{ - amrex::Real RT = 8.31446261815324e+07 * T; // R*T - speciesInternalEnergy(uml, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - uml[id] *= RT; - } -} - -// get enthalpy as a function -// of T for all species (molar units) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKHML(const amrex::Real T, amrex::Real hml[]) -{ - amrex::Real RT = 8.31446261815324e+07 * T; // R*T - speciesEnthalpy(hml, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - hml[id] *= RT; - } -} - -// Returns the standard-state entropies in molar units -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKSML(const amrex::Real T, amrex::Real sml[]) -{ - speciesEntropy(sml, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - sml[id] *= 8.31446261815324e+07; - } -} - -// Returns the specific heats at constant volume -// in mass units (Eq. 29) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCVMS(const amrex::Real T, amrex::Real cvms[]) -{ - cv_R(cvms, T); - // multiply by R/molecularweight - cvms[0] *= 4.124237409798234e+07; // H2 - cvms[1] *= 2.598431970171023e+06; // O2 - cvms[2] *= 5.196863940342046e+06; // O - cvms[3] *= 4.888847308845322e+06; // OH - cvms[4] *= 4.615299815794193e+06; // H2O - cvms[5] *= 8.248474819596468e+07; // H - cvms[6] *= 2.519076112874398e+06; // HO2 - cvms[7] *= 2.444423654422661e+06; // H2O2 - cvms[8] *= 2.968390795484913e+06; // CO - cvms[9] *= 1.889264154639560e+06; // CO2 - cvms[10] *= 2.865277627042952e+06; // HCO - cvms[11] *= 2.967966951578939e+06; // N2 -} - -// Returns the specific heats at constant pressure -// in mass units (Eq. 26) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCPMS(const amrex::Real T, amrex::Real cpms[]) -{ - cp_R(cpms, T); - // multiply by R/molecularweight - cpms[0] *= 4.124237409798234e+07; // H2 - cpms[1] *= 2.598431970171023e+06; // O2 - cpms[2] *= 5.196863940342046e+06; // O - cpms[3] *= 4.888847308845322e+06; // OH - cpms[4] *= 4.615299815794193e+06; // H2O - cpms[5] *= 8.248474819596468e+07; // H - cpms[6] *= 2.519076112874398e+06; // HO2 - cpms[7] *= 2.444423654422661e+06; // H2O2 - cpms[8] *= 2.968390795484913e+06; // CO - cpms[9] *= 1.889264154639560e+06; // CO2 - cpms[10] *= 2.865277627042952e+06; // HCO - cpms[11] *= 2.967966951578939e+06; // N2 -} - -// Returns internal energy in mass units (Eq 30.) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKUMS(const amrex::Real T, amrex::Real ums[]) -{ - amrex::Real RT = 8.31446261815324e+07 * T; // R*T - - speciesInternalEnergy(ums, T); - - for (int i = 0; i < 12; i++) { - ums[i] *= RT * imw(i); - } -} - -// Returns enthalpy in mass units (Eq 27.) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKHMS(const amrex::Real T, amrex::Real hms[]) -{ - amrex::Real RT = 8.31446261815324e+07 * T; // R*T - - speciesEnthalpy(hms, T); - - for (int i = 0; i < 12; i++) { - hms[i] *= RT * imw(i); - } -} - -// Returns the entropies in mass units (Eq 28.) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKSMS(const amrex::Real T, amrex::Real sms[]) -{ - speciesEntropy(sms, T); - // multiply by R/molecularweight - sms[0] *= 4.124237409798234e+07; // H2 - sms[1] *= 2.598431970171023e+06; // O2 - sms[2] *= 5.196863940342046e+06; // O - sms[3] *= 4.888847308845322e+06; // OH - sms[4] *= 4.615299815794193e+06; // H2O - sms[5] *= 8.248474819596468e+07; // H - sms[6] *= 2.519076112874398e+06; // HO2 - sms[7] *= 2.444423654422661e+06; // H2O2 - sms[8] *= 2.968390795484913e+06; // CO - sms[9] *= 1.889264154639560e+06; // CO2 - sms[10] *= 2.865277627042952e+06; // HCO - sms[11] *= 2.967966951578939e+06; // N2 -} - -// GPU version of productionRate: no more use of thermo namespace vectors -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -comp_qfqr( - amrex::Real* qf, - amrex::Real* qr, - const amrex::Real* sc, - const amrex::Real* /*sc_qss*/, - const amrex::Real T, - const amrex::Real invT, - const amrex::Real logT) -{ - - // reaction 8: H + O2 (+M) <=> HO2 (+M) - qf[0] = sc[1] * sc[5]; - qr[0] = sc[6]; - - // reaction 15: H2O2 (+M) <=> 2 OH (+M) - qf[1] = sc[7]; - qr[1] = (sc[3] * sc[3]); - - // reaction 21: CO + O (+M) <=> CO2 (+M) - qf[2] = sc[2] * sc[8]; - qr[2] = sc[9]; - - // reaction 4: H2 + M <=> 2 H + M - qf[3] = sc[0]; - qr[3] = (sc[5] * sc[5]); - - // reaction 5: 2 O + M <=> O2 + M - qf[4] = (sc[2] * sc[2]); - qr[4] = sc[1]; - - // reaction 6: H + O + M <=> OH + M - qf[5] = sc[2] * sc[5]; - qr[5] = sc[3]; - - // reaction 7: H + OH + M <=> H2O + M - qf[6] = sc[3] * sc[5]; - qr[6] = sc[4]; - - // reaction 25: HCO + M <=> CO + H + M - qf[7] = sc[10]; - qr[7] = sc[5] * sc[8]; - - // reaction 0: H + O2 <=> O + OH - qf[8] = sc[1] * sc[5]; - qr[8] = sc[2] * sc[3]; - - // reaction 1: H2 + O <=> H + OH - qf[9] = sc[0] * sc[2]; - qr[9] = sc[3] * sc[5]; - - // reaction 2: H2 + OH <=> H + H2O - qf[10] = sc[0] * sc[3]; - qr[10] = sc[4] * sc[5]; - - // reaction 3: H2O + O <=> 2 OH - qf[11] = sc[2] * sc[4]; - qr[11] = (sc[3] * sc[3]); - - // reaction 9: H + HO2 <=> H2 + O2 - qf[12] = sc[5] * sc[6]; - qr[12] = sc[0] * sc[1]; - - // reaction 10: H + HO2 <=> 2 OH - qf[13] = sc[5] * sc[6]; - qr[13] = (sc[3] * sc[3]); - - // reaction 11: HO2 + O <=> O2 + OH - qf[14] = sc[2] * sc[6]; - qr[14] = sc[1] * sc[3]; - - // reaction 12: HO2 + OH <=> H2O + O2 - qf[15] = sc[3] * sc[6]; - qr[15] = sc[1] * sc[4]; - - // reaction 13: 2 HO2 <=> H2O2 + O2 - qf[16] = (sc[6] * sc[6]); - qr[16] = sc[1] * sc[7]; - - // reaction 14: 2 HO2 <=> H2O2 + O2 - qf[17] = (sc[6] * sc[6]); - qr[17] = sc[1] * sc[7]; - - // reaction 16: H + H2O2 <=> H2O + OH - qf[18] = sc[5] * sc[7]; - qr[18] = sc[3] * sc[4]; - - // reaction 17: H + H2O2 <=> H2 + HO2 - qf[19] = sc[5] * sc[7]; - qr[19] = sc[0] * sc[6]; - - // reaction 18: H2O2 + O <=> HO2 + OH - qf[20] = sc[2] * sc[7]; - qr[20] = sc[3] * sc[6]; - - // reaction 19: H2O2 + OH <=> H2O + HO2 - qf[21] = sc[3] * sc[7]; - qr[21] = sc[4] * sc[6]; - - // reaction 20: H2O2 + OH <=> H2O + HO2 - qf[22] = sc[3] * sc[7]; - qr[22] = sc[4] * sc[6]; - - // reaction 22: CO + O2 <=> CO2 + O - qf[23] = sc[1] * sc[8]; - qr[23] = sc[2] * sc[9]; - - // reaction 23: CO + HO2 <=> CO2 + OH - qf[24] = sc[6] * sc[8]; - qr[24] = sc[3] * sc[9]; - - // reaction 24: CO + OH <=> CO2 + H - qf[25] = sc[3] * sc[8]; - qr[25] = sc[5] * sc[9]; - - // reaction 26: HCO + O2 <=> CO + HO2 - qf[26] = sc[1] * sc[10]; - qr[26] = sc[6] * sc[8]; - - // reaction 27: H + HCO <=> CO + H2 - qf[27] = sc[5] * sc[10]; - qr[27] = sc[0] * sc[8]; - - // reaction 28: HCO + O <=> CO2 + H - qf[28] = sc[2] * sc[10]; - qr[28] = sc[5] * sc[9]; - - // compute the mixture concentration - amrex::Real mixture = 0.0; - for (int i = 0; i < 12; ++i) { - mixture += sc[i]; - } - - // compute the Gibbs free energy - amrex::Real g_RT[12]; - gibbs(g_RT, T); - - // reference concentration: P_atm / (RT) in inverse mol/m^3 - amrex::Real refC = 101325 / 8.31446 * invT; - amrex::Real refCinv = 1 / refC; - - // Evaluate the kfs - amrex::Real k_f, Corr; - amrex::Real redP, F, logPred, logFcent, troe_c, troe_n, troe, F_troe; - - // reaction 0: H + O2 <=> O + OH - k_f = 3547000000 * exp((-0.406) * logT - (8352.89343569254) * invT); - qf[8] *= k_f; - qr[8] *= k_f * exp(-(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5])); - // reaction 1: H2 + O <=> H + OH - k_f = 0.0508 * exp((2.67) * logT - (3165.23282791169) * invT); - qf[9] *= k_f; - qr[9] *= k_f * exp(-(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5])); - // reaction 2: H2 + OH <=> H + H2O - k_f = 216 * exp((1.51) * logT - (1726.03316371019) * invT); - qf[10] *= k_f; - qr[10] *= k_f * exp(-(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5])); - // reaction 3: H2O + O <=> 2 OH - k_f = 2.97 * exp((2.02) * logT - (6743.10332178324) * invT); - qf[11] *= k_f; - qr[11] *= k_f * exp(-(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4])); - // reaction 4: H2 + M <=> 2 H + M - k_f = 45770000000000 * exp((-1.4) * logT - (52525.7555766966) * invT); - Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - qf[3] *= Corr * k_f; - qr[3] *= Corr * k_f * exp(-(g_RT[0] - 2.000000 * g_RT[5])) * (refCinv); - // reaction 5: 2 O + M <=> O2 + M - k_f = 6165 * exp((-0.5) * logT); - Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - qf[4] *= Corr * k_f; - qr[4] *= Corr * k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[2])) * (refC); - // reaction 6: H + O + M <=> OH + M - k_f = 4714000 * exp((-1) * logT); - Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - qf[5] *= Corr * k_f; - qr[5] *= Corr * k_f * exp(-(g_RT[2] - g_RT[3] + g_RT[5])) * (refC); - // reaction 7: H + OH + M <=> H2O + M - k_f = 38000000000 * exp((-2) * logT); - Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - qf[6] *= Corr * k_f; - qr[6] *= Corr * k_f * exp(-(g_RT[3] - g_RT[4] + g_RT[5])) * (refC); - // reaction 8: H + O2 (+M) <=> HO2 (+M) - k_f = 1475000 * exp((0.6) * logT); - Corr = mixture + sc[0] + (-0.22) * sc[1] + (10) * sc[4] + (0.9) * sc[8] + - (2.8) * sc[9]; - redP = Corr / k_f * 636600000 * exp(-1.72 * logT - (264.088106214317) * invT); - F = redP / (1.0 + redP); - logPred = log10(redP); - logFcent = log10((0.2) * exp(-T * 1e+30) + 0.8 * exp(-T * 1e-30) + 0.0); - troe_c = -0.4 - 0.67 * logFcent; - troe_n = 0.75 - 1.27 * logFcent; - troe = (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); - F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); - Corr = F * F_troe; - qf[0] *= Corr * k_f; - qr[0] *= Corr * k_f * exp(-(g_RT[1] + g_RT[5] - g_RT[6])) * (refC); - // reaction 9: H + HO2 <=> H2 + O2 - k_f = 16600000 * exp(-(414.147315957284) * invT); - qf[12] *= k_f; - qr[12] *= k_f * exp(-(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6])); - // reaction 10: H + HO2 <=> 2 OH - k_f = 70790000 * exp(-(148.448916412392) * invT); - qf[13] *= k_f; - qr[13] *= k_f * exp(-(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6])); - // reaction 11: HO2 + O <=> O2 + OH - k_f = 32500000; - qf[14] *= k_f; - qr[14] *= k_f * exp(-(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6])); - // reaction 12: HO2 + OH <=> H2O + O2 - k_f = 28900000 * exp(-(-250.098682904946) * invT); - qf[15] *= k_f; - qr[15] *= k_f * exp(-(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6])); - // reaction 13: 2 HO2 <=> H2O2 + O2 - k_f = 420000000 * exp(-(6029.54208967215) * invT); - qf[16] *= k_f; - qr[16] *= k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])); - // reaction 14: 2 HO2 <=> H2O2 + O2 - k_f = 130000 * exp(-(-819.89091359563) * invT); - qf[17] *= k_f; - qr[17] *= k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])); - // reaction 15: H2O2 (+M) <=> 2 OH (+M) - k_f = 295100000000000 * exp(-(24370.7831249226) * invT); - Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - redP = Corr / k_f * 120200000000 * exp(-(22896.3582941147) * invT); - F = redP / (1.0 + redP); - logPred = log10(redP); - logFcent = log10((0.5) * exp(-T * 1e+30) + 0.5 * exp(-T * 1e-30) + 0.0); - troe_c = -0.4 - 0.67 * logFcent; - troe_n = 0.75 - 1.27 * logFcent; - troe = (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); - F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); - Corr = F * F_troe; - qf[1] *= Corr * k_f; - qr[1] *= Corr * k_f * exp(-(-2.000000 * g_RT[3] + g_RT[7])) * (refCinv); - // reaction 16: H + H2O2 <=> H2O + OH - k_f = 24100000 * exp(-(1997.77016324474) * invT); - qf[18] *= k_f; - qr[18] *= k_f * exp(-(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7])); - // reaction 17: H + H2O2 <=> H2 + HO2 - k_f = 48200000 * exp(-(4000.57249314752) * invT); - qf[19] *= k_f; - qr[19] *= k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7])); - // reaction 18: H2O2 + O <=> HO2 + OH - k_f = 9.55 * exp((2) * logT - (1997.77016324474) * invT); - qf[20] *= k_f; - qr[20] *= k_f * exp(-(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7])); - // reaction 19: H2O2 + OH <=> H2O + HO2 - k_f = 1000000; - qf[21] *= k_f; - qr[21] *= k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])); - // reaction 20: H2O2 + OH <=> H2O + HO2 - k_f = 580000000 * exp(-(4809.24167509571) * invT); - qf[22] *= k_f; - qr[22] *= k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])); - // reaction 21: CO + O (+M) <=> CO2 (+M) - k_f = 18000 * exp(-(1199.66853127845) * invT); - Corr = mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - redP = - Corr / k_f * 1550000000000 * exp(-2.79 * logT - (2108.98104638758) * invT); - Corr = redP / (1. + redP); - qf[2] *= Corr * k_f; - qr[2] *= Corr * k_f * exp(-(g_RT[2] + g_RT[8] - g_RT[9])) * (refC); - // reaction 22: CO + O2 <=> CO2 + O - k_f = 2530000 * exp(-(24003.4349588851) * invT); - qf[23] *= k_f; - qr[23] *= k_f * exp(-(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9])); - // reaction 23: CO + HO2 <=> CO2 + OH - k_f = 30100000 * exp(-(11573.9833135086) * invT); - qf[24] *= k_f; - qr[24] *= k_f * exp(-(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9])); - // reaction 24: CO + OH <=> CO2 + H - k_f = 0.2229 * exp((1.89) * logT - (-583.077150667929) * invT); - qf[25] *= k_f; - qr[25] *= k_f * exp(-(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9])); - // reaction 25: HCO + M <=> CO + H + M - k_f = 474850 * exp((0.659) * logT - (7484.8446871794) * invT); - Corr = mixture + (1.5) * sc[0] + (5) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - qf[7] *= Corr * k_f; - qr[7] *= Corr * k_f * exp(-(-g_RT[5] - g_RT[8] + g_RT[10])) * (refCinv); - // reaction 26: HCO + O2 <=> CO + HO2 - k_f = 7580000 * exp(-(206.318832979935) * invT); - qf[26] *= k_f; - qr[26] *= k_f * exp(-(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10])); - // reaction 27: H + HCO <=> CO + H2 - k_f = 72300000; - qf[27] *= k_f; - qr[27] *= k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10])); - // reaction 28: HCO + O <=> CO2 + H - k_f = 30000000; - qf[28] *= k_f; - qr[28] *= k_f * exp(-(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10])); -} - -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -productionRate(amrex::Real* wdot, const amrex::Real* sc, const amrex::Real T) -{ - const amrex::Real invT = 1.0 / T; - const amrex::Real logT = log(T); - - // reference concentration: P_atm / (RT) in inverse mol/m^3 - const amrex::Real refC = 101325 / 8.31446 * invT; - const amrex::Real refCinv = 1 / refC; - - for (int i = 0; i < 12; ++i) { - wdot[i] = 0.0; - } - - // compute the mixture concentration - amrex::Real mixture = 0.0; - for (int i = 0; i < 12; ++i) { - mixture += sc[i]; - } - - // compute the Gibbs free energy - amrex::Real g_RT[12]; - gibbs(g_RT, T); - - { - // reaction 8: H + O2 (+M) <=> HO2 (+M) - const amrex::Real k_f = 1475000 * exp((0.6) * logT); - amrex::Real Corr = mixture + sc[0] + (-0.22) * sc[1] + (10) * sc[4] + - (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real redP = - Corr / k_f * 636600000 * exp(-1.72 * logT - 264.088106214317 * invT); - const amrex::Real F = redP / (1.0 + redP); - const amrex::Real logPred = log10(redP); - const amrex::Real logFcent = - log10(0.2 * exp(-T * 1e+30) + 0.8 * exp(-T * 1e-30) + 0.0); - const amrex::Real troe_c = -0.4 - 0.67 * logFcent; - const amrex::Real troe_n = 0.75 - 1.27 * logFcent; - const amrex::Real troe = - (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); - const amrex::Real F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); - Corr = F * F_troe; - const amrex::Real qf = Corr * k_f * (sc[1] * sc[5]); - const amrex::Real qr = - Corr * k_f * exp(-(g_RT[1] + g_RT[5] - g_RT[6])) * (refC) * (sc[6]); - const amrex::Real qdot = qf - qr; - wdot[1] -= qdot; - wdot[5] -= qdot; - wdot[6] += qdot; - } - - { - // reaction 15: H2O2 (+M) <=> 2 OH (+M) - const amrex::Real k_f = 295100000000000 * exp(-(24370.7831249226) * invT); - amrex::Real Corr = - mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real redP = - Corr / k_f * 120200000000 * exp(-22896.3582941147 * invT); - const amrex::Real F = redP / (1.0 + redP); - const amrex::Real logPred = log10(redP); - const amrex::Real logFcent = - log10(0.5 * exp(-T * 1e+30) + 0.5 * exp(-T * 1e-30) + 0.0); - const amrex::Real troe_c = -0.4 - 0.67 * logFcent; - const amrex::Real troe_n = 0.75 - 1.27 * logFcent; - const amrex::Real troe = - (troe_c + logPred) / (troe_n - 0.14 * (troe_c + logPred)); - const amrex::Real F_troe = exp(M_LN10 * logFcent / (1.0 + troe * troe)); - Corr = F * F_troe; - const amrex::Real qf = Corr * k_f * (sc[7]); - const amrex::Real qr = Corr * k_f * exp(-(-2.000000 * g_RT[3] + g_RT[7])) * - (refCinv) * ((sc[3] * sc[3])); - const amrex::Real qdot = qf - qr; - wdot[3] += 2.000000 * qdot; - wdot[7] -= qdot; - } - - { - // reaction 21: CO + O (+M) <=> CO2 (+M) - const amrex::Real k_f = 18000 * exp(-(1199.66853127845) * invT); - amrex::Real Corr = - mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real redP = - Corr / k_f * 1550000000000 * exp(-2.79 * logT - 2108.98104638758 * invT); - Corr = redP / (1.0 + redP); - const amrex::Real qf = Corr * k_f * (sc[2] * sc[8]); - const amrex::Real qr = - Corr * k_f * exp(-(g_RT[2] + g_RT[8] - g_RT[9])) * (refC) * (sc[9]); - const amrex::Real qdot = qf - qr; - wdot[2] -= qdot; - wdot[8] -= qdot; - wdot[9] += qdot; - } - - { - // reaction 4: H2 + M <=> 2 H + M - const amrex::Real k_f = - 45770000000000 * exp((-1.4) * logT - (52525.7555766966) * invT); - const amrex::Real Corr = - mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real qf = Corr * k_f * (sc[0]); - const amrex::Real qr = Corr * k_f * exp(-(g_RT[0] - 2.000000 * g_RT[5])) * - (refCinv) * ((sc[5] * sc[5])); - const amrex::Real qdot = qf - qr; - wdot[0] -= qdot; - wdot[5] += 2.000000 * qdot; - } - - { - // reaction 5: 2 O + M <=> O2 + M - const amrex::Real k_f = 6165 * exp((-0.5) * logT); - const amrex::Real Corr = - mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real qf = Corr * k_f * ((sc[2] * sc[2])); - const amrex::Real qr = - Corr * k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[2])) * (refC) * (sc[1]); - const amrex::Real qdot = qf - qr; - wdot[1] += qdot; - wdot[2] -= 2.000000 * qdot; - } - - { - // reaction 6: H + O + M <=> OH + M - const amrex::Real k_f = 4714000 * exp((-1) * logT); - const amrex::Real Corr = - mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real qf = Corr * k_f * (sc[2] * sc[5]); - const amrex::Real qr = - Corr * k_f * exp(-(g_RT[2] - g_RT[3] + g_RT[5])) * (refC) * (sc[3]); - const amrex::Real qdot = qf - qr; - wdot[2] -= qdot; - wdot[3] += qdot; - wdot[5] -= qdot; - } - - { - // reaction 7: H + OH + M <=> H2O + M - const amrex::Real k_f = 38000000000 * exp((-2) * logT); - const amrex::Real Corr = - mixture + (1.5) * sc[0] + (11) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real qf = Corr * k_f * (sc[3] * sc[5]); - const amrex::Real qr = - Corr * k_f * exp(-(g_RT[3] - g_RT[4] + g_RT[5])) * (refC) * (sc[4]); - const amrex::Real qdot = qf - qr; - wdot[3] -= qdot; - wdot[4] += qdot; - wdot[5] -= qdot; - } - - { - // reaction 25: HCO + M <=> CO + H + M - const amrex::Real k_f = - 474850 * exp((0.659) * logT - (7484.8446871794) * invT); - const amrex::Real Corr = - mixture + (1.5) * sc[0] + (5) * sc[4] + (0.9) * sc[8] + (2.8) * sc[9]; - const amrex::Real qf = Corr * k_f * (sc[10]); - const amrex::Real qr = Corr * k_f * exp(-(-g_RT[5] - g_RT[8] + g_RT[10])) * - (refCinv) * (sc[5] * sc[8]); - const amrex::Real qdot = qf - qr; - wdot[5] += qdot; - wdot[8] += qdot; - wdot[10] -= qdot; - } - - { - // reaction 0: H + O2 <=> O + OH - const amrex::Real k_f = - 3547000000 * exp((-0.406) * logT - (8352.89343569254) * invT); - const amrex::Real qf = k_f * (sc[1] * sc[5]); - const amrex::Real qr = - k_f * exp(-(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5])) * (sc[2] * sc[3]); - const amrex::Real qdot = qf - qr; - wdot[1] -= qdot; - wdot[2] += qdot; - wdot[3] += qdot; - wdot[5] -= qdot; - } - - { - // reaction 1: H2 + O <=> H + OH - const amrex::Real k_f = - 0.0508 * exp((2.67) * logT - (3165.23282791169) * invT); - const amrex::Real qf = k_f * (sc[0] * sc[2]); - const amrex::Real qr = - k_f * exp(-(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5])) * (sc[3] * sc[5]); - const amrex::Real qdot = qf - qr; - wdot[0] -= qdot; - wdot[2] -= qdot; - wdot[3] += qdot; - wdot[5] += qdot; - } - - { - // reaction 2: H2 + OH <=> H + H2O - const amrex::Real k_f = - 216 * exp((1.51) * logT - (1726.03316371019) * invT); - const amrex::Real qf = k_f * (sc[0] * sc[3]); - const amrex::Real qr = - k_f * exp(-(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5])) * (sc[4] * sc[5]); - const amrex::Real qdot = qf - qr; - wdot[0] -= qdot; - wdot[3] -= qdot; - wdot[4] += qdot; - wdot[5] += qdot; - } - - { - // reaction 3: H2O + O <=> 2 OH - const amrex::Real k_f = - 2.97 * exp((2.02) * logT - (6743.10332178324) * invT); - const amrex::Real qf = k_f * (sc[2] * sc[4]); - const amrex::Real qr = - k_f * exp(-(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4])) * ((sc[3] * sc[3])); - const amrex::Real qdot = qf - qr; - wdot[2] -= qdot; - wdot[3] += 2.000000 * qdot; - wdot[4] -= qdot; - } - - { - // reaction 9: H + HO2 <=> H2 + O2 - const amrex::Real k_f = 16600000 * exp(-(414.147315957284) * invT); - const amrex::Real qf = k_f * (sc[5] * sc[6]); - const amrex::Real qr = - k_f * exp(-(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6])) * (sc[0] * sc[1]); - const amrex::Real qdot = qf - qr; - wdot[0] += qdot; - wdot[1] += qdot; - wdot[5] -= qdot; - wdot[6] -= qdot; - } - - { - // reaction 10: H + HO2 <=> 2 OH - const amrex::Real k_f = 70790000 * exp(-(148.448916412392) * invT); - const amrex::Real qf = k_f * (sc[5] * sc[6]); - const amrex::Real qr = - k_f * exp(-(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6])) * ((sc[3] * sc[3])); - const amrex::Real qdot = qf - qr; - wdot[3] += 2.000000 * qdot; - wdot[5] -= qdot; - wdot[6] -= qdot; - } - - { - // reaction 11: HO2 + O <=> O2 + OH - const amrex::Real k_f = 32500000; - const amrex::Real qf = k_f * (sc[2] * sc[6]); - const amrex::Real qr = - k_f * exp(-(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6])) * (sc[1] * sc[3]); - const amrex::Real qdot = qf - qr; - wdot[1] += qdot; - wdot[2] -= qdot; - wdot[3] += qdot; - wdot[6] -= qdot; - } - - { - // reaction 12: HO2 + OH <=> H2O + O2 - const amrex::Real k_f = 28900000 * exp(-(-250.098682904946) * invT); - const amrex::Real qf = k_f * (sc[3] * sc[6]); - const amrex::Real qr = - k_f * exp(-(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6])) * (sc[1] * sc[4]); - const amrex::Real qdot = qf - qr; - wdot[1] += qdot; - wdot[3] -= qdot; - wdot[4] += qdot; - wdot[6] -= qdot; - } - - { - // reaction 13: 2 HO2 <=> H2O2 + O2 - const amrex::Real k_f = 420000000 * exp(-(6029.54208967215) * invT); - const amrex::Real qf = k_f * ((sc[6] * sc[6])); - const amrex::Real qr = - k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])) * (sc[1] * sc[7]); - const amrex::Real qdot = qf - qr; - wdot[1] += qdot; - wdot[6] -= 2.000000 * qdot; - wdot[7] += qdot; - } - - { - // reaction 14: 2 HO2 <=> H2O2 + O2 - const amrex::Real k_f = 130000 * exp(-(-819.89091359563) * invT); - const amrex::Real qf = k_f * ((sc[6] * sc[6])); - const amrex::Real qr = - k_f * exp(-(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7])) * (sc[1] * sc[7]); - const amrex::Real qdot = qf - qr; - wdot[1] += qdot; - wdot[6] -= 2.000000 * qdot; - wdot[7] += qdot; - } - - { - // reaction 16: H + H2O2 <=> H2O + OH - const amrex::Real k_f = 24100000 * exp(-(1997.77016324474) * invT); - const amrex::Real qf = k_f * (sc[5] * sc[7]); - const amrex::Real qr = - k_f * exp(-(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7])) * (sc[3] * sc[4]); - const amrex::Real qdot = qf - qr; - wdot[3] += qdot; - wdot[4] += qdot; - wdot[5] -= qdot; - wdot[7] -= qdot; - } - - { - // reaction 17: H + H2O2 <=> H2 + HO2 - const amrex::Real k_f = 48200000 * exp(-(4000.57249314752) * invT); - const amrex::Real qf = k_f * (sc[5] * sc[7]); - const amrex::Real qr = - k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7])) * (sc[0] * sc[6]); - const amrex::Real qdot = qf - qr; - wdot[0] += qdot; - wdot[5] -= qdot; - wdot[6] += qdot; - wdot[7] -= qdot; - } - - { - // reaction 18: H2O2 + O <=> HO2 + OH - const amrex::Real k_f = 9.55 * exp((2) * logT - (1997.77016324474) * invT); - const amrex::Real qf = k_f * (sc[2] * sc[7]); - const amrex::Real qr = - k_f * exp(-(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7])) * (sc[3] * sc[6]); - const amrex::Real qdot = qf - qr; - wdot[2] -= qdot; - wdot[3] += qdot; - wdot[6] += qdot; - wdot[7] -= qdot; - } - - { - // reaction 19: H2O2 + OH <=> H2O + HO2 - const amrex::Real k_f = 1000000; - const amrex::Real qf = k_f * (sc[3] * sc[7]); - const amrex::Real qr = - k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])) * (sc[4] * sc[6]); - const amrex::Real qdot = qf - qr; - wdot[3] -= qdot; - wdot[4] += qdot; - wdot[6] += qdot; - wdot[7] -= qdot; - } - - { - // reaction 20: H2O2 + OH <=> H2O + HO2 - const amrex::Real k_f = 580000000 * exp(-(4809.24167509571) * invT); - const amrex::Real qf = k_f * (sc[3] * sc[7]); - const amrex::Real qr = - k_f * exp(-(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7])) * (sc[4] * sc[6]); - const amrex::Real qdot = qf - qr; - wdot[3] -= qdot; - wdot[4] += qdot; - wdot[6] += qdot; - wdot[7] -= qdot; - } - - { - // reaction 22: CO + O2 <=> CO2 + O - const amrex::Real k_f = 2530000 * exp(-(24003.4349588851) * invT); - const amrex::Real qf = k_f * (sc[1] * sc[8]); - const amrex::Real qr = - k_f * exp(-(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9])) * (sc[2] * sc[9]); - const amrex::Real qdot = qf - qr; - wdot[1] -= qdot; - wdot[2] += qdot; - wdot[8] -= qdot; - wdot[9] += qdot; - } - - { - // reaction 23: CO + HO2 <=> CO2 + OH - const amrex::Real k_f = 30100000 * exp(-(11573.9833135086) * invT); - const amrex::Real qf = k_f * (sc[6] * sc[8]); - const amrex::Real qr = - k_f * exp(-(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9])) * (sc[3] * sc[9]); - const amrex::Real qdot = qf - qr; - wdot[3] += qdot; - wdot[6] -= qdot; - wdot[8] -= qdot; - wdot[9] += qdot; - } - - { - // reaction 24: CO + OH <=> CO2 + H - const amrex::Real k_f = - 0.2229 * exp((1.89) * logT - (-583.077150667929) * invT); - const amrex::Real qf = k_f * (sc[3] * sc[8]); - const amrex::Real qr = - k_f * exp(-(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9])) * (sc[5] * sc[9]); - const amrex::Real qdot = qf - qr; - wdot[3] -= qdot; - wdot[5] += qdot; - wdot[8] -= qdot; - wdot[9] += qdot; - } - - { - // reaction 26: HCO + O2 <=> CO + HO2 - const amrex::Real k_f = 7580000 * exp(-(206.318832979935) * invT); - const amrex::Real qf = k_f * (sc[1] * sc[10]); - const amrex::Real qr = - k_f * exp(-(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10])) * (sc[6] * sc[8]); - const amrex::Real qdot = qf - qr; - wdot[1] -= qdot; - wdot[6] += qdot; - wdot[8] += qdot; - wdot[10] -= qdot; - } - - { - // reaction 27: H + HCO <=> CO + H2 - const amrex::Real k_f = 72300000; - const amrex::Real qf = k_f * (sc[5] * sc[10]); - const amrex::Real qr = - k_f * exp(-(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10])) * (sc[0] * sc[8]); - const amrex::Real qdot = qf - qr; - wdot[0] += qdot; - wdot[5] -= qdot; - wdot[8] += qdot; - wdot[10] -= qdot; - } - - { - // reaction 28: HCO + O <=> CO2 + H - const amrex::Real k_f = 30000000; - const amrex::Real qf = k_f * (sc[2] * sc[10]); - const amrex::Real qr = - k_f * exp(-(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10])) * (sc[5] * sc[9]); - const amrex::Real qdot = qf - qr; - wdot[2] -= qdot; - wdot[5] += qdot; - wdot[9] += qdot; - wdot[10] -= qdot; - } -} - -// compute the production rate for each species -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKWC(const amrex::Real T, amrex::Real C[], amrex::Real wdot[]) -{ - - // convert to SI - for (int id = 0; id < 12; ++id) { - C[id] *= 1.0e6; - } - - // convert to chemkin units - productionRate(wdot, C, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - C[id] *= 1.0e-6; - wdot[id] *= 1.0e-6; - } -} - -// Returns the molar production rate of species -// Given P, T, and mass fractions -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKWYP( - const amrex::Real P, - const amrex::Real T, - const amrex::Real y[], - amrex::Real wdot[]) -{ - amrex::Real c[12]; // temporary storage - amrex::Real YOW = 0; - amrex::Real PWORT; - - // Compute inverse of mean molecular wt first - for (int i = 0; i < 12; i++) { - YOW += y[i] * imw(i); - } - // PW/RT (see Eq. 7) - PWORT = P / (YOW * 8.31446261815324e+07 * T); - // multiply by 1e6 so c goes to SI - PWORT *= 1e6; - // Now compute conversion (and go to SI) - for (int i = 0; i < 12; i++) { - c[i] = PWORT * y[i] * imw(i); - } - - // convert to chemkin units - productionRate(wdot, c, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - wdot[id] *= 1.0e-6; - } -} - -// Returns the molar production rate of species -// Given P, T, and mole fractions -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKWXP( - const amrex::Real P, - const amrex::Real T, - const amrex::Real x[], - amrex::Real wdot[]) -{ - amrex::Real c[12]; // temporary storage - amrex::Real PORT = - 1e6 * P / (8.31446261815324e+07 * T); // 1e6 * P/RT so c goes to SI units - - // Compute conversion, see Eq 10 - for (int id = 0; id < 12; ++id) { - c[id] = x[id] * PORT; - } - - // convert to chemkin units - productionRate(wdot, c, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - wdot[id] *= 1.0e-6; - } -} - -// Returns the molar production rate of species -// Given rho, T, and mass fractions -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKWYR( - const amrex::Real rho, - const amrex::Real T, - const amrex::Real y[], - amrex::Real wdot[]) -{ - amrex::Real c[12]; // temporary storage - - // See Eq 8 with an extra 1e6 so c goes to SI - for (int i = 0; i < 12; i++) { - c[i] = 1e6 * rho * y[i] * imw(i); - } - - // call productionRate - productionRate(wdot, c, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - wdot[id] *= 1.0e-6; - } -} - -// Returns the molar production rate of species -// Given rho, T, and mole fractions -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKWXR( - const amrex::Real rho, - const amrex::Real T, - const amrex::Real x[], - amrex::Real wdot[]) -{ - amrex::Real c[12]; // temporary storage - amrex::Real XW = 0; // See Eq 4, 11 in CK Manual - amrex::Real ROW; - // Compute mean molecular wt first - XW += x[0] * 2.016000; // H2 - XW += x[1] * 31.998000; // O2 - XW += x[2] * 15.999000; // O - XW += x[3] * 17.007000; // OH - XW += x[4] * 18.015000; // H2O - XW += x[5] * 1.008000; // H - XW += x[6] * 33.006000; // HO2 - XW += x[7] * 34.014000; // H2O2 - XW += x[8] * 28.010000; // CO - XW += x[9] * 44.009000; // CO2 - XW += x[10] * 29.018000; // HCO - XW += x[11] * 28.014000; // N2 - // Extra 1e6 factor to take c to SI - ROW = 1e6 * rho / XW; - - // Compute conversion, see Eq 11 - for (int id = 0; id < 12; ++id) { - c[id] = x[id] * ROW; - } - - // convert to chemkin units - productionRate(wdot, c, T); - - // convert to chemkin units - for (int id = 0; id < 12; ++id) { - wdot[id] *= 1.0e-6; - } -} - -// species unit charge number -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCHRG(int kcharge[]) -{ - kcharge[0] = 0; // H2 - kcharge[1] = 0; // O2 - kcharge[2] = 0; // O - kcharge[3] = 0; // OH - kcharge[4] = 0; // H2O - kcharge[5] = 0; // H - kcharge[6] = 0; // HO2 - kcharge[7] = 0; // H2O2 - kcharge[8] = 0; // CO - kcharge[9] = 0; // CO2 - kcharge[10] = 0; // HCO - kcharge[11] = 0; // N2 -} - -// species charge per unit mass -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -CKCHRGMASS(amrex::Real zk[]) -{ - - int kchrg[12]; - CKCHRG(kchrg); - - for (int id = 0; id < 12; ++id) { - zk[id] = 6.02214076e+23 * 1.60217663e-19 * kchrg[id] * imw(id); - } -} - -// compute an approx to the reaction Jacobian -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -aJacobian_precond( - amrex::Real* J, const amrex::Real* sc, const amrex::Real T, const int HP) -{ - -#if defined(PELE_COMPILE_AJACOBIAN) || !defined(AMREX_USE_HIP) - for (int i = 0; i < 169; i++) { - J[i] = 0.0; - } - - amrex::Real wdot[12]; - for (auto& val : wdot) { - val = 0.0; - } - - const amrex::Real invT = 1.0 / T; - const amrex::Real invT2 = invT * invT; - const amrex::Real logT = log(T); - - // reference concentration: P_atm / (RT) in inverse mol/m^3 - amrex::Real refC = 101325 / 8.31446 / T; - amrex::Real refCinv = 1.0 / refC; - - // compute the mixture concentration - amrex::Real mixture = 0.0; - for (int k = 0; k < 12; ++k) { - mixture += sc[k]; - } - - // compute the Gibbs free energy - amrex::Real g_RT[12]; - gibbs(g_RT, T); - - // compute the species enthalpy - amrex::Real h_RT[12]; - speciesEnthalpy(h_RT, T); - - amrex::Real phi_f, k_f, k_r, phi_r, Kc, q, q_nocor, Corr, alpha; - amrex::Real dlnkfdT, dlnk0dT, dlnKcdT, dkrdT, dqdT; - amrex::Real dqdci, dcdc_fac, dqdc[12]; - amrex::Real Pr, fPr, F, k_0, logPr; - amrex::Real logFcent, troe_c, troe_n, troePr_den, troePr, troe; - amrex::Real Fcent1, Fcent2, Fcent3, Fcent; - amrex::Real dlogFdc, dlogFdn, dlogFdcn_fac; - amrex::Real dlogPrdT, dlogfPrdT, dlogFdT, dlogFcentdT, dlogFdlogPr, dlnCorrdT; - const amrex::Real ln10 = log(10.0); - const amrex::Real log10e = 1.0 / log(10.0); - // reaction 8: H + O2 (+M) <=> HO2 (+M) - // a third-body and pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + sc[0] + (0.78 - 1) * sc[1] + (11 - 1) * sc[4] + - (1.9 - 1) * sc[8] + (3.8 - 1) * sc[9]; - // forward - phi_f = sc[1] * sc[5]; - k_f = 1475000 * exp(0.6 * logT); - dlnkfdT = 0.6 * invT; - // pressure-fall-off - k_0 = 6.366e+20 * exp(-1.72 * logT - (264.088106214317) * invT); - Pr = 1e-12 * alpha / k_f * k_0; - fPr = Pr / (1.0 + Pr); - dlnk0dT = -1.72 * invT + (264.088106214317) * invT2; - dlogPrdT = log10e * (dlnk0dT - dlnkfdT); - dlogfPrdT = dlogPrdT / (1.0 + Pr); - // Troe form - logPr = log10(Pr); - Fcent1 = (1. - 0.8) * exp(-T / 1e-30); - Fcent2 = 0.8 * exp(-T / 1e+30); - Fcent3 = 0.; - Fcent = Fcent1 + Fcent2 + Fcent3; - logFcent = log10(Fcent); - troe_c = -.4 - .67 * logFcent; - troe_n = .75 - 1.27 * logFcent; - troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); - troePr = (troe_c + logPr) * troePr_den; - troe = 1.0 / (1.0 + troePr * troePr); - F = exp(M_LN10 * logFcent * troe); - dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); - dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; - dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; - dlogFdn = dlogFdcn_fac * troePr; - dlogFdlogPr = dlogFdc; - dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + - dlogFdlogPr * dlogPrdT; - // reverse - phi_r = sc[6]; - Kc = refCinv * exp(g_RT[1] + g_RT[5] - g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[6]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - Corr = fPr * F; - q = Corr * q_nocor; - dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); - dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; - // update wdot - wdot[1] -= q; // O2 - wdot[5] -= q; // H - wdot[6] += q; // HO2 - // for convenience - k_f *= Corr; - k_r *= Corr; - dcdc_fac = 0.0; - dqdc[0] = 2 * dcdc_fac; - dqdc[1] = 0.78 * dcdc_fac + k_f * sc[5]; - dqdc[2] = dcdc_fac; - dqdc[3] = dcdc_fac; - dqdc[4] = 11 * dcdc_fac; - dqdc[5] = dcdc_fac + k_f * sc[1]; - dqdc[6] = dcdc_fac - k_r; - dqdc[7] = dcdc_fac; - dqdc[8] = 1.9 * dcdc_fac; - dqdc[9] = 3.8 * dcdc_fac; - dqdc[10] = dcdc_fac; - dqdc[11] = dcdc_fac; - for (int k = 0; k < 12; k++) { - J[13 * k + 1] -= dqdc[k]; - J[13 * k + 5] -= dqdc[k]; - J[13 * k + 6] += dqdc[k]; - } - J[157] -= dqdT; // dwdot[O2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] += dqdT; // dwdot[HO2]/dT - - // reaction 15: H2O2 (+M) <=> 2 OH (+M) - // a third-body and pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[7]; - k_f = 295100000000000 * exp(-(24370.7831249226) * invT); - dlnkfdT = (24370.7831249226) * invT2; - // pressure-fall-off - k_0 = 1.202e+17 * exp(-(22896.3582941147) * invT); - Pr = 1e-6 * alpha / k_f * k_0; - fPr = Pr / (1.0 + Pr); - dlnk0dT = (22896.3582941147) * invT2; - dlogPrdT = log10e * (dlnk0dT - dlnkfdT); - dlogfPrdT = dlogPrdT / (1.0 + Pr); - // Troe form - logPr = log10(Pr); - Fcent1 = (1. - 0.5) * exp(-T / 1e-30); - Fcent2 = 0.5 * exp(-T / 1e+30); - Fcent3 = 0.; - Fcent = Fcent1 + Fcent2 + Fcent3; - logFcent = log10(Fcent); - troe_c = -.4 - .67 * logFcent; - troe_n = .75 - 1.27 * logFcent; - troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); - troePr = (troe_c + logPr) * troePr_den; - troe = 1.0 / (1.0 + troePr * troePr); - F = exp(M_LN10 * logFcent * troe); - dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); - dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; - dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; - dlogFdn = dlogFdcn_fac * troePr; - dlogFdlogPr = dlogFdc; - dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + - dlogFdlogPr * dlogPrdT; - // reverse - phi_r = (sc[3] * sc[3]); - Kc = refC * exp(-2.000000 * g_RT[3] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[7]) + (2.000000 * h_RT[3]) - 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - Corr = fPr * F; - q = Corr * q_nocor; - dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); - dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; - // update wdot - wdot[3] += 2 * q; // OH - wdot[7] -= q; // H2O2 - // for convenience - k_f *= Corr; - k_r *= Corr; - dcdc_fac = 0.0; - dqdc[0] = 2.5 * dcdc_fac; - dqdc[1] = dcdc_fac; - dqdc[2] = dcdc_fac; - dqdc[3] = dcdc_fac - k_r * 2.000000 * sc[3]; - dqdc[4] = 12 * dcdc_fac; - dqdc[5] = dcdc_fac; - dqdc[6] = dcdc_fac; - dqdc[7] = dcdc_fac + k_f; - dqdc[8] = 1.9 * dcdc_fac; - dqdc[9] = 3.8 * dcdc_fac; - dqdc[10] = dcdc_fac; - dqdc[11] = dcdc_fac; - for (int k = 0; k < 12; k++) { - J[13 * k + 3] += 2 * dqdc[k]; - J[13 * k + 7] -= dqdc[k]; - } - J[159] += 2 * dqdT; // dwdot[OH]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 21: CO + O (+M) <=> CO2 (+M) - // a third-body and pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[2] * sc[8]; - k_f = 18000 * exp(-(1199.66853127845) * invT); - dlnkfdT = (1199.66853127845) * invT2; - // pressure-fall-off - k_0 = 1.55e+24 * exp(-2.79 * logT - (2108.98104638758) * invT); - Pr = 1e-12 * alpha / k_f * k_0; - fPr = Pr / (1.0 + Pr); - dlnk0dT = -2.79 * invT + (2108.98104638758) * invT2; - dlogPrdT = log10e * (dlnk0dT - dlnkfdT); - dlogfPrdT = dlogPrdT / (1.0 + Pr); - // Lindemann form - F = 1.0; - // dlogFdlogPr is 0.0 and unused - dlogFdT = 0.0; - // reverse - phi_r = sc[9]; - Kc = refCinv * exp(g_RT[2] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[8]) + (h_RT[9]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - Corr = fPr * F; - q = Corr * q_nocor; - dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); - dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; - // update wdot - wdot[2] -= q; // O - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // for convenience - k_f *= Corr; - k_r *= Corr; - dcdc_fac = 0.0; - dqdc[0] = 2.5 * dcdc_fac; - dqdc[1] = dcdc_fac; - dqdc[2] = dcdc_fac + k_f * sc[8]; - dqdc[3] = dcdc_fac; - dqdc[4] = 12 * dcdc_fac; - dqdc[5] = dcdc_fac; - dqdc[6] = dcdc_fac; - dqdc[7] = dcdc_fac; - dqdc[8] = 1.9 * dcdc_fac + k_f * sc[2]; - dqdc[9] = 3.8 * dcdc_fac - k_r; - dqdc[10] = dcdc_fac; - dqdc[11] = dcdc_fac; - for (int k = 0; k < 12; k++) { - J[13 * k + 2] -= dqdc[k]; - J[13 * k + 8] -= dqdc[k]; - J[13 * k + 9] += dqdc[k]; - } - J[158] -= dqdT; // dwdot[O]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 4: H2 + M <=> 2 H + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[0]; - k_f = 45770000000000 * exp(-1.4 * logT - (52525.7555766966) * invT); - dlnkfdT = -1.4 * invT + (52525.7555766966) * invT2; - // reverse - phi_r = (sc[5] * sc[5]); - Kc = refC * exp(g_RT[0] - 2.000000 * g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[0]) + (2.000000 * h_RT[5]) - 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] -= q; // H2 - wdot[5] += 2 * q; // H - // for convenience - k_f *= alpha; - k_r *= alpha; - dqdc[0] = 2.5 * q_nocor + k_f; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor; - dqdc[3] = q_nocor; - dqdc[4] = 12 * q_nocor; - dqdc[5] = q_nocor - k_r * 2.000000 * sc[5]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 0] -= dqdc[k]; - J[13 * k + 5] += 2 * dqdc[k]; - } - J[156] -= dqdT; // dwdot[H2]/dT - J[161] += 2 * dqdT; // dwdot[H]/dT - - // reaction 5: 2 O + M <=> O2 + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = (sc[2] * sc[2]); - k_f = 6165 * exp(-0.5 * logT); - dlnkfdT = -0.5 * invT; - // reverse - phi_r = sc[1]; - Kc = refCinv * exp(-g_RT[1] + 2.000000 * g_RT[2]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(2.000000 * h_RT[2]) + (h_RT[1]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[2] -= 2 * q; // O - // for convenience - k_f *= alpha; - k_r *= alpha; - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor - k_r; - dqdc[2] = q_nocor + k_f * 2.000000 * sc[2]; - dqdc[3] = q_nocor; - dqdc[4] = 12 * q_nocor; - dqdc[5] = q_nocor; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 1] += dqdc[k]; - J[13 * k + 2] += -2 * dqdc[k]; - } - J[157] += dqdT; // dwdot[O2]/dT - J[158] += -2 * dqdT; // dwdot[O]/dT - - // reaction 6: H + O + M <=> OH + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[2] * sc[5]; - k_f = 4714000 * exp(-1 * logT); - dlnkfdT = -1 * invT; - // reverse - phi_r = sc[3]; - Kc = refCinv * exp(g_RT[2] - g_RT[3] + g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[5]) + (h_RT[3]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[5] -= q; // H - // for convenience - k_f *= alpha; - k_r *= alpha; - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor + k_f * sc[5]; - dqdc[3] = q_nocor - k_r; - dqdc[4] = 12 * q_nocor; - dqdc[5] = q_nocor + k_f * sc[2]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 2] -= dqdc[k]; - J[13 * k + 3] += dqdc[k]; - J[13 * k + 5] -= dqdc[k]; - } - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[161] -= dqdT; // dwdot[H]/dT - - // reaction 7: H + OH + M <=> H2O + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[3] * sc[5]; - k_f = 38000000000 * exp(-2 * logT); - dlnkfdT = -2 * invT; - // reverse - phi_r = sc[4]; - Kc = refCinv * exp(g_RT[3] - g_RT[4] + g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[5]) + (h_RT[4]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[5] -= q; // H - // for convenience - k_f *= alpha; - k_r *= alpha; - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor; - dqdc[3] = q_nocor + k_f * sc[5]; - dqdc[4] = 12 * q_nocor - k_r; - dqdc[5] = q_nocor + k_f * sc[3]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 3] -= dqdc[k]; - J[13 * k + 4] += dqdc[k]; - J[13 * k + 5] -= dqdc[k]; - } - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[161] -= dqdT; // dwdot[H]/dT - - // reaction 25: HCO + M <=> CO + H + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (6 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[10]; - k_f = 474850 * exp(0.659 * logT - (7484.8446871794) * invT); - dlnkfdT = 0.659 * invT + (7484.8446871794) * invT2; - // reverse - phi_r = sc[5] * sc[8]; - Kc = refC * exp(-g_RT[5] - g_RT[8] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[10]) + (h_RT[5] + h_RT[8]) - 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[5] += q; // H - wdot[8] += q; // CO - wdot[10] -= q; // HCO - // for convenience - k_f *= alpha; - k_r *= alpha; - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor; - dqdc[3] = q_nocor; - dqdc[4] = 6 * q_nocor; - dqdc[5] = q_nocor - k_r * sc[8]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor - k_r * sc[5]; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor + k_f; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 5] += dqdc[k]; - J[13 * k + 8] += dqdc[k]; - J[13 * k + 10] -= dqdc[k]; - } - J[161] += dqdT; // dwdot[H]/dT - J[164] += dqdT; // dwdot[CO]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - // reaction 0: H + O2 <=> O + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[1] * sc[5]; - k_f = 3547000000 * exp(-0.406 * logT - (8352.89343569254) * invT); - dlnkfdT = -0.406 * invT + (8352.89343569254) * invT2; - // reverse - phi_r = sc[2] * sc[3]; - Kc = exp(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[2] + h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] -= q; // O2 - wdot[2] += q; // O - wdot[3] += q; // OH - wdot[5] -= q; // H - // d()/d[O2] - dqdci = +k_f * sc[5]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[15] += dqdci; // dwdot[O]/d[O2] - J[16] += dqdci; // dwdot[OH]/d[O2] - J[18] -= dqdci; // dwdot[H]/d[O2] - // d()/d[O] - dqdci = -k_r * sc[3]; - J[27] -= dqdci; // dwdot[O2]/d[O] - J[28] += dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[31] -= dqdci; // dwdot[H]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[2]; - J[40] -= dqdci; // dwdot[O2]/d[OH] - J[41] += dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - // d()/d[H] - dqdci = +k_f * sc[1]; - J[66] -= dqdci; // dwdot[O2]/d[H] - J[67] += dqdci; // dwdot[O]/d[H] - J[68] += dqdci; // dwdot[OH]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - // d()/dT - J[157] -= dqdT; // dwdot[O2]/dT - J[158] += dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[161] -= dqdT; // dwdot[H]/dT - - // reaction 1: H2 + O <=> H + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[0] * sc[2]; - k_f = 0.0508 * exp(2.67 * logT - (3165.23282791169) * invT); - dlnkfdT = 2.67 * invT + (3165.23282791169) * invT2; - // reverse - phi_r = sc[3] * sc[5]; - Kc = exp(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[0] + h_RT[2]) + (h_RT[3] + h_RT[5])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] -= q; // H2 - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[5] += q; // H - // d()/d[H2] - dqdci = +k_f * sc[2]; - J[0] -= dqdci; // dwdot[H2]/d[H2] - J[2] -= dqdci; // dwdot[O]/d[H2] - J[3] += dqdci; // dwdot[OH]/d[H2] - J[5] += dqdci; // dwdot[H]/d[H2] - // d()/d[O] - dqdci = +k_f * sc[0]; - J[26] -= dqdci; // dwdot[H2]/d[O] - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[31] += dqdci; // dwdot[H]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[5]; - J[39] -= dqdci; // dwdot[H2]/d[OH] - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[44] += dqdci; // dwdot[H]/d[OH] - // d()/d[H] - dqdci = -k_r * sc[3]; - J[65] -= dqdci; // dwdot[H2]/d[H] - J[67] -= dqdci; // dwdot[O]/d[H] - J[68] += dqdci; // dwdot[OH]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - // d()/dT - J[156] -= dqdT; // dwdot[H2]/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[161] += dqdT; // dwdot[H]/dT - - // reaction 2: H2 + OH <=> H + H2O - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[0] * sc[3]; - k_f = 216 * exp(1.51 * logT - (1726.03316371019) * invT); - dlnkfdT = 1.51 * invT + (1726.03316371019) * invT2; - // reverse - phi_r = sc[4] * sc[5]; - Kc = exp(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[0] + h_RT[3]) + (h_RT[4] + h_RT[5])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] -= q; // H2 - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[5] += q; // H - // d()/d[H2] - dqdci = +k_f * sc[3]; - J[0] -= dqdci; // dwdot[H2]/d[H2] - J[3] -= dqdci; // dwdot[OH]/d[H2] - J[4] += dqdci; // dwdot[H2O]/d[H2] - J[5] += dqdci; // dwdot[H]/d[H2] - // d()/d[OH] - dqdci = +k_f * sc[0]; - J[39] -= dqdci; // dwdot[H2]/d[OH] - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[44] += dqdci; // dwdot[H]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[5]; - J[52] -= dqdci; // dwdot[H2]/d[H2O] - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[57] += dqdci; // dwdot[H]/d[H2O] - // d()/d[H] - dqdci = -k_r * sc[4]; - J[65] -= dqdci; // dwdot[H2]/d[H] - J[68] -= dqdci; // dwdot[OH]/d[H] - J[69] += dqdci; // dwdot[H2O]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - // d()/dT - J[156] -= dqdT; // dwdot[H2]/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[161] += dqdT; // dwdot[H]/dT - - // reaction 3: H2O + O <=> 2 OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[4]; - k_f = 2.97 * exp(2.02 * logT - (6743.10332178324) * invT); - dlnkfdT = 2.02 * invT + (6743.10332178324) * invT2; - // reverse - phi_r = (sc[3] * sc[3]); - Kc = exp(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[4]) + (2.000000 * h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[3] += 2 * q; // OH - wdot[4] -= q; // H2O - // d()/d[O] - dqdci = +k_f * sc[4]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += 2 * dqdci; // dwdot[OH]/d[O] - J[30] -= dqdci; // dwdot[H2O]/d[O] - // d()/d[OH] - dqdci = -k_r * 2.000000 * sc[3]; - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += 2 * dqdci; // dwdot[OH]/d[OH] - J[43] -= dqdci; // dwdot[H2O]/d[OH] - // d()/d[H2O] - dqdci = +k_f * sc[2]; - J[54] -= dqdci; // dwdot[O]/d[H2O] - J[55] += 2 * dqdci; // dwdot[OH]/d[H2O] - J[56] -= dqdci; // dwdot[H2O]/d[H2O] - // d()/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += 2 * dqdT; // dwdot[OH]/dT - J[160] -= dqdT; // dwdot[H2O]/dT - - // reaction 9: H + HO2 <=> H2 + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[6]; - k_f = 16600000 * exp(-(414.147315957284) * invT); - dlnkfdT = (414.147315957284) * invT2; - // reverse - phi_r = sc[0] * sc[1]; - Kc = exp(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (h_RT[0] + h_RT[1])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] += q; // H2 - wdot[1] += q; // O2 - wdot[5] -= q; // H - wdot[6] -= q; // HO2 - // d()/d[H2] - dqdci = -k_r * sc[1]; - J[0] += dqdci; // dwdot[H2]/d[H2] - J[1] += dqdci; // dwdot[O2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[6] -= dqdci; // dwdot[HO2]/d[H2] - // d()/d[O2] - dqdci = -k_r * sc[0]; - J[13] += dqdci; // dwdot[H2]/d[O2] - J[14] += dqdci; // dwdot[O2]/d[O2] - J[18] -= dqdci; // dwdot[H]/d[O2] - J[19] -= dqdci; // dwdot[HO2]/d[O2] - // d()/d[H] - dqdci = +k_f * sc[6]; - J[65] += dqdci; // dwdot[H2]/d[H] - J[66] += dqdci; // dwdot[O2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] -= dqdci; // dwdot[HO2]/d[H] - // d()/d[HO2] - dqdci = +k_f * sc[5]; - J[78] += dqdci; // dwdot[H2]/d[HO2] - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[156] += dqdT; // dwdot[H2]/dT - J[157] += dqdT; // dwdot[O2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 10: H + HO2 <=> 2 OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[6]; - k_f = 70790000 * exp(-(148.448916412392) * invT); - dlnkfdT = (148.448916412392) * invT2; - // reverse - phi_r = (sc[3] * sc[3]); - Kc = exp(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (2.000000 * h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] += 2 * q; // OH - wdot[5] -= q; // H - wdot[6] -= q; // HO2 - // d()/d[OH] - dqdci = -k_r * 2.000000 * sc[3]; - J[42] += 2 * dqdci; // dwdot[OH]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - // d()/d[H] - dqdci = +k_f * sc[6]; - J[68] += 2 * dqdci; // dwdot[OH]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] -= dqdci; // dwdot[HO2]/d[H] - // d()/d[HO2] - dqdci = +k_f * sc[5]; - J[81] += 2 * dqdci; // dwdot[OH]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[159] += 2 * dqdT; // dwdot[OH]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 11: HO2 + O <=> O2 + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[6]; - k_f = 32500000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[1] * sc[3]; - Kc = exp(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[6]) + (h_RT[1] + h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[6] -= q; // HO2 - // d()/d[O2] - dqdci = -k_r * sc[3]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[15] -= dqdci; // dwdot[O]/d[O2] - J[16] += dqdci; // dwdot[OH]/d[O2] - J[19] -= dqdci; // dwdot[HO2]/d[O2] - // d()/d[O] - dqdci = +k_f * sc[6]; - J[27] += dqdci; // dwdot[O2]/d[O] - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[32] -= dqdci; // dwdot[HO2]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[1]; - J[40] += dqdci; // dwdot[O2]/d[OH] - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - // d()/d[HO2] - dqdci = +k_f * sc[2]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[80] -= dqdci; // dwdot[O]/d[HO2] - J[81] += dqdci; // dwdot[OH]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 12: HO2 + OH <=> H2O + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[6]; - k_f = 28900000 * exp(-(-250.098682904946) * invT); - dlnkfdT = (-250.098682904946) * invT2; - // reverse - phi_r = sc[1] * sc[4]; - Kc = exp(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[6]) + (h_RT[1] + h_RT[4])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[6] -= q; // HO2 - // d()/d[O2] - dqdci = -k_r * sc[4]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[16] -= dqdci; // dwdot[OH]/d[O2] - J[17] += dqdci; // dwdot[H2O]/d[O2] - J[19] -= dqdci; // dwdot[HO2]/d[O2] - // d()/d[OH] - dqdci = +k_f * sc[6]; - J[40] += dqdci; // dwdot[O2]/d[OH] - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[1]; - J[53] += dqdci; // dwdot[O2]/d[H2O] - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[58] -= dqdci; // dwdot[HO2]/d[H2O] - // d()/d[HO2] - dqdci = +k_f * sc[3]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[81] -= dqdci; // dwdot[OH]/d[HO2] - J[82] += dqdci; // dwdot[H2O]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 13: 2 HO2 <=> H2O2 + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = (sc[6] * sc[6]); - k_f = 420000000 * exp(-(6029.54208967215) * invT); - dlnkfdT = (6029.54208967215) * invT2; - // reverse - phi_r = sc[1] * sc[7]; - Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[6] -= 2 * q; // HO2 - wdot[7] += q; // H2O2 - // d()/d[O2] - dqdci = -k_r * sc[7]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] - J[20] += dqdci; // dwdot[H2O2]/d[O2] - // d()/d[HO2] - dqdci = +k_f * 2.000000 * sc[6]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] - J[85] += dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = -k_r * sc[1]; - J[92] += dqdci; // dwdot[O2]/d[H2O2] - J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] - J[98] += dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[162] += -2 * dqdT; // dwdot[HO2]/dT - J[163] += dqdT; // dwdot[H2O2]/dT - - // reaction 14: 2 HO2 <=> H2O2 + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = (sc[6] * sc[6]); - k_f = 130000 * exp(-(-819.89091359563) * invT); - dlnkfdT = (-819.89091359563) * invT2; - // reverse - phi_r = sc[1] * sc[7]; - Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[6] -= 2 * q; // HO2 - wdot[7] += q; // H2O2 - // d()/d[O2] - dqdci = -k_r * sc[7]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] - J[20] += dqdci; // dwdot[H2O2]/d[O2] - // d()/d[HO2] - dqdci = +k_f * 2.000000 * sc[6]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] - J[85] += dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = -k_r * sc[1]; - J[92] += dqdci; // dwdot[O2]/d[H2O2] - J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] - J[98] += dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[162] += -2 * dqdT; // dwdot[HO2]/dT - J[163] += dqdT; // dwdot[H2O2]/dT - - // reaction 16: H + H2O2 <=> H2O + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[7]; - k_f = 24100000 * exp(-(1997.77016324474) * invT); - dlnkfdT = (1997.77016324474) * invT2; - // reverse - phi_r = sc[3] * sc[4]; - Kc = exp(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[3] + h_RT[4])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] += q; // OH - wdot[4] += q; // H2O - wdot[5] -= q; // H - wdot[7] -= q; // H2O2 - // d()/d[OH] - dqdci = -k_r * sc[4]; - J[42] += dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[3]; - J[55] += dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[57] -= dqdci; // dwdot[H]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[H] - dqdci = +k_f * sc[7]; - J[68] += dqdci; // dwdot[OH]/d[H] - J[69] += dqdci; // dwdot[H2O]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[72] -= dqdci; // dwdot[H2O2]/d[H] - // d()/d[H2O2] - dqdci = +k_f * sc[5]; - J[94] += dqdci; // dwdot[OH]/d[H2O2] - J[95] += dqdci; // dwdot[H2O]/d[H2O2] - J[96] -= dqdci; // dwdot[H]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[159] += dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 17: H + H2O2 <=> H2 + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[7]; - k_f = 48200000 * exp(-(4000.57249314752) * invT); - dlnkfdT = (4000.57249314752) * invT2; - // reverse - phi_r = sc[0] * sc[6]; - Kc = exp(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[0] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] += q; // H2 - wdot[5] -= q; // H - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[H2] - dqdci = -k_r * sc[6]; - J[0] += dqdci; // dwdot[H2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[6] += dqdci; // dwdot[HO2]/d[H2] - J[7] -= dqdci; // dwdot[H2O2]/d[H2] - // d()/d[H] - dqdci = +k_f * sc[7]; - J[65] += dqdci; // dwdot[H2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] += dqdci; // dwdot[HO2]/d[H] - J[72] -= dqdci; // dwdot[H2O2]/d[H] - // d()/d[HO2] - dqdci = -k_r * sc[0]; - J[78] += dqdci; // dwdot[H2]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[5]; - J[91] += dqdci; // dwdot[H2]/d[H2O2] - J[96] -= dqdci; // dwdot[H]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[156] += dqdT; // dwdot[H2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 18: H2O2 + O <=> HO2 + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[7]; - k_f = 9.55 * exp(2 * logT - (1997.77016324474) * invT); - dlnkfdT = 2 * invT + (1997.77016324474) * invT2; - // reverse - phi_r = sc[3] * sc[6]; - Kc = exp(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[7]) + (h_RT[3] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[O] - dqdci = +k_f * sc[7]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[32] += dqdci; // dwdot[HO2]/d[O] - J[33] -= dqdci; // dwdot[H2O2]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[6]; - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[45] += dqdci; // dwdot[HO2]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[HO2] - dqdci = -k_r * sc[3]; - J[80] -= dqdci; // dwdot[O]/d[HO2] - J[81] += dqdci; // dwdot[OH]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[2]; - J[93] -= dqdci; // dwdot[O]/d[H2O2] - J[94] += dqdci; // dwdot[OH]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 19: H2O2 + OH <=> H2O + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[7]; - k_f = 1000000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[4] * sc[6]; - Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[OH] - dqdci = +k_f * sc[7]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[45] += dqdci; // dwdot[HO2]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[6]; - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[58] += dqdci; // dwdot[HO2]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[HO2] - dqdci = -k_r * sc[4]; - J[81] -= dqdci; // dwdot[OH]/d[HO2] - J[82] += dqdci; // dwdot[H2O]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[3]; - J[94] -= dqdci; // dwdot[OH]/d[H2O2] - J[95] += dqdci; // dwdot[H2O]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 20: H2O2 + OH <=> H2O + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[7]; - k_f = 580000000 * exp(-(4809.24167509571) * invT); - dlnkfdT = (4809.24167509571) * invT2; - // reverse - phi_r = sc[4] * sc[6]; - Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[OH] - dqdci = +k_f * sc[7]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[45] += dqdci; // dwdot[HO2]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[6]; - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[58] += dqdci; // dwdot[HO2]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[HO2] - dqdci = -k_r * sc[4]; - J[81] -= dqdci; // dwdot[OH]/d[HO2] - J[82] += dqdci; // dwdot[H2O]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[3]; - J[94] -= dqdci; // dwdot[OH]/d[H2O2] - J[95] += dqdci; // dwdot[H2O]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 22: CO + O2 <=> CO2 + O - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[1] * sc[8]; - k_f = 2530000 * exp(-(24003.4349588851) * invT); - dlnkfdT = (24003.4349588851) * invT2; - // reverse - phi_r = sc[2] * sc[9]; - Kc = exp(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[8]) + (h_RT[2] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] -= q; // O2 - wdot[2] += q; // O - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // d()/d[O2] - dqdci = +k_f * sc[8]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[15] += dqdci; // dwdot[O]/d[O2] - J[21] -= dqdci; // dwdot[CO]/d[O2] - J[22] += dqdci; // dwdot[CO2]/d[O2] - // d()/d[O] - dqdci = -k_r * sc[9]; - J[27] -= dqdci; // dwdot[O2]/d[O] - J[28] += dqdci; // dwdot[O]/d[O] - J[34] -= dqdci; // dwdot[CO]/d[O] - J[35] += dqdci; // dwdot[CO2]/d[O] - // d()/d[CO] - dqdci = +k_f * sc[1]; - J[105] -= dqdci; // dwdot[O2]/d[CO] - J[106] += dqdci; // dwdot[O]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = -k_r * sc[2]; - J[118] -= dqdci; // dwdot[O2]/d[CO2] - J[119] += dqdci; // dwdot[O]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - // d()/dT - J[157] -= dqdT; // dwdot[O2]/dT - J[158] += dqdT; // dwdot[O]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 23: CO + HO2 <=> CO2 + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[6] * sc[8]; - k_f = 30100000 * exp(-(11573.9833135086) * invT); - dlnkfdT = (11573.9833135086) * invT2; - // reverse - phi_r = sc[3] * sc[9]; - Kc = exp(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[6] + h_RT[8]) + (h_RT[3] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] += q; // OH - wdot[6] -= q; // HO2 - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // d()/d[OH] - dqdci = -k_r * sc[9]; - J[42] += dqdci; // dwdot[OH]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - J[47] -= dqdci; // dwdot[CO]/d[OH] - J[48] += dqdci; // dwdot[CO2]/d[OH] - // d()/d[HO2] - dqdci = +k_f * sc[8]; - J[81] += dqdci; // dwdot[OH]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - J[86] -= dqdci; // dwdot[CO]/d[HO2] - J[87] += dqdci; // dwdot[CO2]/d[HO2] - // d()/d[CO] - dqdci = +k_f * sc[6]; - J[107] += dqdci; // dwdot[OH]/d[CO] - J[110] -= dqdci; // dwdot[HO2]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = -k_r * sc[3]; - J[120] += dqdci; // dwdot[OH]/d[CO2] - J[123] -= dqdci; // dwdot[HO2]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - // d()/dT - J[159] += dqdT; // dwdot[OH]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 24: CO + OH <=> CO2 + H - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[8]; - k_f = 0.2229 * exp(1.89 * logT - (-583.077150667929) * invT); - dlnkfdT = 1.89 * invT + (-583.077150667929) * invT2; - // reverse - phi_r = sc[5] * sc[9]; - Kc = exp(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[8]) + (h_RT[5] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[5] += q; // H - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // d()/d[OH] - dqdci = +k_f * sc[8]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[44] += dqdci; // dwdot[H]/d[OH] - J[47] -= dqdci; // dwdot[CO]/d[OH] - J[48] += dqdci; // dwdot[CO2]/d[OH] - // d()/d[H] - dqdci = -k_r * sc[9]; - J[68] -= dqdci; // dwdot[OH]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - J[73] -= dqdci; // dwdot[CO]/d[H] - J[74] += dqdci; // dwdot[CO2]/d[H] - // d()/d[CO] - dqdci = +k_f * sc[3]; - J[107] -= dqdci; // dwdot[OH]/d[CO] - J[109] += dqdci; // dwdot[H]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = -k_r * sc[5]; - J[120] -= dqdci; // dwdot[OH]/d[CO2] - J[122] += dqdci; // dwdot[H]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - // d()/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[161] += dqdT; // dwdot[H]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 26: HCO + O2 <=> CO + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[1] * sc[10]; - k_f = 7580000 * exp(-(206.318832979935) * invT); - dlnkfdT = (206.318832979935) * invT2; - // reverse - phi_r = sc[6] * sc[8]; - Kc = exp(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[10]) + (h_RT[6] + h_RT[8])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] -= q; // O2 - wdot[6] += q; // HO2 - wdot[8] += q; // CO - wdot[10] -= q; // HCO - // d()/d[O2] - dqdci = +k_f * sc[10]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[19] += dqdci; // dwdot[HO2]/d[O2] - J[21] += dqdci; // dwdot[CO]/d[O2] - J[23] -= dqdci; // dwdot[HCO]/d[O2] - // d()/d[HO2] - dqdci = -k_r * sc[8]; - J[79] -= dqdci; // dwdot[O2]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[86] += dqdci; // dwdot[CO]/d[HO2] - J[88] -= dqdci; // dwdot[HCO]/d[HO2] - // d()/d[CO] - dqdci = -k_r * sc[6]; - J[105] -= dqdci; // dwdot[O2]/d[CO] - J[110] += dqdci; // dwdot[HO2]/d[CO] - J[112] += dqdci; // dwdot[CO]/d[CO] - J[114] -= dqdci; // dwdot[HCO]/d[CO] - // d()/d[HCO] - dqdci = +k_f * sc[1]; - J[131] -= dqdci; // dwdot[O2]/d[HCO] - J[136] += dqdci; // dwdot[HO2]/d[HCO] - J[138] += dqdci; // dwdot[CO]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - // d()/dT - J[157] -= dqdT; // dwdot[O2]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[164] += dqdT; // dwdot[CO]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - // reaction 27: H + HCO <=> CO + H2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[10]; - k_f = 72300000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[0] * sc[8]; - Kc = exp(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[10]) + (h_RT[0] + h_RT[8])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] += q; // H2 - wdot[5] -= q; // H - wdot[8] += q; // CO - wdot[10] -= q; // HCO - // d()/d[H2] - dqdci = -k_r * sc[8]; - J[0] += dqdci; // dwdot[H2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[8] += dqdci; // dwdot[CO]/d[H2] - J[10] -= dqdci; // dwdot[HCO]/d[H2] - // d()/d[H] - dqdci = +k_f * sc[10]; - J[65] += dqdci; // dwdot[H2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[73] += dqdci; // dwdot[CO]/d[H] - J[75] -= dqdci; // dwdot[HCO]/d[H] - // d()/d[CO] - dqdci = -k_r * sc[0]; - J[104] += dqdci; // dwdot[H2]/d[CO] - J[109] -= dqdci; // dwdot[H]/d[CO] - J[112] += dqdci; // dwdot[CO]/d[CO] - J[114] -= dqdci; // dwdot[HCO]/d[CO] - // d()/d[HCO] - dqdci = +k_f * sc[5]; - J[130] += dqdci; // dwdot[H2]/d[HCO] - J[135] -= dqdci; // dwdot[H]/d[HCO] - J[138] += dqdci; // dwdot[CO]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - // d()/dT - J[156] += dqdT; // dwdot[H2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[164] += dqdT; // dwdot[CO]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - // reaction 28: HCO + O <=> CO2 + H - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[10]; - k_f = 30000000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[5] * sc[9]; - Kc = exp(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[10]) + (h_RT[5] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[5] += q; // H - wdot[9] += q; // CO2 - wdot[10] -= q; // HCO - // d()/d[O] - dqdci = +k_f * sc[10]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[31] += dqdci; // dwdot[H]/d[O] - J[35] += dqdci; // dwdot[CO2]/d[O] - J[36] -= dqdci; // dwdot[HCO]/d[O] - // d()/d[H] - dqdci = -k_r * sc[9]; - J[67] -= dqdci; // dwdot[O]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - J[74] += dqdci; // dwdot[CO2]/d[H] - J[75] -= dqdci; // dwdot[HCO]/d[H] - // d()/d[CO2] - dqdci = -k_r * sc[5]; - J[119] -= dqdci; // dwdot[O]/d[CO2] - J[122] += dqdci; // dwdot[H]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - J[127] -= dqdci; // dwdot[HCO]/d[CO2] - // d()/d[HCO] - dqdci = +k_f * sc[2]; - J[132] -= dqdci; // dwdot[O]/d[HCO] - J[135] += dqdci; // dwdot[H]/d[HCO] - J[139] += dqdci; // dwdot[CO2]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - // d()/dT - J[158] -= dqdT; // dwdot[O]/dT - J[161] += dqdT; // dwdot[H]/dT - J[165] += dqdT; // dwdot[CO2]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - amrex::Real c_R[12], dcRdT[12], e_RT[12]; - amrex::Real* eh_RT; - if (HP == 1) { - cp_R(c_R, T); - dcvpRdT(dcRdT, T); - eh_RT = &h_RT[0]; - } else { - cv_R(c_R, T); - dcvpRdT(dcRdT, T); - speciesInternalEnergy(e_RT, T); - eh_RT = &e_RT[0]; - } - - amrex::Real cmix = 0.0, ehmix = 0.0, dcmixdT = 0.0, dehmixdT = 0.0; - for (int k = 0; k < 12; ++k) { - cmix += c_R[k] * sc[k]; - dcmixdT += dcRdT[k] * sc[k]; - ehmix += eh_RT[k] * wdot[k]; - dehmixdT += invT * (c_R[k] - eh_RT[k]) * wdot[k] + eh_RT[k] * J[156 + k]; - } - - amrex::Real cmixinv = 1.0 / cmix; - amrex::Real tmp1 = ehmix * cmixinv; - amrex::Real tmp3 = cmixinv * T; - amrex::Real tmp2 = tmp1 * tmp3; - amrex::Real dehmixdc; - // dTdot/d[X] - for (int k = 0; k < 12; ++k) { - dehmixdc = 0.0; - for (int m = 0; m < 12; ++m) { - dehmixdc += eh_RT[m] * J[k * 13 + m]; - } - J[k * 13 + 12] = tmp2 * c_R[k] - tmp3 * dehmixdc; - } - // dTdot/dT - J[168] = -tmp1 + tmp2 * dcmixdT - tmp3 * dehmixdT; -#else - amrex::Abort(); -#endif -} - -// compute an approx to the reaction Jacobian (for preconditioning) -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -DWDOT_SIMPLIFIED( - amrex::Real* J, const amrex::Real* sc, const amrex::Real* Tp, const int* HP) -{ - amrex::Real c[12]; - - for (int k = 0; k < 12; k++) { - c[k] = 1.e6 * sc[k]; - } - - aJacobian_precond(J, c, *Tp, *HP); - - // dwdot[k]/dT - // dTdot/d[X] - for (int k = 0; k < 12; k++) { - J[156 + k] *= 1.e-6; - J[k * 13 + 12] *= 1.e6; - } -} - -// compute the reaction Jacobian -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -aJacobian( - amrex::Real* J, const amrex::Real* sc, const amrex::Real T, const int consP) -{ - -#if defined(PELE_COMPILE_AJACOBIAN) || !defined(AMREX_USE_HIP) - for (int i = 0; i < 169; i++) { - J[i] = 0.0; - } - - amrex::Real wdot[12]; - for (auto& val : wdot) { - val = 0.0; - } - - const amrex::Real invT = 1.0 / T; - const amrex::Real invT2 = invT * invT; - const amrex::Real logT = log(T); - - // reference concentration: P_atm / (RT) in inverse mol/m^3 - amrex::Real refC = 101325 / 8.31446 / T; - amrex::Real refCinv = 1.0 / refC; - - // compute the mixture concentration - amrex::Real mixture = 0.0; - for (int k = 0; k < 12; ++k) { - mixture += sc[k]; - } - - // compute the Gibbs free energy - amrex::Real g_RT[12]; - gibbs(g_RT, T); - - // compute the species enthalpy - amrex::Real h_RT[12]; - speciesEnthalpy(h_RT, T); - - amrex::Real phi_f, k_f, k_r, phi_r, Kc, q, q_nocor, Corr, alpha; - amrex::Real dlnkfdT, dlnk0dT, dlnKcdT, dkrdT, dqdT; - amrex::Real dqdci, dcdc_fac, dqdc[12]; - amrex::Real Pr, fPr, F, k_0, logPr; - amrex::Real logFcent, troe_c, troe_n, troePr_den, troePr, troe; - amrex::Real Fcent1, Fcent2, Fcent3, Fcent; - amrex::Real dlogFdc, dlogFdn, dlogFdcn_fac; - amrex::Real dlogPrdT, dlogfPrdT, dlogFdT, dlogFcentdT, dlogFdlogPr, dlnCorrdT; - const amrex::Real ln10 = log(10.0); - const amrex::Real log10e = 1.0 / log(10.0); - // reaction 8: H + O2 (+M) <=> HO2 (+M) - // a third-body and pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + sc[0] + (0.78 - 1) * sc[1] + (11 - 1) * sc[4] + - (1.9 - 1) * sc[8] + (3.8 - 1) * sc[9]; - // forward - phi_f = sc[1] * sc[5]; - k_f = 1475000 * exp(0.6 * logT); - dlnkfdT = 0.6 * invT; - // pressure-fall-off - k_0 = 6.366e+20 * exp(-1.72 * logT - (264.088106214317) * invT); - Pr = 1e-12 * alpha / k_f * k_0; - fPr = Pr / (1.0 + Pr); - dlnk0dT = -1.72 * invT + (264.088106214317) * invT2; - dlogPrdT = log10e * (dlnk0dT - dlnkfdT); - dlogfPrdT = dlogPrdT / (1.0 + Pr); - // Troe form - logPr = log10(Pr); - Fcent1 = (1. - 0.8) * exp(-T / 1e-30); - Fcent2 = 0.8 * exp(-T / 1e+30); - Fcent3 = 0.; - Fcent = Fcent1 + Fcent2 + Fcent3; - logFcent = log10(Fcent); - troe_c = -.4 - .67 * logFcent; - troe_n = .75 - 1.27 * logFcent; - troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); - troePr = (troe_c + logPr) * troePr_den; - troe = 1.0 / (1.0 + troePr * troePr); - F = exp(M_LN10 * logFcent * troe); - dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); - dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; - dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; - dlogFdn = dlogFdcn_fac * troePr; - dlogFdlogPr = dlogFdc; - dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + - dlogFdlogPr * dlogPrdT; - // reverse - phi_r = sc[6]; - Kc = refCinv * exp(g_RT[1] + g_RT[5] - g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[6]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - Corr = fPr * F; - q = Corr * q_nocor; - dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); - dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; - // update wdot - wdot[1] -= q; // O2 - wdot[5] -= q; // H - wdot[6] += q; // HO2 - // for convenience - k_f *= Corr; - k_r *= Corr; - dcdc_fac = q / alpha * (1.0 / (Pr + 1.0) + dlogFdlogPr); - if (consP == 1) { - // d()/d[H2] - dqdci = (2 - 1) * dcdc_fac; - J[1] -= dqdci; // dwdot[O2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[6] += dqdci; // dwdot[HO2]/d[H2] - // d()/d[O2] - dqdci = (0.78 - 1) * dcdc_fac + k_f * sc[5]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[18] -= dqdci; // dwdot[H]/d[O2] - J[19] += dqdci; // dwdot[HO2]/d[O2] - // d()/d[H2O] - dqdci = (11 - 1) * dcdc_fac; - J[53] -= dqdci; // dwdot[O2]/d[H2O] - J[57] -= dqdci; // dwdot[H]/d[H2O] - J[58] += dqdci; // dwdot[HO2]/d[H2O] - // d()/d[H] - dqdci = +k_f * sc[1]; - J[66] -= dqdci; // dwdot[O2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] += dqdci; // dwdot[HO2]/d[H] - // d()/d[HO2] - dqdci = -k_r; - J[79] -= dqdci; // dwdot[O2]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - // d()/d[CO] - dqdci = (1.9 - 1) * dcdc_fac; - J[105] -= dqdci; // dwdot[O2]/d[CO] - J[109] -= dqdci; // dwdot[H]/d[CO] - J[110] += dqdci; // dwdot[HO2]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * dcdc_fac; - J[118] -= dqdci; // dwdot[O2]/d[CO2] - J[122] -= dqdci; // dwdot[H]/d[CO2] - J[123] += dqdci; // dwdot[HO2]/d[CO2] - } else { - dqdc[0] = 2 * dcdc_fac; - dqdc[1] = 0.78 * dcdc_fac + k_f * sc[5]; - dqdc[2] = dcdc_fac; - dqdc[3] = dcdc_fac; - dqdc[4] = 11 * dcdc_fac; - dqdc[5] = dcdc_fac + k_f * sc[1]; - dqdc[6] = dcdc_fac - k_r; - dqdc[7] = dcdc_fac; - dqdc[8] = 1.9 * dcdc_fac; - dqdc[9] = 3.8 * dcdc_fac; - dqdc[10] = dcdc_fac; - dqdc[11] = dcdc_fac; - for (int k = 0; k < 12; k++) { - J[13 * k + 1] -= dqdc[k]; - J[13 * k + 5] -= dqdc[k]; - J[13 * k + 6] += dqdc[k]; - } - } - J[157] -= dqdT; // dwdot[O2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] += dqdT; // dwdot[HO2]/dT - - // reaction 15: H2O2 (+M) <=> 2 OH (+M) - // a third-body and pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[7]; - k_f = 295100000000000 * exp(-(24370.7831249226) * invT); - dlnkfdT = (24370.7831249226) * invT2; - // pressure-fall-off - k_0 = 1.202e+17 * exp(-(22896.3582941147) * invT); - Pr = 1e-6 * alpha / k_f * k_0; - fPr = Pr / (1.0 + Pr); - dlnk0dT = (22896.3582941147) * invT2; - dlogPrdT = log10e * (dlnk0dT - dlnkfdT); - dlogfPrdT = dlogPrdT / (1.0 + Pr); - // Troe form - logPr = log10(Pr); - Fcent1 = (1. - 0.5) * exp(-T / 1e-30); - Fcent2 = 0.5 * exp(-T / 1e+30); - Fcent3 = 0.; - Fcent = Fcent1 + Fcent2 + Fcent3; - logFcent = log10(Fcent); - troe_c = -.4 - .67 * logFcent; - troe_n = .75 - 1.27 * logFcent; - troePr_den = 1.0 / (troe_n - .14 * (troe_c + logPr)); - troePr = (troe_c + logPr) * troePr_den; - troe = 1.0 / (1.0 + troePr * troePr); - F = exp(M_LN10 * logFcent * troe); - dlogFcentdT = log10e / Fcent * (-Fcent1 / 1e-30 - Fcent2 / 1e+30); - dlogFdcn_fac = 2.0 * logFcent * troe * troe * troePr * troePr_den; - dlogFdc = -troe_n * dlogFdcn_fac * troePr_den; - dlogFdn = dlogFdcn_fac * troePr; - dlogFdlogPr = dlogFdc; - dlogFdT = dlogFcentdT * (troe - 0.67 * dlogFdc - 1.27 * dlogFdn) + - dlogFdlogPr * dlogPrdT; - // reverse - phi_r = (sc[3] * sc[3]); - Kc = refC * exp(-2.000000 * g_RT[3] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[7]) + (2.000000 * h_RT[3]) - 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - Corr = fPr * F; - q = Corr * q_nocor; - dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); - dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; - // update wdot - wdot[3] += 2 * q; // OH - wdot[7] -= q; // H2O2 - // for convenience - k_f *= Corr; - k_r *= Corr; - dcdc_fac = q / alpha * (1.0 / (Pr + 1.0) + dlogFdlogPr); - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * dcdc_fac; - J[3] += 2 * dqdci; // dwdot[OH]/d[H2] - J[7] -= dqdci; // dwdot[H2O2]/d[H2] - // d()/d[OH] - dqdci = -k_r * 2.000000 * sc[3]; - J[42] += 2 * dqdci; // dwdot[OH]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = (12 - 1) * dcdc_fac; - J[55] += 2 * dqdci; // dwdot[OH]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[H2O2] - dqdci = +k_f; - J[94] += 2 * dqdci; // dwdot[OH]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/d[CO] - dqdci = (1.9 - 1) * dcdc_fac; - J[107] += 2 * dqdci; // dwdot[OH]/d[CO] - J[111] -= dqdci; // dwdot[H2O2]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * dcdc_fac; - J[120] += 2 * dqdci; // dwdot[OH]/d[CO2] - J[124] -= dqdci; // dwdot[H2O2]/d[CO2] - } else { - dqdc[0] = 2.5 * dcdc_fac; - dqdc[1] = dcdc_fac; - dqdc[2] = dcdc_fac; - dqdc[3] = dcdc_fac - k_r * 2.000000 * sc[3]; - dqdc[4] = 12 * dcdc_fac; - dqdc[5] = dcdc_fac; - dqdc[6] = dcdc_fac; - dqdc[7] = dcdc_fac + k_f; - dqdc[8] = 1.9 * dcdc_fac; - dqdc[9] = 3.8 * dcdc_fac; - dqdc[10] = dcdc_fac; - dqdc[11] = dcdc_fac; - for (int k = 0; k < 12; k++) { - J[13 * k + 3] += 2 * dqdc[k]; - J[13 * k + 7] -= dqdc[k]; - } - } - J[159] += 2 * dqdT; // dwdot[OH]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 21: CO + O (+M) <=> CO2 (+M) - // a third-body and pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[2] * sc[8]; - k_f = 18000 * exp(-(1199.66853127845) * invT); - dlnkfdT = (1199.66853127845) * invT2; - // pressure-fall-off - k_0 = 1.55e+24 * exp(-2.79 * logT - (2108.98104638758) * invT); - Pr = 1e-12 * alpha / k_f * k_0; - fPr = Pr / (1.0 + Pr); - dlnk0dT = -2.79 * invT + (2108.98104638758) * invT2; - dlogPrdT = log10e * (dlnk0dT - dlnkfdT); - dlogfPrdT = dlogPrdT / (1.0 + Pr); - // Lindemann form - F = 1.0; - dlogFdlogPr = 0.0; - dlogFdT = 0.0; - // reverse - phi_r = sc[9]; - Kc = refCinv * exp(g_RT[2] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[8]) + (h_RT[9]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - Corr = fPr * F; - q = Corr * q_nocor; - dlnCorrdT = ln10 * (dlogfPrdT + dlogFdT); - dqdT = Corr * (dlnkfdT * k_f * phi_f - dkrdT * phi_r) + dlnCorrdT * q; - // update wdot - wdot[2] -= q; // O - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // for convenience - k_f *= Corr; - k_r *= Corr; - dcdc_fac = q / alpha * (1.0 / (Pr + 1.0) + dlogFdlogPr); - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * dcdc_fac; - J[2] -= dqdci; // dwdot[O]/d[H2] - J[8] -= dqdci; // dwdot[CO]/d[H2] - J[9] += dqdci; // dwdot[CO2]/d[H2] - // d()/d[O] - dqdci = +k_f * sc[8]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[34] -= dqdci; // dwdot[CO]/d[O] - J[35] += dqdci; // dwdot[CO2]/d[O] - // d()/d[H2O] - dqdci = (12 - 1) * dcdc_fac; - J[54] -= dqdci; // dwdot[O]/d[H2O] - J[60] -= dqdci; // dwdot[CO]/d[H2O] - J[61] += dqdci; // dwdot[CO2]/d[H2O] - // d()/d[CO] - dqdci = (1.9 - 1) * dcdc_fac + k_f * sc[2]; - J[106] -= dqdci; // dwdot[O]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * dcdc_fac - k_r; - J[119] -= dqdci; // dwdot[O]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - } else { - dqdc[0] = 2.5 * dcdc_fac; - dqdc[1] = dcdc_fac; - dqdc[2] = dcdc_fac + k_f * sc[8]; - dqdc[3] = dcdc_fac; - dqdc[4] = 12 * dcdc_fac; - dqdc[5] = dcdc_fac; - dqdc[6] = dcdc_fac; - dqdc[7] = dcdc_fac; - dqdc[8] = 1.9 * dcdc_fac + k_f * sc[2]; - dqdc[9] = 3.8 * dcdc_fac - k_r; - dqdc[10] = dcdc_fac; - dqdc[11] = dcdc_fac; - for (int k = 0; k < 12; k++) { - J[13 * k + 2] -= dqdc[k]; - J[13 * k + 8] -= dqdc[k]; - J[13 * k + 9] += dqdc[k]; - } - } - J[158] -= dqdT; // dwdot[O]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 4: H2 + M <=> 2 H + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[0]; - k_f = 45770000000000 * exp(-1.4 * logT - (52525.7555766966) * invT); - dlnkfdT = -1.4 * invT + (52525.7555766966) * invT2; - // reverse - phi_r = (sc[5] * sc[5]); - Kc = refC * exp(g_RT[0] - 2.000000 * g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[0]) + (2.000000 * h_RT[5]) - 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] -= q; // H2 - wdot[5] += 2 * q; // H - // for convenience - k_f *= alpha; - k_r *= alpha; - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * q_nocor + k_f; - J[0] -= dqdci; // dwdot[H2]/d[H2] - J[5] += 2 * dqdci; // dwdot[H]/d[H2] - // d()/d[H2O] - dqdci = (12 - 1) * q_nocor; - J[52] -= dqdci; // dwdot[H2]/d[H2O] - J[57] += 2 * dqdci; // dwdot[H]/d[H2O] - // d()/d[H] - dqdci = -k_r * 2.000000 * sc[5]; - J[65] -= dqdci; // dwdot[H2]/d[H] - J[70] += 2 * dqdci; // dwdot[H]/d[H] - // d()/d[CO] - dqdci = (1.9 - 1) * q_nocor; - J[104] -= dqdci; // dwdot[H2]/d[CO] - J[109] += 2 * dqdci; // dwdot[H]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * q_nocor; - J[117] -= dqdci; // dwdot[H2]/d[CO2] - J[122] += 2 * dqdci; // dwdot[H]/d[CO2] - } else { - dqdc[0] = 2.5 * q_nocor + k_f; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor; - dqdc[3] = q_nocor; - dqdc[4] = 12 * q_nocor; - dqdc[5] = q_nocor - k_r * 2.000000 * sc[5]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 0] -= dqdc[k]; - J[13 * k + 5] += 2 * dqdc[k]; - } - } - J[156] -= dqdT; // dwdot[H2]/dT - J[161] += 2 * dqdT; // dwdot[H]/dT - - // reaction 5: 2 O + M <=> O2 + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = (sc[2] * sc[2]); - k_f = 6165 * exp(-0.5 * logT); - dlnkfdT = -0.5 * invT; - // reverse - phi_r = sc[1]; - Kc = refCinv * exp(-g_RT[1] + 2.000000 * g_RT[2]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(2.000000 * h_RT[2]) + (h_RT[1]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[2] -= 2 * q; // O - // for convenience - k_f *= alpha; - k_r *= alpha; - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * q_nocor; - J[1] += dqdci; // dwdot[O2]/d[H2] - J[2] += -2 * dqdci; // dwdot[O]/d[H2] - // d()/d[O2] - dqdci = -k_r; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[15] += -2 * dqdci; // dwdot[O]/d[O2] - // d()/d[O] - dqdci = +k_f * 2.000000 * sc[2]; - J[27] += dqdci; // dwdot[O2]/d[O] - J[28] += -2 * dqdci; // dwdot[O]/d[O] - // d()/d[H2O] - dqdci = (12 - 1) * q_nocor; - J[53] += dqdci; // dwdot[O2]/d[H2O] - J[54] += -2 * dqdci; // dwdot[O]/d[H2O] - // d()/d[CO] - dqdci = (1.9 - 1) * q_nocor; - J[105] += dqdci; // dwdot[O2]/d[CO] - J[106] += -2 * dqdci; // dwdot[O]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * q_nocor; - J[118] += dqdci; // dwdot[O2]/d[CO2] - J[119] += -2 * dqdci; // dwdot[O]/d[CO2] - } else { - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor - k_r; - dqdc[2] = q_nocor + k_f * 2.000000 * sc[2]; - dqdc[3] = q_nocor; - dqdc[4] = 12 * q_nocor; - dqdc[5] = q_nocor; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 1] += dqdc[k]; - J[13 * k + 2] += -2 * dqdc[k]; - } - } - J[157] += dqdT; // dwdot[O2]/dT - J[158] += -2 * dqdT; // dwdot[O]/dT - - // reaction 6: H + O + M <=> OH + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[2] * sc[5]; - k_f = 4714000 * exp(-1 * logT); - dlnkfdT = -1 * invT; - // reverse - phi_r = sc[3]; - Kc = refCinv * exp(g_RT[2] - g_RT[3] + g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[5]) + (h_RT[3]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[5] -= q; // H - // for convenience - k_f *= alpha; - k_r *= alpha; - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * q_nocor; - J[2] -= dqdci; // dwdot[O]/d[H2] - J[3] += dqdci; // dwdot[OH]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - // d()/d[O] - dqdci = +k_f * sc[5]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[31] -= dqdci; // dwdot[H]/d[O] - // d()/d[OH] - dqdci = -k_r; - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - // d()/d[H2O] - dqdci = (12 - 1) * q_nocor; - J[54] -= dqdci; // dwdot[O]/d[H2O] - J[55] += dqdci; // dwdot[OH]/d[H2O] - J[57] -= dqdci; // dwdot[H]/d[H2O] - // d()/d[H] - dqdci = +k_f * sc[2]; - J[67] -= dqdci; // dwdot[O]/d[H] - J[68] += dqdci; // dwdot[OH]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - // d()/d[CO] - dqdci = (1.9 - 1) * q_nocor; - J[106] -= dqdci; // dwdot[O]/d[CO] - J[107] += dqdci; // dwdot[OH]/d[CO] - J[109] -= dqdci; // dwdot[H]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * q_nocor; - J[119] -= dqdci; // dwdot[O]/d[CO2] - J[120] += dqdci; // dwdot[OH]/d[CO2] - J[122] -= dqdci; // dwdot[H]/d[CO2] - } else { - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor + k_f * sc[5]; - dqdc[3] = q_nocor - k_r; - dqdc[4] = 12 * q_nocor; - dqdc[5] = q_nocor + k_f * sc[2]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 2] -= dqdc[k]; - J[13 * k + 3] += dqdc[k]; - J[13 * k + 5] -= dqdc[k]; - } - } - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[161] -= dqdT; // dwdot[H]/dT - - // reaction 7: H + OH + M <=> H2O + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (12 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[3] * sc[5]; - k_f = 38000000000 * exp(-2 * logT); - dlnkfdT = -2 * invT; - // reverse - phi_r = sc[4]; - Kc = refCinv * exp(g_RT[3] - g_RT[4] + g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[5]) + (h_RT[4]) + 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[5] -= q; // H - // for convenience - k_f *= alpha; - k_r *= alpha; - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * q_nocor; - J[3] -= dqdci; // dwdot[OH]/d[H2] - J[4] += dqdci; // dwdot[H2O]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - // d()/d[OH] - dqdci = +k_f * sc[5]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - // d()/d[H2O] - dqdci = (12 - 1) * q_nocor - k_r; - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[57] -= dqdci; // dwdot[H]/d[H2O] - // d()/d[H] - dqdci = +k_f * sc[3]; - J[68] -= dqdci; // dwdot[OH]/d[H] - J[69] += dqdci; // dwdot[H2O]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - // d()/d[CO] - dqdci = (1.9 - 1) * q_nocor; - J[107] -= dqdci; // dwdot[OH]/d[CO] - J[108] += dqdci; // dwdot[H2O]/d[CO] - J[109] -= dqdci; // dwdot[H]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * q_nocor; - J[120] -= dqdci; // dwdot[OH]/d[CO2] - J[121] += dqdci; // dwdot[H2O]/d[CO2] - J[122] -= dqdci; // dwdot[H]/d[CO2] - } else { - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor; - dqdc[3] = q_nocor + k_f * sc[5]; - dqdc[4] = 12 * q_nocor - k_r; - dqdc[5] = q_nocor + k_f * sc[3]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 3] -= dqdc[k]; - J[13 * k + 4] += dqdc[k]; - J[13 * k + 5] -= dqdc[k]; - } - } - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[161] -= dqdT; // dwdot[H]/dT - - // reaction 25: HCO + M <=> CO + H + M - // a third-body and non-pressure-fall-off reaction - // 3-body correction factor - alpha = mixture + (2.5 - 1) * sc[0] + (6 - 1) * sc[4] + (1.9 - 1) * sc[8] + - (3.8 - 1) * sc[9]; - // forward - phi_f = sc[10]; - k_f = 474850 * exp(0.659 * logT - (7484.8446871794) * invT); - dlnkfdT = 0.659 * invT + (7484.8446871794) * invT2; - // reverse - phi_r = sc[5] * sc[8]; - Kc = refC * exp(-g_RT[5] - g_RT[8] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[10]) + (h_RT[5] + h_RT[8]) - 1.000000); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q_nocor = k_f * phi_f - k_r * phi_r; - q = alpha * q_nocor; - dqdT = alpha * (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[5] += q; // H - wdot[8] += q; // CO - wdot[10] -= q; // HCO - // for convenience - k_f *= alpha; - k_r *= alpha; - if (consP == 1) { - // d()/d[H2] - dqdci = (2.5 - 1) * q_nocor; - J[5] += dqdci; // dwdot[H]/d[H2] - J[8] += dqdci; // dwdot[CO]/d[H2] - J[10] -= dqdci; // dwdot[HCO]/d[H2] - // d()/d[H2O] - dqdci = (6 - 1) * q_nocor; - J[57] += dqdci; // dwdot[H]/d[H2O] - J[60] += dqdci; // dwdot[CO]/d[H2O] - J[62] -= dqdci; // dwdot[HCO]/d[H2O] - // d()/d[H] - dqdci = -k_r * sc[8]; - J[70] += dqdci; // dwdot[H]/d[H] - J[73] += dqdci; // dwdot[CO]/d[H] - J[75] -= dqdci; // dwdot[HCO]/d[H] - // d()/d[CO] - dqdci = (1.9 - 1) * q_nocor - k_r * sc[5]; - J[109] += dqdci; // dwdot[H]/d[CO] - J[112] += dqdci; // dwdot[CO]/d[CO] - J[114] -= dqdci; // dwdot[HCO]/d[CO] - // d()/d[CO2] - dqdci = (3.8 - 1) * q_nocor; - J[122] += dqdci; // dwdot[H]/d[CO2] - J[125] += dqdci; // dwdot[CO]/d[CO2] - J[127] -= dqdci; // dwdot[HCO]/d[CO2] - // d()/d[HCO] - dqdci = +k_f; - J[135] += dqdci; // dwdot[H]/d[HCO] - J[138] += dqdci; // dwdot[CO]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - } else { - dqdc[0] = 2.5 * q_nocor; - dqdc[1] = q_nocor; - dqdc[2] = q_nocor; - dqdc[3] = q_nocor; - dqdc[4] = 6 * q_nocor; - dqdc[5] = q_nocor - k_r * sc[8]; - dqdc[6] = q_nocor; - dqdc[7] = q_nocor; - dqdc[8] = 1.9 * q_nocor - k_r * sc[5]; - dqdc[9] = 3.8 * q_nocor; - dqdc[10] = q_nocor + k_f; - dqdc[11] = q_nocor; - for (int k = 0; k < 12; k++) { - J[13 * k + 5] += dqdc[k]; - J[13 * k + 8] += dqdc[k]; - J[13 * k + 10] -= dqdc[k]; - } - } - J[161] += dqdT; // dwdot[H]/dT - J[164] += dqdT; // dwdot[CO]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - // reaction 0: H + O2 <=> O + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[1] * sc[5]; - k_f = 3547000000 * exp(-0.406 * logT - (8352.89343569254) * invT); - dlnkfdT = -0.406 * invT + (8352.89343569254) * invT2; - // reverse - phi_r = sc[2] * sc[3]; - Kc = exp(g_RT[1] - g_RT[2] - g_RT[3] + g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[5]) + (h_RT[2] + h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] -= q; // O2 - wdot[2] += q; // O - wdot[3] += q; // OH - wdot[5] -= q; // H - // d()/d[O2] - dqdci = +k_f * sc[5]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[15] += dqdci; // dwdot[O]/d[O2] - J[16] += dqdci; // dwdot[OH]/d[O2] - J[18] -= dqdci; // dwdot[H]/d[O2] - // d()/d[O] - dqdci = -k_r * sc[3]; - J[27] -= dqdci; // dwdot[O2]/d[O] - J[28] += dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[31] -= dqdci; // dwdot[H]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[2]; - J[40] -= dqdci; // dwdot[O2]/d[OH] - J[41] += dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - // d()/d[H] - dqdci = +k_f * sc[1]; - J[66] -= dqdci; // dwdot[O2]/d[H] - J[67] += dqdci; // dwdot[O]/d[H] - J[68] += dqdci; // dwdot[OH]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - // d()/dT - J[157] -= dqdT; // dwdot[O2]/dT - J[158] += dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[161] -= dqdT; // dwdot[H]/dT - - // reaction 1: H2 + O <=> H + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[0] * sc[2]; - k_f = 0.0508 * exp(2.67 * logT - (3165.23282791169) * invT); - dlnkfdT = 2.67 * invT + (3165.23282791169) * invT2; - // reverse - phi_r = sc[3] * sc[5]; - Kc = exp(g_RT[0] + g_RT[2] - g_RT[3] - g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[0] + h_RT[2]) + (h_RT[3] + h_RT[5])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] -= q; // H2 - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[5] += q; // H - // d()/d[H2] - dqdci = +k_f * sc[2]; - J[0] -= dqdci; // dwdot[H2]/d[H2] - J[2] -= dqdci; // dwdot[O]/d[H2] - J[3] += dqdci; // dwdot[OH]/d[H2] - J[5] += dqdci; // dwdot[H]/d[H2] - // d()/d[O] - dqdci = +k_f * sc[0]; - J[26] -= dqdci; // dwdot[H2]/d[O] - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[31] += dqdci; // dwdot[H]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[5]; - J[39] -= dqdci; // dwdot[H2]/d[OH] - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[44] += dqdci; // dwdot[H]/d[OH] - // d()/d[H] - dqdci = -k_r * sc[3]; - J[65] -= dqdci; // dwdot[H2]/d[H] - J[67] -= dqdci; // dwdot[O]/d[H] - J[68] += dqdci; // dwdot[OH]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - // d()/dT - J[156] -= dqdT; // dwdot[H2]/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[161] += dqdT; // dwdot[H]/dT - - // reaction 2: H2 + OH <=> H + H2O - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[0] * sc[3]; - k_f = 216 * exp(1.51 * logT - (1726.03316371019) * invT); - dlnkfdT = 1.51 * invT + (1726.03316371019) * invT2; - // reverse - phi_r = sc[4] * sc[5]; - Kc = exp(g_RT[0] + g_RT[3] - g_RT[4] - g_RT[5]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[0] + h_RT[3]) + (h_RT[4] + h_RT[5])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] -= q; // H2 - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[5] += q; // H - // d()/d[H2] - dqdci = +k_f * sc[3]; - J[0] -= dqdci; // dwdot[H2]/d[H2] - J[3] -= dqdci; // dwdot[OH]/d[H2] - J[4] += dqdci; // dwdot[H2O]/d[H2] - J[5] += dqdci; // dwdot[H]/d[H2] - // d()/d[OH] - dqdci = +k_f * sc[0]; - J[39] -= dqdci; // dwdot[H2]/d[OH] - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[44] += dqdci; // dwdot[H]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[5]; - J[52] -= dqdci; // dwdot[H2]/d[H2O] - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[57] += dqdci; // dwdot[H]/d[H2O] - // d()/d[H] - dqdci = -k_r * sc[4]; - J[65] -= dqdci; // dwdot[H2]/d[H] - J[68] -= dqdci; // dwdot[OH]/d[H] - J[69] += dqdci; // dwdot[H2O]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - // d()/dT - J[156] -= dqdT; // dwdot[H2]/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[161] += dqdT; // dwdot[H]/dT - - // reaction 3: H2O + O <=> 2 OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[4]; - k_f = 2.97 * exp(2.02 * logT - (6743.10332178324) * invT); - dlnkfdT = 2.02 * invT + (6743.10332178324) * invT2; - // reverse - phi_r = (sc[3] * sc[3]); - Kc = exp(g_RT[2] - 2.000000 * g_RT[3] + g_RT[4]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[4]) + (2.000000 * h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[3] += 2 * q; // OH - wdot[4] -= q; // H2O - // d()/d[O] - dqdci = +k_f * sc[4]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += 2 * dqdci; // dwdot[OH]/d[O] - J[30] -= dqdci; // dwdot[H2O]/d[O] - // d()/d[OH] - dqdci = -k_r * 2.000000 * sc[3]; - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += 2 * dqdci; // dwdot[OH]/d[OH] - J[43] -= dqdci; // dwdot[H2O]/d[OH] - // d()/d[H2O] - dqdci = +k_f * sc[2]; - J[54] -= dqdci; // dwdot[O]/d[H2O] - J[55] += 2 * dqdci; // dwdot[OH]/d[H2O] - J[56] -= dqdci; // dwdot[H2O]/d[H2O] - // d()/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += 2 * dqdT; // dwdot[OH]/dT - J[160] -= dqdT; // dwdot[H2O]/dT - - // reaction 9: H + HO2 <=> H2 + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[6]; - k_f = 16600000 * exp(-(414.147315957284) * invT); - dlnkfdT = (414.147315957284) * invT2; - // reverse - phi_r = sc[0] * sc[1]; - Kc = exp(-g_RT[0] - g_RT[1] + g_RT[5] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (h_RT[0] + h_RT[1])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] += q; // H2 - wdot[1] += q; // O2 - wdot[5] -= q; // H - wdot[6] -= q; // HO2 - // d()/d[H2] - dqdci = -k_r * sc[1]; - J[0] += dqdci; // dwdot[H2]/d[H2] - J[1] += dqdci; // dwdot[O2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[6] -= dqdci; // dwdot[HO2]/d[H2] - // d()/d[O2] - dqdci = -k_r * sc[0]; - J[13] += dqdci; // dwdot[H2]/d[O2] - J[14] += dqdci; // dwdot[O2]/d[O2] - J[18] -= dqdci; // dwdot[H]/d[O2] - J[19] -= dqdci; // dwdot[HO2]/d[O2] - // d()/d[H] - dqdci = +k_f * sc[6]; - J[65] += dqdci; // dwdot[H2]/d[H] - J[66] += dqdci; // dwdot[O2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] -= dqdci; // dwdot[HO2]/d[H] - // d()/d[HO2] - dqdci = +k_f * sc[5]; - J[78] += dqdci; // dwdot[H2]/d[HO2] - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[156] += dqdT; // dwdot[H2]/dT - J[157] += dqdT; // dwdot[O2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 10: H + HO2 <=> 2 OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[6]; - k_f = 70790000 * exp(-(148.448916412392) * invT); - dlnkfdT = (148.448916412392) * invT2; - // reverse - phi_r = (sc[3] * sc[3]); - Kc = exp(-2.000000 * g_RT[3] + g_RT[5] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[6]) + (2.000000 * h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] += 2 * q; // OH - wdot[5] -= q; // H - wdot[6] -= q; // HO2 - // d()/d[OH] - dqdci = -k_r * 2.000000 * sc[3]; - J[42] += 2 * dqdci; // dwdot[OH]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - // d()/d[H] - dqdci = +k_f * sc[6]; - J[68] += 2 * dqdci; // dwdot[OH]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] -= dqdci; // dwdot[HO2]/d[H] - // d()/d[HO2] - dqdci = +k_f * sc[5]; - J[81] += 2 * dqdci; // dwdot[OH]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[159] += 2 * dqdT; // dwdot[OH]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 11: HO2 + O <=> O2 + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[6]; - k_f = 32500000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[1] * sc[3]; - Kc = exp(-g_RT[1] + g_RT[2] - g_RT[3] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[6]) + (h_RT[1] + h_RT[3])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[6] -= q; // HO2 - // d()/d[O2] - dqdci = -k_r * sc[3]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[15] -= dqdci; // dwdot[O]/d[O2] - J[16] += dqdci; // dwdot[OH]/d[O2] - J[19] -= dqdci; // dwdot[HO2]/d[O2] - // d()/d[O] - dqdci = +k_f * sc[6]; - J[27] += dqdci; // dwdot[O2]/d[O] - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[32] -= dqdci; // dwdot[HO2]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[1]; - J[40] += dqdci; // dwdot[O2]/d[OH] - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - // d()/d[HO2] - dqdci = +k_f * sc[2]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[80] -= dqdci; // dwdot[O]/d[HO2] - J[81] += dqdci; // dwdot[OH]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 12: HO2 + OH <=> H2O + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[6]; - k_f = 28900000 * exp(-(-250.098682904946) * invT); - dlnkfdT = (-250.098682904946) * invT2; - // reverse - phi_r = sc[1] * sc[4]; - Kc = exp(-g_RT[1] + g_RT[3] - g_RT[4] + g_RT[6]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[6]) + (h_RT[1] + h_RT[4])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[6] -= q; // HO2 - // d()/d[O2] - dqdci = -k_r * sc[4]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[16] -= dqdci; // dwdot[OH]/d[O2] - J[17] += dqdci; // dwdot[H2O]/d[O2] - J[19] -= dqdci; // dwdot[HO2]/d[O2] - // d()/d[OH] - dqdci = +k_f * sc[6]; - J[40] += dqdci; // dwdot[O2]/d[OH] - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[1]; - J[53] += dqdci; // dwdot[O2]/d[H2O] - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[58] -= dqdci; // dwdot[HO2]/d[H2O] - // d()/d[HO2] - dqdci = +k_f * sc[3]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[81] -= dqdci; // dwdot[OH]/d[HO2] - J[82] += dqdci; // dwdot[H2O]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - - // reaction 13: 2 HO2 <=> H2O2 + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = (sc[6] * sc[6]); - k_f = 420000000 * exp(-(6029.54208967215) * invT); - dlnkfdT = (6029.54208967215) * invT2; - // reverse - phi_r = sc[1] * sc[7]; - Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[6] -= 2 * q; // HO2 - wdot[7] += q; // H2O2 - // d()/d[O2] - dqdci = -k_r * sc[7]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] - J[20] += dqdci; // dwdot[H2O2]/d[O2] - // d()/d[HO2] - dqdci = +k_f * 2.000000 * sc[6]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] - J[85] += dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = -k_r * sc[1]; - J[92] += dqdci; // dwdot[O2]/d[H2O2] - J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] - J[98] += dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[162] += -2 * dqdT; // dwdot[HO2]/dT - J[163] += dqdT; // dwdot[H2O2]/dT - - // reaction 14: 2 HO2 <=> H2O2 + O2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = (sc[6] * sc[6]); - k_f = 130000 * exp(-(-819.89091359563) * invT); - dlnkfdT = (-819.89091359563) * invT2; - // reverse - phi_r = sc[1] * sc[7]; - Kc = exp(-g_RT[1] + 2.000000 * g_RT[6] - g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(2.000000 * h_RT[6]) + (h_RT[1] + h_RT[7])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] += q; // O2 - wdot[6] -= 2 * q; // HO2 - wdot[7] += q; // H2O2 - // d()/d[O2] - dqdci = -k_r * sc[7]; - J[14] += dqdci; // dwdot[O2]/d[O2] - J[19] += -2 * dqdci; // dwdot[HO2]/d[O2] - J[20] += dqdci; // dwdot[H2O2]/d[O2] - // d()/d[HO2] - dqdci = +k_f * 2.000000 * sc[6]; - J[79] += dqdci; // dwdot[O2]/d[HO2] - J[84] += -2 * dqdci; // dwdot[HO2]/d[HO2] - J[85] += dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = -k_r * sc[1]; - J[92] += dqdci; // dwdot[O2]/d[H2O2] - J[97] += -2 * dqdci; // dwdot[HO2]/d[H2O2] - J[98] += dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[157] += dqdT; // dwdot[O2]/dT - J[162] += -2 * dqdT; // dwdot[HO2]/dT - J[163] += dqdT; // dwdot[H2O2]/dT - - // reaction 16: H + H2O2 <=> H2O + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[7]; - k_f = 24100000 * exp(-(1997.77016324474) * invT); - dlnkfdT = (1997.77016324474) * invT2; - // reverse - phi_r = sc[3] * sc[4]; - Kc = exp(-g_RT[3] - g_RT[4] + g_RT[5] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[3] + h_RT[4])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] += q; // OH - wdot[4] += q; // H2O - wdot[5] -= q; // H - wdot[7] -= q; // H2O2 - // d()/d[OH] - dqdci = -k_r * sc[4]; - J[42] += dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[44] -= dqdci; // dwdot[H]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[3]; - J[55] += dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[57] -= dqdci; // dwdot[H]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[H] - dqdci = +k_f * sc[7]; - J[68] += dqdci; // dwdot[OH]/d[H] - J[69] += dqdci; // dwdot[H2O]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[72] -= dqdci; // dwdot[H2O2]/d[H] - // d()/d[H2O2] - dqdci = +k_f * sc[5]; - J[94] += dqdci; // dwdot[OH]/d[H2O2] - J[95] += dqdci; // dwdot[H2O]/d[H2O2] - J[96] -= dqdci; // dwdot[H]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[159] += dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 17: H + H2O2 <=> H2 + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[7]; - k_f = 48200000 * exp(-(4000.57249314752) * invT); - dlnkfdT = (4000.57249314752) * invT2; - // reverse - phi_r = sc[0] * sc[6]; - Kc = exp(-g_RT[0] + g_RT[5] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[7]) + (h_RT[0] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] += q; // H2 - wdot[5] -= q; // H - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[H2] - dqdci = -k_r * sc[6]; - J[0] += dqdci; // dwdot[H2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[6] += dqdci; // dwdot[HO2]/d[H2] - J[7] -= dqdci; // dwdot[H2O2]/d[H2] - // d()/d[H] - dqdci = +k_f * sc[7]; - J[65] += dqdci; // dwdot[H2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[71] += dqdci; // dwdot[HO2]/d[H] - J[72] -= dqdci; // dwdot[H2O2]/d[H] - // d()/d[HO2] - dqdci = -k_r * sc[0]; - J[78] += dqdci; // dwdot[H2]/d[HO2] - J[83] -= dqdci; // dwdot[H]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[5]; - J[91] += dqdci; // dwdot[H2]/d[H2O2] - J[96] -= dqdci; // dwdot[H]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[156] += dqdT; // dwdot[H2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 18: H2O2 + O <=> HO2 + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[7]; - k_f = 9.55 * exp(2 * logT - (1997.77016324474) * invT); - dlnkfdT = 2 * invT + (1997.77016324474) * invT2; - // reverse - phi_r = sc[3] * sc[6]; - Kc = exp(g_RT[2] - g_RT[3] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[7]) + (h_RT[3] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[3] += q; // OH - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[O] - dqdci = +k_f * sc[7]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[29] += dqdci; // dwdot[OH]/d[O] - J[32] += dqdci; // dwdot[HO2]/d[O] - J[33] -= dqdci; // dwdot[H2O2]/d[O] - // d()/d[OH] - dqdci = -k_r * sc[6]; - J[41] -= dqdci; // dwdot[O]/d[OH] - J[42] += dqdci; // dwdot[OH]/d[OH] - J[45] += dqdci; // dwdot[HO2]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[HO2] - dqdci = -k_r * sc[3]; - J[80] -= dqdci; // dwdot[O]/d[HO2] - J[81] += dqdci; // dwdot[OH]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[2]; - J[93] -= dqdci; // dwdot[O]/d[H2O2] - J[94] += dqdci; // dwdot[OH]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[158] -= dqdT; // dwdot[O]/dT - J[159] += dqdT; // dwdot[OH]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 19: H2O2 + OH <=> H2O + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[7]; - k_f = 1000000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[4] * sc[6]; - Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[OH] - dqdci = +k_f * sc[7]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[45] += dqdci; // dwdot[HO2]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[6]; - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[58] += dqdci; // dwdot[HO2]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[HO2] - dqdci = -k_r * sc[4]; - J[81] -= dqdci; // dwdot[OH]/d[HO2] - J[82] += dqdci; // dwdot[H2O]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[3]; - J[94] -= dqdci; // dwdot[OH]/d[H2O2] - J[95] += dqdci; // dwdot[H2O]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 20: H2O2 + OH <=> H2O + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[7]; - k_f = 580000000 * exp(-(4809.24167509571) * invT); - dlnkfdT = (4809.24167509571) * invT2; - // reverse - phi_r = sc[4] * sc[6]; - Kc = exp(g_RT[3] - g_RT[4] - g_RT[6] + g_RT[7]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[7]) + (h_RT[4] + h_RT[6])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[4] += q; // H2O - wdot[6] += q; // HO2 - wdot[7] -= q; // H2O2 - // d()/d[OH] - dqdci = +k_f * sc[7]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[43] += dqdci; // dwdot[H2O]/d[OH] - J[45] += dqdci; // dwdot[HO2]/d[OH] - J[46] -= dqdci; // dwdot[H2O2]/d[OH] - // d()/d[H2O] - dqdci = -k_r * sc[6]; - J[55] -= dqdci; // dwdot[OH]/d[H2O] - J[56] += dqdci; // dwdot[H2O]/d[H2O] - J[58] += dqdci; // dwdot[HO2]/d[H2O] - J[59] -= dqdci; // dwdot[H2O2]/d[H2O] - // d()/d[HO2] - dqdci = -k_r * sc[4]; - J[81] -= dqdci; // dwdot[OH]/d[HO2] - J[82] += dqdci; // dwdot[H2O]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[85] -= dqdci; // dwdot[H2O2]/d[HO2] - // d()/d[H2O2] - dqdci = +k_f * sc[3]; - J[94] -= dqdci; // dwdot[OH]/d[H2O2] - J[95] += dqdci; // dwdot[H2O]/d[H2O2] - J[97] += dqdci; // dwdot[HO2]/d[H2O2] - J[98] -= dqdci; // dwdot[H2O2]/d[H2O2] - // d()/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[160] += dqdT; // dwdot[H2O]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[163] -= dqdT; // dwdot[H2O2]/dT - - // reaction 22: CO + O2 <=> CO2 + O - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[1] * sc[8]; - k_f = 2530000 * exp(-(24003.4349588851) * invT); - dlnkfdT = (24003.4349588851) * invT2; - // reverse - phi_r = sc[2] * sc[9]; - Kc = exp(g_RT[1] - g_RT[2] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[8]) + (h_RT[2] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] -= q; // O2 - wdot[2] += q; // O - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // d()/d[O2] - dqdci = +k_f * sc[8]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[15] += dqdci; // dwdot[O]/d[O2] - J[21] -= dqdci; // dwdot[CO]/d[O2] - J[22] += dqdci; // dwdot[CO2]/d[O2] - // d()/d[O] - dqdci = -k_r * sc[9]; - J[27] -= dqdci; // dwdot[O2]/d[O] - J[28] += dqdci; // dwdot[O]/d[O] - J[34] -= dqdci; // dwdot[CO]/d[O] - J[35] += dqdci; // dwdot[CO2]/d[O] - // d()/d[CO] - dqdci = +k_f * sc[1]; - J[105] -= dqdci; // dwdot[O2]/d[CO] - J[106] += dqdci; // dwdot[O]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = -k_r * sc[2]; - J[118] -= dqdci; // dwdot[O2]/d[CO2] - J[119] += dqdci; // dwdot[O]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - // d()/dT - J[157] -= dqdT; // dwdot[O2]/dT - J[158] += dqdT; // dwdot[O]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 23: CO + HO2 <=> CO2 + OH - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[6] * sc[8]; - k_f = 30100000 * exp(-(11573.9833135086) * invT); - dlnkfdT = (11573.9833135086) * invT2; - // reverse - phi_r = sc[3] * sc[9]; - Kc = exp(-g_RT[3] + g_RT[6] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[6] + h_RT[8]) + (h_RT[3] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] += q; // OH - wdot[6] -= q; // HO2 - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // d()/d[OH] - dqdci = -k_r * sc[9]; - J[42] += dqdci; // dwdot[OH]/d[OH] - J[45] -= dqdci; // dwdot[HO2]/d[OH] - J[47] -= dqdci; // dwdot[CO]/d[OH] - J[48] += dqdci; // dwdot[CO2]/d[OH] - // d()/d[HO2] - dqdci = +k_f * sc[8]; - J[81] += dqdci; // dwdot[OH]/d[HO2] - J[84] -= dqdci; // dwdot[HO2]/d[HO2] - J[86] -= dqdci; // dwdot[CO]/d[HO2] - J[87] += dqdci; // dwdot[CO2]/d[HO2] - // d()/d[CO] - dqdci = +k_f * sc[6]; - J[107] += dqdci; // dwdot[OH]/d[CO] - J[110] -= dqdci; // dwdot[HO2]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = -k_r * sc[3]; - J[120] += dqdci; // dwdot[OH]/d[CO2] - J[123] -= dqdci; // dwdot[HO2]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - // d()/dT - J[159] += dqdT; // dwdot[OH]/dT - J[162] -= dqdT; // dwdot[HO2]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 24: CO + OH <=> CO2 + H - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[3] * sc[8]; - k_f = 0.2229 * exp(1.89 * logT - (-583.077150667929) * invT); - dlnkfdT = 1.89 * invT + (-583.077150667929) * invT2; - // reverse - phi_r = sc[5] * sc[9]; - Kc = exp(g_RT[3] - g_RT[5] + g_RT[8] - g_RT[9]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[3] + h_RT[8]) + (h_RT[5] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[3] -= q; // OH - wdot[5] += q; // H - wdot[8] -= q; // CO - wdot[9] += q; // CO2 - // d()/d[OH] - dqdci = +k_f * sc[8]; - J[42] -= dqdci; // dwdot[OH]/d[OH] - J[44] += dqdci; // dwdot[H]/d[OH] - J[47] -= dqdci; // dwdot[CO]/d[OH] - J[48] += dqdci; // dwdot[CO2]/d[OH] - // d()/d[H] - dqdci = -k_r * sc[9]; - J[68] -= dqdci; // dwdot[OH]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - J[73] -= dqdci; // dwdot[CO]/d[H] - J[74] += dqdci; // dwdot[CO2]/d[H] - // d()/d[CO] - dqdci = +k_f * sc[3]; - J[107] -= dqdci; // dwdot[OH]/d[CO] - J[109] += dqdci; // dwdot[H]/d[CO] - J[112] -= dqdci; // dwdot[CO]/d[CO] - J[113] += dqdci; // dwdot[CO2]/d[CO] - // d()/d[CO2] - dqdci = -k_r * sc[5]; - J[120] -= dqdci; // dwdot[OH]/d[CO2] - J[122] += dqdci; // dwdot[H]/d[CO2] - J[125] -= dqdci; // dwdot[CO]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - // d()/dT - J[159] -= dqdT; // dwdot[OH]/dT - J[161] += dqdT; // dwdot[H]/dT - J[164] -= dqdT; // dwdot[CO]/dT - J[165] += dqdT; // dwdot[CO2]/dT - - // reaction 26: HCO + O2 <=> CO + HO2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[1] * sc[10]; - k_f = 7580000 * exp(-(206.318832979935) * invT); - dlnkfdT = (206.318832979935) * invT2; - // reverse - phi_r = sc[6] * sc[8]; - Kc = exp(g_RT[1] - g_RT[6] - g_RT[8] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[1] + h_RT[10]) + (h_RT[6] + h_RT[8])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[1] -= q; // O2 - wdot[6] += q; // HO2 - wdot[8] += q; // CO - wdot[10] -= q; // HCO - // d()/d[O2] - dqdci = +k_f * sc[10]; - J[14] -= dqdci; // dwdot[O2]/d[O2] - J[19] += dqdci; // dwdot[HO2]/d[O2] - J[21] += dqdci; // dwdot[CO]/d[O2] - J[23] -= dqdci; // dwdot[HCO]/d[O2] - // d()/d[HO2] - dqdci = -k_r * sc[8]; - J[79] -= dqdci; // dwdot[O2]/d[HO2] - J[84] += dqdci; // dwdot[HO2]/d[HO2] - J[86] += dqdci; // dwdot[CO]/d[HO2] - J[88] -= dqdci; // dwdot[HCO]/d[HO2] - // d()/d[CO] - dqdci = -k_r * sc[6]; - J[105] -= dqdci; // dwdot[O2]/d[CO] - J[110] += dqdci; // dwdot[HO2]/d[CO] - J[112] += dqdci; // dwdot[CO]/d[CO] - J[114] -= dqdci; // dwdot[HCO]/d[CO] - // d()/d[HCO] - dqdci = +k_f * sc[1]; - J[131] -= dqdci; // dwdot[O2]/d[HCO] - J[136] += dqdci; // dwdot[HO2]/d[HCO] - J[138] += dqdci; // dwdot[CO]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - // d()/dT - J[157] -= dqdT; // dwdot[O2]/dT - J[162] += dqdT; // dwdot[HO2]/dT - J[164] += dqdT; // dwdot[CO]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - // reaction 27: H + HCO <=> CO + H2 - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[5] * sc[10]; - k_f = 72300000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[0] * sc[8]; - Kc = exp(-g_RT[0] + g_RT[5] - g_RT[8] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[5] + h_RT[10]) + (h_RT[0] + h_RT[8])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[0] += q; // H2 - wdot[5] -= q; // H - wdot[8] += q; // CO - wdot[10] -= q; // HCO - // d()/d[H2] - dqdci = -k_r * sc[8]; - J[0] += dqdci; // dwdot[H2]/d[H2] - J[5] -= dqdci; // dwdot[H]/d[H2] - J[8] += dqdci; // dwdot[CO]/d[H2] - J[10] -= dqdci; // dwdot[HCO]/d[H2] - // d()/d[H] - dqdci = +k_f * sc[10]; - J[65] += dqdci; // dwdot[H2]/d[H] - J[70] -= dqdci; // dwdot[H]/d[H] - J[73] += dqdci; // dwdot[CO]/d[H] - J[75] -= dqdci; // dwdot[HCO]/d[H] - // d()/d[CO] - dqdci = -k_r * sc[0]; - J[104] += dqdci; // dwdot[H2]/d[CO] - J[109] -= dqdci; // dwdot[H]/d[CO] - J[112] += dqdci; // dwdot[CO]/d[CO] - J[114] -= dqdci; // dwdot[HCO]/d[CO] - // d()/d[HCO] - dqdci = +k_f * sc[5]; - J[130] += dqdci; // dwdot[H2]/d[HCO] - J[135] -= dqdci; // dwdot[H]/d[HCO] - J[138] += dqdci; // dwdot[CO]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - // d()/dT - J[156] += dqdT; // dwdot[H2]/dT - J[161] -= dqdT; // dwdot[H]/dT - J[164] += dqdT; // dwdot[CO]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - // reaction 28: HCO + O <=> CO2 + H - // a non-third-body and non-pressure-fall-off reaction - // forward - phi_f = sc[2] * sc[10]; - k_f = 30000000; - dlnkfdT = 0.0; - // reverse - phi_r = sc[5] * sc[9]; - Kc = exp(g_RT[2] - g_RT[5] - g_RT[9] + g_RT[10]); - k_r = k_f / Kc; - dlnKcdT = invT * (-(h_RT[2] + h_RT[10]) + (h_RT[5] + h_RT[9])); - dkrdT = (dlnkfdT - dlnKcdT) * k_r; - // rate of progress - q = k_f * phi_f - k_r * phi_r; - dqdT = (dlnkfdT * k_f * phi_f - dkrdT * phi_r); - // update wdot - wdot[2] -= q; // O - wdot[5] += q; // H - wdot[9] += q; // CO2 - wdot[10] -= q; // HCO - // d()/d[O] - dqdci = +k_f * sc[10]; - J[28] -= dqdci; // dwdot[O]/d[O] - J[31] += dqdci; // dwdot[H]/d[O] - J[35] += dqdci; // dwdot[CO2]/d[O] - J[36] -= dqdci; // dwdot[HCO]/d[O] - // d()/d[H] - dqdci = -k_r * sc[9]; - J[67] -= dqdci; // dwdot[O]/d[H] - J[70] += dqdci; // dwdot[H]/d[H] - J[74] += dqdci; // dwdot[CO2]/d[H] - J[75] -= dqdci; // dwdot[HCO]/d[H] - // d()/d[CO2] - dqdci = -k_r * sc[5]; - J[119] -= dqdci; // dwdot[O]/d[CO2] - J[122] += dqdci; // dwdot[H]/d[CO2] - J[126] += dqdci; // dwdot[CO2]/d[CO2] - J[127] -= dqdci; // dwdot[HCO]/d[CO2] - // d()/d[HCO] - dqdci = +k_f * sc[2]; - J[132] -= dqdci; // dwdot[O]/d[HCO] - J[135] += dqdci; // dwdot[H]/d[HCO] - J[139] += dqdci; // dwdot[CO2]/d[HCO] - J[140] -= dqdci; // dwdot[HCO]/d[HCO] - // d()/dT - J[158] -= dqdT; // dwdot[O]/dT - J[161] += dqdT; // dwdot[H]/dT - J[165] += dqdT; // dwdot[CO2]/dT - J[166] -= dqdT; // dwdot[HCO]/dT - - amrex::Real c_R[12], dcRdT[12], e_RT[12]; - amrex::Real* eh_RT; - if (consP == 1) { - cp_R(c_R, T); - dcvpRdT(dcRdT, T); - eh_RT = &h_RT[0]; - } else { - cv_R(c_R, T); - dcvpRdT(dcRdT, T); - speciesInternalEnergy(e_RT, T); - eh_RT = &e_RT[0]; - } - - amrex::Real cmix = 0.0, ehmix = 0.0, dcmixdT = 0.0, dehmixdT = 0.0; - for (int k = 0; k < 12; ++k) { - cmix += c_R[k] * sc[k]; - dcmixdT += dcRdT[k] * sc[k]; - ehmix += eh_RT[k] * wdot[k]; - dehmixdT += invT * (c_R[k] - eh_RT[k]) * wdot[k] + eh_RT[k] * J[156 + k]; - } - - amrex::Real cmixinv = 1.0 / cmix; - amrex::Real tmp1 = ehmix * cmixinv; - amrex::Real tmp3 = cmixinv * T; - amrex::Real tmp2 = tmp1 * tmp3; - amrex::Real dehmixdc; - // dTdot/d[X] - for (int k = 0; k < 12; ++k) { - dehmixdc = 0.0; - for (int m = 0; m < 12; ++m) { - dehmixdc += eh_RT[m] * J[k * 13 + m]; - } - J[k * 13 + 12] = tmp2 * c_R[k] - tmp3 * dehmixdc; - } - // dTdot/dT - J[168] = -tmp1 + tmp2 * dcmixdT - tmp3 * dehmixdT; -#else - amrex::Abort(); -#endif -} - -// compute the reaction Jacobian -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -DWDOT( - amrex::Real* J, - const amrex::Real* sc, - const amrex::Real* Tp, - const int* consP) -{ - amrex::Real c[12]; - - for (int k = 0; k < 12; k++) { - c[k] = 1.e6 * sc[k]; - } - - aJacobian(J, c, *Tp, *consP); - - // dwdot[k]/dT - // dTdot/d[X] - for (int k = 0; k < 12; k++) { - J[156 + k] *= 1.e-6; - J[k * 13 + 12] *= 1.e6; - } -} - -// Transport function declarations - -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetLENIMC(int* LENIMC) -{ - *LENIMC = 50; -} - -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetLENRMC(int* LENRMC) -{ - *LENRMC = 3156; -} - -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetNO(int* NO) -{ - *NO = 4; -} - -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetKK(int* KK) -{ - *KK = 12; -} - -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetNLITE(int* NLITE) -{ - *NLITE = 2; -} - -// Patm in ergs/cm3 -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetPATM(amrex::Real* PATM) -{ - *PATM = 0.1013250000000000E+07; -} - -// the molecular weights in g/mol -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetWT(amrex::Real* WT) -{ - WT[0] = 2.01600000E+00; - WT[1] = 3.19980000E+01; - WT[2] = 1.59990000E+01; - WT[3] = 1.70070000E+01; - WT[4] = 1.80150000E+01; - WT[5] = 1.00800000E+00; - WT[6] = 3.30060000E+01; - WT[7] = 3.40140000E+01; - WT[8] = 2.80100000E+01; - WT[9] = 4.40090000E+01; - WT[10] = 2.90180000E+01; - WT[11] = 2.80140000E+01; -} - -// the lennard-jones potential well depth eps/kb in K -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetEPS(amrex::Real* EPS) -{ - EPS[0] = 3.80000000E+01; - EPS[1] = 1.07400000E+02; - EPS[2] = 8.00000000E+01; - EPS[3] = 8.00000000E+01; - EPS[4] = 5.72400000E+02; - EPS[5] = 1.45000000E+02; - EPS[6] = 1.07400000E+02; - EPS[7] = 1.07400000E+02; - EPS[8] = 9.81000000E+01; - EPS[9] = 2.44000000E+02; - EPS[10] = 4.98000000E+02; - EPS[11] = 9.75300000E+01; -} - -// the lennard-jones collision diameter in Angstroms -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetSIG(amrex::Real* SIG) -{ - SIG[0] = 2.92000000E+00; - SIG[1] = 3.45800000E+00; - SIG[2] = 2.75000000E+00; - SIG[3] = 2.75000000E+00; - SIG[4] = 2.60500000E+00; - SIG[5] = 2.05000000E+00; - SIG[6] = 3.45800000E+00; - SIG[7] = 3.45800000E+00; - SIG[8] = 3.65000000E+00; - SIG[9] = 3.76300000E+00; - SIG[10] = 3.59000000E+00; - SIG[11] = 3.62100000E+00; -} - -// the dipole moment in Debye -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetDIP(amrex::Real* DIP) -{ - DIP[0] = 0.00000000E+00; - DIP[1] = 0.00000000E+00; - DIP[2] = 0.00000000E+00; - DIP[3] = 0.00000000E+00; - DIP[4] = 1.84400000E+00; - DIP[5] = 0.00000000E+00; - DIP[6] = 0.00000000E+00; - DIP[7] = 0.00000000E+00; - DIP[8] = 0.00000000E+00; - DIP[9] = 0.00000000E+00; - DIP[10] = 0.00000000E+00; - DIP[11] = 0.00000000E+00; -} - -// the polarizability in cubic Angstroms -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetPOL(amrex::Real* POL) -{ - POL[0] = 7.90000000E-01; - POL[1] = 1.60000000E+00; - POL[2] = 0.00000000E+00; - POL[3] = 0.00000000E+00; - POL[4] = 0.00000000E+00; - POL[5] = 0.00000000E+00; - POL[6] = 0.00000000E+00; - POL[7] = 0.00000000E+00; - POL[8] = 1.95000000E+00; - POL[9] = 2.65000000E+00; - POL[10] = 0.00000000E+00; - POL[11] = 1.76000000E+00; -} - -// the rotational relaxation collision number at 298 K -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetZROT(amrex::Real* ZROT) -{ - ZROT[0] = 2.80000000E+02; - ZROT[1] = 3.80000000E+00; - ZROT[2] = 0.00000000E+00; - ZROT[3] = 0.00000000E+00; - ZROT[4] = 4.00000000E+00; - ZROT[5] = 0.00000000E+00; - ZROT[6] = 1.00000000E+00; - ZROT[7] = 3.80000000E+00; - ZROT[8] = 1.80000000E+00; - ZROT[9] = 2.10000000E+00; - ZROT[10] = 0.00000000E+00; - ZROT[11] = 4.00000000E+00; -} - -// 0: monoatomic, 1: linear, 2: nonlinear -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetNLIN(int* NLIN) -{ - NLIN[0] = 1; - NLIN[1] = 1; - NLIN[2] = 0; - NLIN[3] = 1; - NLIN[4] = 2; - NLIN[5] = 0; - NLIN[6] = 2; - NLIN[7] = 2; - NLIN[8] = 1; - NLIN[9] = 1; - NLIN[10] = 2; - NLIN[11] = 1; -} - -// Poly fits for the viscosities, dim NO*KK -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetCOFETA(amrex::Real* COFETA) -{ - COFETA[0] = -1.37549291E+01; - COFETA[1] = 9.65530587E-01; - COFETA[2] = -4.45720114E-02; - COFETA[3] = 2.05871810E-03; - COFETA[4] = -1.68118998E+01; - COFETA[5] = 2.52362554E+00; - COFETA[6] = -2.49309128E-01; - COFETA[7] = 1.10211025E-02; - COFETA[8] = -1.48001711E+01; - COFETA[9] = 1.79491990E+00; - COFETA[10] = -1.54008440E-01; - COFETA[11] = 6.86719439E-03; - COFETA[12] = -1.47696217E+01; - COFETA[13] = 1.79491990E+00; - COFETA[14] = -1.54008440E-01; - COFETA[15] = 6.86719439E-03; - COFETA[16] = -1.17770995E+01; - COFETA[17] = -8.26744826E-01; - COFETA[18] = 3.39009392E-01; - COFETA[19] = -2.00674472E-02; - COFETA[20] = -1.98744352E+01; - COFETA[21] = 3.41660514E+00; - COFETA[22] = -3.63206306E-01; - COFETA[23] = 1.58671021E-02; - COFETA[24] = -1.67963918E+01; - COFETA[25] = 2.52362554E+00; - COFETA[26] = -2.49309128E-01; - COFETA[27] = 1.10211025E-02; - COFETA[28] = -1.67813504E+01; - COFETA[29] = 2.52362554E+00; - COFETA[30] = -2.49309128E-01; - COFETA[31] = 1.10211025E-02; - COFETA[32] = -1.63031343E+01; - COFETA[33] = 2.26143219E+00; - COFETA[34] = -2.15114671E-01; - COFETA[35] = 9.53461976E-03; - COFETA[36] = -2.36749638E+01; - COFETA[37] = 4.99775518E+00; - COFETA[38] = -5.52687718E-01; - COFETA[39] = 2.34353338E-02; - COFETA[40] = -2.11306886E+01; - COFETA[41] = 3.26961843E+00; - COFETA[42] = -2.51355092E-01; - COFETA[43] = 7.35605058E-03; - COFETA[44] = -1.62526676E+01; - COFETA[45] = 2.24839597E+00; - COFETA[46] = -2.13428438E-01; - COFETA[47] = 9.46192413E-03; -} - -// Poly fits for the conductivities, dim NO*KK -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetCOFLAM(amrex::Real* COFLAM) -{ - COFLAM[0] = 1.11035309E+01; - COFLAM[1] = -1.31883723E+00; - COFLAM[2] = 2.44042222E-01; - COFLAM[3] = -8.99835317E-03; - COFLAM[4] = -2.51295522E+00; - COFLAM[5] = 3.15165699E+00; - COFLAM[6] = -3.10007687E-01; - COFLAM[7] = 1.34522334E-02; - COFLAM[8] = 1.98515155E+00; - COFLAM[9] = 1.79491990E+00; - COFLAM[10] = -1.54008440E-01; - COFLAM[11] = 6.86719439E-03; - COFLAM[12] = 1.60618776E+01; - COFLAM[13] = -4.10626624E+00; - COFLAM[14] = 6.63570999E-01; - COFLAM[15] = -2.97906170E-02; - COFLAM[16] = 2.21730553E+01; - COFLAM[17] = -8.46935470E+00; - COFLAM[18] = 1.46153792E+00; - COFLAM[19] = -7.29502313E-02; - COFLAM[20] = -3.24554543E-01; - COFLAM[21] = 3.41660514E+00; - COFLAM[22] = -3.63206306E-01; - COFLAM[23] = 1.58671021E-02; - COFLAM[24] = 5.56033781E-01; - COFLAM[25] = 1.59073629E+00; - COFLAM[26] = -5.28054537E-02; - COFLAM[27] = 4.07605156E-04; - COFLAM[28] = 1.48802076E+00; - COFLAM[29] = 1.06176261E+00; - COFLAM[30] = 5.72195029E-02; - COFLAM[31] = -6.38391114E-03; - COFLAM[32] = 9.94279641E+00; - COFLAM[33] = -2.29161583E+00; - COFLAM[34] = 4.74393158E-01; - COFLAM[35] = -2.40686330E-02; - COFLAM[36] = -1.21375517E+01; - COFLAM[37] = 6.23624372E+00; - COFLAM[38] = -6.22471355E-01; - COFLAM[39] = 2.30613270E-02; - COFLAM[40] = 1.70862641E+00; - COFLAM[41] = -1.65304969E-01; - COFLAM[42] = 3.30690188E-01; - COFLAM[43] = -2.30097301E-02; - COFLAM[44] = 1.15507226E+01; - COFLAM[45] = -2.91453572E+00; - COFLAM[46] = 5.55045264E-01; - COFLAM[47] = -2.75173246E-02; -} - -// Poly fits for the diffusion coefficients, dim NO*KK*KK -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetCOFD(amrex::Real* COFD) -{ - COFD[0] = -1.02395385E+01; - COFD[1] = 2.15403244E+00; - COFD[2] = -6.97480266E-02; - COFD[3] = 3.23666871E-03; - COFD[4] = -1.15797897E+01; - COFD[5] = 2.43235504E+00; - COFD[6] = -1.02890179E-01; - COFD[7] = 4.52903603E-03; - COFD[8] = -1.06250314E+01; - COFD[9] = 2.15849701E+00; - COFD[10] = -6.53886401E-02; - COFD[11] = 2.81453370E-03; - COFD[12] = -1.06283588E+01; - COFD[13] = 2.15849701E+00; - COFD[14] = -6.53886401E-02; - COFD[15] = 2.81453370E-03; - COFD[16] = -1.68759075E+01; - COFD[17] = 4.49460341E+00; - COFD[18] = -3.64766179E-01; - COFD[19] = 1.56457173E-02; - COFD[20] = -1.11808845E+01; - COFD[21] = 2.66936727E+00; - COFD[22] = -1.34411514E-01; - COFD[23] = 5.92957488E-03; - COFD[24] = -1.15806955E+01; - COFD[25] = 2.43235504E+00; - COFD[26] = -1.02890179E-01; - COFD[27] = 4.52903603E-03; - COFD[28] = -1.15815492E+01; - COFD[29] = 2.43235504E+00; - COFD[30] = -1.02890179E-01; - COFD[31] = 4.52903603E-03; - COFD[32] = -1.13541221E+01; - COFD[33] = 2.31999438E+00; - COFD[34] = -8.75064804E-02; - COFD[35] = 3.82656365E-03; - COFD[36] = -1.35545391E+01; - COFD[37] = 3.13878730E+00; - COFD[38] = -1.94980335E-01; - COFD[39] = 8.53744486E-03; - COFD[40] = -1.57161352E+01; - COFD[41] = 3.96062263E+00; - COFD[42] = -2.98964970E-01; - COFD[43] = 1.29322565E-02; - COFD[44] = -1.13253618E+01; - COFD[45] = 2.31195095E+00; - COFD[46] = -8.63988037E-02; - COFD[47] = 3.77573452E-03; - COFD[48] = -1.15797897E+01; - COFD[49] = 2.43235504E+00; - COFD[50] = -1.02890179E-01; - COFD[51] = 4.52903603E-03; - COFD[52] = -1.53110597E+01; - COFD[53] = 3.37317428E+00; - COFD[54] = -2.24900439E-01; - COFD[55] = 9.81228151E-03; - COFD[56] = -1.40864784E+01; - COFD[57] = 3.07458927E+00; - COFD[58] = -1.86899591E-01; - COFD[59] = 8.19829781E-03; - COFD[60] = -1.41066358E+01; - COFD[61] = 3.07458927E+00; - COFD[62] = -1.86899591E-01; - COFD[63] = 8.19829781E-03; - COFD[64] = -2.10639926E+01; - COFD[65] = 5.50980703E+00; - COFD[66] = -4.78335492E-01; - COFD[67] = 1.98515434E-02; - COFD[68] = -1.43713019E+01; - COFD[69] = 3.70920439E+00; - COFD[70] = -2.67274113E-01; - COFD[71] = 1.15967481E-02; - COFD[72] = -1.53187536E+01; - COFD[73] = 3.37317428E+00; - COFD[74] = -2.24900439E-01; - COFD[75] = 9.81228151E-03; - COFD[76] = -1.53261011E+01; - COFD[77] = 3.37317428E+00; - COFD[78] = -2.24900439E-01; - COFD[79] = 9.81228151E-03; - COFD[80] = -1.50371688E+01; - COFD[81] = 3.26249588E+00; - COFD[82] = -2.10658287E-01; - COFD[83] = 9.20032462E-03; - COFD[84] = -1.81197250E+01; - COFD[85] = 4.33684042E+00; - COFD[86] = -3.44981265E-01; - COFD[87] = 1.48142449E-02; - COFD[88] = -2.05107395E+01; - COFD[89] = 5.21473296E+00; - COFD[90] = -4.48646311E-01; - COFD[91] = 1.89013813E-02; - COFD[92] = -1.50096252E+01; - COFD[93] = 3.25515933E+00; - COFD[94] = -2.09710110E-01; - COFD[95] = 9.15941830E-03; - COFD[96] = -1.06250314E+01; - COFD[97] = 2.15849701E+00; - COFD[98] = -6.53886401E-02; - COFD[99] = 2.81453370E-03; - COFD[100] = -1.40864784E+01; - COFD[101] = 3.07458927E+00; - COFD[102] = -1.86899591E-01; - COFD[103] = 8.19829781E-03; - COFD[104] = -1.29877255E+01; - COFD[105] = 2.80841511E+00; - COFD[106] = -1.52629888E-01; - COFD[107] = 6.72604927E-03; - COFD[108] = -1.30027669E+01; - COFD[109] = 2.80841511E+00; - COFD[110] = -1.52629888E-01; - COFD[111] = 6.72604927E-03; - COFD[112] = -1.91096700E+01; - COFD[113] = 5.02608697E+00; - COFD[114] = -4.26959993E-01; - COFD[115] = 1.80709910E-02; - COFD[116] = -1.31860264E+01; - COFD[117] = 3.38003453E+00; - COFD[118] = -2.25783856E-01; - COFD[119] = 9.85028660E-03; - COFD[120] = -1.40915944E+01; - COFD[121] = 3.07458927E+00; - COFD[122] = -1.86899591E-01; - COFD[123] = 8.19829781E-03; - COFD[124] = -1.40964555E+01; - COFD[125] = 3.07458927E+00; - COFD[126] = -1.86899591E-01; - COFD[127] = 8.19829781E-03; - COFD[128] = -1.39007309E+01; - COFD[129] = 2.99164244E+00; - COFD[130] = -1.76293106E-01; - COFD[131] = 7.74575100E-03; - COFD[132] = -1.67115471E+01; - COFD[133] = 3.98859394E+00; - COFD[134] = -3.02316219E-01; - COFD[135] = 1.30661099E-02; - COFD[136] = -1.91045520E+01; - COFD[137] = 4.87977047E+00; - COFD[138] = -4.10448693E-01; - COFD[139] = 1.74535827E-02; - COFD[140] = -1.38756380E+01; - COFD[141] = 2.98558426E+00; - COFD[142] = -1.75507216E-01; - COFD[143] = 7.71173691E-03; - COFD[144] = -1.06283588E+01; - COFD[145] = 2.15849701E+00; - COFD[146] = -6.53886401E-02; - COFD[147] = 2.81453370E-03; - COFD[148] = -1.41066358E+01; - COFD[149] = 3.07458927E+00; - COFD[150] = -1.86899591E-01; - COFD[151] = 8.19829781E-03; - COFD[152] = -1.30027669E+01; - COFD[153] = 2.80841511E+00; - COFD[154] = -1.52629888E-01; - COFD[155] = 6.72604927E-03; - COFD[156] = -1.30182749E+01; - COFD[157] = 2.80841511E+00; - COFD[158] = -1.52629888E-01; - COFD[159] = 6.72604927E-03; - COFD[160] = -1.91256173E+01; - COFD[161] = 5.02608697E+00; - COFD[162] = -4.26959993E-01; - COFD[163] = 1.80709910E-02; - COFD[164] = -1.31877859E+01; - COFD[165] = 3.38003453E+00; - COFD[166] = -2.25783856E-01; - COFD[167] = 9.85028660E-03; - COFD[168] = -1.41119635E+01; - COFD[169] = 3.07458927E+00; - COFD[170] = -1.86899591E-01; - COFD[171] = 8.19829781E-03; - COFD[172] = -1.41170278E+01; - COFD[173] = 3.07458927E+00; - COFD[174] = -1.86899591E-01; - COFD[175] = 8.19829781E-03; - COFD[176] = -1.39199573E+01; - COFD[177] = 2.99164244E+00; - COFD[178] = -1.76293106E-01; - COFD[179] = 7.74575100E-03; - COFD[180] = -1.67337674E+01; - COFD[181] = 3.98859394E+00; - COFD[182] = -3.02316219E-01; - COFD[183] = 1.30661099E-02; - COFD[184] = -1.91240292E+01; - COFD[185] = 4.87977047E+00; - COFD[186] = -4.10448693E-01; - COFD[187] = 1.74535827E-02; - COFD[188] = -1.38948654E+01; - COFD[189] = 2.98558426E+00; - COFD[190] = -1.75507216E-01; - COFD[191] = 7.71173691E-03; - COFD[192] = -1.68759075E+01; - COFD[193] = 4.49460341E+00; - COFD[194] = -3.64766179E-01; - COFD[195] = 1.56457173E-02; - COFD[196] = -2.10639926E+01; - COFD[197] = 5.50980703E+00; - COFD[198] = -4.78335492E-01; - COFD[199] = 1.98515434E-02; - COFD[200] = -1.91096700E+01; - COFD[201] = 5.02608697E+00; - COFD[202] = -4.26959993E-01; - COFD[203] = 1.80709910E-02; - COFD[204] = -1.91256173E+01; - COFD[205] = 5.02608697E+00; - COFD[206] = -4.26959993E-01; - COFD[207] = 1.80709910E-02; - COFD[208] = -1.31492509E+01; - COFD[209] = 1.48004045E+00; - COFD[210] = 1.60499956E-01; - COFD[211] = -1.19765871E-02; - COFD[212] = -1.93611201E+01; - COFD[213] = 5.51579726E+00; - COFD[214] = -4.76061961E-01; - COFD[215] = 1.96329391E-02; - COFD[216] = -2.04177394E+01; - COFD[217] = 5.31457079E+00; - COFD[218] = -4.58216496E-01; - COFD[219] = 1.91825910E-02; - COFD[220] = -2.04229988E+01; - COFD[221] = 5.31457079E+00; - COFD[222] = -4.58216496E-01; - COFD[223] = 1.91825910E-02; - COFD[224] = -2.08943723E+01; - COFD[225] = 5.44718673E+00; - COFD[226] = -4.72082974E-01; - COFD[227] = 1.96531328E-02; - COFD[228] = -2.12021420E+01; - COFD[229] = 5.20775027E+00; - COFD[230] = -4.07348285E-01; - COFD[231] = 1.55473262E-02; - COFD[232] = -1.87171338E+01; - COFD[233] = 4.00967621E+00; - COFD[234] = -2.21153539E-01; - COFD[235] = 6.31528745E-03; - COFD[236] = -2.08123331E+01; - COFD[237] = 5.42470175E+00; - COFD[238] = -4.69700438E-01; - COFD[239] = 1.95706912E-02; - COFD[240] = -1.11808845E+01; - COFD[241] = 2.66936727E+00; - COFD[242] = -1.34411514E-01; - COFD[243] = 5.92957488E-03; - COFD[244] = -1.43713019E+01; - COFD[245] = 3.70920439E+00; - COFD[246] = -2.67274113E-01; - COFD[247] = 1.15967481E-02; - COFD[248] = -1.31860264E+01; - COFD[249] = 3.38003453E+00; - COFD[250] = -2.25783856E-01; - COFD[251] = 9.85028660E-03; - COFD[252] = -1.31877859E+01; - COFD[253] = 3.38003453E+00; - COFD[254] = -2.25783856E-01; - COFD[255] = 9.85028660E-03; - COFD[256] = -1.93611201E+01; - COFD[257] = 5.51579726E+00; - COFD[258] = -4.76061961E-01; - COFD[259] = 1.96329391E-02; - COFD[260] = -1.43693219E+01; - COFD[261] = 4.03992999E+00; - COFD[262] = -3.08044800E-01; - COFD[263] = 1.32757775E-02; - COFD[264] = -1.43717684E+01; - COFD[265] = 3.70920439E+00; - COFD[266] = -2.67274113E-01; - COFD[267] = 1.15967481E-02; - COFD[268] = -1.43722077E+01; - COFD[269] = 3.70920439E+00; - COFD[270] = -2.67274113E-01; - COFD[271] = 1.15967481E-02; - COFD[272] = -1.40524219E+01; - COFD[273] = 3.56261348E+00; - COFD[274] = -2.48287981E-01; - COFD[275] = 1.07752947E-02; - COFD[276] = -1.72994129E+01; - COFD[277] = 4.71931868E+00; - COFD[278] = -3.91258152E-01; - COFD[279] = 1.66866639E-02; - COFD[280] = -1.95312879E+01; - COFD[281] = 5.47046983E+00; - COFD[282] = -4.74577605E-01; - COFD[283] = 1.97408822E-02; - COFD[284] = -1.40298991E+01; - COFD[285] = 3.55837688E+00; - COFD[286] = -2.47785790E-01; - COFD[287] = 1.07555332E-02; - COFD[288] = -1.15806955E+01; - COFD[289] = 2.43235504E+00; - COFD[290] = -1.02890179E-01; - COFD[291] = 4.52903603E-03; - COFD[292] = -1.53187536E+01; - COFD[293] = 3.37317428E+00; - COFD[294] = -2.24900439E-01; - COFD[295] = 9.81228151E-03; - COFD[296] = -1.40915944E+01; - COFD[297] = 3.07458927E+00; - COFD[298] = -1.86899591E-01; - COFD[299] = 8.19829781E-03; - COFD[300] = -1.41119635E+01; - COFD[301] = 3.07458927E+00; - COFD[302] = -1.86899591E-01; - COFD[303] = 8.19829781E-03; - COFD[304] = -2.04177394E+01; - COFD[305] = 5.31457079E+00; - COFD[306] = -4.58216496E-01; - COFD[307] = 1.91825910E-02; - COFD[308] = -1.43717684E+01; - COFD[309] = 3.70920439E+00; - COFD[310] = -2.67274113E-01; - COFD[311] = 1.15967481E-02; - COFD[312] = -1.53265677E+01; - COFD[313] = 3.37317428E+00; - COFD[314] = -2.24900439E-01; - COFD[315] = 9.81228151E-03; - COFD[316] = -1.53340319E+01; - COFD[317] = 3.37317428E+00; - COFD[318] = -2.24900439E-01; - COFD[319] = 9.81228151E-03; - COFD[320] = -1.50443476E+01; - COFD[321] = 3.26249588E+00; - COFD[322] = -2.10658287E-01; - COFD[323] = 9.20032462E-03; - COFD[324] = -1.81286456E+01; - COFD[325] = 4.33684042E+00; - COFD[326] = -3.44981265E-01; - COFD[327] = 1.48142449E-02; - COFD[328] = -2.05180548E+01; - COFD[329] = 5.21473296E+00; - COFD[330] = -4.48646311E-01; - COFD[331] = 1.89013813E-02; - COFD[332] = -1.50168047E+01; - COFD[333] = 3.25515933E+00; - COFD[334] = -2.09710110E-01; - COFD[335] = 9.15941830E-03; - COFD[336] = -1.15815492E+01; - COFD[337] = 2.43235504E+00; - COFD[338] = -1.02890179E-01; - COFD[339] = 4.52903603E-03; - COFD[340] = -1.53261011E+01; - COFD[341] = 3.37317428E+00; - COFD[342] = -2.24900439E-01; - COFD[343] = 9.81228151E-03; - COFD[344] = -1.40964555E+01; - COFD[345] = 3.07458927E+00; - COFD[346] = -1.86899591E-01; - COFD[347] = 8.19829781E-03; - COFD[348] = -1.41170278E+01; - COFD[349] = 3.07458927E+00; - COFD[350] = -1.86899591E-01; - COFD[351] = 8.19829781E-03; - COFD[352] = -2.04229988E+01; - COFD[353] = 5.31457079E+00; - COFD[354] = -4.58216496E-01; - COFD[355] = 1.91825910E-02; - COFD[356] = -1.43722077E+01; - COFD[357] = 3.70920439E+00; - COFD[358] = -2.67274113E-01; - COFD[359] = 1.15967481E-02; - COFD[360] = -1.53340319E+01; - COFD[361] = 3.37317428E+00; - COFD[362] = -2.24900439E-01; - COFD[363] = 9.81228151E-03; - COFD[364] = -1.53416091E+01; - COFD[365] = 3.37317428E+00; - COFD[366] = -2.24900439E-01; - COFD[367] = 9.81228151E-03; - COFD[368] = -1.50511964E+01; - COFD[369] = 3.26249588E+00; - COFD[370] = -2.10658287E-01; - COFD[371] = 9.20032462E-03; - COFD[372] = -1.81371853E+01; - COFD[373] = 4.33684042E+00; - COFD[374] = -3.44981265E-01; - COFD[375] = 1.48142449E-02; - COFD[376] = -2.05250357E+01; - COFD[377] = 5.21473296E+00; - COFD[378] = -4.48646311E-01; - COFD[379] = 1.89013813E-02; - COFD[380] = -1.50236540E+01; - COFD[381] = 3.25515933E+00; - COFD[382] = -2.09710110E-01; - COFD[383] = 9.15941830E-03; - COFD[384] = -1.13541221E+01; - COFD[385] = 2.31999438E+00; - COFD[386] = -8.75064804E-02; - COFD[387] = 3.82656365E-03; - COFD[388] = -1.50371688E+01; - COFD[389] = 3.26249588E+00; - COFD[390] = -2.10658287E-01; - COFD[391] = 9.20032462E-03; - COFD[392] = -1.39007309E+01; - COFD[393] = 2.99164244E+00; - COFD[394] = -1.76293106E-01; - COFD[395] = 7.74575100E-03; - COFD[396] = -1.39199573E+01; - COFD[397] = 2.99164244E+00; - COFD[398] = -1.76293106E-01; - COFD[399] = 7.74575100E-03; - COFD[400] = -2.08943723E+01; - COFD[401] = 5.44718673E+00; - COFD[402] = -4.72082974E-01; - COFD[403] = 1.96531328E-02; - COFD[404] = -1.40524219E+01; - COFD[405] = 3.56261348E+00; - COFD[406] = -2.48287981E-01; - COFD[407] = 1.07752947E-02; - COFD[408] = -1.50443476E+01; - COFD[409] = 3.26249588E+00; - COFD[410] = -2.10658287E-01; - COFD[411] = 9.20032462E-03; - COFD[412] = -1.50511964E+01; - COFD[413] = 3.26249588E+00; - COFD[414] = -2.10658287E-01; - COFD[415] = 9.20032462E-03; - COFD[416] = -1.48061406E+01; - COFD[417] = 3.16912473E+00; - COFD[418] = -1.98792456E-01; - COFD[419] = 8.69726395E-03; - COFD[420] = -1.77672912E+01; - COFD[421] = 4.20234040E+00; - COFD[422] = -3.28057658E-01; - COFD[423] = 1.41006192E-02; - COFD[424] = -2.02361782E+01; - COFD[425] = 5.11785645E+00; - COFD[426] = -4.37867828E-01; - COFD[427] = 1.85047543E-02; - COFD[428] = -1.47850505E+01; - COFD[429] = 3.16433919E+00; - COFD[430] = -1.98191564E-01; - COFD[431] = 8.67209742E-03; - COFD[432] = -1.35545391E+01; - COFD[433] = 3.13878730E+00; - COFD[434] = -1.94980335E-01; - COFD[435] = 8.53744486E-03; - COFD[436] = -1.81197250E+01; - COFD[437] = 4.33684042E+00; - COFD[438] = -3.44981265E-01; - COFD[439] = 1.48142449E-02; - COFD[440] = -1.67115471E+01; - COFD[441] = 3.98859394E+00; - COFD[442] = -3.02316219E-01; - COFD[443] = 1.30661099E-02; - COFD[444] = -1.67337674E+01; - COFD[445] = 3.98859394E+00; - COFD[446] = -3.02316219E-01; - COFD[447] = 1.30661099E-02; - COFD[448] = -2.12021420E+01; - COFD[449] = 5.20775027E+00; - COFD[450] = -4.07348285E-01; - COFD[451] = 1.55473262E-02; - COFD[452] = -1.72994129E+01; - COFD[453] = 4.71931868E+00; - COFD[454] = -3.91258152E-01; - COFD[455] = 1.66866639E-02; - COFD[456] = -1.81286456E+01; - COFD[457] = 4.33684042E+00; - COFD[458] = -3.44981265E-01; - COFD[459] = 1.48142449E-02; - COFD[460] = -1.81371853E+01; - COFD[461] = 4.33684042E+00; - COFD[462] = -3.44981265E-01; - COFD[463] = 1.48142449E-02; - COFD[464] = -1.77672912E+01; - COFD[465] = 4.20234040E+00; - COFD[466] = -3.28057658E-01; - COFD[467] = 1.41006192E-02; - COFD[468] = -2.10907633E+01; - COFD[469] = 5.29211327E+00; - COFD[470] = -4.56068366E-01; - COFD[471] = 1.91195062E-02; - COFD[472] = -2.20758670E+01; - COFD[473] = 5.52171573E+00; - COFD[474] = -4.63284984E-01; - COFD[475] = 1.85570924E-02; - COFD[476] = -1.77350630E+01; - COFD[477] = 4.19328271E+00; - COFD[478] = -3.26911461E-01; - COFD[479] = 1.40520357E-02; - COFD[480] = -1.57161352E+01; - COFD[481] = 3.96062263E+00; - COFD[482] = -2.98964970E-01; - COFD[483] = 1.29322565E-02; - COFD[484] = -2.05107395E+01; - COFD[485] = 5.21473296E+00; - COFD[486] = -4.48646311E-01; - COFD[487] = 1.89013813E-02; - COFD[488] = -1.91045520E+01; - COFD[489] = 4.87977047E+00; - COFD[490] = -4.10448693E-01; - COFD[491] = 1.74535827E-02; - COFD[492] = -1.91240292E+01; - COFD[493] = 4.87977047E+00; - COFD[494] = -4.10448693E-01; - COFD[495] = 1.74535827E-02; - COFD[496] = -1.87171338E+01; - COFD[497] = 4.00967621E+00; - COFD[498] = -2.21153539E-01; - COFD[499] = 6.31528745E-03; - COFD[500] = -1.95312879E+01; - COFD[501] = 5.47046983E+00; - COFD[502] = -4.74577605E-01; - COFD[503] = 1.97408822E-02; - COFD[504] = -2.05180548E+01; - COFD[505] = 5.21473296E+00; - COFD[506] = -4.48646311E-01; - COFD[507] = 1.89013813E-02; - COFD[508] = -2.05250357E+01; - COFD[509] = 5.21473296E+00; - COFD[510] = -4.48646311E-01; - COFD[511] = 1.89013813E-02; - COFD[512] = -2.02361782E+01; - COFD[513] = 5.11785645E+00; - COFD[514] = -4.37867828E-01; - COFD[515] = 1.85047543E-02; - COFD[516] = -2.20758670E+01; - COFD[517] = 5.52171573E+00; - COFD[518] = -4.63284984E-01; - COFD[519] = 1.85570924E-02; - COFD[520] = -1.98983685E+01; - COFD[521] = 4.38041133E+00; - COFD[522] = -2.77538214E-01; - COFD[523] = 9.06748822E-03; - COFD[524] = -2.02052920E+01; - COFD[525] = 5.10993120E+00; - COFD[526] = -4.36931630E-01; - COFD[527] = 1.84677592E-02; - COFD[528] = -1.13253618E+01; - COFD[529] = 2.31195095E+00; - COFD[530] = -8.63988037E-02; - COFD[531] = 3.77573452E-03; - COFD[532] = -1.50096252E+01; - COFD[533] = 3.25515933E+00; - COFD[534] = -2.09710110E-01; - COFD[535] = 9.15941830E-03; - COFD[536] = -1.38756380E+01; - COFD[537] = 2.98558426E+00; - COFD[538] = -1.75507216E-01; - COFD[539] = 7.71173691E-03; - COFD[540] = -1.38948654E+01; - COFD[541] = 2.98558426E+00; - COFD[542] = -1.75507216E-01; - COFD[543] = 7.71173691E-03; - COFD[544] = -2.08123331E+01; - COFD[545] = 5.42470175E+00; - COFD[546] = -4.69700438E-01; - COFD[547] = 1.95706912E-02; - COFD[548] = -1.40298991E+01; - COFD[549] = 3.55837688E+00; - COFD[550] = -2.47785790E-01; - COFD[551] = 1.07555332E-02; - COFD[552] = -1.50168047E+01; - COFD[553] = 3.25515933E+00; - COFD[554] = -2.09710110E-01; - COFD[555] = 9.15941830E-03; - COFD[556] = -1.50236540E+01; - COFD[557] = 3.25515933E+00; - COFD[558] = -2.09710110E-01; - COFD[559] = 9.15941830E-03; - COFD[560] = -1.47850505E+01; - COFD[561] = 3.16433919E+00; - COFD[562] = -1.98191564E-01; - COFD[563] = 8.67209742E-03; - COFD[564] = -1.77350630E+01; - COFD[565] = 4.19328271E+00; - COFD[566] = -3.26911461E-01; - COFD[567] = 1.40520357E-02; - COFD[568] = -2.02052920E+01; - COFD[569] = 5.10993120E+00; - COFD[570] = -4.36931630E-01; - COFD[571] = 1.84677592E-02; - COFD[572] = -1.47639411E+01; - COFD[573] = 3.15955654E+00; - COFD[574] = -1.97590757E-01; - COFD[575] = 8.64692156E-03; -} - -// List of specs with small weight, dim NLITE -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetKTDIF(int* KTDIF) -{ - KTDIF[0] = 0; - KTDIF[1] = 5; -} - -// Poly fits for thermal diff ratios, dim NO*NLITE*KK -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -egtransetCOFTD(amrex::Real* COFTD) -{ - COFTD[0] = 0.00000000E+00; - COFTD[1] = 0.00000000E+00; - COFTD[2] = 0.00000000E+00; - COFTD[3] = 0.00000000E+00; - COFTD[4] = 4.42736017E-01; - COFTD[5] = 7.11765887E-05; - COFTD[6] = -3.84765396E-08; - COFTD[7] = 6.86318682E-12; - COFTD[8] = 4.15577509E-01; - COFTD[9] = 1.09736860E-05; - COFTD[10] = -3.96016410E-09; - COFTD[11] = 1.14412838E-12; - COFTD[12] = 4.21927217E-01; - COFTD[13] = 1.11413555E-05; - COFTD[14] = -4.02067239E-09; - COFTD[15] = 1.16160979E-12; - COFTD[16] = 6.02021050E-02; - COFTD[17] = 5.61555733E-04; - COFTD[18] = -2.55370065E-07; - COFTD[19] = 3.63385926E-11; - COFTD[20] = -1.52534742E-01; - COFTD[21] = -5.46404022E-05; - COFTD[22] = 2.93412470E-08; - COFTD[23] = -4.87091914E-12; - COFTD[24] = 4.44449675E-01; - COFTD[25] = 7.14520855E-05; - COFTD[26] = -3.86254673E-08; - COFTD[27] = 6.88975155E-12; - COFTD[28] = 4.46067449E-01; - COFTD[29] = 7.17121674E-05; - COFTD[30] = -3.87660620E-08; - COFTD[31] = 6.91482989E-12; - COFTD[32] = 4.44650439E-01; - COFTD[33] = 5.06628083E-05; - COFTD[34] = -2.69818971E-08; - COFTD[35] = 5.01286176E-12; - COFTD[36] = 3.25740914E-01; - COFTD[37] = 3.03631979E-04; - COFTD[38] = -1.55289598E-07; - COFTD[39] = 2.41465297E-11; - COFTD[40] = 1.61391212E-01; - COFTD[41] = 5.01080793E-04; - COFTD[42] = -2.38272376E-07; - COFTD[43] = 3.49342098E-11; - COFTD[44] = 4.45261429E-01; - COFTD[45] = 4.94696577E-05; - COFTD[46] = -2.63023124E-08; - COFTD[47] = 4.90305626E-12; - COFTD[48] = 1.52534742E-01; - COFTD[49] = 5.46404022E-05; - COFTD[50] = -2.93412470E-08; - COFTD[51] = 4.87091914E-12; - COFTD[52] = 2.20482081E-01; - COFTD[53] = 4.80162630E-04; - COFTD[54] = -2.32927140E-07; - COFTD[55] = 3.46469239E-11; - COFTD[56] = 2.70008280E-01; - COFTD[57] = 3.61552588E-04; - COFTD[58] = -1.80743499E-07; - COFTD[59] = 2.75319341E-11; - COFTD[60] = 2.72039997E-01; - COFTD[61] = 3.64273144E-04; - COFTD[62] = -1.82103531E-07; - COFTD[63] = 2.77391022E-11; - COFTD[64] = -1.41882969E-01; - COFTD[65] = 7.66554625E-04; - COFTD[66] = -3.06548330E-07; - COFTD[67] = 4.02957302E-11; - COFTD[68] = 0.00000000E+00; - COFTD[69] = 0.00000000E+00; - COFTD[70] = 0.00000000E+00; - COFTD[71] = 0.00000000E+00; - COFTD[72] = 2.20907136E-01; - COFTD[73] = 4.81088308E-04; - COFTD[74] = -2.33376187E-07; - COFTD[75] = 3.47137178E-11; - COFTD[76] = 2.21307723E-01; - COFTD[77] = 4.81960701E-04; - COFTD[78] = -2.33799385E-07; - COFTD[79] = 3.47766667E-11; - COFTD[80] = 2.39409087E-01; - COFTD[81] = 4.47195587E-04; - COFTD[82] = -2.18950923E-07; - COFTD[83] = 3.27972343E-11; - COFTD[84] = 2.44368810E-02; - COFTD[85] = 7.18240808E-04; - COFTD[86] = -3.19717751E-07; - COFTD[87] = 4.48827629E-11; - COFTD[88] = -1.24647578E-01; - COFTD[89] = 7.96522972E-04; - COFTD[90] = -3.24997704E-07; - COFTD[91] = 4.32515301E-11; - COFTD[92] = 2.40744276E-01; - COFTD[93] = 4.45343183E-04; - COFTD[94] = -2.18173742E-07; - COFTD[95] = 3.26958310E-11; -} - -// compute the critical parameters for each species -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -GET_CRITPARAMS( - amrex::Real* Tci, amrex::Real* ai, amrex::Real* bi, amrex::Real* acentric_i) -{ - - amrex::Real EPS[12]; - amrex::Real SIG[12]; - amrex::Real wt[12]; - amrex::Real Rcst = 83.144598; // in bar [CGS] ! - amrex::Real avogadro = 6.02214199e23; - amrex::Real boltzmann = 1.3806503e-16; // we work in CGS - - egtransetEPS(EPS); - egtransetSIG(SIG); - get_mw(wt); - - // species 0: H2 - // Imported from NIST - Tci[0] = 33.145000; - ai[0] = 1e6 * 0.42748 * Rcst * Rcst * Tci[0] * Tci[0] / - (2.015880 * 2.015880 * 12.964000); - bi[0] = 0.08664 * Rcst * Tci[0] / (2.015880 * 12.964000); - acentric_i[0] = -0.219000; - - // species 1: O2 - // Imported from NIST - Tci[1] = 154.581000; - ai[1] = 1e6 * 0.42748 * Rcst * Rcst * Tci[1] * Tci[1] / - (31.998800 * 31.998800 * 50.430466); - bi[1] = 0.08664 * Rcst * Tci[1] / (31.998800 * 50.430466); - acentric_i[1] = 0.022200; - - // species 2: O - Tci[2] = 1.316 * EPS[2]; - ai[2] = (5.55 * avogadro * avogadro * EPS[2] * boltzmann * 1e-24 * SIG[2] * - SIG[2] * SIG[2]) / - (wt[2] * wt[2]); - bi[2] = 0.855 * avogadro * 1e-24 * SIG[2] * SIG[2] * SIG[2] / (wt[2]); - acentric_i[2] = 0.0; - - // species 3: OH - Tci[3] = 1.316 * EPS[3]; - ai[3] = (5.55 * avogadro * avogadro * EPS[3] * boltzmann * 1e-24 * SIG[3] * - SIG[3] * SIG[3]) / - (wt[3] * wt[3]); - bi[3] = 0.855 * avogadro * 1e-24 * SIG[3] * SIG[3] * SIG[3] / (wt[3]); - acentric_i[3] = 0.0; - - // species 4: H2O - // Imported from NIST - Tci[4] = 647.096000; - ai[4] = 1e6 * 0.42748 * Rcst * Rcst * Tci[4] * Tci[4] / - (18.015340 * 18.015340 * 220.640000); - bi[4] = 0.08664 * Rcst * Tci[4] / (18.015340 * 220.640000); - acentric_i[4] = 0.344300; - - // species 5: H - Tci[5] = 1.316 * EPS[5]; - ai[5] = (5.55 * avogadro * avogadro * EPS[5] * boltzmann * 1e-24 * SIG[5] * - SIG[5] * SIG[5]) / - (wt[5] * wt[5]); - bi[5] = 0.855 * avogadro * 1e-24 * SIG[5] * SIG[5] * SIG[5] / (wt[5]); - acentric_i[5] = 0.0; - - // species 6: HO2 - Tci[6] = 1.316 * EPS[6]; - ai[6] = (5.55 * avogadro * avogadro * EPS[6] * boltzmann * 1e-24 * SIG[6] * - SIG[6] * SIG[6]) / - (wt[6] * wt[6]); - bi[6] = 0.855 * avogadro * 1e-24 * SIG[6] * SIG[6] * SIG[6] / (wt[6]); - acentric_i[6] = 0.0; - - // species 7: H2O2 - Tci[7] = 1.316 * EPS[7]; - ai[7] = (5.55 * avogadro * avogadro * EPS[7] * boltzmann * 1e-24 * SIG[7] * - SIG[7] * SIG[7]) / - (wt[7] * wt[7]); - bi[7] = 0.855 * avogadro * 1e-24 * SIG[7] * SIG[7] * SIG[7] / (wt[7]); - acentric_i[7] = 0.0; - - // species 8: CO - // Imported from NIST - Tci[8] = 132.850000; - ai[8] = 1e6 * 0.42748 * Rcst * Rcst * Tci[8] * Tci[8] / - (28.010000 * 28.010000 * 34.940000); - bi[8] = 0.08664 * Rcst * Tci[8] / (28.010000 * 34.940000); - acentric_i[8] = 0.045000; - - // species 9: CO2 - // Imported from NIST - Tci[9] = 304.120000; - ai[9] = 1e6 * 0.42748 * Rcst * Rcst * Tci[9] * Tci[9] / - (44.009950 * 44.009950 * 73.740000); - bi[9] = 0.08664 * Rcst * Tci[9] / (44.009950 * 73.740000); - acentric_i[9] = 0.225000; - - // species 10: HCO - Tci[10] = 1.316 * EPS[10]; - ai[10] = (5.55 * avogadro * avogadro * EPS[10] * boltzmann * 1e-24 * SIG[10] * - SIG[10] * SIG[10]) / - (wt[10] * wt[10]); - bi[10] = 0.855 * avogadro * 1e-24 * SIG[10] * SIG[10] * SIG[10] / (wt[10]); - acentric_i[10] = 0.0; - - // species 11: N2 - // Imported from NIST - Tci[11] = 126.192000; - ai[11] = 1e6 * 0.42748 * Rcst * Rcst * Tci[11] * Tci[11] / - (28.013400 * 28.013400 * 33.958000); - bi[11] = 0.08664 * Rcst * Tci[11] / (28.013400 * 33.958000); - acentric_i[11] = 0.037200; -} - -// compute the critical parameter quantities for each species for SRK -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -GET_CRITPARAMS_SRK( - amrex::Real* sqrtOneOverTc, - amrex::Real* sqrtAsti, - amrex::Real* Bi, - amrex::Real* Fomega) -{ - - // species 0: H2 - // Imported from NIST - sqrtOneOverTc[0] = 1.7369646834812e-01; - sqrtAsti[0] = 2.4824229305911e+05; - Bi[0] = 9.1362254169923e+00; - Fomega[0] = 1.3798618890700e-01; - - // species 1: O2 - // Imported from NIST - sqrtOneOverTc[1] = 8.0430717653241e-02; - sqrtAsti[1] = 3.6980081924740e+04; - Bi[1] = 6.9005216444999e-01; - Fomega[1] = 5.1945301904908e-01; - - // species 2: O - // Computed from Lennard-Jones - sqrtOneOverTc[2] = 9.7460146948181e-02; - sqrtAsti[2] = 4.2500156012386e+04; - Bi[2] = 6.6930234851885e-01; - Fomega[2] = 4.8508000000000e-01; - - // species 3: OH - // Computed from Lennard-Jones - sqrtOneOverTc[3] = 9.7460146948181e-02; - sqrtAsti[3] = 3.9981183985545e+04; - Bi[3] = 6.2963299076575e-01; - Fomega[3] = 4.8508000000000e-01; - - // species 4: H2O - // Imported from NIST - sqrtOneOverTc[4] = 3.9311140369715e-02; - sqrtAsti[4] = 1.3145468419592e+05; - Bi[4] = 1.1727204136223e+00; - Fomega[4] = 1.0013577274636e+00; - - // species 5: H - // Computed from Lennard-Jones - sqrtOneOverTc[5] = 7.2391579785311e-02; - sqrtAsti[5] = 5.8451221185793e+05; - Bi[5] = 4.4006634563410e+00; - Fomega[5] = 4.8508000000000e-01; - - // species 6: HO2 - // Computed from Lennard-Jones - sqrtOneOverTc[6] = 8.4114315417892e-02; - sqrtAsti[6] = 3.3657825710980e+04; - Bi[6] = 6.4505861132042e-01; - Fomega[6] = 4.8508000000000e-01; - - // species 7: H2O2 - // Computed from Lennard-Jones - sqrtOneOverTc[7] = 8.4114315417892e-02; - sqrtAsti[7] = 3.2660380884830e+04; - Bi[7] = 6.2594239211036e-01; - Fomega[7] = 4.8508000000000e-01; - - // species 8: CO - // Imported from NIST - sqrtOneOverTc[8] = 8.6759935530451e-02; - sqrtAsti[8] = 4.3619324712923e+04; - Bi[8] = 9.7786303823350e-01; - Fomega[8] = 5.5459948367500e-01; - - // species 9: CO2 - // Imported from NIST - sqrtOneOverTc[9] = 5.7342616962522e-02; - sqrtAsti[9] = 4.3745610142919e+04; - Bi[9] = 6.7506167841745e-01; - Fomega[9] = 8.2653709187500e-01; - - // species 10: HCO - // Computed from Lennard-Jones - sqrtOneOverTc[10] = 3.9062261583604e-02; - sqrtAsti[10] = 8.7202351509582e+04; - Bi[10] = 8.2098075206475e-01; - Fomega[10] = 4.8508000000000e-01; - - // species 11: N2 - // Imported from NIST - sqrtOneOverTc[11] = 8.9019282240563e-02; - sqrtAsti[11] = 4.2022983929562e+04; - Bi[11] = 9.5560052221563e-01; - Fomega[11] = 5.4259343186608e-01; -} - -// gauss-jordan solver external routine -// Replace this routine with the one generated by the Gauss Jordan solver of DW -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -sgjsolve(amrex::Real* /*A*/, amrex::Real* /*x*/, amrex::Real* /*b*/) -{ - amrex::Abort("sgjsolve not implemented, choose a different solver "); -} - -// Replace this routine with the one generated by the Gauss Jordan solver of DW -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void -sgjsolve_simplified(amrex::Real* /*A*/, amrex::Real* /*x*/, amrex::Real* /*b*/) -{ - amrex::Abort( - "sgjsolve_simplified not implemented, choose a different solver "); -} - -#endif diff --git a/Support/ceptr/Kolla/mechanism.cpp b/Support/ceptr/Kolla/mechanism.cpp deleted file mode 100644 index 3751157fc..000000000 --- a/Support/ceptr/Kolla/mechanism.cpp +++ /dev/null @@ -1,489 +0,0 @@ -#include "mechanism.H" -const int rmap[NUM_REACTIONS] = {8, 15, 21, 4, 5, 6, 7, 25, 0, 1, - 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, - 18, 19, 20, 22, 23, 24, 26, 27, 28}; - -// Returns 0-based map of reaction order -void -GET_RMAP(int* _rmap) -{ - for (int j = 0; j < NUM_REACTIONS; ++j) { - _rmap[j] = rmap[j]; - } -} - -// Returns a count of species in a reaction, and their indices -// and stoichiometric coefficients. (Eq 50) -void -CKINU(const int i, int& nspec, int ki[], int nu[]) -{ - const int ns[29] = {4, 4, 4, 3, 2, 2, 3, 3, 3, 4, 3, 4, 4, 3, 3, - 2, 4, 4, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4}; - const int kiv[116] = { - 5, 1, 2, 3, 0, 2, 5, 3, 0, 3, 5, 4, 4, 2, 3, 0, 0, 5, 0, 0, 2, 1, 0, 0, - 5, 2, 3, 0, 5, 3, 4, 0, 5, 1, 6, 0, 5, 6, 0, 1, 5, 6, 3, 0, 6, 2, 1, 3, - 6, 3, 4, 1, 6, 7, 1, 0, 6, 7, 1, 0, 7, 3, 0, 0, 5, 7, 4, 3, 5, 7, 0, 6, - 7, 2, 6, 3, 7, 3, 4, 6, 7, 3, 4, 6, 8, 2, 9, 0, 8, 1, 9, 2, 8, 6, 9, 3, - 8, 3, 9, 5, 10, 8, 5, 0, 10, 1, 8, 6, 5, 10, 8, 0, 10, 2, 9, 5}; - const int nuv[116] = { - -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 2, 0, -1, 2, 0, 0, - -2, 1, 0, 0, -1, -1, 1, 0, -1, -1, 1, 0, -1, -1, 1, 0, -1, -1, 1, 1, - -1, -1, 2, 0, -1, -1, 1, 1, -1, -1, 1, 1, -2, 1, 1, 0, -2, 1, 1, 0, - -1, 2, 0, 0, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, - -1, -1, 1, 1, -1, -1, 1, 0, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, - -1, 1, 1, 0, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1}; - if (i < 1) { - // Return max num species per reaction - nspec = 4; - } else { - if (i > 29) { - nspec = -1; - } else { - nspec = ns[i - 1]; - for (int j = 0; j < nspec; ++j) { - ki[j] = kiv[(i - 1) * 4 + j] + 1; - nu[j] = nuv[(i - 1) * 4 + j]; - } - } - } -} - -// Returns the progress rates of each reactions -// Given P, T, and mole fractions -void -CKKFKR( - const amrex::Real P, - const amrex::Real T, - const amrex::Real x[], - amrex::Real q_f[], - amrex::Real q_r[]) -{ - amrex::Real c[12]; // temporary storage - amrex::Real PORT = - 1e6 * P / (8.31446261815324e+07 * T); // 1e6 * P/RT so c goes to SI units - - // Compute conversion, see Eq 10 - for (int id = 0; id < 12; ++id) { - c[id] = x[id] * PORT; - } - - // convert to chemkin units - progressRateFR(q_f, q_r, c, T); - - // convert to chemkin units - for (int id = 0; id < 29; ++id) { - q_f[id] *= 1.0e-6; - q_r[id] *= 1.0e-6; - } -} - -// compute the progress rate for each reaction -// USES progressRate : todo switch to GPU -void -progressRateFR( - amrex::Real* q_f, amrex::Real* q_r, amrex::Real* sc, amrex::Real T) -{ - const amrex::Real invT = 1.0 / T; - const amrex::Real logT = log(T); - // compute the Gibbs free energy - amrex::Real g_RT[12]; - gibbs(g_RT, T); - - amrex::Real sc_qss[1]; - comp_qfqr(q_f, q_r, sc, sc_qss, T, invT, logT); -} - -// save atomic weights into array -void -atomicWeight(amrex::Real* awt) -{ - awt[0] = 12.011000; // C - awt[1] = 1.008000; // H - awt[2] = 15.999000; // O - awt[3] = 14.007000; // N -} - -// get atomic weight for all elements -void -CKAWT(amrex::Real* awt) -{ - atomicWeight(awt); -} - -// Returns the elemental composition -// of the speciesi (mdim is num of elements) -void -CKNCF(int* ncf) -{ - int kd = 4; - // Zero ncf - for (int id = 0; id < kd * 12; ++id) { - ncf[id] = 0; - } - - // H2 - ncf[0 * kd + 1] = 2; // H - - // O2 - ncf[1 * kd + 2] = 2; // O - - // O - ncf[2 * kd + 2] = 1; // O - - // OH - ncf[3 * kd + 1] = 1; // H - ncf[3 * kd + 2] = 1; // O - - // H2O - ncf[4 * kd + 1] = 2; // H - ncf[4 * kd + 2] = 1; // O - - // H - ncf[5 * kd + 1] = 1; // H - - // HO2 - ncf[6 * kd + 1] = 1; // H - ncf[6 * kd + 2] = 2; // O - - // H2O2 - ncf[7 * kd + 1] = 2; // H - ncf[7 * kd + 2] = 2; // O - - // CO - ncf[8 * kd + 0] = 1; // C - ncf[8 * kd + 2] = 1; // O - - // CO2 - ncf[9 * kd + 0] = 1; // C - ncf[9 * kd + 2] = 2; // O - - // HCO - ncf[10 * kd + 0] = 1; // C - ncf[10 * kd + 1] = 1; // H - ncf[10 * kd + 2] = 1; // O - - // N2 - ncf[11 * kd + 3] = 2; // N -} - -// Returns the vector of strings of element names -void -CKSYME_STR(amrex::Vector& ename) -{ - ename.resize(4); - ename[0] = "C"; - ename[1] = "H"; - ename[2] = "O"; - ename[3] = "N"; -} - -// Returns the vector of strings of species names -void -CKSYMS_STR(amrex::Vector& kname) -{ - kname.resize(12); - kname[0] = "H2"; - kname[1] = "O2"; - kname[2] = "O"; - kname[3] = "OH"; - kname[4] = "H2O"; - kname[5] = "H"; - kname[6] = "HO2"; - kname[7] = "H2O2"; - kname[8] = "CO"; - kname[9] = "CO2"; - kname[10] = "HCO"; - kname[11] = "N2"; -} - -// compute the sparsity pattern of the chemistry Jacobian -void -SPARSITY_INFO(int* nJdata, const int* consP, int NCELLS) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian(Jac.data(), conc.data(), 1500.0, *consP); - - int nJdata_tmp = 0; - for (int k = 0; k < 13; k++) { - for (int l = 0; l < 13; l++) { - if (Jac[13 * k + l] != 0.0) { - nJdata_tmp = nJdata_tmp + 1; - } - } - } - - *nJdata = NCELLS * nJdata_tmp; -} - -// compute the sparsity pattern of the system Jacobian -void -SPARSITY_INFO_SYST(int* nJdata, const int* consP, int NCELLS) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian(Jac.data(), conc.data(), 1500.0, *consP); - - int nJdata_tmp = 0; - for (int k = 0; k < 13; k++) { - for (int l = 0; l < 13; l++) { - if (k == l) { - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - nJdata_tmp = nJdata_tmp + 1; - } - } - } - } - - *nJdata = NCELLS * nJdata_tmp; -} - -// compute the sparsity pattern of the simplified (for preconditioning) system -// Jacobian -void -SPARSITY_INFO_SYST_SIMPLIFIED(int* nJdata, const int* consP) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian_precond(Jac.data(), conc.data(), 1500.0, *consP); - - int nJdata_tmp = 0; - for (int k = 0; k < 13; k++) { - for (int l = 0; l < 13; l++) { - if (k == l) { - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - nJdata_tmp = nJdata_tmp + 1; - } - } - } - } - - nJdata[0] = nJdata_tmp; -} - -// compute the sparsity pattern of the chemistry Jacobian in CSC format -- base -// 0 -void -SPARSITY_PREPROC_CSC(int* rowVals, int* colPtrs, const int* consP, int NCELLS) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian(Jac.data(), conc.data(), 1500.0, *consP); - - colPtrs[0] = 0; - int nJdata_tmp = 0; - for (int nc = 0; nc < NCELLS; nc++) { - int offset_row = nc * 13; - int offset_col = nc * 13; - for (int k = 0; k < 13; k++) { - for (int l = 0; l < 13; l++) { - if (Jac[13 * k + l] != 0.0) { - rowVals[nJdata_tmp] = l + offset_row; - nJdata_tmp = nJdata_tmp + 1; - } - } - colPtrs[offset_col + (k + 1)] = nJdata_tmp; - } - } -} - -// compute the sparsity pattern of the chemistry Jacobian in CSR format -- base -// 0 -void -SPARSITY_PREPROC_CSR( - int* colVals, int* rowPtrs, const int* consP, int NCELLS, int base) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian(Jac.data(), conc.data(), 1500.0, *consP); - - if (base == 1) { - rowPtrs[0] = 1; - int nJdata_tmp = 1; - for (int nc = 0; nc < NCELLS; nc++) { - int offset = nc * 13; - for (int l = 0; l < 13; l++) { - for (int k = 0; k < 13; k++) { - if (Jac[13 * k + l] != 0.0) { - colVals[nJdata_tmp - 1] = k + 1 + offset; - nJdata_tmp = nJdata_tmp + 1; - } - } - rowPtrs[offset + (l + 1)] = nJdata_tmp; - } - } - } else { - rowPtrs[0] = 0; - int nJdata_tmp = 0; - for (int nc = 0; nc < NCELLS; nc++) { - int offset = nc * 13; - for (int l = 0; l < 13; l++) { - for (int k = 0; k < 13; k++) { - if (Jac[13 * k + l] != 0.0) { - colVals[nJdata_tmp] = k + offset; - nJdata_tmp = nJdata_tmp + 1; - } - } - rowPtrs[offset + (l + 1)] = nJdata_tmp; - } - } - } -} - -// compute the sparsity pattern of the system Jacobian -// CSR format BASE is user choice -void -SPARSITY_PREPROC_SYST_CSR( - int* colVals, int* rowPtr, const int* consP, int NCELLS, int base) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian(Jac.data(), conc.data(), 1500.0, *consP); - - if (base == 1) { - rowPtr[0] = 1; - int nJdata_tmp = 1; - for (int nc = 0; nc < NCELLS; nc++) { - int offset = nc * 13; - for (int l = 0; l < 13; l++) { - for (int k = 0; k < 13; k++) { - if (k == l) { - colVals[nJdata_tmp - 1] = l + 1 + offset; - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - colVals[nJdata_tmp - 1] = k + 1 + offset; - nJdata_tmp = nJdata_tmp + 1; - } - } - } - rowPtr[offset + (l + 1)] = nJdata_tmp; - } - } - } else { - rowPtr[0] = 0; - int nJdata_tmp = 0; - for (int nc = 0; nc < NCELLS; nc++) { - int offset = nc * 13; - for (int l = 0; l < 13; l++) { - for (int k = 0; k < 13; k++) { - if (k == l) { - colVals[nJdata_tmp] = l + offset; - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - colVals[nJdata_tmp] = k + offset; - nJdata_tmp = nJdata_tmp + 1; - } - } - } - rowPtr[offset + (l + 1)] = nJdata_tmp; - } - } - } -} - -// compute the sparsity pattern of the simplified (for precond) system Jacobian -// on CPU BASE 0 -void -SPARSITY_PREPROC_SYST_SIMPLIFIED_CSC( - int* rowVals, int* colPtrs, int* indx, const int* consP) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian_precond(Jac.data(), conc.data(), 1500.0, *consP); - - colPtrs[0] = 0; - int nJdata_tmp = 0; - for (int k = 0; k < 13; k++) { - for (int l = 0; l < 13; l++) { - if (k == l) { - rowVals[nJdata_tmp] = l; - indx[nJdata_tmp] = 13 * k + l; - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - rowVals[nJdata_tmp] = l; - indx[nJdata_tmp] = 13 * k + l; - nJdata_tmp = nJdata_tmp + 1; - } - } - } - colPtrs[k + 1] = nJdata_tmp; - } -} - -// compute the sparsity pattern of the simplified (for precond) system Jacobian -// CSR format BASE is under choice -void -SPARSITY_PREPROC_SYST_SIMPLIFIED_CSR( - int* colVals, int* rowPtr, const int* consP, int base) -{ - amrex::GpuArray Jac = {0.0}; - amrex::GpuArray conc = {0.0}; - for (int n = 0; n < 12; n++) { - conc[n] = 1.0 / 12.000000; - } - aJacobian_precond(Jac.data(), conc.data(), 1500.0, *consP); - - if (base == 1) { - rowPtr[0] = 1; - int nJdata_tmp = 1; - for (int l = 0; l < 13; l++) { - for (int k = 0; k < 13; k++) { - if (k == l) { - colVals[nJdata_tmp - 1] = l + 1; - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - colVals[nJdata_tmp - 1] = k + 1; - nJdata_tmp = nJdata_tmp + 1; - } - } - } - rowPtr[l + 1] = nJdata_tmp; - } - } else { - rowPtr[0] = 0; - int nJdata_tmp = 0; - for (int l = 0; l < 13; l++) { - for (int k = 0; k < 13; k++) { - if (k == l) { - colVals[nJdata_tmp] = l; - nJdata_tmp = nJdata_tmp + 1; - } else { - if (Jac[13 * k + l] != 0.0) { - colVals[nJdata_tmp] = k; - nJdata_tmp = nJdata_tmp + 1; - } - } - } - rowPtr[l + 1] = nJdata_tmp; - } - } -} diff --git a/Support/ceptr/Kolla/mechanism.inp b/Support/ceptr/Kolla/mechanism.inp deleted file mode 100644 index b54399c2d..000000000 --- a/Support/ceptr/Kolla/mechanism.inp +++ /dev/null @@ -1,239 +0,0 @@ -! Mechanism for CO/H2 oxidation by Hemanth Kolla -! based on the skeletal mechanism of Evatt R. Hawkes and Ramanan Sankaran -! -! Only difference from skeletal mechanism is the inclusion of H2O2 and -! the reactions corresponding to its formation and consumption -! -! The skeletal mechanism is derived from a detailed C1 mechanism by J. Li -! -! Original notes on the skeletal mechanism and the detailed mechanisms follow -! -! ------------------------------------------------------------------------------ -! Skeletal Mechanism for CO/H2 oxidation -! by Evatt R. Hawkes and Ramanan Sankaran -! -! Reduced from complete C1 Mechanism that is published in: -! -! J. Li, PhD Thesis, -! Mechanical and Aerospace Engineering Department, -! Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. -! -! http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip -! -! At the time of writing, a publication to IJCK is in preparation -! by the authors of the complete mechanism. -! -! This mechanism was reduced specifically for the purpose of the -! Direct Numerical Simulations performed in -! Hawkes, E.R., Sankaran, R., Sutherland, J.C., and Chen, J.H. (2006) -! Proc. Combust. Inst. 31, to appear. -! -! It was validated by comparison with the full mechanism in several cases: -! 1. freely propagating premixed flames in a range of equivalence ratios, -! 2. opposed-flow non-premixed flames in a range of strains up to extinction, -! 3. homogeneous ignition calculations for mixtures of fuel and oxidizer streams -! and equilibrium products, -! 4. two-dimensional DNS featuring extinction and local reignition. -! In all cases the agreement was excellent. -! -! However, the mechanism is validated ONLY for the specific conditions of the -! DNS and is not expected to be valid in general. -! -! The following changes (only) were made to the complete mechanism: -! 1) Only the species H2 O2 O OH H2O H HO2 CO CO2 HCO N2 were retained. -! All other species and reactions involving these species were removed. Note -! this includes all C containing species other than those essential for CO -! oxidation: CO, CO2 and HCO. For the atmospheric pressure of the simulation, -! H2O2 was also found to be unimportant and was removed. -! 2) It was found HCO has only a minor importance, and its reaction rates were -! dominated by a few key reactions. These reactions (below) were retained -! and all others neglected. -! -! Steady state assumptions were investigated and found to be reasonably accurate -! for fully burning conditions but it was found they increased stiffness, hence -! they were not employed. For reference, a steady state approximation for HCO -! and HO2 may be expected to perform reasonably well if the added stiffness can -! be tackled. However, note the HO2 steady state assumption will degrade the -! prediction of ignition at longer ignition delay times. -! -! --------------------------------------------------------------------------------- -! -! Notes on the original mechanism by its authors: -! -! Authors: J. Li, Z. Zhao, A. Kazakov, F.L. Dryer, -! Address: Dept. of Mechanical and Aerospace Engineering, -! Princeton University, Princeton, NJ 08544 -! -! This C1 mechanism is based on the CH3OH mechanism of Held and Dryer (IJCK,1998, 30, 805) -! with following important revision: -! 1. H2/O2 subset is updated to that of Li et al. (IJCK, in press, 2004) -! 2. CO + OH = CO2 + H is optimized to fit the literature experimental result -! 3. HCO + M = H + CO + M is optimized to fit the literature experimental result -! 4. CH3 + HO2 = CH3O + OH is modified to match Scire's value at 1000 K -! 5. CH3 + HO2 = CH4 + H is taken from Scire (IJCK, 2001, 33, 75) -! 6. CH3 + O2 = CH2O + OH is taken from Scire (2002, Ph.D. thesis) -! 7. CH2O + HO2 = HCO + H2O2 is from Eiteneer et al. (JPC A. 1998, 102, 5196) -! 8. CH2O + H = HCO + H2 is from Irdam et al. (IJCK 1993, 25, 285) -! 9. CH2O + M reactions are from Friedrichs et al.(IJCK 2004, 36, 157) -! 10. CH3OH decomposition reactions are taken from GRI-3.0 (1999) -! 11. CH2OH + HCO = CH2O + CH2O is taken from Friedrichs et al. (IJCK, 2004, 36, 157) -! 12. CH2OH + HCO = CH3OH + CO is changed to keep the branching ratio with the above reaction -! 13. HCOOH reactions are not included since it is not important and has large uncertainties -! 14. dHf of OH is adjusted to 8.91 kcal/mol (Ruscic et al. JPC A. 2002, 106, 2727) -! 15. thermochemical data of CH2OH is fit to Johnson & Hudgens' table (JPC 1996, 100, 19874) - - -ELEMENTS -C H O N -END - -SPECIES -H2 O2 O OH H2O H HO2 H2O2 CO CO2 HCO N2 -END - -TRANS ALL -H2 1 38.000 2.920 0.000 0.790 280.000 -O2 1 107.400 3.458 0.000 1.600 3.800 -O 0 80.000 2.750 0.000 0.000 0.000 -OH 1 80.000 2.750 0.000 0.000 0.000 -H2O 2 572.400 2.605 1.844 0.000 4.000 -H 0 145.000 2.050 0.000 0.000 0.000 -HO2 2 107.400 3.458 0.000 0.000 1.000 -H2O2 2 107.400 3.458 0.000 0.000 3.800 -CO 1 98.100 3.650 0.000 1.950 1.800 -CO2 1 244.000 3.763 0.000 2.650 2.100 -HCO 2 498.000 3.590 0.000 0.000 0.000 -N2 1 97.530 3.621 0.000 1.760 4.000 -END - - - -REACTIONS - -! ************ H2-O2 Chain Reactions ********************** - -! Hessler, J. Phys. Chem. A, 102:4517 (1998) -H+O2=O+OH 3.547e+15 -0.406 1.6599E+4 - -! Sutherland et al., 21st Symposium, p. 929 (1986) -O+H2=H+OH 0.508E+05 2.67 0.629E+04 - -! Michael and Sutherland, J. Phys. Chem. 92:3853 (1988) -H2+OH=H2O+H 0.216E+09 1.51 0.343E+04 - -! Sutherland et al., 23rd Symposium, p. 51 (1990) -O+H2O=OH+OH 2.97e+06 2.02 1.34e+4 - -! *************** H2-O2 Dissociation Reactions ****************** - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -H2+M=H+H+M 4.577E+19 -1.40 1.0438E+05 - H2/2.5/ H2O/12/ - CO/1.9/ CO2/3.8/ - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -O+O+M=O2+M 6.165E+15 -0.50 0.000E+00 - H2/2.5/ H2O/12/ - CO/1.9/ CO2/3.8/ - - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -O+H+M=OH+M 4.714E+18 -1.00 0.000E+00 - H2/2.5/ H2O/12/ - CO/1.9/ CO2/3.8/ - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -!H+OH+M=H2O+M 2.212E+22 -2.00 0.000E+00 -H+OH+M=H2O+M 3.800E+22 -2.00 0.000E+00 - H2/2.5/ H2O/12/ - CO/1.9/ CO2/3.8/ - -!************** Formation and Consumption of HO2****************** - -! Cobos et al., J. Phys. Chem. 89:342 (1985) for kinf -! Michael, et al., J. Phys. Chem. A, 106:5297 (2002) for k0 - -!****************************************************************************** -! MAIN BATH GAS IS N2 (comment this reaction otherwise) -! - H+O2(+M)=HO2(+M) 1.475E+12 0.60 0.00E+00 - LOW/6.366E+20 -1.72 5.248E+02/ - TROE/0.8 1E-30 1E+30/ - H2/2.0/ H2O/11./ O2/0.78/ CO/1.9/ CO2/3.8/ - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] -HO2+H=H2+O2 1.66E+13 0.00 0.823E+03 - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] -HO2+H=OH+OH 7.079E+13 0.00 2.95E+02 - -! Baulch et al., J. Phys. Chem. Ref Data, 21:411 (1992) -HO2+O=O2+OH 0.325E+14 0.00 0.00E+00 - -! Keyser, J. Phys. Chem. 92:1193 (1988) -HO2+OH=H2O+O2 2.890E+13 0.00 -4.970E+02 - -! ***************Formation and Consumption of H2O2****************** - -! Hippler et al., J. Chem. Phys. 93:1755 (1990) -HO2+HO2=H2O2+O2 4.200e+14 0.00 1.1982e+04 - DUPLICATE -HO2+HO2=H2O2+O2 1.300e+11 0.00 -1.6293e+3 - DUPLICATE - -! Brouwer et al., J. Chem. Phys. 86:6171 (1987) for kinf -! Warnatz, J. in Combustion chemistry (1984) for k0 -H2O2(+M)=OH+OH(+M) 2.951e+14 0.00 4.843E+04 - LOW/1.202E+17 0.00 4.55E+04/ - TROE/0.5 1E-30 1E+30/ - H2/2.5/ H2O/12/ - CO/1.9/ CO2/3.8/ - - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -H2O2+H=H2O+OH 0.241E+14 0.00 0.397E+04 - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -H2O2+H=HO2+H2 0.482E+14 0.00 0.795E+04 - -! Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -H2O2+O=OH+HO2 9.550E+06 2.00 3.970E+03 - -! Hippler and Troe, J. Chem. Phys. Lett. 192:333 (1992) -H2O2+OH=HO2+H2O 1.000E+12 0.00 0.000 - DUPLICATE -H2O2+OH=HO2+H2O 5.800E+14 0.00 9.557E+03 - DUPLICATE - -!************** CO/HCO REACTIONS ***************** - -! Troe, 15th Symposium -CO+O(+M)=CO2(+M) 1.80E+10 0.00 2384. -! Fit of Westmoreland, AiChe J., 1986, rel. to N2 - Tim adjusted from MTA's -! rate constant, which was rel to Ar. - LOW/1.55E+24 -2.79 4191./ - H2/2.5/ H2O/12/ CO/1.9/ CO2/3.8/ - -! Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) -CO+O2=CO2+O 0.253E+13 0.00 0.477E+05 - -! This rate constant is modified per an updated value for HO2+HO2=H2O2+OH -CO+HO2=CO2+OH 3.01E+13 0.00 2.30E+04 - -! This study (2004) by matching literature experiment results -CO+OH=CO2+H 2.229E+05 1.89 -1158.7 - -! This study (2004) by matching literature experiment results -HCO+M=H+CO+M 4.7485E+11 0.659 1.4874E+04 -H2/2.5/ H2O/6/ CO/1.9/ CO2/3.8/ - -! Timonen et al., JPC, 92:651 (1988) -HCO+O2=CO+HO2 0.758E+13 0.00 0.410E+03 - -! Timonen et al., JPC, 91:692 (1987) -HCO+H=CO+H2 0.723E+14 0.00 0.000E+00 - -! All reactions from Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) -HCO + O = CO2 + H 3.000E+13 0.00 0.000E+00 - -END diff --git a/Support/ceptr/Kolla/mechanism.yaml b/Support/ceptr/Kolla/mechanism.yaml deleted file mode 100644 index 14292861f..000000000 --- a/Support/ceptr/Kolla/mechanism.yaml +++ /dev/null @@ -1,437 +0,0 @@ -description: |- - Mechanism for CO/H2 oxidation by Hemanth Kolla - based on the skeletal mechanism of Evatt R. Hawkes and Ramanan Sankaran - - Only difference from skeletal mechanism is the inclusion of H2O2 and - the reactions corresponding to its formation and consumption - - The skeletal mechanism is derived from a detailed C1 mechanism by J. Li - - Original notes on the skeletal mechanism and the detailed mechanisms follow - - ------------------------------------------------------------------------------ - Skeletal Mechanism for CO/H2 oxidation - by Evatt R. Hawkes and Ramanan Sankaran - - Reduced from complete C1 Mechanism that is published in: - - J. Li, PhD Thesis, - Mechanical and Aerospace Engineering Department, - Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. - - http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip - - At the time of writing, a publication to IJCK is in preparation - by the authors of the complete mechanism. - - This mechanism was reduced specifically for the purpose of the - Direct Numerical Simulations performed in - Hawkes, E.R., Sankaran, R., Sutherland, J.C., and Chen, J.H. (2006) - Proc. Combust. Inst. 31, to appear. - - It was validated by comparison with the full mechanism in several cases: - 1. freely propagating premixed flames in a range of equivalence ratios, - 2. opposed-flow non-premixed flames in a range of strains up to extinction, - 3. homogeneous ignition calculations for mixtures of fuel and oxidizer streams - and equilibrium products, - 4. two-dimensional DNS featuring extinction and local reignition. - In all cases the agreement was excellent. - - However, the mechanism is validated ONLY for the specific conditions of the - DNS and is not expected to be valid in general. - - The following changes (only) were made to the complete mechanism: - 1) Only the species H2 O2 O OH H2O H HO2 CO CO2 HCO N2 were retained. - All other species and reactions involving these species were removed. Note - this includes all C containing species other than those essential for CO - oxidation: CO, CO2 and HCO. For the atmospheric pressure of the simulation, - H2O2 was also found to be unimportant and was removed. - 2) It was found HCO has only a minor importance, and its reaction rates were - dominated by a few key reactions. These reactions (below) were retained - and all others neglected. - - Steady state assumptions were investigated and found to be reasonably accurate - for fully burning conditions but it was found they increased stiffness, hence - they were not employed. For reference, a steady state approximation for HCO - and HO2 may be expected to perform reasonably well if the added stiffness can - be tackled. However, note the HO2 steady state assumption will degrade the - prediction of ignition at longer ignition delay times. - - --------------------------------------------------------------------------------- - - Notes on the original mechanism by its authors: - - Authors: J. Li, Z. Zhao, A. Kazakov, F.L. Dryer, - Address: Dept. of Mechanical and Aerospace Engineering, - Princeton University, Princeton, NJ 08544 - - This C1 mechanism is based on the CH3OH mechanism of Held and Dryer (IJCK,1998, 30, 805) - with following important revision: - 1. H2/O2 subset is updated to that of Li et al. (IJCK, in press, 2004) - 2. CO + OH = CO2 + H is optimized to fit the literature experimental result - 3. HCO + M = H + CO + M is optimized to fit the literature experimental result - 4. CH3 + HO2 = CH3O + OH is modified to match Scire's value at 1000 K - 5. CH3 + HO2 = CH4 + H is taken from Scire (IJCK, 2001, 33, 75) - 6. CH3 + O2 = CH2O + OH is taken from Scire (2002, Ph.D. thesis) - 7. CH2O + HO2 = HCO + H2O2 is from Eiteneer et al. (JPC A. 1998, 102, 5196) - 8. CH2O + H = HCO + H2 is from Irdam et al. (IJCK 1993, 25, 285) - 9. CH2O + M reactions are from Friedrichs et al.(IJCK 2004, 36, 157) - 10. CH3OH decomposition reactions are taken from GRI-3.0 (1999) - 11. CH2OH + HCO = CH2O + CH2O is taken from Friedrichs et al. (IJCK, 2004, 36, 157) - 12. CH2OH + HCO = CH3OH + CO is changed to keep the branching ratio with the above reaction - 13. HCOOH reactions are not included since it is not important and has large uncertainties - 14. dHf of OH is adjusted to 8.91 kcal/mol (Ruscic et al. JPC A. 2002, 106, 2727) - 15. thermochemical data of CH2OH is fit to Johnson & Hudgens' table (JPC 1996, 100, 19874) - -generator: ck2yaml -input-files: [mechanism.inp, therm.dat, tran.dat] -cantera-version: 2.6.0 -date: Wed, 11 May 2022 17:40:41 -0700 - -units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol} - -phases: -- name: gas - thermo: ideal-gas - elements: [C, H, O, N] - species: [H2, O2, O, OH, H2O, H, HO2, H2O2, CO, CO2, HCO, N2] - kinetics: gas - transport: mixture-averaged - state: {T: 300.0, P: 1 atm} - -species: -- name: H2 - composition: {H: 2} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [3.298124, 8.249442e-04, -8.143015e-07, -9.475434e-11, 4.134872e-13, - -1012.521, -3.294094] - - [2.991423, 7.000644e-04, -5.633829e-08, -9.231578e-12, 1.582752e-15, - -835.034, -1.35511] - note: '121286' - transport: - model: gas - geometry: linear - well-depth: 38.0 - diameter: 2.92 - polarizability: 0.79 - rotational-relaxation: 280.0 -- name: O2 - composition: {O: 2} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [3.212936, 1.127486e-03, -5.75615e-07, 1.313877e-09, -8.768554e-13, - -1005.249, 6.034738] - - [3.697578, 6.135197e-04, -1.258842e-07, 1.775281e-11, -1.136435e-15, - -1233.93, 3.189166] - note: '121386' - transport: - model: gas - geometry: linear - well-depth: 107.4 - diameter: 3.458 - polarizability: 1.6 - rotational-relaxation: 3.8 -- name: O - composition: {O: 1} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [2.946429, -1.638166e-03, 2.421032e-06, -1.602843e-09, 3.890696e-13, - 2.914764e+04, 2.963995] - - [2.54206, -2.755062e-05, -3.102803e-09, 4.551067e-12, -4.368052e-16, - 2.92308e+04, 4.920308] - note: '120186' - transport: - model: gas - geometry: atom - well-depth: 80.0 - diameter: 2.75 -- name: OH - composition: {O: 1, H: 1} - thermo: - model: NASA7 - temperature-ranges: [200.0, 1000.0, 6000.0] - data: - - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, - 3346.30913, -0.69043296] - - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, - 3683.62875, 5.70164073] - note: S 9/01 - transport: - model: gas - geometry: linear - well-depth: 80.0 - diameter: 2.75 -- name: H2O - composition: {H: 2, O: 1} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [3.386842, 3.474982e-03, -6.354696e-06, 6.968581e-09, -2.506588e-12, - -3.020811e+04, 2.590233] - - [2.672146, 3.056293e-03, -8.73026e-07, 1.200996e-10, -6.391618e-15, - -2.989921e+04, 6.862817] - note: '20387' - transport: - model: gas - geometry: nonlinear - well-depth: 572.4 - diameter: 2.605 - dipole: 1.844 - rotational-relaxation: 4.0 -- name: H - composition: {H: 1} - thermo: - model: NASA7 - temperature-ranges: [300.0, 5000.0] - data: - - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547163e+04, -0.4601176] - note: '120186' - transport: - model: gas - geometry: atom - well-depth: 145.0 - diameter: 2.05 -- name: HO2 - composition: {H: 1, O: 2} - thermo: - model: NASA7 - temperature-ranges: [200.0, 1000.0, 3500.0] - data: - - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, - 294.80804, 3.71666245] - - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, - 111.856713, 3.78510215] - note: L 5/89 - transport: - model: gas - geometry: nonlinear - well-depth: 107.4 - diameter: 3.458 - rotational-relaxation: 1.0 -- name: H2O2 - composition: {H: 2, O: 2} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [3.388754, 6.569226e-03, -1.485013e-07, -4.625806e-09, 2.471515e-12, - -1.766315e+04, 6.785363] - - [4.573167, 4.336136e-03, -1.474689e-06, 2.348904e-10, -1.431654e-14, - -1.800696e+04, 0.501137] - note: '120186' - transport: - model: gas - geometry: nonlinear - well-depth: 107.4 - diameter: 3.458 - rotational-relaxation: 3.8 -- name: CO - composition: {C: 1, O: 1} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [3.262452, 1.511941e-03, -3.881755e-06, 5.581944e-09, -2.474951e-12, - -1.431054e+04, 4.848897] - - [3.025078, 1.442689e-03, -5.630828e-07, 1.018581e-10, -6.910952e-15, - -1.426835e+04, 6.108218] - note: '121286' - transport: - model: gas - geometry: linear - well-depth: 98.1 - diameter: 3.65 - polarizability: 1.95 - rotational-relaxation: 1.8 -- name: CO2 - composition: {C: 1, O: 2} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [2.275725, 9.922072e-03, -1.040911e-05, 6.866687e-09, -2.11728e-12, - -4.837314e+04, 10.18849] - - [4.453623, 3.140169e-03, -1.278411e-06, 2.393997e-10, -1.669033e-14, - -4.896696e+04, -0.9553959] - note: '121286' - transport: - model: gas - geometry: linear - well-depth: 244.0 - diameter: 3.763 - polarizability: 2.65 - rotational-relaxation: 2.1 -- name: HCO - composition: {H: 1, C: 1, O: 1} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [2.89833, 6.199147e-03, -9.623084e-06, 1.089825e-08, -4.574885e-12, - 4159.922, 8.983614] - - [3.557271, 3.345573e-03, -1.335006e-06, 2.470573e-10, -1.713851e-14, - 3916.324, 5.552299] - note: '121286' - transport: - model: gas - geometry: nonlinear - well-depth: 498.0 - diameter: 3.59 -- name: N2 - composition: {N: 2} - thermo: - model: NASA7 - temperature-ranges: [300.0, 1000.0, 5000.0] - data: - - [3.298677, 1.40824e-03, -3.963222e-06, 5.641515e-09, -2.444855e-12, - -1020.9, 3.950372] - - [2.92664, 1.487977e-03, -5.684761e-07, 1.009704e-10, -6.753351e-15, - -922.7977, 5.980528] - note: '121286' - transport: - model: gas - geometry: linear - well-depth: 97.53 - diameter: 3.621 - polarizability: 1.76 - rotational-relaxation: 4.0 - -reactions: -- equation: H + O2 <=> O + OH # Reaction 1 - rate-constant: {A: 3.547e+15, b: -0.406, Ea: 1.6599e+04} - note: |- - ************ H2-O2 Chain Reactions ********************** - Hessler, J. Phys. Chem. A, 102:4517 (1998) -- equation: O + H2 <=> H + OH # Reaction 2 - rate-constant: {A: 5.08e+04, b: 2.67, Ea: 6290.0} - note: Sutherland et al., 21st Symposium, p. 929 (1986) -- equation: H2 + OH <=> H2O + H # Reaction 3 - rate-constant: {A: 2.16e+08, b: 1.51, Ea: 3430.0} - note: Michael and Sutherland, J. Phys. Chem. 92:3853 (1988) -- equation: O + H2O <=> OH + OH # Reaction 4 - rate-constant: {A: 2.97e+06, b: 2.02, Ea: 1.34e+04} - note: Sutherland et al., 23rd Symposium, p. 51 (1990) -- equation: H2 + M <=> H + H + M # Reaction 5 - type: three-body - rate-constant: {A: 4.577e+19, b: -1.4, Ea: 1.0438e+05} - efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} - note: |- - *************** H2-O2 Dissociation Reactions ****************** - Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -- equation: O + O + M <=> O2 + M # Reaction 6 - type: three-body - rate-constant: {A: 6.165e+15, b: -0.5, Ea: 0.0} - efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -- equation: O + H + M <=> OH + M # Reaction 7 - type: three-body - rate-constant: {A: 4.714e+18, b: -1.0, Ea: 0.0} - efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -- equation: H + OH + M <=> H2O + M # Reaction 8 - type: three-body - rate-constant: {A: 3.8e+22, b: -2.0, Ea: 0.0} - efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} - note: |2- - Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) - H+OH+M=H2O+M 2.212E+22 -2.00 0.000E+00 -- equation: H + O2 (+M) <=> HO2 (+M) # Reaction 9 - type: falloff - low-P-rate-constant: {A: 6.366e+20, b: -1.72, Ea: 524.8} - high-P-rate-constant: {A: 1.475e+12, b: 0.6, Ea: 0.0} - Troe: {A: 0.8, T3: 1.0e-30, T1: 1.0e+30} - efficiencies: {H2: 2.0, H2O: 11.0, O2: 0.78, CO: 1.9, CO2: 3.8} - note: |- - ************** Formation and Consumption of HO2****************** - Cobos et al., J. Phys. Chem. 89:342 (1985) for kinf - Michael, et al., J. Phys. Chem. A, 106:5297 (2002) for k0 - ****************************************************************************** - MAIN BATH GAS IS N2 (comment this reaction otherwise) -- equation: HO2 + H <=> H2 + O2 # Reaction 10 - rate-constant: {A: 1.66e+13, b: 0.0, Ea: 823.0} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] -- equation: HO2 + H <=> OH + OH # Reaction 11 - rate-constant: {A: 7.079e+13, b: 0.0, Ea: 295.0} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) [modified] -- equation: HO2 + O <=> O2 + OH # Reaction 12 - rate-constant: {A: 3.25e+13, b: 0.0, Ea: 0.0} - note: Baulch et al., J. Phys. Chem. Ref Data, 21:411 (1992) -- equation: HO2 + OH <=> H2O + O2 # Reaction 13 - rate-constant: {A: 2.89e+13, b: 0.0, Ea: -497.0} - note: Keyser, J. Phys. Chem. 92:1193 (1988) -- equation: HO2 + HO2 <=> H2O2 + O2 # Reaction 14 - duplicate: true - rate-constant: {A: 4.2e+14, b: 0.0, Ea: 1.1982e+04} - note: |- - ***************Formation and Consumption of H2O2****************** - Hippler et al., J. Chem. Phys. 93:1755 (1990) -- equation: HO2 + HO2 <=> H2O2 + O2 # Reaction 15 - duplicate: true - rate-constant: {A: 1.3e+11, b: 0.0, Ea: -1629.3} -- equation: H2O2 (+M) <=> OH + OH (+M) # Reaction 16 - type: falloff - low-P-rate-constant: {A: 1.202e+17, b: 0.0, Ea: 4.55e+04} - high-P-rate-constant: {A: 2.951e+14, b: 0.0, Ea: 4.843e+04} - Troe: {A: 0.5, T3: 1.0e-30, T1: 1.0e+30} - efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} - note: |- - Brouwer et al., J. Chem. Phys. 86:6171 (1987) for kinf - Warnatz, J. in Combustion chemistry (1984) for k0 -- equation: H2O2 + H <=> H2O + OH # Reaction 17 - rate-constant: {A: 2.41e+13, b: 0.0, Ea: 3970.0} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -- equation: H2O2 + H <=> HO2 + H2 # Reaction 18 - rate-constant: {A: 4.82e+13, b: 0.0, Ea: 7950.0} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -- equation: H2O2 + O <=> OH + HO2 # Reaction 19 - rate-constant: {A: 9.55e+06, b: 2.0, Ea: 3970.0} - note: Tsang and Hampson, J. Phys. Chem. Ref. Data, 15:1087 (1986) -- equation: H2O2 + OH <=> HO2 + H2O # Reaction 20 - duplicate: true - rate-constant: {A: 1.0e+12, b: 0.0, Ea: 0.0} - note: Hippler and Troe, J. Chem. Phys. Lett. 192:333 (1992) -- equation: H2O2 + OH <=> HO2 + H2O # Reaction 21 - duplicate: true - rate-constant: {A: 5.8e+14, b: 0.0, Ea: 9557.0} -- equation: CO + O (+M) <=> CO2 (+M) # Reaction 22 - type: falloff - low-P-rate-constant: {A: 1.55e+24, b: -2.79, Ea: 4191.0} - high-P-rate-constant: {A: 1.8e+10, b: 0.0, Ea: 2384.0} - efficiencies: {H2: 2.5, H2O: 12.0, CO: 1.9, CO2: 3.8} - note: |- - ************** CO/HCO REACTIONS ***************** - Troe, 15th Symposium -- equation: CO + O2 <=> CO2 + O # Reaction 23 - rate-constant: {A: 2.53e+12, b: 0.0, Ea: 4.77e+04} - note: |- - Fit of Westmoreland, AiChe J., 1986, rel. to N2 - Tim adjusted from MTA's - rate constant, which was rel to Ar. - Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) -- equation: CO + HO2 <=> CO2 + OH # Reaction 24 - rate-constant: {A: 3.01e+13, b: 0.0, Ea: 2.3e+04} - note: This rate constant is modified per an updated value for HO2+HO2=H2O2+OH -- equation: CO + OH <=> CO2 + H # Reaction 25 - rate-constant: {A: 2.229e+05, b: 1.89, Ea: -1158.7} - note: This study (2004) by matching literature experiment results -- equation: HCO + M <=> H + CO + M # Reaction 26 - type: three-body - rate-constant: {A: 4.7485e+11, b: 0.659, Ea: 1.4874e+04} - efficiencies: {H2: 2.5, H2O: 6.0, CO: 1.9, CO2: 3.8} - note: This study (2004) by matching literature experiment results -- equation: HCO + O2 <=> CO + HO2 # Reaction 27 - rate-constant: {A: 7.58e+12, b: 0.0, Ea: 410.0} - note: Timonen et al., JPC, 92:651 (1988) -- equation: HCO + H <=> CO + H2 # Reaction 28 - rate-constant: {A: 7.23e+13, b: 0.0, Ea: 0.0} - note: Timonen et al., JPC, 91:692 (1987) -- equation: HCO + O <=> CO2 + H # Reaction 29 - rate-constant: {A: 3.0e+13, b: 0.0, Ea: 0.0} - note: All reactions from Tsang and Hampson, JPC Ref. Data, 15:1087 (1986) diff --git a/Support/ceptr/Kolla/therm.dat b/Support/ceptr/Kolla/therm.dat deleted file mode 100644 index df43c61ee..000000000 --- a/Support/ceptr/Kolla/therm.dat +++ /dev/null @@ -1,51 +0,0 @@ -THERMO ALL -0300.00 1000.00 5000.00 -HO2 L 5/89H 1O 2 00 00G 200.000 3500.000 1000.000 1 - 4.01721090E+00 2.23982013E-03-6.33658150E-07 1.14246370E-10-1.07908535E-14 2 - 1.11856713E+02 3.78510215E+00 4.30179801E+00-4.74912051E-03 2.11582891E-05 3 --2.42763894E-08 9.29225124E-12 2.94808040E+02 3.71666245E+00 1.00021620E+04 4 -CO 121286C 1O 1 G 0300.00 5000.00 1000.00 1 - 0.03025078E+02 0.01442689E-01-0.05630828E-05 0.01018581E-08-0.06910952E-13 2 --0.01426835E+06 0.06108218E+02 0.03262452E+02 0.01511941E-01-0.03881755E-04 3 - 0.05581944E-07-0.02474951E-10-0.01431054E+06 0.04848897E+02 4 -CO2 121286C 1O 2 G 0300.00 5000.00 1000.00 1 - 0.04453623E+02 0.03140169E-01-0.01278411E-04 0.02393997E-08-0.01669033E-12 2 --0.04896696E+06-0.09553959E+01 0.02275725E+02 0.09922072E-01-0.01040911E-03 3 - 0.06866687E-07-0.02117280E-10-0.04837314E+06 0.01018849E+03 4 -H 120186H 1 G 0300.00 5000.00 1000.00 1 - 0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2 - 0.02547163E+06-0.04601176E+01 0.02500000E+02 0.00000000E+00 0.00000000E+00 3 - 0.00000000E+00 0.00000000E+00 0.02547163E+06-0.04601176E+01 4 -H2 121286H 2 G 0300.00 5000.00 1000.00 1 - 0.02991423E+02 0.07000644E-02-0.05633829E-06-0.09231578E-10 0.01582752E-13 2 --0.08350340E+04-0.01355110E+02 0.03298124E+02 0.08249442E-02-0.08143015E-05 3 --0.09475434E-09 0.04134872E-11-0.01012521E+05-0.03294094E+02 4 -H2O 20387H 2O 1 G 0300.00 5000.00 1000.00 1 - 0.02672146E+02 0.03056293E-01-0.08730260E-05 0.01200996E-08-0.06391618E-13 2 --0.02989921E+06 0.06862817E+02 0.03386842E+02 0.03474982E-01-0.06354696E-04 3 - 0.06968581E-07-0.02506588E-10-0.03020811E+06 0.02590233E+02 4 -H2O2 120186H 2O 2 G 0300.00 5000.00 1000.00 1 - 0.04573167E+02 0.04336136E-01-0.01474689E-04 0.02348904E-08-0.01431654E-12 2 --0.01800696E+06 0.05011370E+01 0.03388754E+02 0.06569226E-01-0.01485013E-05 3 --0.04625806E-07 0.02471515E-10-0.01766315E+06 0.06785363E+02 4 -HCO 121286H 1C 1O 1 G 0300.00 5000.00 1000.00 1 - 0.03557271E+02 0.03345573E-01-0.01335006E-04 0.02470573E-08-0.01713851E-12 2 - 0.03916324E+05 0.05552299E+02 0.02898330E+02 0.06199147E-01-0.09623084E-04 3 - 0.01089825E-06-0.04574885E-10 0.04159922E+05 0.08983614E+02 4 -O 120186O 1 G 0300.00 5000.00 1000.00 1 - 0.02542060E+02-0.02755062E-03-0.03102803E-07 0.04551067E-10-0.04368052E-14 2 - 0.02923080E+06 0.04920308E+02 0.02946429E+02-0.01638166E-01 0.02421032E-04 3 --0.01602843E-07 0.03890696E-11 0.02914764E+06 0.02963995E+02 4 -O2 121386O 2 G 0300.00 5000.00 1000.00 1 - 0.03697578E+02 0.06135197E-02-0.01258842E-05 0.01775281E-09-0.01136435E-13 2 --0.01233930E+05 0.03189166E+02 0.03212936E+02 0.01127486E-01-0.05756150E-05 3 - 0.01313877E-07-0.08768554E-11-0.01005249E+05 0.06034738E+02 4 -N2 121286N 2 G 0300.00 5000.00 1000.00 1 - 0.02926640E+02 0.01487977E-01-0.05684761E-05 0.01009704E-08-0.06753351E-13 2 --0.09227977E+04 0.05980528E+02 0.03298677E+02 0.01408240E-01-0.03963222E-04 3 - 0.05641515E-07-0.02444855E-10-0.01020900E+05 0.03950372E+02 4 -OH S 9/01O 1H 1 0 0G 200.000 6000.000 1000. 1 - 2.86472886E+00 1.05650448E-03-2.59082758E-07 3.05218674E-11-1.33195876E-15 2 - 3.68362875E+03 5.70164073E+00 4.12530561E+00-3.22544939E-03 6.52764691E-06 3 --5.79853643E-09 2.06237379E-12 3.34630913E+03-6.90432960E-01 4.51532273E+03 4 -END diff --git a/Support/ceptr/Kolla/tran.dat b/Support/ceptr/Kolla/tran.dat deleted file mode 100644 index aba301c02..000000000 --- a/Support/ceptr/Kolla/tran.dat +++ /dev/null @@ -1,319 +0,0 @@ -! -! Transport data file to complement -! skeletal Mechanism for CO/H2 oxidation -! by Evatt R. Hawkes and Ramanan Sankaran -! -! The transport data were obtained from the authors of the complete -! C1-mechanism from which our skeletal mechanism was reduced, and were not -! altered. -! -! The complete C1-mechanism is found in: -! -! http://www.princeton.edu/~combust/database/files/symposium/C1_Mechanism.zip -! -! J. Li, PhD Thesis, -! Mechanical and Aerospace Engineering Department, -! Princeton University, Princeton NJ. November 2004. Thesis No. 3122-T. -! -! At the time of writing, a publication to IJCK is in preparation -! by the authors of the complete mechanism. -! -! -AR 0 136.500 3.330 0.000 0.000 0.000 -AS 0 1045.500 4.580 0.000 0.000 0.000 ! MEC -ASH 1 199.300 4.215 0.000 0.000 1.000 ! MEC -ASH2 2 229.600 4.180 0.000 0.000 1.000 ! MEC -C 0 71.400 3.298 0.000 0.000 0.000 ! * -C2 1 97.530 3.621 0.000 1.760 4.000 -C2O 1 232.400 3.828 0.000 0.000 1.000 ! * -CN2 1 232.400 3.828 0.000 0.000 1.000 ! OIS -C2H 1 265.300 3.721 0.000 0.000 2.500 ! NMM -C2H2 1 265.300 3.721 0.000 0.000 2.500 ! NMM -C2H2OH 2 224.700 4.162 0.000 0.000 1.000 ! * -C2H3 2 265.300 3.721 0.000 0.000 1.000 ! NMM -C2H4 2 238.400 3.496 0.000 0.000 1.500 ! NMM -C2H5 2 247.500 4.350 0.000 0.000 1.500 ! NMM -C2H5OH 2 470.600 4.410 0.000 0.000 1.500 ! NMM -CH3CHOH 2 470.600 4.410 0.000 0.000 1.500 -CH3CH2O 2 470.600 4.410 0.000 0.000 1.500 ! NMM -C2H4OH 2 470.600 4.410 0.000 0.000 1.500 -PC2H4OH 2 470.600 4.410 0.000 0.000 1.500 ! NMM -SC2H4OH 2 470.600 4.410 0.000 0.000 1.500 ! NMM -HCOOH 2 470.600 4.410 0.000 0.000 1.500 -C2H6 2 247.500 4.350 0.000 0.000 1.500 ! NMM -C2N 1 232.400 3.828 0.000 0.000 1.000 ! OIS -C2N2 1 349.000 4.361 0.000 0.000 1.000 ! OIS -C3H2 2 209.000 4.100 0.000 0.000 1.000 ! * -C3H2(S) 2 209.000 4.100 0.000 0.000 1.000 ! * -C3H3 1 324.800 4.290 0.000 0.000 1.000 ! NMM -C4H3 1 357.000 4.720 0.000 0.000 1.000 ! NMM -C3H4O 2 443.200 4.120 0.000 0.000 1.000 ! NMM -ACETONE 2 443.200 4.120 0.000 0.000 1.000 -CH2CHCH2O 2 443.200 4.120 0.000 0.000 1.000 -HOC2H4O2 2 443.200 4.120 0.000 0.000 1.000 -CH3COCH2 2 443.200 4.120 0.000 0.000 1.000 -CHCHCHO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -HCCCHO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -HCCCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -H2CCHCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -CH3CCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -CH3CHCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -CH2CHCO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -C2H3CO 2 443.200 4.120 0.000 0.000 1.000 ! NMM -C2H5CHO 2 424.600 4.820 0.000 0.000 1.000 ! NMM -CH2CH2CHO 2 424.600 4.820 0.000 0.000 1.000 ! NMM -CH2CHCHO 2 424.600 4.820 0.000 0.000 1.000 -C2H5CO 2 424.600 4.820 0.000 0.000 1.000 ! NMM -CH3COCH3 2 435.500 4.860 0.000 0.000 1.000 ! NMM -CH3COCH2 2 435.500 4.860 0.000 0.000 1.000 ! NMM -AC3H4 1 324.800 4.290 0.000 0.000 1.000 ! NMM -PC3H4 1 324.800 4.290 0.000 0.000 1.000 ! NMM -C3H4C 2 324.800 4.290 0.000 0.000 1.000 ! NMM -C3H6 2 307.800 4.140 0.000 0.000 1.000 ! NMM -C3H6OH 2 487.900 4.820 0.000 0.000 1.000 ! NMM -C3H6O 2 411.000 4.820 0.000 0.000 1.000 ! NMM -C3H5O 2 411.000 4.820 0.000 0.000 1.000 ! NMM -C3H7 2 303.400 4.810 0.000 0.000 1.000 ! NMM -C4H6 2 357.000 4.720 0.000 0.000 1.000 ! NMM -IC3H7 2 303.400 4.810 0.000 0.000 1.000 ! NMM -NC3H7 2 303.400 4.810 0.000 0.000 1.000 ! NMM -C3H8 2 303.400 4.810 0.000 0.000 1.000 ! NMM -C4H 1 357.000 4.720 0.000 0.000 1.000 ! NMM -C4H2 1 357.000 4.720 0.000 0.000 1.000 ! NMM -C4H2OH 2 224.700 4.162 0.000 0.000 1.000 ! * -CH3CHCCH 2 355.000 4.650 0.000 0.000 1.000 ! NMM -IC4H7 2 355.000 4.650 0.000 0.000 1.000 ! NMM -C4H7 2 355.000 4.650 0.000 0.000 1.000 ! NMM -C4H8 2 355.000 4.650 0.000 0.000 1.000 ! NMM -C4H8-1 2 355.000 4.650 0.000 0.000 1.000 ! NMM -C4H8-2 2 355.000 4.650 0.000 0.000 1.000 ! NMM -IC4H8 2 355.000 4.650 0.000 0.000 1.000 ! NMM -PC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM -C4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM -SC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM -TC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM -IC4H9 2 352.000 5.240 0.000 0.000 1.000 ! NMM -C4H10 2 352.000 5.240 0.000 0.000 1.000 ! NMM -IC4H10 2 352.000 5.240 0.000 0.000 1.000 ! NMM -C5H2 1 408.000 5.200 0.000 0.000 1.000 ! NMM -C5H3 1 408.000 5.200 0.000 0.000 1.000 ! NMM -C5H5 1 408.000 5.200 0.000 0.000 1.000 ! NMM -C5H6 1 408.000 5.200 0.000 0.000 1.000 ! NMM -C5H7 2 408.000 5.200 0.000 0.000 1.000 ! NMM -CYC5H7 2 408.000 5.200 0.000 0.000 1.000 ! -C5H8 2 408.000 5.200 0.000 0.000 1.000 ! NMM -C6H2 1 408.000 5.200 0.000 0.000 1.000 ! NMM -C6H4 2 412.300 5.349 0.000 0.000 1.000 ! JAM -C6H5 2 412.300 5.349 0.000 0.000 1.000 ! JAM -C6H5(L) 2 412.300 5.349 0.000 0.000 1.000 ! JAM -C6H5OH 2 450.000 5.500 0.000 0.000 1.000 ! NMM -C6H5O 2 450.000 5.500 0.000 0.000 1.000 ! JAM -C6H4O2 2 450.000 5.500 0.000 0.000 1.000 -C5H4O 2 450.000 5.500 0.000 0.000 1.000 ! NMM -C5H4OH 2 450.000 5.500 0.000 0.000 1.000 ! NMM -C5H5O 2 450.000 5.500 0.000 0.000 1.000 ! NMM -C5H5OH 2 450.000 5.500 0.000 0.000 1.000 ! NMM -C6H5C2H 2 468.500 5.230 0.000 0.000 1.000 ! NMM -LC6H5 2 426.300 5.510 0.000 0.000 1.000 -C6H6 2 468.500 5.230 0.000 10.30 1.000 ! NMM -C6H7 2 468.500 5.230 0.000 0.000 1.000 ! NMM -CYC6H7 2 468.500 5.230 0.000 0.000 1.000 ! NMM -CYC6H8 2 468.500 5.230 0.000 0.000 1.000 ! NMM -C6H5CH2 2 495.300 5.680 0.000 0.000 1.000 ! NMM -C6H5CH3 2 495.300 5.680 0.430 12.30 1.000 ! NMM -C6H5CO 2 622.400 5.530 0.000 0.000 1.000 ! NMM -C6H5CHO 2 622.400 5.530 0.000 0.000 1.000 ! NMM -C6H5CH2OH 2 622.400 5.530 0.000 0.000 1.000 ! NMM -OC6H4CH3 2 621.100 5.640 0.000 0.000 1.000 ! NMM -HOC6H4CH3 2 621.100 5.640 0.000 0.000 1.000 ! NMM -XYLYLENE 2 523.600 6.182 0.000 0.000 1.000 -XYLYLRAD 2 523.600 6.182 0.000 0.000 1.000 -C6H5C2H5 2 523.600 5.960 0.000 0.000 1.000 ! NMM -C6H9 2 426.300 5.510 0.000 0.000 1.000 ! NMM -C6H10 2 426.300 5.510 0.000 0.000 1.000 ! NMM -C8H14 2 494.000 6.170 0.000 0.000 1.000 ! NMM -IC8H14 2 494.000 6.170 0.000 0.000 1.000 ! NMM -C6H5C2H3 2 546.200 6.000 0.130 15.00 1.000 ! NMM -C6H5CHCH 2 546.200 6.000 0.000 0.000 1.000 ! NMM -C6H5CCH2 2 546.200 6.000 0.000 0.000 1.000 -C6H5C2H 2 534.300 5.710 0.770 0.000 1.000 ! NMM -C6H4C2H3 2 546.200 6.000 0.000 0.000 1.000 ! NMM -C6H4C2H 2 534.300 5.710 0.000 0.000 1.000 ! NMM -C6H5CCO 2 588.200 5.940 0.000 0.000 1.0001 -C10H7 2 630.400 6.180 0.000 0.000 1.000 ! NMM -C10H7O 2 630.400 6.180 0.000 0.000 1.000 ! NMM -C10H8 2 630.400 6.180 0.000 16.50 1.000 ! NMM -C10H9 2 630.400 6.180 0.000 0.000 1.000 ! NMM -C10H10 2 630.400 6.180 0.000 0.000 1.000 ! NMM -C10H7CH2 2 660.00 6.350 0.000 0.000 1.000 ! NMM -C10H7OH 2 663.45 6.362 0.000 0.000 1.000 -C10H7CH3 2 660.0 6.350 0.000 0.000 1.000 ! NMM -FLRNTHN 2 812.3 7.170 0.000 0.000 1.000 ! NMM -ACEPHEN 2 812.3 7.170 0.000 0.000 1.000 -ANTHRACN 2 772.0 6.960 0.000 25.40 1.000 -CH3INDENE 2 625.0 6.150 0.000 0.000 1.000 -CH3INDENYL 2 625.0 6.150 0.000 0.000 1.000 -PHNTHRN 2 772.0 6.960 0.000 38.80 1.000 -PYRENE 2 834.9 7.240 0.000 0.000 1.000 ! NMM -PYRENYL 2 834.9 7.240 0.000 0.000 1.000 ! NMM -DHPYRENE 2 834.9 7.240 0.000 0.000 1.000 -BENZOAP 2 832.5 7.550 1.400 0.000 1.000 ! NMM -BENZOGHI 2 832.5 7.550 0.000 0.000 1.000 -CPENTACD 2 832.5 7.550 0.000 0.000 1.000 -INDENE 2 588.6 5.960 0.650 0.000 1.000 ! NMM -INDENYL 2 588.6 5.960 0.000 0.000 1.000 ! NMM -CH3FLRNE 2 712.6 6.890 0.000 0.000 1.000 -CH3FLRNL 2 712.6 6.890 0.000 0.000 1.000 -FLRENE 2 712.6 6.890 0.000 0.000 1.000 -BIBENZYL 2 783.800 6.640 0.000 0.000 1.000 ! NMM -STILBENE 2 772.0 6.960 0.000 0.000 1.000 ! NMM -STILBNRD 2 772.0 6.960 0.000 0.000 1.000 ! NMM -ANTHRACN 2 772.0 6.960 0.000 0.000 1.000 ! NMM -DHANTHRN 2 772.0 6.960 0.000 0.000 1.000 -CH 1 80.000 2.750 0.000 0.000 0.000 -CH2 1 144.000 3.800 0.000 0.000 0.000 -CH2(S) 1 144.000 3.800 0.000 0.000 0.000 -CH2CHCCH 2 373.700 4.790 0.000 0.000 1.000 ! NMM -CH2CHCCH2 2 373.700 4.790 0.000 0.000 1.000 ! NMM -CH3CCCH2 2 357.100 4.720 0.000 0.000 1.000 -CH3CHCCH2 2 357.100 4.720 0.000 0.000 1.000 -CH2CH2CCH 2 373.700 4.790 0.000 0.000 1.000 ! NMM -CH2CHCH2 2 316.000 4.220 0.000 0.000 1.000 ! NMM -AC3H5 2 316.000 4.220 0.000 0.000 1.000 -PC3H5 2 316.000 4.220 0.000 0.000 1.000 -CH2CHCHCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM -CH2CHCHCH2 2 357.100 4.720 0.000 0.000 1.000 ! NMM -CH2CO 2 436.000 3.970 0.000 0.000 2.000 -CH2O 2 498.000 3.590 0.000 0.000 2.000 -HCOH 2 498.000 3.590 0.000 0.000 1.000 -H2CO 2 498.000 3.590 0.000 0.000 2.000 -CH2OH 2 417.000 3.690 1.700 0.000 2.000 -CH2HCO 2 436.000 3.970 0.000 0.000 2.000 -CHOCHO 1 440.200 4.010 0.000 0.000 2.000 ! NMM -CHOCO 1 440.200 4.010 0.000 0.000 2.000 ! NMM -CH3 1 144.000 3.800 0.000 0.000 0.000 -CH3CC 2 252.000 4.760 0.000 0.000 1.000 ! JAM -CH3CHCCH 2 373.700 4.790 0.000 0.000 1.000 ! NMM -CH3CCCH2 2 357.100 4.720 0.000 0.000 1.000 ! NMM -CH3CCCH3 2 357.100 4.720 0.000 0.000 1.000 ! NMM -CH3CCH2 2 316.000 4.220 0.000 0.000 1.000 ! NMM -TC3H5 2 316.000 4.220 0.000 0.000 1.000 -CH3CHCH 2 316.000 4.220 0.000 0.000 1.000 ! NMM -SC3H5 2 316.000 4.220 0.000 0.000 1.000 -CH3CH2CCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM -CH3HCO 2 436.000 3.970 0.000 0.000 2.000 -CH3CO 2 436.000 3.970 0.000 0.000 2.000 -CH3O 2 417.000 3.690 1.700 0.000 2.000 -CH3OH 2 481.800 3.626 0.000 0.000 1.000 ! SVE -CH4 2 141.400 3.746 0.000 2.600 13.000 -CH4O 2 417.000 3.690 1.700 0.000 2.000 -CN 1 75.000 3.856 0.000 0.000 1.000 ! OIS -CNC 1 232.400 3.828 0.000 0.000 1.000 ! OIS -CNN 1 232.400 3.828 0.000 0.000 1.000 ! OIS -CO 1 98.100 3.650 0.000 1.950 1.800 -CO2 1 244.000 3.763 0.000 2.650 2.100 -F 0 80.000 2.750 0.000 0.000 0.000 -F2 1 125.700 3.301 0.000 1.600 3.800 -H 0 145.000 2.050 0.000 0.000 0.000 -GAH 1 335.500 4.240 0.000 0.000 1.000 ! MEC -H2C4O 2 357.000 5.180 0.000 0.000 1.000 ! JAM -H2 1 38.000 2.920 0.000 0.790 280.000 -H2CCC 2 265.300 3.721 0.000 0.000 1.000 ! * -H2CCC(S) 2 265.300 3.721 0.000 0.000 1.000 ! * -H2CCCH 2 252.000 4.760 0.000 0.000 1.000 ! JAM -H2CCCCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM -H2CCCCH2 2 357.100 4.720 0.000 0.000 1.000 ! NMM -H2CCCCCH 1 408.000 5.200 0.000 0.000 1.000 ! NMM -H2CN 1 569.000 3.630 0.000 0.000 1.000 ! OS/JM -H2NO 2 116.700 3.492 0.000 0.000 1.000 ! JAM -H2O 2 572.400 2.605 1.844 0.000 4.000 -H2O2 2 107.400 3.458 0.000 0.000 3.800 -H2S 2 301.000 3.600 0.000 0.000 1.000 ! OIS -HC2N2 1 349.000 4.361 0.000 0.000 1.000 ! OIS -HCCHCCH 2 357.100 4.720 0.000 0.000 1.000 ! NMM -HCCO 2 150.000 2.500 0.000 0.000 1.000 ! * -HCCOH 2 436.000 3.970 0.000 0.000 2.000 -HCCCHCCH 1 408.000 5.200 0.000 0.000 1.000 ! NMM -HCN 1 569.000 3.630 0.000 0.000 1.000 ! OIS -HCO 2 498.000 3.590 0.000 0.000 0.000 -HCO+ 1 498.000 3.590 0.000 0.000 0.000 -HE 0 10.200 2.576 0.000 0.000 0.000 ! * -HF 1 330.000 3.148 1.920 2.460 1.000 ! SV/MEC -HF0 1 352.000 2.490 1.730 0.000 5.000 -HF1 1 352.000 2.490 1.730 0.000 5.000 -HF2 1 352.000 2.490 1.730 0.000 5.000 -HF3 1 352.000 2.490 1.730 0.000 5.000 -HF4 1 352.000 2.490 1.730 0.000 5.000 -HF5 1 352.000 2.490 1.730 0.000 5.000 -HF6 1 352.000 2.490 1.730 0.000 5.000 -HF7 1 352.000 2.490 1.730 0.000 5.000 -HF8 1 352.000 2.490 1.730 0.000 5.000 -HCNO 2 232.400 3.828 0.000 0.000 1.000 ! JAM -HOCN 2 232.400 3.828 0.000 0.000 1.000 ! JAM -HNCO 2 232.400 3.828 0.000 0.000 1.000 ! OIS -HNNO 2 232.400 3.828 0.000 0.000 1.000 ! * -HNO 2 116.700 3.492 0.000 0.000 1.000 ! * -HNOH 2 116.700 3.492 0.000 0.000 1.000 ! JAM -HO2 2 107.400 3.458 0.000 0.000 1.000 ! * -HSO2 2 252.000 4.290 0.000 0.000 1.000 ! OIS -N 0 71.400 3.298 0.000 0.000 0.000 ! * -N2 1 97.530 3.621 0.000 1.760 4.000 -N2H2 2 71.400 3.798 0.000 0.000 1.000 ! * -N2H3 2 200.000 3.900 0.000 0.000 1.000 ! * -N2H4 2 205.000 4.230 0.000 4.260 1.500 -N2O 1 232.400 3.828 0.000 0.000 1.000 ! * -NCN 1 232.400 3.828 0.000 0.000 1.000 ! OIS -NCO 1 232.400 3.828 0.000 0.000 1.000 ! OIS -NH 1 80.000 2.650 0.000 0.000 4.000 -NH2 2 80.000 2.650 0.000 2.260 4.000 -NH3 2 481.000 2.920 1.470 0.000 10.000 -NNH 2 71.400 3.798 0.000 0.000 1.000 ! * -NO 1 97.530 3.621 0.000 1.760 4.000 -NCNO 2 232.400 3.828 0.000 0.000 1.000 ! OIS -NO2 2 200.000 3.500 0.000 0.000 1.000 ! * -O 0 80.000 2.750 0.000 0.000 0.000 -O2 1 107.400 3.458 0.000 1.600 3.800 -O3 2 180.000 4.100 0.000 0.000 2.000 -OH 1 80.000 2.750 0.000 0.000 0.000 -S 0 847.000 3.839 0.000 0.000 0.000 ! OIS -S2 1 847.000 3.900 0.000 0.000 1.000 ! OIS -SH 1 847.000 3.900 0.000 0.000 1.000 ! OIS -SO 1 301.000 3.993 0.000 0.000 1.000 ! OIS -SO2 2 252.000 4.290 0.000 0.000 1.000 ! OIS -SO3 2 378.400 4.175 0.000 0.000 1.000 ! OIS -SIH4 2 207.6 4.084 0.000 0.000 1.000 ! MEC -SIH3 2 170.3 3.943 0.000 0.000 1.000 ! MEC -SIH2 2 133.1 3.803 0.000 0.000 1.000 ! MEC -SIH 1 95.8 3.662 0.000 0.000 1.000 ! MEC -SI 0 3036. 2.910 0.000 0.000 0.000 ! MEC -SI2H6 2 301.3 4.828 0.000 0.000 1.000 ! MEC -SI2H5 2 306.9 4.717 0.000 0.000 1.000 ! MEC -SI2H4 2 312.6 4.601 0.000 0.000 1.000 ! MEC -SI2H3 2 318.2 4.494 0.000 0.000 1.000 ! MEC -SI2H2 2 323.8 4.383 0.000 0.000 1.000 ! MEC -SI2 1 3036. 3.280 0.000 0.000 1.000 ! MEC -SI3 2 3036. 3.550 0.000 0.000 1.000 ! MEC -SIF3 2 309.6 4.359 0.000 0.000 1.000 ! MEC -SIF3NH2 2 231.0 4.975 0.000 0.000 1.000 ! MEC -SIF4 2 171.9 4.880 0.000 0.000 1.000 ! SVE -SIHF3 2 180.8 4.681 0.000 0.000 1.000 ! MEC -H2SISIH2 2 312.6 4.601 0.000 0.000 1.000 ! MEC -H3SISIH 2 312.6 4.601 0.000 0.000 1.000 ! MEC -SI3H8 2 331.2 5.562 0.000 0.000 1.000 ! MEC -ASH3 2 259.8 4.145 0.000 0.000 1.000 ! MEC -AS2 1 1045.5 5.510 0.000 0.000 1.000 ! MEC -GAME3 2 378.2 5.52 0.000 0.000 1.000 ! MEC -GAME2 2 675.8 5.22 0.000 0.000 1.000 ! MEC -GAME 2 972.7 4.92 0.000 0.000 1.000 ! MEC -GA 0 2961.8 4.62 0.000 0.000 0.000 ! MEC -K 0 850. 4.25 0.000 0.000 1.000 ! SINGH -KOH 2 1213. 4.52 0.000 0.000 1.000 ! SINGH -KO2 2 1213. 4.69 0.000 0.000 1.000 ! SINGH -KH 1 93.3 3.542 0.000 0.000 1.000 ! SINGH -K+ 0 850. 4.25 0.000 0.000 1.000 ! SINGH -E 0 850. 425. 0.000 0.000 1.000 ! SINGH -KCL 1 1989. 4.186 0.000 0.000 1.000 ! SINGH -CL 0 130.8 3.613 0.000 0.000 1.000 ! SINGH -CL- 0 130.8 3.613 0.000 0.000 1.000 ! SINGH -HCL 1 344.7 3.339 1.084 0.000 1.000 ! SINGH -KO 1 383.0 3.812 0.000 0.000 1.000 ! SINGH From a170d9fbce178f70fbe80b5a3ce95cb405fc16fd Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Fri, 2 Feb 2024 07:25:23 +0530 Subject: [PATCH 15/20] Modified ceptr.py to run in batch mode --- Support/ceptr/ceptr/ceptr.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Support/ceptr/ceptr/ceptr.py b/Support/ceptr/ceptr/ceptr.py index 02d7f594a..31778c7a0 100644 --- a/Support/ceptr/ceptr/ceptr.py +++ b/Support/ceptr/ceptr/ceptr.py @@ -78,6 +78,9 @@ def convert_lst( qss_format_input, qss_symbolic_jac, ncpu, + chemistry, + gas_name, + interface_name, ): """Convert mechanisms from a file containing a list of directories.""" mechnames = parse_lst_file(lst) @@ -90,6 +93,9 @@ def convert_lst( repeat(jacobian), repeat(qss_format_input), repeat(qss_symbolic_jac), + repeat(chemistry), + repeat(gas_name), + repeat(interface_name), ), ) @@ -98,6 +104,9 @@ def convert_lst_qss( lst, jacobian, ncpu, + chemistry, + gas_name, + interface_name, ): """Convert QSS mechanisms from a file of directories and format input.""" mechnames, qss_format_inputs = parse_qss_lst_file(lst) @@ -105,7 +114,15 @@ def convert_lst_qss( with Pool(ncpu) as pool: pool.starmap( convert, - zip(mechnames, repeat(jacobian), qss_format_inputs, repeat(True)), + zip( + mechnames, + repeat(jacobian), + qss_format_inputs, + repeat(True), + repeat(chemistry), + repeat(gas_name), + repeat(interface_name), + ), ) @@ -197,12 +214,18 @@ def main(): args.qss_format_input, args.qss_symbolic_jacobian, args.ncpu, + args.chemistry, + args.gas_name, + args.interface_name, ) elif args.lst_qss: convert_lst_qss( args.lst_qss, not args.no_jacobian, args.ncpu, + args.chemistry, + args.gas_name, + args.interface_name, ) end = time.time() print(f"CEPTR run time: {end-start:.2f} s") From 8b52eded233d292dec41198ee81888c940eec034 Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 5 Feb 2024 14:25:24 +0530 Subject: [PATCH 16/20] Added missing parenthesis in preprocessor directives --- Support/ceptr/ceptr/converter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Support/ceptr/ceptr/converter.py b/Support/ceptr/ceptr/converter.py index 13788214b..018fe41b1 100644 --- a/Support/ceptr/ceptr/converter.py +++ b/Support/ceptr/ceptr/converter.py @@ -759,14 +759,14 @@ def mechanism_header_includes(self, fstream): cw.writer(fstream) cw.writer( - fstream, "#define NUM_ELEMENTS NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS" + fstream, "#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS)" ) cw.writer( fstream, - f"#define NUM_SPECIES NUM_{qssa_str}GAS_SPECIES + NUM_SURFACE_SPECIES", + f"#define NUM_SPECIES (NUM_{qssa_str}GAS_SPECIES + NUM_SURFACE_SPECIES)", ) cw.writer( - fstream, "#define NUM_REACTIONS NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS" + fstream, "#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS)" ) cw.writer(fstream) cw.writer(fstream, f"#define NUM_IONS {nb_ions}") From cdf345141ad0b3c50fd0ff76ebb684b482847e7f Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Mon, 5 Feb 2024 14:32:59 +0530 Subject: [PATCH 17/20] Batch generated non-qss homogeneous reaction mechanions with new code --- Mechanisms/Aromatic_KrNara/mechanism.H | 53 ++++++----- Mechanisms/Aromatic_KrNara/mechanism.cpp | 4 +- Mechanisms/BurkeDryer/mechanism.H | 17 +++- Mechanisms/BurkeDryer/mechanism.cpp | 7 +- Mechanisms/C1-C2-NO/mechanism.H | 17 +++- Mechanisms/C1-C2-NO/mechanism.cpp | 4 +- Mechanisms/CH4_lean/mechanism.H | 23 +++-- Mechanisms/CH4_lean/mechanism.cpp | 4 +- Mechanisms/Davis/mechanism.H | 17 +++- Mechanisms/Davis/mechanism.cpp | 8 +- Mechanisms/FFCM1_Red/mechanism.H | 19 +++- Mechanisms/FFCM1_Red/mechanism.cpp | 4 +- Mechanisms/H2-CO-CO2-3spec/mechanism.H | 17 +++- Mechanisms/IonizedAir/mechanism.H | 17 +++- Mechanisms/JL4/mechanism.H | 17 +++- Mechanisms/JL4/mechanism.cpp | 4 +- Mechanisms/Kolla/mechanism.H | 17 +++- Mechanisms/Kolla/mechanism.cpp | 8 +- Mechanisms/LiDryer/mechanism.H | 17 +++- Mechanisms/LiDryer/mechanism.cpp | 6 +- Mechanisms/LuDME/mechanism.H | 23 +++-- Mechanisms/LuDME/mechanism.cpp | 4 +- Mechanisms/LuEthylene/mechanism.H | 17 +++- Mechanisms/LuEthylene/mechanism.cpp | 4 +- Mechanisms/NUIGalway/mechanism.H | 37 +++++--- Mechanisms/NUIGalway/mechanism.cpp | 4 +- Mechanisms/SootReaction/mechanism.H | 17 +++- Mechanisms/SootReaction/mechanism.cpp | 4 +- Mechanisms/air/mechanism.H | 17 +++- Mechanisms/alzeta/mechanism.H | 25 +++-- Mechanisms/alzeta/mechanism.cpp | 4 +- Mechanisms/chem-CH4-2step/mechanism.H | 17 +++- Mechanisms/chem-CH4-2step/mechanism.cpp | 4 +- Mechanisms/chem-H/mechanism.H | 17 +++- Mechanisms/chem-H/mechanism.cpp | 7 +- Mechanisms/decane_3sp/mechanism.H | 17 +++- Mechanisms/dodecane_lu/mechanism.H | 17 +++- Mechanisms/dodecane_lu/mechanism.cpp | 4 +- Mechanisms/dodecane_wang/mechanism.H | 17 +++- Mechanisms/dodecane_wang/mechanism.cpp | 4 +- Mechanisms/dodmethair_4sp/mechanism.H | 17 +++- Mechanisms/drm19/mechanism.H | 19 +++- Mechanisms/drm19/mechanism.cpp | 14 +-- Mechanisms/ethylene_af/mechanism.H | 17 +++- Mechanisms/ethylene_af/mechanism.cpp | 4 +- Mechanisms/grimech12/mechanism.H | 19 +++- Mechanisms/grimech12/mechanism.cpp | 4 +- Mechanisms/grimech30-noArN/mechanism.H | 19 +++- Mechanisms/grimech30-noArN/mechanism.cpp | 4 +- Mechanisms/grimech30/mechanism.H | 19 +++- Mechanisms/grimech30/mechanism.cpp | 4 +- Mechanisms/heptane_3sp/mechanism.H | 17 +++- Mechanisms/heptane_fc/mechanism.H | 21 ++++- Mechanisms/heptane_fc/mechanism.cpp | 4 +- Mechanisms/heptane_lu_88sk/mechanism.H | 27 ++++-- Mechanisms/heptane_lu_88sk/mechanism.cpp | 4 +- Mechanisms/isooctane_lu/mechanism.H | 97 +++++++++++--------- Mechanisms/isooctane_lu/mechanism.cpp | 4 +- Mechanisms/methaneIons_diRenzo/mechanism.H | 19 +++- Mechanisms/methaneIons_diRenzo/mechanism.cpp | 4 +- Mechanisms/ndodecane_35/mechanism.H | 17 +++- Mechanisms/nitrogens/mechanism.H | 17 +++- Mechanisms/propane_fc/mechanism.H | 37 +++++--- Mechanisms/propane_fc/mechanism.cpp | 4 +- Mechanisms/sCO2/mechanism.H | 17 +++- Mechanisms/sCO2/mechanism.cpp | 12 +-- 66 files changed, 695 insertions(+), 286 deletions(-) diff --git a/Mechanisms/Aromatic_KrNara/mechanism.H b/Mechanisms/Aromatic_KrNara/mechanism.H index 04d864b84..36cb10654 100644 --- a/Mechanisms/Aromatic_KrNara/mechanism.H +++ b/Mechanisms/Aromatic_KrNara/mechanism.H @@ -172,10 +172,21 @@ #define OC6H4O_ID 156 #define N2_ID 157 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 158 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 158 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 1049 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 7 -#define NUM_REACTIONS 1049 #define NUM_FIT 4 @@ -186439,7 +186450,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[33806] = -4.21537415E-01; COFD[33807] = 1.63630500E-02; COFD[33808] = -2.25933772E+01; - COFD[33809] = 5.42562555E+00; + COFD[33809] = 5.42562556E+00; COFD[33810] = -4.48132861E-01; COFD[33811] = 1.77847329E-02; COFD[33812] = -2.24804061E+01; @@ -202139,7 +202150,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[49506] = -4.91225485E-01; COFD[49507] = 2.04057002E-02; COFD[49508] = -2.25933772E+01; - COFD[49509] = 5.42562555E+00; + COFD[49509] = 5.42562556E+00; COFD[49510] = -4.48132861E-01; COFD[49511] = 1.77847329E-02; COFD[49512] = -2.27399898E+01; @@ -221355,19 +221366,19 @@ egtransetCOFD(amrex::Real* COFD) COFD[68722] = 3.67306611E-01; COFD[68723] = -2.15544181E-02; COFD[68724] = -1.25531803E+01; - COFD[68725] = -2.57908185E-02; + COFD[68725] = -2.57908186E-02; COFD[68726] = 3.65103624E-01; COFD[68727] = -2.14528891E-02; COFD[68728] = -1.25520156E+01; - COFD[68729] = -2.57908185E-02; + COFD[68729] = -2.57908186E-02; COFD[68730] = 3.65103624E-01; COFD[68731] = -2.14528891E-02; COFD[68732] = -1.25785265E+01; - COFD[68733] = -2.57908185E-02; + COFD[68733] = -2.57908186E-02; COFD[68734] = 3.65103624E-01; COFD[68735] = -2.14528891E-02; COFD[68736] = -1.25531803E+01; - COFD[68737] = -2.57908185E-02; + COFD[68737] = -2.57908186E-02; COFD[68738] = 3.65103624E-01; COFD[68739] = -2.14528891E-02; COFD[68740] = -1.91904086E+01; @@ -221987,19 +221998,19 @@ egtransetCOFD(amrex::Real* COFD) COFD[69354] = 3.67306611E-01; COFD[69355] = -2.15544181E-02; COFD[69356] = -1.25516454E+01; - COFD[69357] = -2.57908185E-02; + COFD[69357] = -2.57908186E-02; COFD[69358] = 3.65103624E-01; COFD[69359] = -2.14528891E-02; COFD[69360] = -1.25504843E+01; - COFD[69361] = -2.57908185E-02; + COFD[69361] = -2.57908186E-02; COFD[69362] = 3.65103624E-01; COFD[69363] = -2.14528891E-02; COFD[69364] = -1.25769119E+01; - COFD[69365] = -2.57908185E-02; + COFD[69365] = -2.57908186E-02; COFD[69366] = 3.65103624E-01; COFD[69367] = -2.14528891E-02; COFD[69368] = -1.25516454E+01; - COFD[69369] = -2.57908185E-02; + COFD[69369] = -2.57908186E-02; COFD[69370] = 3.65103624E-01; COFD[69371] = -2.14528891E-02; COFD[69372] = -1.91896245E+01; @@ -227007,11 +227018,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[74374] = 3.64334842E-01; COFD[74375] = -2.14173756E-02; COFD[74376] = -1.25531803E+01; - COFD[74377] = -2.57908185E-02; + COFD[74377] = -2.57908186E-02; COFD[74378] = 3.65103624E-01; COFD[74379] = -2.14528891E-02; COFD[74380] = -1.25516454E+01; - COFD[74381] = -2.57908185E-02; + COFD[74381] = -2.57908186E-02; COFD[74382] = 3.65103624E-01; COFD[74383] = -2.14528891E-02; COFD[74384] = -1.38292265E+01; @@ -227639,11 +227650,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[75006] = 3.64334842E-01; COFD[75007] = -2.14173756E-02; COFD[75008] = -1.25520156E+01; - COFD[75009] = -2.57908185E-02; + COFD[75009] = -2.57908186E-02; COFD[75010] = 3.65103624E-01; COFD[75011] = -2.14528891E-02; COFD[75012] = -1.25504843E+01; - COFD[75013] = -2.57908185E-02; + COFD[75013] = -2.57908186E-02; COFD[75014] = 3.65103624E-01; COFD[75015] = -2.14528891E-02; COFD[75016] = -1.38281442E+01; @@ -228271,11 +228282,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[75638] = 3.64334842E-01; COFD[75639] = -2.14173756E-02; COFD[75640] = -1.25785265E+01; - COFD[75641] = -2.57908185E-02; + COFD[75641] = -2.57908186E-02; COFD[75642] = 3.65103624E-01; COFD[75643] = -2.14528891E-02; COFD[75644] = -1.25769119E+01; - COFD[75645] = -2.57908185E-02; + COFD[75645] = -2.57908186E-02; COFD[75646] = 3.65103624E-01; COFD[75647] = -2.14528891E-02; COFD[75648] = -1.38527338E+01; @@ -228903,11 +228914,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[76270] = 3.64334842E-01; COFD[76271] = -2.14173756E-02; COFD[76272] = -1.25531803E+01; - COFD[76273] = -2.57908185E-02; + COFD[76273] = -2.57908186E-02; COFD[76274] = 3.65103624E-01; COFD[76275] = -2.14528891E-02; COFD[76276] = -1.25516454E+01; - COFD[76277] = -2.57908185E-02; + COFD[76277] = -2.57908186E-02; COFD[76278] = 3.65103624E-01; COFD[76279] = -2.14528891E-02; COFD[76280] = -1.38292265E+01; diff --git a/Mechanisms/Aromatic_KrNara/mechanism.cpp b/Mechanisms/Aromatic_KrNara/mechanism.cpp index fef79e9df..32a7996bc 100644 --- a/Mechanisms/Aromatic_KrNara/mechanism.cpp +++ b/Mechanisms/Aromatic_KrNara/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[1049] = { +const int rmap[NUM_REACTIONS] = { 11, 13, 26, 44, 47, 49, 50, 51, 61, 74, 80, 81, 88, 91, 97, 112, 120, 141, 152, 166, 191, 192, 200, 201, 209, 210, 217, 220, 280, 391, 430, 823, 989, 4, 5, 6, 7, 8, 9, @@ -86,7 +86,7 @@ const int rmap[1049] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 1049; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/BurkeDryer/mechanism.H b/Mechanisms/BurkeDryer/mechanism.H index 99b173d0c..e3963ebdf 100644 --- a/Mechanisms/BurkeDryer/mechanism.H +++ b/Mechanisms/BurkeDryer/mechanism.H @@ -28,10 +28,21 @@ #define CO_ID 11 #define CO2_ID 12 -#define NUM_ELEMENTS 6 -#define NUM_SPECIES 13 +#define NUM_GAS_ELEMENTS 6 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 13 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 27 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 27 #define NUM_FIT 4 diff --git a/Mechanisms/BurkeDryer/mechanism.cpp b/Mechanisms/BurkeDryer/mechanism.cpp index 596310c6b..4e9a067e8 100644 --- a/Mechanisms/BurkeDryer/mechanism.cpp +++ b/Mechanisms/BurkeDryer/mechanism.cpp @@ -1,12 +1,13 @@ #include "mechanism.H" -const int rmap[27] = {14, 21, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1, 2, - 3, 4, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26}; +const int rmap[NUM_REACTIONS] = {14, 21, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 0, 1, 2, 3, 4, 15, 16, + 17, 18, 19, 20, 22, 23, 24, 25, 26}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 27; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/C1-C2-NO/mechanism.H b/Mechanisms/C1-C2-NO/mechanism.H index d02f2de60..fb72e3874 100644 --- a/Mechanisms/C1-C2-NO/mechanism.H +++ b/Mechanisms/C1-C2-NO/mechanism.H @@ -58,10 +58,21 @@ #define NCO_ID 42 #define CH3O2_ID 43 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 44 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 44 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 269 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 269 #define NUM_FIT 4 diff --git a/Mechanisms/C1-C2-NO/mechanism.cpp b/Mechanisms/C1-C2-NO/mechanism.cpp index 39ab9ac58..104027947 100644 --- a/Mechanisms/C1-C2-NO/mechanism.cpp +++ b/Mechanisms/C1-C2-NO/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[269] = { +const int rmap[NUM_REACTIONS] = { 11, 13, 41, 50, 52, 53, 61, 73, 78, 85, 87, 101, 104, 128, 139, 145, 158, 172, 173, 188, 196, 203, 213, 220, 222, 29, 127, 4, 5, 6, 7, 8, 9, 10, 38, 39, 245, 252, 0, 1, 2, 3, 12, 14, 15, @@ -23,7 +23,7 @@ const int rmap[269] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 269; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/CH4_lean/mechanism.H b/Mechanisms/CH4_lean/mechanism.H index 6685bf504..df1b51c2e 100644 --- a/Mechanisms/CH4_lean/mechanism.H +++ b/Mechanisms/CH4_lean/mechanism.H @@ -21,7 +21,7 @@ #define H2O_ID 5 #define HO2_ID 6 #define CH2_ID 7 -#define CH2S_ID 8 +#define CH2_S_ID 8 #define CH3_ID 9 #define CH4_ID 10 #define CO_ID 11 @@ -31,10 +31,21 @@ #define CH2OH_ID 15 #define N2_ID 16 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 17 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 17 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 73 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 73 #define NUM_FIT 4 @@ -14184,7 +14195,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[805] = 5.11785645E+00; COFD[806] = -4.37867828E-01; COFD[807] = 1.85047543E-02; - COFD[808] = -1.99343635E+01; + COFD[808] = -1.99343636E+01; COFD[809] = 4.99746595E+00; COFD[810] = -4.23838963E-01; COFD[811] = 1.79592094E-02; @@ -14440,7 +14451,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[1061] = 5.35659323E+00; COFD[1062] = -4.62684013E-01; COFD[1063] = 1.93375283E-02; - COFD[1064] = -1.99343635E+01; + COFD[1064] = -1.99343636E+01; COFD[1065] = 4.99746595E+00; COFD[1066] = -4.23838963E-01; COFD[1067] = 1.79592094E-02; diff --git a/Mechanisms/CH4_lean/mechanism.cpp b/Mechanisms/CH4_lean/mechanism.cpp index 72ed9ccad..5439ccd8f 100644 --- a/Mechanisms/CH4_lean/mechanism.cpp +++ b/Mechanisms/CH4_lean/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[73] = { +const int rmap[NUM_REACTIONS] = { 28, 29, 31, 33, 38, 0, 1, 8, 15, 16, 17, 18, 20, 21, 22, 23, 24, 69, 70, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 19, 25, 26, 27, 30, 32, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, @@ -9,7 +9,7 @@ const int rmap[73] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 73; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/Davis/mechanism.H b/Mechanisms/Davis/mechanism.H index bf11ead17..9c6525933 100644 --- a/Mechanisms/Davis/mechanism.H +++ b/Mechanisms/Davis/mechanism.H @@ -29,10 +29,21 @@ #define H2O2_ID 12 #define CO2_ID 13 -#define NUM_ELEMENTS 6 -#define NUM_SPECIES 14 +#define NUM_GAS_ELEMENTS 6 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 14 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 38 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 38 #define NUM_FIT 4 diff --git a/Mechanisms/Davis/mechanism.cpp b/Mechanisms/Davis/mechanism.cpp index 565a37d27..8b1c96ef8 100644 --- a/Mechanisms/Davis/mechanism.cpp +++ b/Mechanisms/Davis/mechanism.cpp @@ -1,13 +1,13 @@ #include "mechanism.H" -const int rmap[38] = {11, 13, 26, 4, 5, 6, 7, 8, 9, 10, 35, 36, 0, - 1, 2, 3, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 37}; +const int rmap[NUM_REACTIONS] = { + 11, 13, 26, 4, 5, 6, 7, 8, 9, 10, 35, 36, 0, 1, 2, 3, 12, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 37}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 38; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/FFCM1_Red/mechanism.H b/Mechanisms/FFCM1_Red/mechanism.H index f38f70298..afbd4933f 100644 --- a/Mechanisms/FFCM1_Red/mechanism.H +++ b/Mechanisms/FFCM1_Red/mechanism.H @@ -25,7 +25,7 @@ #define CO2_ID 9 #define CH_ID 10 #define CH2_ID 11 -#define CH2S_ID 12 +#define CH2_S_ID 12 #define CH3_ID 13 #define CH4_ID 14 #define HCO_ID 15 @@ -35,10 +35,21 @@ #define CH3OH_ID 19 #define HE_ID 20 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 21 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 21 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 124 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 124 #define NUM_FIT 4 diff --git a/Mechanisms/FFCM1_Red/mechanism.cpp b/Mechanisms/FFCM1_Red/mechanism.cpp index ce5c8a345..2c7cf9529 100644 --- a/Mechanisms/FFCM1_Red/mechanism.cpp +++ b/Mechanisms/FFCM1_Red/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[124] = { +const int rmap[NUM_REACTIONS] = { 12, 33, 40, 58, 64, 65, 72, 75, 85, 86, 96, 97, 19, 5, 6, 7, 8, 9, 10, 11, 24, 0, 1, 2, 3, 4, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, @@ -14,7 +14,7 @@ const int rmap[124] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 124; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/H2-CO-CO2-3spec/mechanism.H b/Mechanisms/H2-CO-CO2-3spec/mechanism.H index 1979b527f..d9c7d11c1 100644 --- a/Mechanisms/H2-CO-CO2-3spec/mechanism.H +++ b/Mechanisms/H2-CO-CO2-3spec/mechanism.H @@ -15,10 +15,21 @@ #define CO_ID 1 #define CO2_ID 2 -#define NUM_ELEMENTS 3 -#define NUM_SPECIES 3 +#define NUM_GAS_ELEMENTS 3 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 3 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/IonizedAir/mechanism.H b/Mechanisms/IonizedAir/mechanism.H index 52026438e..5c6d9364f 100644 --- a/Mechanisms/IonizedAir/mechanism.H +++ b/Mechanisms/IonizedAir/mechanism.H @@ -17,10 +17,21 @@ #define On_ID 3 #define O2n_ID 4 -#define NUM_ELEMENTS 3 -#define NUM_SPECIES 5 +#define NUM_GAS_ELEMENTS 3 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 5 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 3 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/JL4/mechanism.H b/Mechanisms/JL4/mechanism.H index bd74aae2c..9595b7185 100644 --- a/Mechanisms/JL4/mechanism.H +++ b/Mechanisms/JL4/mechanism.H @@ -20,10 +20,21 @@ #define CO2_ID 5 #define H2_ID 6 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 7 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 7 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 4 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 4 #define NUM_FIT 4 diff --git a/Mechanisms/JL4/mechanism.cpp b/Mechanisms/JL4/mechanism.cpp index b365be841..235c5383a 100644 --- a/Mechanisms/JL4/mechanism.cpp +++ b/Mechanisms/JL4/mechanism.cpp @@ -1,11 +1,11 @@ #include "mechanism.H" -const int rmap[4] = {0, 1, 2, 3}; +const int rmap[NUM_REACTIONS] = {0, 1, 2, 3}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 4; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/Kolla/mechanism.H b/Mechanisms/Kolla/mechanism.H index 2086a5e83..6063885f1 100644 --- a/Mechanisms/Kolla/mechanism.H +++ b/Mechanisms/Kolla/mechanism.H @@ -25,10 +25,21 @@ #define HCO_ID 10 #define N2_ID 11 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 12 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 12 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 29 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 29 #define NUM_FIT 4 diff --git a/Mechanisms/Kolla/mechanism.cpp b/Mechanisms/Kolla/mechanism.cpp index 8cfa257c1..3751157fc 100644 --- a/Mechanisms/Kolla/mechanism.cpp +++ b/Mechanisms/Kolla/mechanism.cpp @@ -1,13 +1,13 @@ #include "mechanism.H" -const int rmap[29] = {8, 15, 21, 4, 5, 6, 7, 25, 0, 1, - 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, - 18, 19, 20, 22, 23, 24, 26, 27, 28}; +const int rmap[NUM_REACTIONS] = {8, 15, 21, 4, 5, 6, 7, 25, 0, 1, + 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, + 18, 19, 20, 22, 23, 24, 26, 27, 28}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 29; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/LiDryer/mechanism.H b/Mechanisms/LiDryer/mechanism.H index 9a82281b9..526639c41 100644 --- a/Mechanisms/LiDryer/mechanism.H +++ b/Mechanisms/LiDryer/mechanism.H @@ -21,10 +21,21 @@ #define H2O2_ID 7 #define N2_ID 8 -#define NUM_ELEMENTS 3 -#define NUM_SPECIES 9 +#define NUM_GAS_ELEMENTS 3 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 9 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 21 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 21 #define NUM_FIT 4 diff --git a/Mechanisms/LiDryer/mechanism.cpp b/Mechanisms/LiDryer/mechanism.cpp index 298861cc2..3dbb62d92 100644 --- a/Mechanisms/LiDryer/mechanism.cpp +++ b/Mechanisms/LiDryer/mechanism.cpp @@ -1,12 +1,12 @@ #include "mechanism.H" -const int rmap[21] = {8, 15, 4, 5, 6, 7, 0, 1, 2, 3, 9, - 10, 11, 12, 13, 14, 16, 17, 18, 19, 20}; +const int rmap[NUM_REACTIONS] = {8, 15, 4, 5, 6, 7, 0, 1, 2, 3, 9, + 10, 11, 12, 13, 14, 16, 17, 18, 19, 20}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 21; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/LuDME/mechanism.H b/Mechanisms/LuDME/mechanism.H index 29d90fc5f..b1bcf20f0 100644 --- a/Mechanisms/LuDME/mechanism.H +++ b/Mechanisms/LuDME/mechanism.H @@ -15,7 +15,7 @@ #define H_ID 0 #define H2_ID 1 #define CH2_ID 2 -#define CH2S_ID 3 +#define CH2_S_ID 3 #define CH3_ID 4 #define O_ID 5 #define CH4_ID 6 @@ -52,10 +52,21 @@ #define O2CH2OCH2O2H_ID 37 #define N2_ID 38 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 39 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 39 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 175 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 175 #define NUM_FIT 4 @@ -31317,7 +31328,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[33] = 5.61113230E+00; COFD[34] = -4.90190187E-01; COFD[35] = 2.03260675E-02; - COFD[36] = -1.79310920E+01; + COFD[36] = -1.79310921E+01; COFD[37] = 4.98037650E+00; COFD[38] = -4.26676911E-01; COFD[39] = 1.83007231E-02; @@ -32685,7 +32696,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[1401] = 5.53614864E+00; COFD[1402] = -4.86046753E-01; COFD[1403] = 2.03659193E-02; - COFD[1404] = -1.79310920E+01; + COFD[1404] = -1.79310921E+01; COFD[1405] = 4.98037650E+00; COFD[1406] = -4.26676911E-01; COFD[1407] = 1.83007231E-02; diff --git a/Mechanisms/LuDME/mechanism.cpp b/Mechanisms/LuDME/mechanism.cpp index a55cbaa04..056f50ea5 100644 --- a/Mechanisms/LuDME/mechanism.cpp +++ b/Mechanisms/LuDME/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[175] = { +const int rmap[NUM_REACTIONS] = { 8, 15, 47, 48, 85, 92, 93, 94, 108, 111, 21, 4, 5, 6, 7, 25, 35, 36, 54, 63, 118, 165, 166, 169, 170, 0, 1, 2, 3, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 26, 27, @@ -17,7 +17,7 @@ const int rmap[175] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 175; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/LuEthylene/mechanism.H b/Mechanisms/LuEthylene/mechanism.H index 173aa3856..911aa44d4 100644 --- a/Mechanisms/LuEthylene/mechanism.H +++ b/Mechanisms/LuEthylene/mechanism.H @@ -46,10 +46,21 @@ #define nC3H7_ID 30 #define N2_ID 31 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 32 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 32 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 206 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 206 #define NUM_FIT 4 diff --git a/Mechanisms/LuEthylene/mechanism.cpp b/Mechanisms/LuEthylene/mechanism.cpp index b42e3b7e6..cdf9e17ba 100644 --- a/Mechanisms/LuEthylene/mechanism.cpp +++ b/Mechanisms/LuEthylene/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[206] = { +const int rmap[NUM_REACTIONS] = { 15, 30, 38, 40, 47, 55, 70, 77, 88, 92, 114, 125, 131, 144, 147, 154, 155, 169, 184, 189, 113, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 28, 45, 120, 0, 1, 2, 3, 16, 17, 18, 19, 20, 21, @@ -19,7 +19,7 @@ const int rmap[206] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 206; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/NUIGalway/mechanism.H b/Mechanisms/NUIGalway/mechanism.H index 1433a29c0..2b2d702fa 100644 --- a/Mechanisms/NUIGalway/mechanism.H +++ b/Mechanisms/NUIGalway/mechanism.H @@ -126,17 +126,28 @@ #define CH2_ID 109 #define CH3COCH2_ID 110 #define C3H4A_ID 111 -#define CH2S_ID 112 +#define CH2_S_ID 112 #define CH3COCH2O2_ID 113 #define C3H3_ID 114 #define HE_ID 115 #define AR_ID 116 #define N2_ID 117 -#define NUM_ELEMENTS 6 -#define NUM_SPECIES 118 +#define NUM_GAS_ELEMENTS 6 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 118 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 1246 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 1246 #define NUM_FIT 4 @@ -138175,7 +138186,7 @@ egtransetCOFLAM(amrex::Real* COFLAM) COFLAM[292] = -9.25905015E+00; COFLAM[293] = 4.19521307E+00; COFLAM[294] = -2.21286487E-01; - COFLAM[295] = 6.15676251E-05; + COFLAM[295] = 6.15676252E-05; COFLAM[296] = -1.02946201E+01; COFLAM[297] = 4.43693862E+00; COFLAM[298] = -2.37437627E-01; @@ -138458,7 +138469,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[97] = 3.83606243E+00; COFD[98] = -2.86076532E-01; COFD[99] = 1.25205829E-02; - COFD[100] = -1.79310920E+01; + COFD[100] = -1.79310921E+01; COFD[101] = 4.98037650E+00; COFD[102] = -4.26676911E-01; COFD[103] = 1.83007231E-02; @@ -142455,7 +142466,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4094] = -3.27236567E-01; COFD[4095] = 1.15357180E-02; COFD[4096] = -2.25999325E+01; - COFD[4097] = 5.42562555E+00; + COFD[4097] = 5.42562556E+00; COFD[4098] = -4.48132861E-01; COFD[4099] = 1.77847329E-02; COFD[4100] = -2.13482736E+01; @@ -142471,7 +142482,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4110] = -2.98091562E-01; COFD[4111] = 1.00715438E-02; COFD[4112] = -2.25933772E+01; - COFD[4113] = 5.42562555E+00; + COFD[4113] = 5.42562556E+00; COFD[4114] = -4.48132861E-01; COFD[4115] = 1.77847329E-02; COFD[4116] = -2.13482736E+01; @@ -142487,7 +142498,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4126] = -3.27236567E-01; COFD[4127] = 1.15357180E-02; COFD[4128] = -2.25933772E+01; - COFD[4129] = 5.42562555E+00; + COFD[4129] = 5.42562556E+00; COFD[4130] = -4.48132861E-01; COFD[4131] = 1.77847329E-02; COFD[4132] = -2.12239035E+01; @@ -150158,7 +150169,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[11797] = 3.35922578E+00; COFD[11798] = -2.25181399E-01; COFD[11799] = 9.92132878E-03; - COFD[11800] = -1.79310920E+01; + COFD[11800] = -1.79310921E+01; COFD[11801] = 4.98037650E+00; COFD[11802] = -4.26676911E-01; COFD[11803] = 1.83007231E-02; @@ -176151,7 +176162,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[37790] = -4.37707223E-01; COFD[37791] = 1.72157190E-02; COFD[37792] = -2.25999325E+01; - COFD[37793] = 5.42562555E+00; + COFD[37793] = 5.42562556E+00; COFD[37794] = -4.48132861E-01; COFD[37795] = 1.77847329E-02; COFD[37796] = -1.95250705E+01; @@ -178039,7 +178050,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[39678] = -4.37707223E-01; COFD[39679] = 1.72157190E-02; COFD[39680] = -2.25933772E+01; - COFD[39681] = 5.42562555E+00; + COFD[39681] = 5.42562556E+00; COFD[39682] = -4.48132861E-01; COFD[39683] = 1.77847329E-02; COFD[39684] = -1.95201761E+01; @@ -179927,7 +179938,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[41566] = -4.37707223E-01; COFD[41567] = 1.72157190E-02; COFD[41568] = -2.25933772E+01; - COFD[41569] = 5.42562555E+00; + COFD[41569] = 5.42562556E+00; COFD[41570] = -4.48132861E-01; COFD[41571] = 1.77847329E-02; COFD[41572] = -1.95201761E+01; diff --git a/Mechanisms/NUIGalway/mechanism.cpp b/Mechanisms/NUIGalway/mechanism.cpp index 24f1d8451..5cfee7ff0 100644 --- a/Mechanisms/NUIGalway/mechanism.cpp +++ b/Mechanisms/NUIGalway/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[1246] = { +const int rmap[NUM_REACTIONS] = { 16, 29, 75, 76, 110, 123, 154, 155, 176, 207, 244, 277, 278, 299, 420, 448, 449, 480, 493, 512, 513, 514, 515, 569, 651, 768, 40, 394, 8, 9, 10, 11, 12, 13, 14, 15, 47, 48, 70, @@ -101,7 +101,7 @@ const int rmap[1246] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 1246; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/SootReaction/mechanism.H b/Mechanisms/SootReaction/mechanism.H index 4d09a8b52..91b0b1490 100644 --- a/Mechanisms/SootReaction/mechanism.H +++ b/Mechanisms/SootReaction/mechanism.H @@ -60,10 +60,21 @@ #define A2n_ID 45 #define A1C2H_ID 46 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 47 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 47 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 224 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 2 -#define NUM_REACTIONS 224 #define NUM_FIT 4 diff --git a/Mechanisms/SootReaction/mechanism.cpp b/Mechanisms/SootReaction/mechanism.cpp index 97f770f4d..f4a7bde53 100644 --- a/Mechanisms/SootReaction/mechanism.cpp +++ b/Mechanisms/SootReaction/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[224] = { +const int rmap[NUM_REACTIONS] = { 6, 29, 35, 51, 75, 83, 93, 101, 102, 108, 113, 149, 32, 2, 3, 60, 61, 0, 1, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, @@ -20,7 +20,7 @@ const int rmap[224] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 224; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/air/mechanism.H b/Mechanisms/air/mechanism.H index 168b8b280..29be62ea2 100644 --- a/Mechanisms/air/mechanism.H +++ b/Mechanisms/air/mechanism.H @@ -13,10 +13,21 @@ #define O2_ID 0 #define N2_ID 1 -#define NUM_ELEMENTS 2 -#define NUM_SPECIES 2 +#define NUM_GAS_ELEMENTS 2 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 2 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/alzeta/mechanism.H b/Mechanisms/alzeta/mechanism.H index 549d511d2..90638dc41 100644 --- a/Mechanisms/alzeta/mechanism.H +++ b/Mechanisms/alzeta/mechanism.H @@ -25,7 +25,7 @@ #define C_ID 8 #define CH_ID 9 #define CH2_ID 10 -#define CH2S_ID 11 +#define CH2_S_ID 11 #define CH3_ID 12 #define CH4_ID 13 #define CO_ID 14 @@ -87,10 +87,21 @@ #define iC3H7_ID 70 #define nC3H7_ID 71 -#define NUM_ELEMENTS 6 -#define NUM_SPECIES 72 +#define NUM_GAS_ELEMENTS 6 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 72 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 518 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 518 #define NUM_FIT 4 @@ -84570,7 +84581,7 @@ egtransetCOFLAM(amrex::Real* COFLAM) COFLAM[227] = -4.56934676E-02; COFLAM[228] = -6.07136823E+00; COFLAM[229] = 2.66185913E+00; - COFLAM[230] = 3.99059116E-03; + COFLAM[230] = 3.99059117E-03; COFLAM[231] = -1.08975779E-02; COFLAM[232] = -1.65952907E+01; COFLAM[233] = 7.48711221E+00; @@ -91824,7 +91835,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[7187] = 1.38954729E-02; COFD[7188] = -1.56843459E+01; COFD[7189] = 2.42687065E+00; - COFD[7190] = 3.11557501E-03; + COFD[7190] = 3.11557502E-03; COFD[7191] = -4.32109630E-03; COFD[7192] = -2.08102625E+01; COFD[7193] = 4.99697590E+00; @@ -104604,7 +104615,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[19967] = 3.20636012E-03; COFD[19968] = -1.56843459E+01; COFD[19969] = 2.42687065E+00; - COFD[19970] = 3.11557501E-03; + COFD[19970] = 3.11557502E-03; COFD[19971] = -4.32109630E-03; COFD[19972] = -1.66206882E+01; COFD[19973] = 2.82977426E+00; diff --git a/Mechanisms/alzeta/mechanism.cpp b/Mechanisms/alzeta/mechanism.cpp index a25152462..020ba3719 100644 --- a/Mechanisms/alzeta/mechanism.cpp +++ b/Mechanisms/alzeta/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[518] = { +const int rmap[NUM_REACTIONS] = { 49, 51, 53, 55, 56, 58, 62, 69, 70, 71, 73, 75, 82, 84, 94, 130, 139, 146, 157, 173, 240, 288, 303, 311, 317, 319, 11, 184, 236, 346, 433, 498, 0, 1, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 165, @@ -40,7 +40,7 @@ const int rmap[518] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 518; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/chem-CH4-2step/mechanism.H b/Mechanisms/chem-CH4-2step/mechanism.H index 189f41e44..4d875c157 100644 --- a/Mechanisms/chem-CH4-2step/mechanism.H +++ b/Mechanisms/chem-CH4-2step/mechanism.H @@ -19,10 +19,21 @@ #define CO2_ID 4 #define N2_ID 5 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 6 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 6 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 3 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 3 #define NUM_FIT 4 diff --git a/Mechanisms/chem-CH4-2step/mechanism.cpp b/Mechanisms/chem-CH4-2step/mechanism.cpp index 6f01130fb..95c74ce64 100644 --- a/Mechanisms/chem-CH4-2step/mechanism.cpp +++ b/Mechanisms/chem-CH4-2step/mechanism.cpp @@ -1,11 +1,11 @@ #include "mechanism.H" -const int rmap[3] = {0, 1, 2}; +const int rmap[NUM_REACTIONS] = {0, 1, 2}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 3; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/chem-H/mechanism.H b/Mechanisms/chem-H/mechanism.H index 84f8a6481..889329d33 100644 --- a/Mechanisms/chem-H/mechanism.H +++ b/Mechanisms/chem-H/mechanism.H @@ -21,10 +21,21 @@ #define H2O2_ID 7 #define N2_ID 8 -#define NUM_ELEMENTS 3 -#define NUM_SPECIES 9 +#define NUM_GAS_ELEMENTS 3 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 9 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 27 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 27 #define NUM_FIT 4 diff --git a/Mechanisms/chem-H/mechanism.cpp b/Mechanisms/chem-H/mechanism.cpp index 82e60bfad..04e3ef960 100644 --- a/Mechanisms/chem-H/mechanism.cpp +++ b/Mechanisms/chem-H/mechanism.cpp @@ -1,12 +1,13 @@ #include "mechanism.H" -const int rmap[27] = {20, 0, 1, 5, 6, 7, 8, 10, 11, 12, 13, 2, 3, 4, - 9, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26}; +const int rmap[NUM_REACTIONS] = {20, 0, 1, 5, 6, 7, 8, 10, 11, + 12, 13, 2, 3, 4, 9, 14, 15, 16, + 17, 18, 19, 21, 22, 23, 24, 25, 26}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 27; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/decane_3sp/mechanism.H b/Mechanisms/decane_3sp/mechanism.H index 4e0a19fd4..e745dedf7 100644 --- a/Mechanisms/decane_3sp/mechanism.H +++ b/Mechanisms/decane_3sp/mechanism.H @@ -16,10 +16,21 @@ #define O2_ID 1 #define N2_ID 2 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 3 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 3 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/dodecane_lu/mechanism.H b/Mechanisms/dodecane_lu/mechanism.H index 128bbfdaf..b1b85d5b4 100644 --- a/Mechanisms/dodecane_lu/mechanism.H +++ b/Mechanisms/dodecane_lu/mechanism.H @@ -66,10 +66,21 @@ #define OC12H23OOH_ID 51 #define N2_ID 52 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 53 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 53 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 268 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 268 #define NUM_FIT 4 diff --git a/Mechanisms/dodecane_lu/mechanism.cpp b/Mechanisms/dodecane_lu/mechanism.cpp index 2ec3950f3..ce30ec905 100644 --- a/Mechanisms/dodecane_lu/mechanism.cpp +++ b/Mechanisms/dodecane_lu/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[268] = { +const int rmap[NUM_REACTIONS] = { 4, 17, 37, 38, 39, 58, 64, 77, 90, 95, 107, 113, 126, 134, 141, 148, 149, 168, 172, 192, 196, 200, 204, 208, 212, 28, 18, 19, 20, 21, 22, 23, 24, 30, 36, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, @@ -23,7 +23,7 @@ const int rmap[268] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 268; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/dodecane_wang/mechanism.H b/Mechanisms/dodecane_wang/mechanism.H index 25762996f..ad1f17ff2 100644 --- a/Mechanisms/dodecane_wang/mechanism.H +++ b/Mechanisms/dodecane_wang/mechanism.H @@ -69,10 +69,21 @@ #define C5H10_ID 54 #define N2_ID 55 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 56 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 56 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 289 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 289 #define NUM_FIT 4 diff --git a/Mechanisms/dodecane_wang/mechanism.cpp b/Mechanisms/dodecane_wang/mechanism.cpp index dc370545d..738345a5c 100644 --- a/Mechanisms/dodecane_wang/mechanism.cpp +++ b/Mechanisms/dodecane_wang/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[289] = { +const int rmap[NUM_REACTIONS] = { 9, 11, 48, 55, 60, 61, 68, 70, 81, 111, 124, 128, 139, 148, 151, 156, 157, 171, 179, 199, 207, 211, 212, 279, 282, 24, 4, 5, 6, 7, 8, 32, 33, 0, 1, 2, 3, 10, 12, 13, 14, 15, 16, 17, 18, @@ -25,7 +25,7 @@ const int rmap[289] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 289; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/dodmethair_4sp/mechanism.H b/Mechanisms/dodmethair_4sp/mechanism.H index 0e087e782..206450251 100644 --- a/Mechanisms/dodmethair_4sp/mechanism.H +++ b/Mechanisms/dodmethair_4sp/mechanism.H @@ -17,10 +17,21 @@ #define O2_ID 2 #define N2_ID 3 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 4 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 4 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/drm19/mechanism.H b/Mechanisms/drm19/mechanism.H index f59b9f56f..2d5b9f66c 100644 --- a/Mechanisms/drm19/mechanism.H +++ b/Mechanisms/drm19/mechanism.H @@ -21,7 +21,7 @@ #define H2O_ID 5 #define HO2_ID 6 #define CH2_ID 7 -#define CH2S_ID 8 +#define CH2_S_ID 8 #define CH3_ID 9 #define CH4_ID 10 #define CO_ID 11 @@ -35,10 +35,21 @@ #define N2_ID 19 #define AR_ID 20 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 21 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 21 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 84 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 84 #define NUM_FIT 4 diff --git a/Mechanisms/drm19/mechanism.cpp b/Mechanisms/drm19/mechanism.cpp index 02327c0b7..25bf1c012 100644 --- a/Mechanisms/drm19/mechanism.cpp +++ b/Mechanisms/drm19/mechanism.cpp @@ -1,16 +1,16 @@ #include "mechanism.H" -const int rmap[84] = {29, 30, 32, 34, 37, 38, 40, 74, 0, 7, 16, 17, 18, 19, - 20, 22, 23, 24, 25, 26, 79, 80, 1, 2, 3, 4, 5, 6, - 8, 9, 10, 11, 12, 13, 14, 15, 21, 27, 28, 31, 33, 35, - 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 81, 82, 83}; +const int rmap[NUM_REACTIONS] = { + 29, 30, 32, 34, 37, 38, 40, 74, 0, 7, 16, 17, 18, 19, 20, 22, 23, + 24, 25, 26, 79, 80, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, + 14, 15, 21, 27, 28, 31, 33, 35, 36, 39, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 81, 82, 83}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 84; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/ethylene_af/mechanism.H b/Mechanisms/ethylene_af/mechanism.H index bcfd4a9e4..27b57ac00 100644 --- a/Mechanisms/ethylene_af/mechanism.H +++ b/Mechanisms/ethylene_af/mechanism.H @@ -42,10 +42,21 @@ #define CH2CHO_ID 27 #define C2H5O_ID 28 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 29 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 29 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 172 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 172 #define NUM_FIT 4 diff --git a/Mechanisms/ethylene_af/mechanism.cpp b/Mechanisms/ethylene_af/mechanism.cpp index 1d5cb2b82..be3954304 100644 --- a/Mechanisms/ethylene_af/mechanism.cpp +++ b/Mechanisms/ethylene_af/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[172] = { +const int rmap[NUM_REACTIONS] = { 5, 10, 30, 32, 56, 70, 74, 75, 77, 80, 102, 111, 115, 125, 135, 0, 1, 3, 4, 6, 9, 82, 83, 96, 166, 2, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, @@ -17,7 +17,7 @@ const int rmap[172] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 172; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/grimech12/mechanism.H b/Mechanisms/grimech12/mechanism.H index 7e41800e5..91633180e 100644 --- a/Mechanisms/grimech12/mechanism.H +++ b/Mechanisms/grimech12/mechanism.H @@ -24,7 +24,7 @@ #define C_ID 8 #define CH_ID 9 #define CH2_ID 10 -#define CH2S_ID 11 +#define CH2_S_ID 11 #define CH3_ID 12 #define CH4_ID 13 #define CO_ID 14 @@ -46,10 +46,21 @@ #define N2_ID 30 #define AR_ID 31 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 32 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 32 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 177 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 177 #define NUM_FIT 4 diff --git a/Mechanisms/grimech12/mechanism.cpp b/Mechanisms/grimech12/mechanism.cpp index 7b1b71423..9a0e3af7e 100644 --- a/Mechanisms/grimech12/mechanism.cpp +++ b/Mechanisms/grimech12/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[177] = { +const int rmap[NUM_REACTIONS] = { 49, 51, 53, 55, 56, 58, 62, 69, 70, 71, 73, 75, 82, 84, 94, 130, 139, 146, 157, 173, 0, 1, 11, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 165, 166, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, @@ -17,7 +17,7 @@ const int rmap[177] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 177; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/grimech30-noArN/mechanism.H b/Mechanisms/grimech30-noArN/mechanism.H index 3576c7e9d..47c95d4a9 100644 --- a/Mechanisms/grimech30-noArN/mechanism.H +++ b/Mechanisms/grimech30-noArN/mechanism.H @@ -23,7 +23,7 @@ #define C_ID 8 #define CH_ID 9 #define CH2_ID 10 -#define CH2S_ID 11 +#define CH2_S_ID 11 #define CH3_ID 12 #define CH4_ID 13 #define CO_ID 14 @@ -48,10 +48,21 @@ #define CH2CHO_ID 33 #define CH3CHO_ID 34 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 35 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 35 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 217 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 217 #define NUM_FIT 4 diff --git a/Mechanisms/grimech30-noArN/mechanism.cpp b/Mechanisms/grimech30-noArN/mechanism.cpp index b9329d5ea..b85f6a8ef 100644 --- a/Mechanisms/grimech30-noArN/mechanism.cpp +++ b/Mechanisms/grimech30-noArN/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[217] = { +const int rmap[NUM_REACTIONS] = { 48, 50, 52, 54, 55, 57, 61, 68, 69, 70, 72, 74, 81, 83, 93, 129, 138, 144, 155, 171, 180, 195, 203, 209, 211, 11, 0, 1, 32, 33, 34, 35, 37, 38, 39, 40, 41, 163, 164, 194, 2, 3, 4, 5, 6, @@ -20,7 +20,7 @@ const int rmap[217] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 217; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/grimech30/mechanism.H b/Mechanisms/grimech30/mechanism.H index 05f704f75..4e035c297 100644 --- a/Mechanisms/grimech30/mechanism.H +++ b/Mechanisms/grimech30/mechanism.H @@ -24,7 +24,7 @@ #define C_ID 8 #define CH_ID 9 #define CH2_ID 10 -#define CH2S_ID 11 +#define CH2_S_ID 11 #define CH3_ID 12 #define CH4_ID 13 #define CO_ID 14 @@ -67,10 +67,21 @@ #define CH2CHO_ID 51 #define CH3CHO_ID 52 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 53 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 53 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 325 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 325 #define NUM_FIT 4 diff --git a/Mechanisms/grimech30/mechanism.cpp b/Mechanisms/grimech30/mechanism.cpp index 554c3a746..dc6dcaaea 100644 --- a/Mechanisms/grimech30/mechanism.cpp +++ b/Mechanisms/grimech30/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[325] = { +const int rmap[NUM_REACTIONS] = { 49, 51, 53, 55, 56, 58, 62, 69, 70, 71, 73, 75, 82, 84, 94, 130, 139, 146, 157, 173, 240, 288, 303, 311, 317, 319, 11, 184, 236, 0, 1, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 165, 166, 186, 204, @@ -27,7 +27,7 @@ const int rmap[325] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 325; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/heptane_3sp/mechanism.H b/Mechanisms/heptane_3sp/mechanism.H index 9da4950e8..aec578456 100644 --- a/Mechanisms/heptane_3sp/mechanism.H +++ b/Mechanisms/heptane_3sp/mechanism.H @@ -16,10 +16,21 @@ #define O2_ID 1 #define N2_ID 2 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 3 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 3 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/heptane_fc/mechanism.H b/Mechanisms/heptane_fc/mechanism.H index 6208fe615..f80b83275 100644 --- a/Mechanisms/heptane_fc/mechanism.H +++ b/Mechanisms/heptane_fc/mechanism.H @@ -65,10 +65,21 @@ #define C7H15X2_ID 50 #define NXC7H16_ID 51 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 52 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 52 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 218 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 218 #define NUM_FIT 4 @@ -32111,7 +32122,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[725] = 5.54637286E+00; COFD[726] = -4.87070324E-01; COFD[727] = 2.03983467E-02; - COFD[728] = -1.79310920E+01; + COFD[728] = -1.79310921E+01; COFD[729] = 4.98037650E+00; COFD[730] = -4.26676911E-01; COFD[731] = 1.83007231E-02; @@ -36803,7 +36814,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[5417] = 3.30394764E+00; COFD[5418] = -2.17920112E-01; COFD[5419] = 9.60284243E-03; - COFD[5420] = -1.79310920E+01; + COFD[5420] = -1.79310921E+01; COFD[5421] = 4.98037650E+00; COFD[5422] = -4.26676911E-01; COFD[5423] = 1.83007231E-02; diff --git a/Mechanisms/heptane_fc/mechanism.cpp b/Mechanisms/heptane_fc/mechanism.cpp index 75f6caba1..8e1a15284 100644 --- a/Mechanisms/heptane_fc/mechanism.cpp +++ b/Mechanisms/heptane_fc/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[218] = { +const int rmap[NUM_REACTIONS] = { 7, 17, 41, 43, 46, 55, 56, 72, 96, 100, 125, 4, 29, 30, 64, 77, 80, 86, 87, 126, 0, 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, @@ -20,7 +20,7 @@ const int rmap[218] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 218; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/heptane_lu_88sk/mechanism.H b/Mechanisms/heptane_lu_88sk/mechanism.H index 1f5225bd4..cd8cec510 100644 --- a/Mechanisms/heptane_lu_88sk/mechanism.H +++ b/Mechanisms/heptane_lu_88sk/mechanism.H @@ -62,7 +62,7 @@ #define c3h5a_ID 47 #define c3h3_ID 48 #define c3h2_ID 49 -#define ch2s_ID 50 +#define ch2_s_ID 50 #define nc4ket13_ID 51 #define nc3h7cho_ID 52 #define nc3h7co_ID 53 @@ -101,10 +101,21 @@ #define nc7ket42_ID 86 #define n2_ID 87 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 88 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 88 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 729 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 729 #define NUM_FIT 4 @@ -81386,7 +81397,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[69] = 4.88268692E+00; COFD[70] = -4.14917638E-01; COFD[71] = 1.78274298E-02; - COFD[72] = -1.79310920E+01; + COFD[72] = -1.79310921E+01; COFD[73] = 4.98037650E+00; COFD[74] = -4.26676911E-01; COFD[75] = 1.83007231E-02; @@ -87650,7 +87661,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[6333] = 4.39538102E+00; COFD[6334] = -3.56367230E-01; COFD[6335] = 1.54788461E-02; - COFD[6336] = -1.79310920E+01; + COFD[6336] = -1.79310921E+01; COFD[6337] = 4.98037650E+00; COFD[6338] = -4.26676911E-01; COFD[6339] = 1.83007231E-02; @@ -91339,7 +91350,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[10022] = -4.41046938E-01; COFD[10023] = 1.73939950E-02; COFD[10024] = -2.25933772E+01; - COFD[10025] = 5.42562555E+00; + COFD[10025] = 5.42562556E+00; COFD[10026] = -4.48132861E-01; COFD[10027] = 1.77847329E-02; COFD[10028] = -2.23631758E+01; @@ -96211,7 +96222,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[14894] = -4.14322433E-01; COFD[14895] = 1.59763256E-02; COFD[14896] = -2.25933772E+01; - COFD[14897] = 5.42562555E+00; + COFD[14897] = 5.42562556E+00; COFD[14898] = -4.48132861E-01; COFD[14899] = 1.77847329E-02; COFD[14900] = -2.23366684E+01; diff --git a/Mechanisms/heptane_lu_88sk/mechanism.cpp b/Mechanisms/heptane_lu_88sk/mechanism.cpp index 26be9c26c..bc132809d 100644 --- a/Mechanisms/heptane_lu_88sk/mechanism.cpp +++ b/Mechanisms/heptane_lu_88sk/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[729] = { +const int rmap[NUM_REACTIONS] = { 0, 27, 40, 43, 89, 102, 105, 44, 69, 70, 151, 21, 22, 41, 42, 51, 52, 96, 97, 98, 99, 100, 101, 196, 197, 311, 312, 319, 320, 343, 344, 440, 441, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -54,7 +54,7 @@ const int rmap[729] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 729; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/isooctane_lu/mechanism.H b/Mechanisms/isooctane_lu/mechanism.H index 50219bf24..f72bbf51c 100644 --- a/Mechanisms/isooctane_lu/mechanism.H +++ b/Mechanisms/isooctane_lu/mechanism.H @@ -34,7 +34,7 @@ #define CH4_ID 19 #define CH3_ID 20 #define CH2_ID 21 -#define CH2S_ID 22 +#define CH2_S_ID 22 #define C2H6_ID 23 #define C2H5_ID 24 #define C2H4_ID 25 @@ -156,10 +156,21 @@ #define TC4H9COC2H4S_ID 141 #define N2_ID 142 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 143 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 143 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 1178 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 1178 #define NUM_FIT 4 @@ -132550,7 +132561,7 @@ egtransetCOFETA(amrex::Real* COFETA) COFETA[323] = 1.89491518E-02; COFETA[324] = -2.46375247E+01; COFETA[325] = 4.77833535E+00; - COFETA[326] = -4.81964250E-01; + COFETA[326] = -4.81964251E-01; COFETA[327] = 1.86974310E-02; COFETA[328] = -2.48533639E+01; COFETA[329] = 4.93065103E+00; @@ -133068,7 +133079,7 @@ egtransetCOFLAM(amrex::Real* COFLAM) COFLAM[263] = 1.12499230E-02; COFLAM[264] = -2.03547095E+01; COFLAM[265] = 8.42728193E+00; - COFLAM[266] = -7.69633088E-01; + COFLAM[266] = -7.69633089E-01; COFLAM[267] = 2.41171017E-02; COFLAM[268] = -1.47306523E+01; COFLAM[269] = 6.20937943E+00; @@ -133164,7 +133175,7 @@ egtransetCOFLAM(amrex::Real* COFLAM) COFLAM[359] = 2.24969266E-02; COFLAM[360] = -1.96922670E+01; COFLAM[361] = 8.16871646E+00; - COFLAM[362] = -7.30182651E-01; + COFLAM[362] = -7.30182652E-01; COFLAM[363] = 2.22087891E-02; COFLAM[364] = -1.34267943E+01; COFLAM[365] = 5.84766135E+00; @@ -138016,11 +138027,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[4633] = 5.11785645E+00; COFD[4634] = -4.37867828E-01; COFD[4635] = 1.85047543E-02; - COFD[4636] = -1.99343635E+01; + COFD[4636] = -1.99343636E+01; COFD[4637] = 4.99746595E+00; COFD[4638] = -4.23838963E-01; COFD[4639] = 1.79592094E-02; - COFD[4640] = -1.99343635E+01; + COFD[4640] = -1.99343636E+01; COFD[4641] = 4.99746595E+00; COFD[4642] = -4.23838963E-01; COFD[4643] = 1.79592094E-02; @@ -141992,7 +142003,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[8609] = 5.00532670E+00; COFD[8610] = -4.24686880E-01; COFD[8611] = 1.79891229E-02; - COFD[8612] = -1.99343635E+01; + COFD[8612] = -1.99343636E+01; COFD[8613] = 4.99746595E+00; COFD[8614] = -4.23838963E-01; COFD[8615] = 1.79592094E-02; @@ -142564,7 +142575,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[9181] = 5.00532670E+00; COFD[9182] = -4.24686880E-01; COFD[9183] = 1.79891229E-02; - COFD[9184] = -1.99343635E+01; + COFD[9184] = -1.99343636E+01; COFD[9185] = 4.99746595E+00; COFD[9186] = -4.23838963E-01; COFD[9187] = 1.79592094E-02; @@ -146935,15 +146946,15 @@ egtransetCOFD(amrex::Real* COFD) COFD[13552] = -2.26523065E+01; COFD[13553] = 5.52117558E+00; COFD[13554] = -4.68225360E-01; - COFD[13555] = 1.89617585E-02; + COFD[13555] = 1.89617586E-02; COFD[13556] = -2.26506447E+01; COFD[13557] = 5.52117558E+00; COFD[13558] = -4.68225360E-01; - COFD[13559] = 1.89617585E-02; + COFD[13559] = 1.89617586E-02; COFD[13560] = -2.26506447E+01; COFD[13561] = 5.52117558E+00; COFD[13562] = -4.68225360E-01; - COFD[13563] = 1.89617585E-02; + COFD[13563] = 1.89617586E-02; COFD[13564] = -2.24686251E+01; COFD[13565] = 5.51405355E+00; COFD[13566] = -4.73603380E-01; @@ -147507,15 +147518,15 @@ egtransetCOFD(amrex::Real* COFD) COFD[14124] = -2.26397699E+01; COFD[14125] = 5.52117558E+00; COFD[14126] = -4.68225360E-01; - COFD[14127] = 1.89617585E-02; + COFD[14127] = 1.89617586E-02; COFD[14128] = -2.26381492E+01; COFD[14129] = 5.52117558E+00; COFD[14130] = -4.68225360E-01; - COFD[14131] = 1.89617585E-02; + COFD[14131] = 1.89617586E-02; COFD[14132] = -2.26381492E+01; COFD[14133] = 5.52117558E+00; COFD[14134] = -4.68225360E-01; - COFD[14135] = 1.89617585E-02; + COFD[14135] = 1.89617586E-02; COFD[14136] = -2.24565814E+01; COFD[14137] = 5.51405355E+00; COFD[14138] = -4.73603380E-01; @@ -156670,15 +156681,15 @@ egtransetCOFD(amrex::Real* COFD) COFD[23287] = 1.80361746E-02; COFD[23288] = -2.28751849E+01; COFD[23289] = 5.52112044E+00; - COFD[23290] = -4.67199920E-01; + COFD[23290] = -4.67199921E-01; COFD[23291] = 1.88783245E-02; COFD[23292] = -2.29374128E+01; COFD[23293] = 5.52112044E+00; - COFD[23294] = -4.67199920E-01; + COFD[23294] = -4.67199921E-01; COFD[23295] = 1.88783245E-02; COFD[23296] = -2.29374128E+01; COFD[23297] = 5.52112044E+00; - COFD[23298] = -4.67199920E-01; + COFD[23298] = -4.67199921E-01; COFD[23299] = 1.88783245E-02; COFD[23300] = -2.28843910E+01; COFD[23301] = 5.38228445E+00; @@ -163389,11 +163400,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[30006] = -3.13823840E-01; COFD[30007] = 1.08409837E-02; COFD[30008] = -2.21335685E+01; - COFD[30009] = 4.89884590E+00; + COFD[30009] = 4.89884591E+00; COFD[30010] = -3.57454891E-01; COFD[30011] = 1.30099739E-02; COFD[30012] = -2.21299654E+01; - COFD[30013] = 4.89884590E+00; + COFD[30013] = 4.89884591E+00; COFD[30014] = -3.57454891E-01; COFD[30015] = 1.30099739E-02; COFD[30016] = -2.07910304E+01; @@ -163413,19 +163424,19 @@ egtransetCOFD(amrex::Real* COFD) COFD[30030] = -2.86645017E-01; COFD[30031] = 9.58804779E-03; COFD[30032] = -2.21262856E+01; - COFD[30033] = 4.89884590E+00; + COFD[30033] = 4.89884591E+00; COFD[30034] = -3.57454891E-01; COFD[30035] = 1.30099739E-02; COFD[30036] = -2.21225264E+01; - COFD[30037] = 4.89884590E+00; + COFD[30037] = 4.89884591E+00; COFD[30038] = -3.57454891E-01; COFD[30039] = 1.30099739E-02; COFD[30040] = -2.21795168E+01; - COFD[30041] = 4.89884590E+00; + COFD[30041] = 4.89884591E+00; COFD[30042] = -3.57454891E-01; COFD[30043] = 1.30099739E-02; COFD[30044] = -2.21262856E+01; - COFD[30045] = 4.89884590E+00; + COFD[30045] = 4.89884591E+00; COFD[30046] = -3.57454891E-01; COFD[30047] = 1.30099739E-02; COFD[30048] = -2.16169538E+01; @@ -163433,7 +163444,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[30050] = -3.11346903E-01; COFD[30051] = 1.07195437E-02; COFD[30052] = -2.22167954E+01; - COFD[30053] = 4.89884590E+00; + COFD[30053] = 4.89884591E+00; COFD[30054] = -3.57454891E-01; COFD[30055] = 1.30099739E-02; COFD[30056] = -2.11977877E+01; @@ -171341,7 +171352,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[37958] = -3.72184796E-01; COFD[37959] = 1.37586931E-02; COFD[37960] = -2.21335685E+01; - COFD[37961] = 4.89884590E+00; + COFD[37961] = 4.89884591E+00; COFD[37962] = -3.57454891E-01; COFD[37963] = 1.30099739E-02; COFD[37964] = -2.21287442E+01; @@ -171913,7 +171924,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[38530] = -3.72184796E-01; COFD[38531] = 1.37586931E-02; COFD[38532] = -2.21299654E+01; - COFD[38533] = 4.89884590E+00; + COFD[38533] = 4.89884591E+00; COFD[38534] = -3.57454891E-01; COFD[38535] = 1.30099739E-02; COFD[38536] = -2.21248225E+01; @@ -174773,7 +174784,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[41390] = -3.72184796E-01; COFD[41391] = 1.37586931E-02; COFD[41392] = -2.21262856E+01; - COFD[41393] = 4.89884590E+00; + COFD[41393] = 4.89884591E+00; COFD[41394] = -3.57454891E-01; COFD[41395] = 1.30099739E-02; COFD[41396] = -2.21208199E+01; @@ -175345,7 +175356,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[41962] = -3.72184796E-01; COFD[41963] = 1.37586931E-02; COFD[41964] = -2.21225264E+01; - COFD[41965] = 4.89884590E+00; + COFD[41965] = 4.89884591E+00; COFD[41966] = -3.57454891E-01; COFD[41967] = 1.30099739E-02; COFD[41968] = -2.21167337E+01; @@ -175917,7 +175928,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[42534] = -3.72184796E-01; COFD[42535] = 1.37586931E-02; COFD[42536] = -2.21795168E+01; - COFD[42537] = 4.89884590E+00; + COFD[42537] = 4.89884591E+00; COFD[42538] = -3.57454891E-01; COFD[42539] = 1.30099739E-02; COFD[42540] = -2.21789826E+01; @@ -176489,7 +176500,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[43106] = -3.72184796E-01; COFD[43107] = 1.37586931E-02; COFD[43108] = -2.21262856E+01; - COFD[43109] = 4.89884590E+00; + COFD[43109] = 4.89884591E+00; COFD[43110] = -3.57454891E-01; COFD[43111] = 1.30099739E-02; COFD[43112] = -2.21208199E+01; @@ -177633,7 +177644,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[44250] = -3.72184796E-01; COFD[44251] = 1.37586931E-02; COFD[44252] = -2.22167954E+01; - COFD[44253] = 4.89884590E+00; + COFD[44253] = 4.89884591E+00; COFD[44254] = -3.57454891E-01; COFD[44255] = 1.30099739E-02; COFD[44256] = -2.22200744E+01; @@ -190103,11 +190114,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[56720] = -2.26523065E+01; COFD[56721] = 5.52117558E+00; COFD[56722] = -4.68225360E-01; - COFD[56723] = 1.89617585E-02; + COFD[56723] = 1.89617586E-02; COFD[56724] = -2.26397699E+01; COFD[56725] = 5.52117558E+00; COFD[56726] = -4.68225360E-01; - COFD[56727] = 1.89617585E-02; + COFD[56727] = 1.89617586E-02; COFD[56728] = -2.24232509E+01; COFD[56729] = 5.52589273E+00; COFD[56730] = -4.70253574E-01; @@ -190675,11 +190686,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[57292] = -2.26506447E+01; COFD[57293] = 5.52117558E+00; COFD[57294] = -4.68225360E-01; - COFD[57295] = 1.89617585E-02; + COFD[57295] = 1.89617586E-02; COFD[57296] = -2.26381492E+01; COFD[57297] = 5.52117558E+00; COFD[57298] = -4.68225360E-01; - COFD[57299] = 1.89617585E-02; + COFD[57299] = 1.89617586E-02; COFD[57300] = -2.24216720E+01; COFD[57301] = 5.52589273E+00; COFD[57302] = -4.70253574E-01; @@ -191247,11 +191258,11 @@ egtransetCOFD(amrex::Real* COFD) COFD[57864] = -2.26506447E+01; COFD[57865] = 5.52117558E+00; COFD[57866] = -4.68225360E-01; - COFD[57867] = 1.89617585E-02; + COFD[57867] = 1.89617586E-02; COFD[57868] = -2.26381492E+01; COFD[57869] = 5.52117558E+00; COFD[57870] = -4.68225360E-01; - COFD[57871] = 1.89617585E-02; + COFD[57871] = 1.89617586E-02; COFD[57872] = -2.24216720E+01; COFD[57873] = 5.52589273E+00; COFD[57874] = -4.70253574E-01; @@ -191886,7 +191897,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[58503] = 1.66621819E-02; COFD[58504] = -2.28751849E+01; COFD[58505] = 5.52112044E+00; - COFD[58506] = -4.67199920E-01; + COFD[58506] = -4.67199921E-01; COFD[58507] = 1.88783245E-02; COFD[58508] = -2.27379882E+01; COFD[58509] = 5.51737489E+00; @@ -192458,7 +192469,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[59075] = 1.66621819E-02; COFD[59076] = -2.29374128E+01; COFD[59077] = 5.52112044E+00; - COFD[59078] = -4.67199920E-01; + COFD[59078] = -4.67199921E-01; COFD[59079] = 1.88783245E-02; COFD[59080] = -2.27992430E+01; COFD[59081] = 5.51737489E+00; @@ -193030,7 +193041,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[59647] = 1.66621819E-02; COFD[59648] = -2.29374128E+01; COFD[59649] = 5.52112044E+00; - COFD[59650] = -4.67199920E-01; + COFD[59650] = -4.67199921E-01; COFD[59651] = 1.88783245E-02; COFD[59652] = -2.27992430E+01; COFD[59653] = 5.51737489E+00; diff --git a/Mechanisms/isooctane_lu/mechanism.cpp b/Mechanisms/isooctane_lu/mechanism.cpp index d01fd8ae4..c65dc3697 100644 --- a/Mechanisms/isooctane_lu/mechanism.cpp +++ b/Mechanisms/isooctane_lu/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[1178] = { +const int rmap[NUM_REACTIONS] = { 16, 29, 75, 76, 87, 96, 111, 142, 172, 178, 179, 196, 256, 276, 277, 292, 313, 40, 249, 8, 9, 10, 11, 12, 13, 14, 15, 47, 48, 70, 71, 469, 470, 491, 492, 0, 1, 2, 3, @@ -96,7 +96,7 @@ const int rmap[1178] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 1178; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/methaneIons_diRenzo/mechanism.H b/Mechanisms/methaneIons_diRenzo/mechanism.H index 7e8570fff..f41e7fed5 100644 --- a/Mechanisms/methaneIons_diRenzo/mechanism.H +++ b/Mechanisms/methaneIons_diRenzo/mechanism.H @@ -27,7 +27,7 @@ #define CH4_ID 11 #define CH3_ID 12 #define CH2_ID 13 -#define CH2S_ID 14 +#define CH2_S_ID 14 #define C_ID 15 #define CH_ID 16 #define CH3OH_ID 17 @@ -40,10 +40,21 @@ #define O2n_ID 24 #define E_ID 25 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 26 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 26 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 134 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 4 -#define NUM_REACTIONS 134 #define NUM_FIT 4 diff --git a/Mechanisms/methaneIons_diRenzo/mechanism.cpp b/Mechanisms/methaneIons_diRenzo/mechanism.cpp index dfd4e275e..7b9c57020 100644 --- a/Mechanisms/methaneIons_diRenzo/mechanism.cpp +++ b/Mechanisms/methaneIons_diRenzo/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[134] = { +const int rmap[NUM_REACTIONS] = { 6, 19, 24, 43, 66, 67, 106, 107, 20, 3, 5, 97, 108, 120, 131, 132, 133, 0, 1, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, @@ -14,7 +14,7 @@ const int rmap[134] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 134; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/ndodecane_35/mechanism.H b/Mechanisms/ndodecane_35/mechanism.H index 43e16e5de..6d664ce25 100644 --- a/Mechanisms/ndodecane_35/mechanism.H +++ b/Mechanisms/ndodecane_35/mechanism.H @@ -48,10 +48,21 @@ #define OC12H23OOH_ID 33 #define N2_ID 34 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 35 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 35 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/nitrogens/mechanism.H b/Mechanisms/nitrogens/mechanism.H index cdcb15e8e..3ad0c49cb 100644 --- a/Mechanisms/nitrogens/mechanism.H +++ b/Mechanisms/nitrogens/mechanism.H @@ -12,10 +12,21 @@ #define N2_ID 0 #define N2a_ID 1 -#define NUM_ELEMENTS 1 -#define NUM_SPECIES 2 +#define NUM_GAS_ELEMENTS 1 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 2 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 0 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 0 #define NUM_FIT 4 diff --git a/Mechanisms/propane_fc/mechanism.H b/Mechanisms/propane_fc/mechanism.H index c1f22326a..d60c0f93b 100644 --- a/Mechanisms/propane_fc/mechanism.H +++ b/Mechanisms/propane_fc/mechanism.H @@ -47,10 +47,21 @@ #define IXC3H7O2_ID 32 #define NXC3H7O2_ID 33 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 34 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 34 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 167 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 167 #define NUM_FIT 4 @@ -23115,7 +23126,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[357] = 5.54637286E+00; COFD[358] = -4.87070324E-01; COFD[359] = 2.03983467E-02; - COFD[360] = -1.79310920E+01; + COFD[360] = -1.79310921E+01; COFD[361] = 4.98037650E+00; COFD[362] = -4.26676911E-01; COFD[363] = 1.83007231E-02; @@ -25755,7 +25766,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[2997] = 4.24084025E+00; COFD[2998] = -3.37428619E-01; COFD[2999] = 1.47032793E-02; - COFD[3000] = -1.79310920E+01; + COFD[3000] = -1.79310921E+01; COFD[3001] = 4.98037650E+00; COFD[3002] = -4.26676911E-01; COFD[3003] = 1.83007231E-02; @@ -26011,7 +26022,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[3253] = 5.15745622E+00; COFD[3254] = -4.46648283E-01; COFD[3255] = 1.90458987E-02; - COFD[3256] = -2.18644448E+01; + COFD[3256] = -2.18644449E+01; COFD[3257] = 5.53438558E+00; COFD[3258] = -4.85873757E-01; COFD[3259] = 2.03606278E-02; @@ -26680,15 +26691,15 @@ egtransetCOFD(amrex::Real* COFD) COFD[3922] = -3.75026436E-01; COFD[3923] = 1.39466941E-02; COFD[3924] = -2.25933772E+01; - COFD[3925] = 5.42562555E+00; + COFD[3925] = 5.42562556E+00; COFD[3926] = -4.48132861E-01; COFD[3927] = 1.77847329E-02; COFD[3928] = -2.25933772E+01; - COFD[3929] = 5.42562555E+00; + COFD[3929] = 5.42562556E+00; COFD[3930] = -4.48132861E-01; COFD[3931] = 1.77847329E-02; COFD[3932] = -2.25999325E+01; - COFD[3933] = 5.42562555E+00; + COFD[3933] = 5.42562556E+00; COFD[3934] = -4.48132861E-01; COFD[3935] = 1.77847329E-02; COFD[3936] = -2.15763414E+01; @@ -26812,7 +26823,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4054] = -4.81921515E-01; COFD[4055] = 1.97721229E-02; COFD[4056] = -2.25933772E+01; - COFD[4057] = 5.42562555E+00; + COFD[4057] = 5.42562556E+00; COFD[4058] = -4.48132861E-01; COFD[4059] = 1.77847329E-02; COFD[4060] = -2.26149331E+01; @@ -26948,7 +26959,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4190] = -4.81921515E-01; COFD[4191] = 1.97721229E-02; COFD[4192] = -2.25933772E+01; - COFD[4193] = 5.42562555E+00; + COFD[4193] = 5.42562556E+00; COFD[4194] = -4.48132861E-01; COFD[4195] = 1.77847329E-02; COFD[4196] = -2.26149331E+01; @@ -27084,7 +27095,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4326] = -4.81921515E-01; COFD[4327] = 1.97721229E-02; COFD[4328] = -2.25999325E+01; - COFD[4329] = 5.42562555E+00; + COFD[4329] = 5.42562556E+00; COFD[4330] = -4.48132861E-01; COFD[4331] = 1.77847329E-02; COFD[4332] = -2.26206807E+01; @@ -27199,7 +27210,7 @@ egtransetCOFD(amrex::Real* COFD) COFD[4441] = 5.44889462E+00; COFD[4442] = -4.52325002E-01; COFD[4443] = 1.80132629E-02; - COFD[4444] = -2.18644448E+01; + COFD[4444] = -2.18644449E+01; COFD[4445] = 5.53438558E+00; COFD[4446] = -4.85873757E-01; COFD[4447] = 2.03606278E-02; diff --git a/Mechanisms/propane_fc/mechanism.cpp b/Mechanisms/propane_fc/mechanism.cpp index 50d36b8f3..b31924d2b 100644 --- a/Mechanisms/propane_fc/mechanism.cpp +++ b/Mechanisms/propane_fc/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[167] = { +const int rmap[NUM_REACTIONS] = { 6, 12, 45, 46, 60, 75, 92, 94, 103, 0, 3, 7, 66, 67, 82, 83, 1, 2, 4, 5, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, @@ -17,7 +17,7 @@ const int rmap[167] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 167; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/sCO2/mechanism.H b/Mechanisms/sCO2/mechanism.H index 8eac70c70..45956f6c6 100644 --- a/Mechanisms/sCO2/mechanism.H +++ b/Mechanisms/sCO2/mechanism.H @@ -29,10 +29,21 @@ #define CH2O_ID 14 #define HCO_ID 15 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 16 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_GAS_SPECIES 16 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 60 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 60 #define NUM_FIT 4 diff --git a/Mechanisms/sCO2/mechanism.cpp b/Mechanisms/sCO2/mechanism.cpp index aa7fe45a2..abc2847ed 100644 --- a/Mechanisms/sCO2/mechanism.cpp +++ b/Mechanisms/sCO2/mechanism.cpp @@ -1,15 +1,15 @@ #include "mechanism.H" -const int rmap[60] = {5, 16, 22, 28, 44, 59, 17, 0, 2, 4, 51, 1, - 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, - 19, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, - 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58}; +const int rmap[NUM_REACTIONS] = { + 5, 16, 22, 28, 44, 59, 17, 0, 2, 4, 51, 1, 3, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 23, 24, 25, + 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58}; // Returns 0-based map of reaction order void GET_RMAP(int* _rmap) { - for (int j = 0; j < 60; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } From 625d8f008ff07bd4d508b3faf3557d052f30eb3c Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 8 Feb 2024 09:10:03 -0700 Subject: [PATCH 18/20] Doing qss files --- Mechanisms/C1-C2-NO_qss/mechanism.H | 17 +++++-- Mechanisms/C1-C2-NO_qss/mechanism.cpp | 4 +- Mechanisms/CH4_lean_qss/mechanism.H | 64 ++++++++++++++---------- Mechanisms/CH4_lean_qss/mechanism.cpp | 4 +- Mechanisms/LuEthylene_qss/mechanism.H | 17 +++++-- Mechanisms/LuEthylene_qss/mechanism.cpp | 4 +- Mechanisms/dodecane_lu_qss/mechanism.H | 17 +++++-- Mechanisms/dodecane_lu_qss/mechanism.cpp | 4 +- Mechanisms/heptane_lu_qss/mechanism.H | 33 ++++++++---- Mechanisms/heptane_lu_qss/mechanism.cpp | 4 +- 10 files changed, 112 insertions(+), 56 deletions(-) diff --git a/Mechanisms/C1-C2-NO_qss/mechanism.H b/Mechanisms/C1-C2-NO_qss/mechanism.H index 58f6f83da..552156769 100644 --- a/Mechanisms/C1-C2-NO_qss/mechanism.H +++ b/Mechanisms/C1-C2-NO_qss/mechanism.H @@ -53,10 +53,21 @@ #define NCO_ID 37 #define CH3O2_ID 38 -#define NUM_ELEMENTS 5 -#define NUM_SPECIES 39 +#define NUM_GAS_ELEMENTS 5 // Elements in the homogeneous phase +#define NUM_QSSA_GAS_SPECIES 39 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 269 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_QSSA_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 269 #define NUM_FIT 4 diff --git a/Mechanisms/C1-C2-NO_qss/mechanism.cpp b/Mechanisms/C1-C2-NO_qss/mechanism.cpp index 49a3508ae..e850ed85e 100644 --- a/Mechanisms/C1-C2-NO_qss/mechanism.cpp +++ b/Mechanisms/C1-C2-NO_qss/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[269] = { +const int rmap[NUM_REACTIONS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, @@ -23,7 +23,7 @@ const int rmap[269] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 269; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/CH4_lean_qss/mechanism.H b/Mechanisms/CH4_lean_qss/mechanism.H index 17b024495..d30d57655 100644 --- a/Mechanisms/CH4_lean_qss/mechanism.H +++ b/Mechanisms/CH4_lean_qss/mechanism.H @@ -26,10 +26,21 @@ #define CH2O_ID 11 #define N2_ID 12 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 13 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_QSSA_GAS_SPECIES 13 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 73 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_QSSA_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 73 #define NUM_FIT 4 @@ -3201,23 +3212,23 @@ comp_sc_qss(amrex::Real* sc_qss, amrex::Real* qf_co, amrex::Real* qr_co) qf_co[15] - qf_co[16] - qf_co[23] - qf_co[40]; amrex::Real CH2OH_rhs = -CH2OH_num / CH2OH_denom; - amrex::Real CH2OH_CH2S = (epsilon + 1.0 * qr_co[16]) / CH2OH_denom; + amrex::Real CH2OH_CH2_S = (epsilon + 1.0 * qr_co[16]) / CH2OH_denom; // QSSA species 1: CH2(S) - amrex::Real CH2S_num = epsilon + 1.0 * qr_co[6] + 1.0 * qr_co[18] + - 1.0 * qf_co[20] + 1.0 * qr_co[29] + 1.0 * qr_co[30] + - 1.0 * qr_co[31] + 1.0 * qr_co[33] + 1.0 * qr_co[36]; - amrex::Real CH2S_denom = epsilon - qf_co[6] - qr_co[16] - qf_co[18] - - qr_co[20] - qf_co[28] - qf_co[29] - qf_co[30] - - qf_co[31] - qf_co[32] - qf_co[33] - qf_co[34] - - qf_co[35] - qf_co[36]; - amrex::Real CH2S_rhs = -CH2S_num / CH2S_denom; + amrex::Real CH2_S_num = epsilon + 1.0 * qr_co[6] + 1.0 * qr_co[18] + + 1.0 * qf_co[20] + 1.0 * qr_co[29] + 1.0 * qr_co[30] + + 1.0 * qr_co[31] + 1.0 * qr_co[33] + 1.0 * qr_co[36]; + amrex::Real CH2_S_denom = epsilon - qf_co[6] - qr_co[16] - qf_co[18] - + qr_co[20] - qf_co[28] - qf_co[29] - qf_co[30] - + qf_co[31] - qf_co[32] - qf_co[33] - qf_co[34] - + qf_co[35] - qf_co[36]; + amrex::Real CH2_S_rhs = -CH2_S_num / CH2_S_denom; - amrex::Real CH2S_CH2OH = (epsilon + 1.0 * qf_co[16]) / CH2S_denom; - amrex::Real CH2S_CH2 = (epsilon + 1.0 * qr_co[28] + 1.0 * qr_co[32] + - 1.0 * qr_co[34] + 1.0 * qr_co[35]) / - CH2S_denom; + amrex::Real CH2_S_CH2OH = (epsilon + 1.0 * qf_co[16]) / CH2_S_denom; + amrex::Real CH2_S_CH2 = (epsilon + 1.0 * qr_co[28] + 1.0 * qr_co[32] + + 1.0 * qr_co[34] + 1.0 * qr_co[35]) / + CH2_S_denom; // QSSA species 0: CH2 @@ -3232,21 +3243,22 @@ comp_sc_qss(amrex::Real* sc_qss, amrex::Real* qf_co, amrex::Real* qr_co) amrex::Real CH2_HCO = (epsilon + 1.0 * qr_co[5] + 1.0 * qr_co[25]) / CH2_denom; - amrex::Real CH2_CH2S = (epsilon + 1.0 * qf_co[28] + 1.0 * qf_co[32] + - 1.0 * qf_co[34] + 1.0 * qf_co[35]) / - CH2_denom; + amrex::Real CH2_CH2_S = (epsilon + 1.0 * qf_co[28] + 1.0 * qf_co[32] + + 1.0 * qf_co[34] + 1.0 * qf_co[35]) / + CH2_denom; // Putting it all together amrex::Real H_0 = CH2_HCO; - amrex::Real H_1 = CH2S_CH2OH; - amrex::Real H_2 = CH2_CH2S / (1 - CH2OH_CH2S * H_1); - sc_qss[0] = ((CH2_rhs - HCO_rhs * H_0) - (CH2S_rhs - CH2OH_rhs * H_1) * H_2) / - ((1 - HCO_CH2 * H_0) - CH2S_CH2 * H_2); + amrex::Real H_1 = CH2_S_CH2OH; + amrex::Real H_2 = CH2_CH2_S / (1 - CH2OH_CH2_S * H_1); + sc_qss[0] = + ((CH2_rhs - HCO_rhs * H_0) - (CH2_S_rhs - CH2OH_rhs * H_1) * H_2) / + ((1 - HCO_CH2 * H_0) - CH2_S_CH2 * H_2); - sc_qss[1] = ((CH2S_rhs - CH2OH_rhs * H_1) - (CH2S_CH2 * sc_qss[0])) / - (1 - CH2OH_CH2S * H_1); + sc_qss[1] = ((CH2_S_rhs - CH2OH_rhs * H_1) - (CH2_S_CH2 * sc_qss[0])) / + (1 - CH2OH_CH2_S * H_1); - sc_qss[3] = CH2OH_rhs - (+CH2OH_CH2S * sc_qss[1]); + sc_qss[3] = CH2OH_rhs - (+CH2OH_CH2_S * sc_qss[1]); sc_qss[2] = HCO_rhs - (HCO_CH2 * sc_qss[0]); diff --git a/Mechanisms/CH4_lean_qss/mechanism.cpp b/Mechanisms/CH4_lean_qss/mechanism.cpp index 377e96205..594d6fe10 100644 --- a/Mechanisms/CH4_lean_qss/mechanism.cpp +++ b/Mechanisms/CH4_lean_qss/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[73] = { +const int rmap[NUM_REACTIONS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, @@ -9,7 +9,7 @@ const int rmap[73] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 73; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/LuEthylene_qss/mechanism.H b/Mechanisms/LuEthylene_qss/mechanism.H index c65cb7327..b79d5638f 100644 --- a/Mechanisms/LuEthylene_qss/mechanism.H +++ b/Mechanisms/LuEthylene_qss/mechanism.H @@ -35,10 +35,21 @@ #define C3H6_ID 20 #define N2_ID 21 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 22 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_QSSA_GAS_SPECIES 22 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 206 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_QSSA_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 206 #define NUM_FIT 4 diff --git a/Mechanisms/LuEthylene_qss/mechanism.cpp b/Mechanisms/LuEthylene_qss/mechanism.cpp index 6079df5de..8d9aff152 100644 --- a/Mechanisms/LuEthylene_qss/mechanism.cpp +++ b/Mechanisms/LuEthylene_qss/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[206] = { +const int rmap[NUM_REACTIONS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, @@ -19,7 +19,7 @@ const int rmap[206] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 206; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/dodecane_lu_qss/mechanism.H b/Mechanisms/dodecane_lu_qss/mechanism.H index 576828d29..5360d90c1 100644 --- a/Mechanisms/dodecane_lu_qss/mechanism.H +++ b/Mechanisms/dodecane_lu_qss/mechanism.H @@ -48,10 +48,21 @@ #define OC12H23OOH_ID 33 #define N2_ID 34 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 35 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_QSSA_GAS_SPECIES 35 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 268 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_QSSA_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 268 #define NUM_FIT 4 diff --git a/Mechanisms/dodecane_lu_qss/mechanism.cpp b/Mechanisms/dodecane_lu_qss/mechanism.cpp index 98f20472d..d36d77bb7 100644 --- a/Mechanisms/dodecane_lu_qss/mechanism.cpp +++ b/Mechanisms/dodecane_lu_qss/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[268] = { +const int rmap[NUM_REACTIONS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, @@ -23,7 +23,7 @@ const int rmap[268] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 268; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } diff --git a/Mechanisms/heptane_lu_qss/mechanism.H b/Mechanisms/heptane_lu_qss/mechanism.H index 80e28f3e9..b51508687 100644 --- a/Mechanisms/heptane_lu_qss/mechanism.H +++ b/Mechanisms/heptane_lu_qss/mechanism.H @@ -68,10 +68,21 @@ #define c7h14o24_ID 53 #define n2_ID 54 -#define NUM_ELEMENTS 4 -#define NUM_SPECIES 55 +#define NUM_GAS_ELEMENTS 4 // Elements in the homogeneous phase +#define NUM_QSSA_GAS_SPECIES 55 // Species in the homogeneous phase +#define NUM_GAS_REACTIONS 724 // Reactions in the homogeneous phase + +#define SITE_DENSITY 0.000000E+00 // mol/cm^2 + +#define NUM_SURFACE_ELEMENTS 0 // Additional elements in heterogeneous phase +#define NUM_SURFACE_SPECIES 0 // Species in the heterogeneous phase +#define NUM_SURFACE_REACTIONS 0 // Reactions in the heterogeneous phase + +#define NUM_ELEMENTS (NUM_GAS_ELEMENTS + NUM_SURFACE_ELEMENTS) +#define NUM_SPECIES (NUM_QSSA_GAS_SPECIES + NUM_SURFACE_SPECIES) +#define NUM_REACTIONS (NUM_GAS_REACTIONS + NUM_SURFACE_REACTIONS) + #define NUM_IONS 0 -#define NUM_REACTIONS 724 #define NUM_FIT 4 @@ -13251,15 +13262,15 @@ comp_sc_qss(amrex::Real* sc_qss, amrex::Real* qf_co, amrex::Real* qr_co) // QSSA species 11: ch2(s) - amrex::Real ch2s_num = epsilon + 1.0 * qf_co[41] + 1.0 * qf_co[127] + - 1.0 * qf_co[190] + 1.0 * qf_co[192] + - 1.0 * qf_co[195] + 1.0 * qf_co[198] + - 1.0 * qf_co[200] + 1.0 * qf_co[202] + 1.0 * qf_co[204]; - amrex::Real ch2s_denom = epsilon - qf_co[42] - qf_co[128] - qf_co[189] - - qf_co[191] - qf_co[193] - qf_co[194] - qf_co[196] - - qf_co[197] - qf_co[199] - qf_co[201] - qf_co[203]; + amrex::Real ch2_s_num = + epsilon + 1.0 * qf_co[41] + 1.0 * qf_co[127] + 1.0 * qf_co[190] + + 1.0 * qf_co[192] + 1.0 * qf_co[195] + 1.0 * qf_co[198] + 1.0 * qf_co[200] + + 1.0 * qf_co[202] + 1.0 * qf_co[204]; + amrex::Real ch2_s_denom = epsilon - qf_co[42] - qf_co[128] - qf_co[189] - + qf_co[191] - qf_co[193] - qf_co[194] - qf_co[196] - + qf_co[197] - qf_co[199] - qf_co[201] - qf_co[203]; - sc_qss[11] = -ch2s_num / ch2s_denom; + sc_qss[11] = -ch2_s_num / ch2_s_denom; // QSSA species 12: nc3h7co diff --git a/Mechanisms/heptane_lu_qss/mechanism.cpp b/Mechanisms/heptane_lu_qss/mechanism.cpp index 1bd17dccd..8656c032a 100644 --- a/Mechanisms/heptane_lu_qss/mechanism.cpp +++ b/Mechanisms/heptane_lu_qss/mechanism.cpp @@ -1,5 +1,5 @@ #include "mechanism.H" -const int rmap[724] = { +const int rmap[NUM_REACTIONS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, @@ -54,7 +54,7 @@ const int rmap[724] = { void GET_RMAP(int* _rmap) { - for (int j = 0; j < 724; ++j) { + for (int j = 0; j < NUM_REACTIONS; ++j) { _rmap[j] = rmap[j]; } } From e10e40f95f49fe686497665549c5348afa0eac6c Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Fri, 9 Feb 2024 14:58:30 +0530 Subject: [PATCH 19/20] Updated Ceptr.rst with details of modified usage --- Docs/sphinx/Ceptr.rst | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Docs/sphinx/Ceptr.rst b/Docs/sphinx/Ceptr.rst index 49c99d061..6fdb66302 100644 --- a/Docs/sphinx/Ceptr.rst +++ b/Docs/sphinx/Ceptr.rst @@ -27,11 +27,28 @@ Generating for a single chemistry There are three ways to use CEPTR to generate C++ mechanism files for a given chemistry -1. Using CEPTR directly:: +1. Using CEPTR directly: + + Executed from the ``${PELE_PHYSICS_HOME}/Support/ceptr`` directory, the most general usage of CEPTR is:: + + $ poetry run convert -f ${PELEPHYSICS_HOME}/Mechanisms/${chemistry}/mechanism.yaml \ + --chemistry {chemistry-type} \ + --gas_name {gas-name} \ + --interface_name {interface-name} + + The ``--chemistry``, or equivalently ``-c``, argument allows users to convey if the ``${chemistry}`` of interest is either one of two valid options, namely, ``homogeneous`` or ``heterogeneous``. + Similarly, the ``--gas_name`` and ``--interface_name`` allows users to specify the names of the homogeneous phase and gas-solid interface prescribed in the corresponding ``mechanism.yaml`` file. + + The default ``chemistry-type``, ``gas-name`` are ``homogeneous`` and ``gas`` respectively while that for ``interface-name`` is ``None``. + Note that if a ``heterogeneous`` ``chemistry-type`` is specified, the user must necessarily specify a corresponding ``interface-name``. + + An example of directly using CEPTR for homogeneous mechanisms is:: $ cd ${PELE_PHYSICS_HOME}/Support/ceptr $ poetry run convert -f ${PELE_PHYSICS_HOME}/Mechanisms/LiDryer/mechanism.yaml + NOTE: CEPTR interpretations of heterogeneous mechanisms is currently a work in progress. + 2. Using a helper script in the directory containing the ``mechanism.yaml`` file:: $ ./convert.sh From 8d400a241e303da89e23ea6af128b007facd4a42 Mon Sep 17 00:00:00 2001 From: Anirudh Jonnalagadda Date: Fri, 9 Feb 2024 22:30:39 +0530 Subject: [PATCH 20/20] Used rst note in Ceptr.rst --- Docs/sphinx/Ceptr.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Docs/sphinx/Ceptr.rst b/Docs/sphinx/Ceptr.rst index 6fdb66302..2bed1fef3 100644 --- a/Docs/sphinx/Ceptr.rst +++ b/Docs/sphinx/Ceptr.rst @@ -37,7 +37,7 @@ There are three ways to use CEPTR to generate C++ mechanism files for a given ch --interface_name {interface-name} The ``--chemistry``, or equivalently ``-c``, argument allows users to convey if the ``${chemistry}`` of interest is either one of two valid options, namely, ``homogeneous`` or ``heterogeneous``. - Similarly, the ``--gas_name`` and ``--interface_name`` allows users to specify the names of the homogeneous phase and gas-solid interface prescribed in the corresponding ``mechanism.yaml`` file. + Similarly, the ``--gas_name`` and ``--interface_name`` arguments allow users to specify the names of the homogeneous phase and gas-solid interface prescribed in the corresponding ``mechanism.yaml`` file. The default ``chemistry-type``, ``gas-name`` are ``homogeneous`` and ``gas`` respectively while that for ``interface-name`` is ``None``. Note that if a ``heterogeneous`` ``chemistry-type`` is specified, the user must necessarily specify a corresponding ``interface-name``. @@ -47,7 +47,7 @@ There are three ways to use CEPTR to generate C++ mechanism files for a given ch $ cd ${PELE_PHYSICS_HOME}/Support/ceptr $ poetry run convert -f ${PELE_PHYSICS_HOME}/Mechanisms/LiDryer/mechanism.yaml - NOTE: CEPTR interpretations of heterogeneous mechanisms is currently a work in progress. + .. note:: CEPTR interpretations of heterogeneous mechanisms is currently a work in progress. 2. Using a helper script in the directory containing the ``mechanism.yaml`` file::