diamondSurf and min_python/diamond tests now use the same code

This commit is contained in:
Ray Speth 2012-02-23 21:25:27 +00:00
parent 1ece5bcc3d
commit f7a4e3de64
9 changed files with 17 additions and 1135 deletions

View file

@ -239,11 +239,18 @@ CompileAndTest('cxx_ex', 'cxx_ex', 'cxx_examples', 'output_blessed.txt',
threshold=1e-7,
artifacts=['eq1.dat', 'kin1.dat', 'kin2.dat', 'kin3.csv',
'kin3.dat', 'tr1.dat', 'tr2.dat'])
CompileAndTest('diamondSurf', 'diamondSurf', 'runDiamond', 'runDiamond_blessed.out')
diamond = localenv.Program('diamondSurf/runDiamond',
'diamondSurf/runDiamond.cpp',
LIBS=env['cantera_libs'])
diamond_name = diamond[0].name
Test('diamondSurf-xml', 'diamondSurf', diamond, 'runDiamond_blessed.out',
options='diamond_blessed.xml', artifacts=diamond_name)
Test('diamondSurf-cti', 'diamondSurf', diamond, 'runDiamond_blessed.out',
options='diamond.cti', artifacts=diamond_name,
comparisons=[('diamond_blessed.xml', 'diamond.xml')])
CompileAndTest('fracCoeff', 'fracCoeff', 'fracCoeff', 'frac_blessed.out')
CompileAndTest('minDiamond', pjoin('min_python', 'minDiamond'),
'runDiamond', 'runDiamond_blessed.out',
comparisons=[('diamond_blessed.xml', 'diamond.xml')])
CompileAndTest('mixGasTransport',
'mixGasTransport', 'mixGasTransport', 'output_blessed.txt')
CompileAndTest('multiGasTransport',

View file

@ -1,449 +0,0 @@
<?xml version="1.0"?>
<ctml>
<validate reactions="yes" species="yes"/>
<!-- phase gas -->
<phase dim="3" id="gas">
<elementArray datasrc="elements.xml">H C</elementArray>
<speciesArray datasrc="gri30.xml#species_data">H H2 CH3 CH4</speciesArray>
<state>
<temperature units="K">1200.0</temperature>
<pressure units="Pa">2666.4473684210525</pressure>
<moleFractions>H:0.002, H2:0.988, CH3:0.0002, CH4:0.01</moleFractions>
</state>
<thermo model="IdealGas"/>
<kinetics model="GasKinetics"/>
<transport model="None"/>
</phase>
<!-- phase diamond -->
<phase dim="3" id="diamond">
<elementArray datasrc="elements.xml">H C</elementArray>
<speciesArray datasrc="#species_data">C(d)</speciesArray>
<thermo model="StoichSubstance">
<density units="g/cm3">3.52</density>
</thermo>
<transport model="None"/>
<kinetics model="none"/>
</phase>
<!-- phase diamond_100 -->
<phase dim="2" id="diamond_100">
<elementArray datasrc="elements.xml">H C </elementArray>
<speciesArray datasrc="#species_data">c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B</speciesArray>
<reactionArray datasrc="#reaction_data"/>
<state>
<temperature units="K">1200.0</temperature>
<coverages>c6H*:0.1, c6HH:0.9</coverages>
</state>
<thermo model="Surface">
<site_density units="mol/cm2">3e-09</site_density>
</thermo>
<kinetics model="Interface"/>
<transport model="None"/>
<phaseArray>gas diamond</phaseArray>
</phase>
<!-- species definitions -->
<speciesData id="species_data">
<!-- species C(d) -->
<species name="C(d)">
<atomArray>C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="J/mol">0.0</h0>
<s0 units="J/mol/K">0.0</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6H* -->
<species name="c6H*">
<atomArray>H:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">51.700000000000003</h0>
<s0 units="cal/mol/K">19.5</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6*H -->
<species name="c6*H">
<atomArray>H:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">46.100000000000001</h0>
<s0 units="cal/mol/K">19.899999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6HH -->
<species name="c6HH">
<atomArray>H:2 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">11.4</h0>
<s0 units="cal/mol/K">21.0</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6HM -->
<species name="c6HM">
<atomArray>H:4 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">26.899999999999999</h0>
<s0 units="cal/mol/K">40.299999999999997</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6HM* -->
<species name="c6HM*">
<atomArray>H:3 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">65.799999999999997</h0>
<s0 units="cal/mol/K">40.100000000000001</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6*M -->
<species name="c6*M">
<atomArray>H:3 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">53.299999999999997</h0>
<s0 units="cal/mol/K">38.899999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6** -->
<species name="c6**">
<atomArray>C:0 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">90.0</h0>
<s0 units="cal/mol/K">18.399999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6B -->
<species name="c6B">
<atomArray>H:2 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">40.899999999999999</h0>
<s0 units="cal/mol/K">26.899999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
</speciesData>
<reactionData id="reaction_data">
<!-- reaction 0001 -->
<reaction reversible="yes" type="surface" id="0001">
<equation>c6HH + H [=] c6H* + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HH:1.0</reactants>
<products>H2:1 c6H*:1.0</products>
</reaction>
<!-- reaction 0002 -->
<reaction reversible="yes" type="surface" id="0002">
<equation>c6H* + H [=] c6HH</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0 H:1</reactants>
<products>c6HH:1.0</products>
</reaction>
<!-- reaction 0003 -->
<reaction reversible="yes" type="surface" id="0003">
<equation>c6H* + CH3 [=] c6HM</equation>
<rateCoeff>
<Arrhenius>
<A>5.000000E+09</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0 CH3:1</reactants>
<products>c6HM:1.0</products>
</reaction>
<!-- reaction 0004 -->
<reaction reversible="yes" type="surface" id="0004">
<equation>c6HM + H [=] c6*M + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HM:1.0</reactants>
<products>H2:1 c6*M:1.0</products>
</reaction>
<!-- reaction 0005 -->
<reaction reversible="yes" type="surface" id="0005">
<equation>c6*M + H [=] c6HM</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6*M:1.0</reactants>
<products>c6HM:1.0</products>
</reaction>
<!-- reaction 0006 -->
<reaction reversible="yes" type="surface" id="0006">
<equation>c6HM + H [=] c6HM* + H2</equation>
<rateCoeff>
<Arrhenius>
<A>2.800000E+04</A>
<b>0.0</b>
<E units="kcal/mol">7.700000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HM:1.0</reactants>
<products>H2:1 c6HM*:1.0</products>
</reaction>
<!-- reaction 0007 -->
<reaction reversible="yes" type="surface" id="0007">
<equation>c6HM* + H [=] c6HM</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0 H:1</reactants>
<products>c6HM:1.0</products>
</reaction>
<!-- reaction 0008 -->
<reaction reversible="yes" type="surface" id="0008">
<equation>c6HM* [=] c6*M</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+08</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0</reactants>
<products>c6*M:1.0</products>
</reaction>
<!-- reaction 0009 -->
<reaction reversible="yes" type="surface" id="0009">
<equation>c6HM* + H [=] c6H* + CH3</equation>
<rateCoeff>
<Arrhenius>
<A>3.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0 H:1</reactants>
<products>c6H*:1.0 CH3:1</products>
</reaction>
<!-- reaction 0010 -->
<reaction reversible="yes" type="surface" id="0010">
<equation>c6HM* + H [=] c6B + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0 H:1</reactants>
<products>H2:1 c6B:1.0</products>
</reaction>
<!-- reaction 0011 -->
<reaction reversible="yes" type="surface" id="0011">
<equation>c6*M + H [=] c6B + H2</equation>
<rateCoeff>
<Arrhenius>
<A>2.800000E+04</A>
<b>2.0</b>
<E units="kcal/mol">7.700000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6*M:1.0</reactants>
<products>H2:1 c6B:1.0</products>
</reaction>
<!-- reaction 0012 -->
<reaction reversible="yes" type="surface" id="0012">
<equation>c6HH + H [=] c6*H + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HH:1.0</reactants>
<products>H2:1 c6*H:1.0</products>
</reaction>
<!-- reaction 0013 -->
<reaction reversible="yes" type="surface" id="0013">
<equation>c6*H + H [=] c6HH</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6*H:1.0 H:1</reactants>
<products>c6HH:1.0</products>
</reaction>
<!-- reaction 0014 -->
<reaction reversible="yes" type="surface" id="0014">
<equation>c6H* + H [=] c6** + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0 H:1</reactants>
<products>H2:1 c6**:1.0</products>
</reaction>
<!-- reaction 0015 -->
<reaction reversible="yes" type="surface" id="0015">
<equation>c6** + H [=] c6H*</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6**:1.0</reactants>
<products>c6H*:1.0</products>
</reaction>
<!-- reaction 0016 -->
<reaction reversible="yes" type="surface" id="0016">
<equation>c6*H + H [=] c6** + H2</equation>
<rateCoeff>
<Arrhenius>
<A>4.500000E+03</A>
<b>2.0</b>
<E units="kcal/mol">5.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6*H:1.0 H:1</reactants>
<products>H2:1 c6**:1.0</products>
</reaction>
<!-- reaction 0017 -->
<reaction reversible="yes" type="surface" id="0017">
<equation>c6** + H [=] c6*H</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6**:1.0</reactants>
<products>c6*H:1.0</products>
</reaction>
<!-- reaction 0018 -->
<reaction reversible="yes" type="surface" id="0018">
<equation>c6** + CH3 [=] c6*M</equation>
<rateCoeff>
<Arrhenius>
<A>5.000000E+09</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>CH3:1 c6**:1.0</reactants>
<products>c6*M:1.0</products>
</reaction>
<!-- reaction 0019 -->
<reaction reversible="yes" type="surface" id="0019">
<equation>c6H* [=] c6*H</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+08</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0</reactants>
<products>c6*H:1.0</products>
</reaction>
<!-- reaction 0020 -->
<reaction reversible="yes" type="surface" id="0020">
<equation>c6B [=] c6HH + C(d)</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+09</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6B:1.0</reactants>
<products>C(d):1 c6HH:1.0</products>
</reaction>
</reactionData>
</ctml>

View file

@ -35,8 +35,13 @@ int main(int argc, char** argv)
#ifdef _MSC_VER
_set_output_format(_TWO_DIGIT_EXPONENT);
#endif
if (argc != 2) {
cout << "Error: no input file specified.\n"
"Choose either 'diamond.cti' or 'diamond_blessed.xml" << endl;
exit(-1);
}
std::string infile(argv[1]);
int i, k;
string infile = "diamond.xml";
try {
XML_Node* xc = new XML_Node();
@ -56,7 +61,6 @@ int main(int argc, char** argv)
XML_Node* const xs = xc->findNameID("phase", "diamond_100");
ThermoPhase* diamond100TP = newPhase(*xs);
//SurfPhase *diamond100TP = new SurfPhase(*xs);
int nsp_d100 = diamond100TP->nSpecies();
cout << "Number of species in diamond_100 = " << nsp_d100 << endl;

View file

@ -1,449 +0,0 @@
<?xml version="1.0"?>
<ctml>
<validate reactions="yes" species="yes"/>
<!-- phase gas -->
<phase dim="3" id="gas">
<elementArray datasrc="elements.xml">H C</elementArray>
<speciesArray datasrc="gri30.xml#species_data">H H2 CH3 CH4</speciesArray>
<state>
<temperature units="K">1200.0</temperature>
<pressure units="Pa">2666.4473684210525</pressure>
<moleFractions>H:0.002, H2:0.988, CH3:0.0002, CH4:0.01</moleFractions>
</state>
<thermo model="IdealGas"/>
<kinetics model="GasKinetics"/>
<transport model="None"/>
</phase>
<!-- phase diamond -->
<phase dim="3" id="diamond">
<elementArray datasrc="elements.xml">H C</elementArray>
<speciesArray datasrc="#species_data">C(d)</speciesArray>
<thermo model="StoichSubstance">
<density units="g/cm3">3.52</density>
</thermo>
<transport model="None"/>
<kinetics model="none"/>
</phase>
<!-- phase diamond_100 -->
<phase dim="2" id="diamond_100">
<elementArray datasrc="elements.xml">H C </elementArray>
<speciesArray datasrc="#species_data">c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B</speciesArray>
<reactionArray datasrc="#reaction_data"/>
<state>
<temperature units="K">1200.0</temperature>
<coverages>c6H*:0.1, c6HH:0.9</coverages>
</state>
<thermo model="Surface">
<site_density units="mol/cm2">3e-09</site_density>
</thermo>
<kinetics model="Interface"/>
<transport model="None"/>
<phaseArray>gas diamond</phaseArray>
</phase>
<!-- species definitions -->
<speciesData id="species_data">
<!-- species C(d) -->
<species name="C(d)">
<atomArray>C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="J/mol">0.0</h0>
<s0 units="J/mol/K">0.0</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6H* -->
<species name="c6H*">
<atomArray>H:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">51.700000000000003</h0>
<s0 units="cal/mol/K">19.5</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6*H -->
<species name="c6*H">
<atomArray>H:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">46.100000000000001</h0>
<s0 units="cal/mol/K">19.899999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6HH -->
<species name="c6HH">
<atomArray>H:2 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">11.4</h0>
<s0 units="cal/mol/K">21.0</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6HM -->
<species name="c6HM">
<atomArray>H:4 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">26.899999999999999</h0>
<s0 units="cal/mol/K">40.299999999999997</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6HM* -->
<species name="c6HM*">
<atomArray>H:3 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">65.799999999999997</h0>
<s0 units="cal/mol/K">40.100000000000001</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6*M -->
<species name="c6*M">
<atomArray>H:3 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">53.299999999999997</h0>
<s0 units="cal/mol/K">38.899999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6** -->
<species name="c6**">
<atomArray>C:0 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">90.0</h0>
<s0 units="cal/mol/K">18.399999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
<!-- species c6B -->
<species name="c6B">
<atomArray>H:2 C:1 </atomArray>
<thermo>
<const_cp Tmax="5000.0" Tmin="100.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="kcal/mol">40.899999999999999</h0>
<s0 units="cal/mol/K">26.899999999999999</s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
</species>
</speciesData>
<reactionData id="reaction_data">
<!-- reaction 0001 -->
<reaction reversible="yes" type="surface" id="0001">
<equation>c6HH + H [=] c6H* + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HH:1.0</reactants>
<products>H2:1 c6H*:1.0</products>
</reaction>
<!-- reaction 0002 -->
<reaction reversible="yes" type="surface" id="0002">
<equation>c6H* + H [=] c6HH</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0 H:1</reactants>
<products>c6HH:1.0</products>
</reaction>
<!-- reaction 0003 -->
<reaction reversible="yes" type="surface" id="0003">
<equation>c6H* + CH3 [=] c6HM</equation>
<rateCoeff>
<Arrhenius>
<A>5.000000E+09</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0 CH3:1</reactants>
<products>c6HM:1.0</products>
</reaction>
<!-- reaction 0004 -->
<reaction reversible="yes" type="surface" id="0004">
<equation>c6HM + H [=] c6*M + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HM:1.0</reactants>
<products>H2:1 c6*M:1.0</products>
</reaction>
<!-- reaction 0005 -->
<reaction reversible="yes" type="surface" id="0005">
<equation>c6*M + H [=] c6HM</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6*M:1.0</reactants>
<products>c6HM:1.0</products>
</reaction>
<!-- reaction 0006 -->
<reaction reversible="yes" type="surface" id="0006">
<equation>c6HM + H [=] c6HM* + H2</equation>
<rateCoeff>
<Arrhenius>
<A>2.800000E+04</A>
<b>0.0</b>
<E units="kcal/mol">7.700000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HM:1.0</reactants>
<products>H2:1 c6HM*:1.0</products>
</reaction>
<!-- reaction 0007 -->
<reaction reversible="yes" type="surface" id="0007">
<equation>c6HM* + H [=] c6HM</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0 H:1</reactants>
<products>c6HM:1.0</products>
</reaction>
<!-- reaction 0008 -->
<reaction reversible="yes" type="surface" id="0008">
<equation>c6HM* [=] c6*M</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+08</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0</reactants>
<products>c6*M:1.0</products>
</reaction>
<!-- reaction 0009 -->
<reaction reversible="yes" type="surface" id="0009">
<equation>c6HM* + H [=] c6H* + CH3</equation>
<rateCoeff>
<Arrhenius>
<A>3.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0 H:1</reactants>
<products>c6H*:1.0 CH3:1</products>
</reaction>
<!-- reaction 0010 -->
<reaction reversible="yes" type="surface" id="0010">
<equation>c6HM* + H [=] c6B + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6HM*:1.0 H:1</reactants>
<products>H2:1 c6B:1.0</products>
</reaction>
<!-- reaction 0011 -->
<reaction reversible="yes" type="surface" id="0011">
<equation>c6*M + H [=] c6B + H2</equation>
<rateCoeff>
<Arrhenius>
<A>2.800000E+04</A>
<b>2.0</b>
<E units="kcal/mol">7.700000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6*M:1.0</reactants>
<products>H2:1 c6B:1.0</products>
</reaction>
<!-- reaction 0012 -->
<reaction reversible="yes" type="surface" id="0012">
<equation>c6HH + H [=] c6*H + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6HH:1.0</reactants>
<products>H2:1 c6*H:1.0</products>
</reaction>
<!-- reaction 0013 -->
<reaction reversible="yes" type="surface" id="0013">
<equation>c6*H + H [=] c6HH</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6*H:1.0 H:1</reactants>
<products>c6HH:1.0</products>
</reaction>
<!-- reaction 0014 -->
<reaction reversible="yes" type="surface" id="0014">
<equation>c6H* + H [=] c6** + H2</equation>
<rateCoeff>
<Arrhenius>
<A>1.300000E+11</A>
<b>0.0</b>
<E units="kcal/mol">7.300000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0 H:1</reactants>
<products>H2:1 c6**:1.0</products>
</reaction>
<!-- reaction 0015 -->
<reaction reversible="yes" type="surface" id="0015">
<equation>c6** + H [=] c6H*</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6**:1.0</reactants>
<products>c6H*:1.0</products>
</reaction>
<!-- reaction 0016 -->
<reaction reversible="yes" type="surface" id="0016">
<equation>c6*H + H [=] c6** + H2</equation>
<rateCoeff>
<Arrhenius>
<A>4.500000E+03</A>
<b>2.0</b>
<E units="kcal/mol">5.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6*H:1.0 H:1</reactants>
<products>H2:1 c6**:1.0</products>
</reaction>
<!-- reaction 0017 -->
<reaction reversible="yes" type="surface" id="0017">
<equation>c6** + H [=] c6*H</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+10</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>H:1 c6**:1.0</reactants>
<products>c6*H:1.0</products>
</reaction>
<!-- reaction 0018 -->
<reaction reversible="yes" type="surface" id="0018">
<equation>c6** + CH3 [=] c6*M</equation>
<rateCoeff>
<Arrhenius>
<A>5.000000E+09</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>CH3:1 c6**:1.0</reactants>
<products>c6*M:1.0</products>
</reaction>
<!-- reaction 0019 -->
<reaction reversible="yes" type="surface" id="0019">
<equation>c6H* [=] c6*H</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+08</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6H*:1.0</reactants>
<products>c6*H:1.0</products>
</reaction>
<!-- reaction 0020 -->
<reaction reversible="yes" type="surface" id="0020">
<equation>c6B [=] c6HH + C(d)</equation>
<rateCoeff>
<Arrhenius>
<A>1.000000E+09</A>
<b>0.0</b>
<E units="kcal/mol">0.000000</E>
</Arrhenius>
</rateCoeff>
<reactants>c6B:1.0</reactants>
<products>C(d):1 c6HH:1.0</products>
</reaction>
</reactionData>
</ctml>

View file

@ -1,147 +0,0 @@
/**
* @file runDiamond.cpp
*
*/
// Example
//
// Note that this example needs updating. It works fine, but is
// written in a way that is less than transparent or
// user-friendly. This could be rewritten using class Interface to
// make things simpler.
#include "cantera/kinetics.h"
#include <iostream>
#include <string>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
using namespace Cantera;
void printDbl(double val)
{
if (fabs(val) < 5.0E-17) {
cout << " nil";
} else {
cout << val;
}
}
int main(int argc, char** argv)
{
#ifdef _MSC_VER
_set_output_format(_TWO_DIGIT_EXPONENT);
#endif
int i, k;
string infile = "diamond.cti";
try {
XML_Node* xc = new XML_Node();
string path = findInputFile(infile);
ctml::get_CTML_Tree(xc, path);
XML_Node* const xg = xc->findNameID("phase", "gas");
ThermoPhase* gasTP = newPhase(*xg);
int nsp = gasTP->nSpecies();
cout << "Number of species = " << nsp << endl;
XML_Node* const xd = xc->findNameID("phase", "diamond");
ThermoPhase* diamondTP = newPhase(*xd);
int nsp_diamond = diamondTP->nSpecies();
cout << "Number of species in diamond = " << nsp_diamond << endl;
XML_Node* const xs = xc->findNameID("phase", "diamond_100");
ThermoPhase* diamond100TP = newPhase(*xs);
int nsp_d100 = diamond100TP->nSpecies();
cout << "Number of species in diamond_100 = " << nsp_d100 << endl;
vector<ThermoPhase*> phaseList;
phaseList.push_back(gasTP);
phaseList.push_back(diamondTP);
phaseList.push_back(diamond100TP);
InterfaceKinetics* iKin_ptr = new InterfaceKinetics();
importKinetics(*xs, phaseList, iKin_ptr);
int nr = iKin_ptr->nReactions();
cout << "Number of reactions = " << nr << endl;
double x[20];
for (i = 0; i < 20; i++) {
x[i] = 0.0;
}
x[0] = 0.0010;
x[1] = 0.9888;
x[2] = 0.0002;
x[3] = 0.0100;
double p = 20.0*OneAtm/760.0;
gasTP->setState_TPX(1200., p, x);
for (i = 0; i < 20; i++) {
x[i] = 0.0;
}
int i0 = diamond100TP->speciesIndex("c6H*");
x[i0] = 0.1;
int i1 = diamond100TP->speciesIndex("c6HH");
x[i1] = 0.9;
diamond100TP->setState_TX(1200., x);
for (i = 0; i < 20; i++) {
x[i] = 0.0;
}
x[0] = 1.0;
diamondTP->setState_TPX(1200., p, x);
iKin_ptr->advanceCoverages(100.);
double src[20];
for (i = 0; i < 20; i++) {
src[i] = 0.0;
}
iKin_ptr->getNetProductionRates(src);
double sum = 0.0;
double naH = 0.0;
for (k = 0; k < 13; k++) {
if (k < 4) {
naH = gasTP->nAtoms(k, 0);
} else if (k == 4) {
naH = 0;
} else if (k > 4) {
int itp = k - 5;
naH = diamond100TP->nAtoms(itp, 0);
}
cout << k << " " << naH << " " ;
printDbl(src[k]);
cout << endl;
sum += naH * src[k];
}
cout << "sum = ";
printDbl(sum);
cout << endl;
double mwd = diamondTP->molecularWeight(0);
double dens = diamondTP->density();
double gr = src[4] * mwd / dens;
gr *= 1.0E6 * 3600.;
cout << "growth rate = " << gr << " microns per hour" << endl;
diamond100TP->getMoleFractions(x);
cout << "Coverages:" << endl;
for (k = 0; k < 8; k++) {
cout << k << " " << diamond100TP->speciesName(k)
<< " "
<< x[k] << endl;
}
} catch (CanteraError) {
showErrors(cout);
}
return 0;
}
/***********************************************************/

View file

@ -1,28 +0,0 @@
Number of species = 4
Number of species in diamond = 1
Number of species in diamond_100 = 8
Number of reactions = 20
0 1 -8.95751e-05
1 2 4.48403e-05
2 3 -3.51539e-08
3 4 nil
4 0 3.51539e-08
5 2 nil
6 1 nil
7 1 nil
8 0 nil
9 4 nil
10 3 nil
11 3 nil
12 2 nil
sum = nil
growth rate = 0.43183 microns per hour
Coverages:
0 c6HH 0.462262
1 c6H* 0.037052
2 c6*H 0.474283
3 c6** 0.0219445
4 c6HM 0.00174648
5 c6HM* 2.56272e-05
6 c6*M 0.00264858
7 c6B 3.8171e-05

View file

@ -1,25 +0,0 @@
from Cantera import *
# import the bulk phases
g, dbulk = importPhases('diamond.cti', ['gas','diamond'])
# import the interface
d = importInterface('diamond.cti', 'diamond_100', phases = [g, dbulk])
mw = dbulk.molarMasses()[0] #mol. wt. of carbin
t = g.temperature()
p = g.pressure()
x = g.moleFractions()
ih = g.speciesIndex('H')
f = open('d.csv', 'w')
for n in range (20):
x[ih] /= 1.4
g.setState_TPX(t, p, x)
# integrate the coverage equations to steady state
d.advanceCoverages(100.0)
cdot = d.netProductionRates(phase = dbulk) [0] #net rate of C(d production /m^2
mdot = mw * cdot
linear_rate = mdot/dbulk.density()
writeCSV(f, [x[ih], rate]+list(d.coverages()))
f.close()

View file

@ -1,31 +0,0 @@
from Cantera import *
import math
g, dbulk = importPhases('diamond.cti',['gas','diamond'])
d = importInterface('diamond.cti','diamond_100',phases = [g, dbulk])
ns = d.nSpecies()
mw = dbulk.molarMasses()[0]
t = 1200.0
x = g.moleFractions()
p = 20.0*OneAtm/760.0
g.setState_TPX(t, p, x)
ih = g.speciesIndex('H')
xh0 = x[ih]
f = open('d.csv','w')
#writeCSV(f, ['H mole Fraction', 'Rate']+d.speciesNames())
for n in range(20):
x[ih] /= 1.4
g.setState_TPX(t, p, x)
d.advanceCoverages(10.0)
cdot = d.netProductionRates(phase = dbulk)[0]
mdot = mw*cdot
rate = mdot/dbulk.density()
print x[ih], rate*1.0e6*3600.0
writeCSV(f,[x[ih],rate]+list(d.coverages()))
f.close()