mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[Test] Use YAML input files as reference for ctml2yaml tests
This is necessary so these tests can be retained after the XML format is removed and only the ctml2yaml conversion tool remains.
This commit is contained in:
@@ -812,11 +812,19 @@ class cti2yamlTest(utilities.CanteraTest):
|
||||
self.checkTransport(ctiGas, yamlGas, [298, 1001, 2400])
|
||||
|
||||
class ctml2yamlTest(utilities.CanteraTest):
|
||||
def convert(self, basename, src_dir=None):
|
||||
if src_dir is None:
|
||||
src_dir = self.test_data_path
|
||||
|
||||
ctml2yaml.convert(
|
||||
Path(src_dir) / f"{basename}.xml",
|
||||
self.test_work_path / f"{basename}-from-xml.yaml",
|
||||
)
|
||||
|
||||
def checkConversion(self, basename, cls=ct.Solution, ctmlphases=(),
|
||||
yamlphases=(), **kwargs):
|
||||
ctmlPhase = cls(basename + '.xml', adjacent=ctmlphases, **kwargs)
|
||||
yamlPhase = cls(basename + '.yaml', adjacent=yamlphases, **kwargs)
|
||||
ctmlPhase = cls(f"{basename}-from-xml.yaml", adjacent=ctmlphases, **kwargs)
|
||||
yamlPhase = cls(f"{basename}.yaml", adjacent=yamlphases, **kwargs)
|
||||
|
||||
self.assertEqual(ctmlPhase.element_names, yamlPhase.element_names)
|
||||
self.assertEqual(ctmlPhase.species_names, yamlPhase.species_names)
|
||||
@@ -884,10 +892,7 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
|
||||
@utilities.slow_test
|
||||
def test_gri30(self):
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / "gri30.xml",
|
||||
self.test_work_path / "gri30.yaml",
|
||||
)
|
||||
self.convert("gri30", self.cantera_data_path)
|
||||
ctmlPhase, yamlPhase = self.checkConversion('gri30')
|
||||
X = {'O2': 0.3, 'H2': 0.1, 'CH4': 0.2, 'CO2': 0.4}
|
||||
ctmlPhase.X = X
|
||||
@@ -897,19 +902,14 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkTransport(ctmlPhase, yamlPhase, [298, 1001, 2400])
|
||||
|
||||
def test_pdep(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "pdep-test.xml",
|
||||
self.test_work_path / "pdep-test.yaml",
|
||||
)
|
||||
self.convert("pdep-test")
|
||||
ctmlPhase, yamlPhase = self.checkConversion('pdep-test')
|
||||
# Chebyshev coefficients in XML are truncated to 6 digits, limiting accuracy
|
||||
self.checkKinetics(ctmlPhase, yamlPhase, [300, 1000, 2200],
|
||||
[100, ct.one_atm, 2e5, 2e6, 9.9e6])
|
||||
[100, ct.one_atm, 2e5, 2e6, 9.9e6], tol=2e-4)
|
||||
|
||||
def test_ptcombust(self):
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / "ptcombust.xml",
|
||||
self.test_work_path / "ptcombust.yaml",
|
||||
)
|
||||
self.convert("ptcombust", self.cantera_data_path)
|
||||
ctmlGas, yamlGas = self.checkConversion('ptcombust')
|
||||
ctmlSurf, yamlSurf = self.checkConversion('ptcombust', ct.Interface,
|
||||
name='Pt_surf', ctmlphases=[ctmlGas], yamlphases=[yamlGas])
|
||||
@@ -919,10 +919,7 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkKinetics(ctmlSurf, yamlSurf, [500, 1200], [1e4, 3e5])
|
||||
|
||||
def test_ptcombust_motzwise(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "ptcombust-motzwise.xml",
|
||||
self.test_work_path / "ptcombust-motzwise.yaml",
|
||||
)
|
||||
self.convert("ptcombust-motzwise")
|
||||
ctmlGas, yamlGas = self.checkConversion('ptcombust-motzwise')
|
||||
ctmlSurf, yamlSurf = self.checkConversion('ptcombust-motzwise', ct.Interface,
|
||||
name='Pt_surf', ctmlphases=[ctmlGas], yamlphases=[yamlGas])
|
||||
@@ -932,10 +929,7 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkKinetics(ctmlSurf, yamlSurf, [500, 1200], [1e4, 3e5])
|
||||
|
||||
def test_sofc(self):
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / "sofc.xml",
|
||||
self.test_work_path / "sofc.yaml",
|
||||
)
|
||||
self.convert("sofc", self.cantera_data_path)
|
||||
ctmlGas, yamlGas = self.checkConversion('sofc')
|
||||
ctmlMetal, yamlMetal = self.checkConversion('sofc', name='metal')
|
||||
ctmlOxide, yamlOxide = self.checkConversion('sofc', name='oxide_bulk')
|
||||
@@ -957,24 +951,14 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkKinetics(ctml_tpb, yaml_tpb, [900, 1000, 1100], [1e5])
|
||||
|
||||
def test_liquidvapor(self):
|
||||
output_file = self.test_work_path / "liquidvapor.yaml"
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / "liquidvapor.xml", output_file,
|
||||
)
|
||||
for name in ['water', 'nitrogen', 'methane', 'hydrogen', 'oxygen',
|
||||
'hfc134a', 'carbondioxide', 'heptane']:
|
||||
self.convert("liquidvapor", self.cantera_data_path)
|
||||
for name in ['water', 'nitrogen', 'methane', 'hydrogen', 'oxygen', 'heptane']:
|
||||
ctmlPhase, yamlPhase = self.checkConversion('liquidvapor', name=name)
|
||||
self.checkThermo(ctmlPhase, yamlPhase,
|
||||
[1.3 * ctmlPhase.min_temp, 0.7 * ctmlPhase.max_temp])
|
||||
# The output file must be removed after this test because it shadows
|
||||
# a file distributed with Cantera that is used in other tests.
|
||||
output_file.unlink()
|
||||
|
||||
def test_Redlich_Kwong_CO2(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "co2_RK_example.xml",
|
||||
self.test_work_path / "co2_RK_example.yaml",
|
||||
)
|
||||
self.convert("co2_RK_example")
|
||||
ctmlGas, yamlGas = self.checkConversion('co2_RK_example')
|
||||
for P in [1e5, 2e6, 1.3e7]:
|
||||
yamlGas.TP = ctmlGas.TP = 300, P
|
||||
@@ -982,20 +966,14 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
|
||||
@utilities.slow_test
|
||||
def test_Redlich_Kwong_ndodecane(self):
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / "nDodecane_Reitz.xml",
|
||||
self.test_work_path / "nDodecane_Reitz.yaml",
|
||||
)
|
||||
self.convert("nDodecane_Reitz", self.cantera_data_path)
|
||||
ctmlGas, yamlGas = self.checkConversion('nDodecane_Reitz')
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 400, 500])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [300, 500, 1300], [1e5, 2e6, 1.4e7],
|
||||
1e-6)
|
||||
|
||||
def test_diamond(self):
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / "diamond.xml",
|
||||
self.test_work_path / "diamond.yaml",
|
||||
)
|
||||
self.convert("diamond", self.cantera_data_path)
|
||||
ctmlGas, yamlGas = self.checkConversion('diamond', name='gas')
|
||||
ctmlSolid, yamlSolid = self.checkConversion('diamond', name='diamond')
|
||||
ctmlSurf, yamlSurf = self.checkConversion('diamond',
|
||||
@@ -1007,10 +985,7 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
|
||||
def test_lithium_ion_battery(self):
|
||||
name = 'lithium_ion_battery'
|
||||
ctml2yaml.convert(
|
||||
self.cantera_data_path / (name + ".xml"),
|
||||
self.test_work_path / (name + ".yaml"),
|
||||
)
|
||||
self.convert(name, self.cantera_data_path)
|
||||
ctmlAnode, yamlAnode = self.checkConversion(name, name='anode')
|
||||
ctmlCathode, yamlCathode = self.checkConversion(name, name='cathode')
|
||||
ctmlMetal, yamlMetal = self.checkConversion(name, name='electron')
|
||||
@@ -1045,82 +1020,56 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkKinetics(ctmlCathodeInt, yamlCathodeInt, [300], [1e5])
|
||||
|
||||
def test_noxNeg(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "noxNeg.xml",
|
||||
self.test_work_path / "noxNeg.yaml",
|
||||
)
|
||||
self.convert("noxNeg")
|
||||
ctmlGas, yamlGas = self.checkConversion('noxNeg')
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 1000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [300, 1000], [1e5])
|
||||
|
||||
def test_ch4_ion(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "ch4_ion.xml",
|
||||
self.test_work_path / "ch4_ion.yaml",
|
||||
)
|
||||
self.convert("ch4_ion")
|
||||
ctmlGas, yamlGas = self.checkConversion("ch4_ion")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
self.checkTransport(ctmlGas, yamlGas, [298, 1001, 2400])
|
||||
|
||||
def test_nasa9(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "nasa9-test.xml",
|
||||
self.test_work_path / "nasa9-test.yaml",
|
||||
)
|
||||
self.convert("nasa9-test")
|
||||
ctmlGas, yamlGas = self.checkConversion("nasa9-test")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
|
||||
def test_chemically_activated(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "chemically-activated-reaction.xml",
|
||||
self.test_work_path / "chemically-activated-reaction.yaml",
|
||||
)
|
||||
self.convert("chemically-activated-reaction")
|
||||
ctmlGas, yamlGas = self.checkConversion("chemically-activated-reaction")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
def test_explicit_forward_order(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "explicit-forward-order.xml",
|
||||
self.test_work_path / "explicit-forward-order.yaml",
|
||||
)
|
||||
self.convert("explicit-forward-order")
|
||||
ctmlGas, yamlGas = self.checkConversion("explicit-forward-order")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
# Accuracy limited by precision of ck2cti
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5], tol=2e-7)
|
||||
|
||||
def test_explicit_reverse_rate(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "explicit-reverse-rate.xml",
|
||||
self.test_work_path / "explicit-reverse-rate.yaml",
|
||||
)
|
||||
self.convert("explicit-reverse-rate")
|
||||
ctmlGas, yamlGas = self.checkConversion("explicit-reverse-rate")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
def test_explicit_third_bodies(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "explicit-third-bodies.xml",
|
||||
self.test_work_path / "explicit-third-bodies.yaml",
|
||||
)
|
||||
self.convert("explicit-third-bodies")
|
||||
ctmlGas, yamlGas = self.checkConversion("explicit-third-bodies")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
def test_fractional_stoich_coeffs(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "frac.xml",
|
||||
self.test_work_path / "frac.yaml",
|
||||
)
|
||||
self.convert("frac")
|
||||
ctmlGas, yamlGas = self.checkConversion("frac")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
def test_water_IAPWS95_thermo(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "liquid-water.xml",
|
||||
self.test_work_path / "liquid-water.yaml",
|
||||
)
|
||||
self.convert("liquid-water")
|
||||
ctmlWater, yamlWater = self.checkConversion("liquid-water")
|
||||
self.checkThermo(ctmlWater, yamlWater, [300, 500, 1300, 2000], pressure=22064000.0)
|
||||
self.assertEqual(ctmlWater.transport_model, yamlWater.transport_model)
|
||||
@@ -1135,9 +1084,9 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
|
||||
def test_hmw_nacl_phase(self):
|
||||
basename = "HMW_NaCl_sp1977_alt"
|
||||
xml_file = self.test_data_path / (basename + ".xml")
|
||||
self.convert(basename)
|
||||
xml_file = self.test_work_path / (basename + "-from-xml.yaml")
|
||||
yaml_file = self.test_data_path / (basename + ".yaml")
|
||||
ctml2yaml.convert(xml_file, yaml_file)
|
||||
|
||||
# Can only be loaded by ThermoPhase due to a bug in TransportFactory
|
||||
# ThermoPhase does not have reactions (neither does the input file)
|
||||
@@ -1149,18 +1098,12 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_NaCl_solid_phase(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "NaCl_Solid.xml",
|
||||
self.test_work_path / "NaCl_Solid.yaml",
|
||||
)
|
||||
self.convert("NaCl_Solid")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("NaCl_Solid")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500, 1300, 2000])
|
||||
|
||||
def test_DH_NaCl_phase(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "debye-huckel-all.xml",
|
||||
self.test_work_path / "debye-huckel-all.yaml",
|
||||
)
|
||||
self.convert("debye-huckel-all")
|
||||
for name in [
|
||||
"debye-huckel-dilute",
|
||||
"debye-huckel-B-dot-ak",
|
||||
@@ -1171,18 +1114,14 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
# Can only be loaded by ThermoPhase due to a bug in TransportFactory
|
||||
# ThermoPhase does not have reactions (neither does the input file)
|
||||
# so we can't use checkConversion
|
||||
ctmlPhase = ct.ThermoPhase("debye-huckel-all.xml", name=name)
|
||||
ctmlPhase = ct.ThermoPhase("debye-huckel-all-from-xml.yaml", name=name)
|
||||
yamlPhase = ct.ThermoPhase("debye-huckel-all.yaml", name=name)
|
||||
self.assertEqual(ctmlPhase.element_names, yamlPhase.element_names)
|
||||
self.assertEqual(ctmlPhase.species_names, yamlPhase.species_names)
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_Maskell_solid_soln(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "MaskellSolidSolnPhase_valid.xml",
|
||||
self.test_work_path / "MaskellSolidSolnPhase_valid.yaml",
|
||||
)
|
||||
|
||||
self.convert("MaskellSolidSolnPhase_valid")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("MaskellSolidSolnPhase_valid")
|
||||
# Maskell phase doesn't support partial molar properties, so just check density
|
||||
for T in [300, 500, 1300, 2000]:
|
||||
@@ -1191,11 +1130,8 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.assertNear(ctmlPhase.density, yamlPhase.density)
|
||||
|
||||
def test_mock_ion(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "mock_ion.xml",
|
||||
self.test_work_path / "mock_ion.yaml",
|
||||
)
|
||||
ctmlPhase = ct.ThermoPhase("mock_ion.xml")
|
||||
self.convert("mock_ion")
|
||||
ctmlPhase = ct.ThermoPhase("mock_ion-from-xml.yaml")
|
||||
yamlPhase = ct.ThermoPhase("mock_ion.yaml")
|
||||
# Due to changes in how the species elements are specified, the composition
|
||||
# of the species differs from XML to YAML (electrons are used to specify charge
|
||||
@@ -1212,37 +1148,24 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.assertNear(ctmlPhase.density, yamlPhase.density)
|
||||
|
||||
def test_Redlich_Kister(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "RedlichKisterVPSSTP_valid.xml",
|
||||
self.test_work_path / "RedlichKisterVPSSTP_valid.yaml",
|
||||
)
|
||||
|
||||
self.convert("RedlichKisterVPSSTP_valid")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("RedlichKisterVPSSTP_valid")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_species_names(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "species-names.xml",
|
||||
self.test_work_path / "species-names.yaml",
|
||||
)
|
||||
self.convert("species-names")
|
||||
ctmlGas, yamlGas = self.checkConversion('species-names')
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
|
||||
def test_sri_falloff_reaction(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "sri-falloff.xml",
|
||||
self.test_work_path / "sri-falloff.yaml",
|
||||
)
|
||||
self.convert("sri-falloff")
|
||||
ctmlGas, yamlGas = self.checkConversion("sri-falloff")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
def test_vpss_and_hkft(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "pdss_hkft.xml",
|
||||
self.test_work_path / "pdss_hkft.yaml",
|
||||
)
|
||||
ctmlPhase = ct.ThermoPhase("pdss_hkft.xml")
|
||||
self.convert("pdss_hkft")
|
||||
ctmlPhase = ct.ThermoPhase("pdss_hkft-from-xml.yaml")
|
||||
yamlPhase = ct.ThermoPhase("pdss_hkft.yaml")
|
||||
# Due to changes in how the species elements are specified, the
|
||||
# composition of the species differs from XML to YAML (electrons are used
|
||||
@@ -1255,38 +1178,29 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_lattice_solid(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "Li7Si3_ls.xml",
|
||||
self.test_work_path / "Li7Si3_ls.yaml",
|
||||
)
|
||||
self.convert("Li7Si3_ls")
|
||||
# Use ThermoPhase to avoid constructing a default Transport object which
|
||||
# throws an error for the LatticeSolidPhase
|
||||
basename = "Li7Si3_ls"
|
||||
name = "Li7Si3_and_Interstitials(S)"
|
||||
ctmlPhase = ct.ThermoPhase(basename + ".xml", name=name)
|
||||
ctmlPhase = ct.ThermoPhase(basename + "-from-xml.yaml", name=name)
|
||||
yamlPhase = ct.ThermoPhase(basename + ".yaml", name=name)
|
||||
self.assertEqual(ctmlPhase.element_names, yamlPhase.element_names)
|
||||
self.assertEqual(ctmlPhase.species_names, yamlPhase.species_names)
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_margules(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "LiKCl_liquid.xml",
|
||||
self.test_work_path / "LiKCl_liquid.yaml",
|
||||
)
|
||||
self.convert("LiKCl_liquid")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("LiKCl_liquid")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_idealsolidsoln(self):
|
||||
with self.assertWarnsRegex(UserWarning, "SolidKinetics type is not implemented"):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "IdealSolidSolnPhaseExample.xml",
|
||||
self.test_work_path / "IdealSolidSolnPhaseExample.yaml",
|
||||
)
|
||||
self.convert("IdealSolidSolnPhaseExample")
|
||||
|
||||
# SolidKinetics is not implemented, so can't create a Kinetics class instance.
|
||||
basename = "IdealSolidSolnPhaseExample"
|
||||
ctmlPhase = ct.ThermoPhase(basename + ".xml")
|
||||
ctmlPhase = ct.ThermoPhase(basename + "-from-xml.yaml")
|
||||
yamlPhase = ct.ThermoPhase(basename + ".yaml")
|
||||
|
||||
self.assertEqual(ctmlPhase.element_names, yamlPhase.element_names)
|
||||
@@ -1294,50 +1208,29 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_idealmolalsoln(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "IdealMolalSolnPhaseExample.xml",
|
||||
self.test_work_path / "IdealMolalSolnPhaseExample.yaml",
|
||||
)
|
||||
|
||||
self.convert("IdealMolalSolnPhaseExample")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("IdealMolalSolnPhaseExample")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_transport_models(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "transport_models_test.xml",
|
||||
self.test_work_path / "transport_models_test.yaml",
|
||||
)
|
||||
self.convert("transport_models_test")
|
||||
for name in ["UnityLewis", "CK_Mix", "CK_Multi", "HighP"]:
|
||||
ctmlPhase, yamlPhase = self.checkConversion("transport_models_test", name=name)
|
||||
self.checkTransport(ctmlPhase, yamlPhase, [298, 1001, 2500])
|
||||
|
||||
def test_nonreactant_orders(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "reaction-orders.xml",
|
||||
self.test_work_path / "reaction-orders.yaml",
|
||||
)
|
||||
|
||||
self.convert("reaction-orders")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("reaction-orders")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
self.checkKinetics(ctmlPhase, yamlPhase, [300, 1001, 2500], [1e5, 10e5])
|
||||
|
||||
def test_species_ss_temperature_polynomials(self):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "Li_Liquid.xml",
|
||||
self.test_work_path / "Li_Liquid.yaml",
|
||||
)
|
||||
|
||||
self.convert("Li_Liquid")
|
||||
ctmlPhase, yamlPhase = self.checkConversion("Li_Liquid")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_duplicate_section_ids(self):
|
||||
with self.assertWarnsRegex(UserWarning, "Duplicate 'speciesData' id"):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "duplicate-speciesData-ids.xml",
|
||||
self.test_work_path / "duplicate-speciesData-ids.yaml",
|
||||
)
|
||||
self.convert("duplicate-speciesData-ids")
|
||||
with self.assertWarnsRegex(UserWarning, "Duplicate 'reactionData' id"):
|
||||
ctml2yaml.convert(
|
||||
self.test_data_path / "duplicate-reactionData-ids.xml",
|
||||
self.test_work_path / "duplicate-reactionData-ids.yaml",
|
||||
)
|
||||
self.convert("duplicate-reactionData-ids")
|
||||
|
||||
83
test/data/IdealMolalSolnPhaseExample.yaml
Normal file
83
test/data/IdealMolalSolnPhaseExample.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
description: Totally made up data just to test the CTML->YAML converter
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 14:14:41 -0500
|
||||
input-files: [test/data/IdealMolalSolnPhaseExample.xml]
|
||||
|
||||
phases:
|
||||
- name: NaCl_electrolyte
|
||||
elements: [O, H, C, E, Fe, Si, N, Na, Cl]
|
||||
species:
|
||||
- species_waterSolution: [H2O(L), Cl-, H+, Na+, OH-]
|
||||
thermo: ideal-molal-solution
|
||||
cutoff:
|
||||
model: none
|
||||
gamma_o: 1.0
|
||||
gamma_k: 1.0
|
||||
X_o: 1.0
|
||||
c_0: 1.0
|
||||
slope_f: 1.0
|
||||
slope_g: 1.0
|
||||
state: {T: 298.15 K, P: 1.01325e+05 Pa, molalities: {Na+: 6.0954, Cl-: 6.0954, H+: 2.1628e-09,
|
||||
OH-: 1.3977e-06}}
|
||||
|
||||
species_waterSolution:
|
||||
- name: H2O(L)
|
||||
composition: {H: 2.0, O: 1.0}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [273.15, 600.0]
|
||||
data:
|
||||
- [72.5575005, -0.662445402, 2.56198746e-03, -4.36591923e-06, 2.78178981e-09,
|
||||
-4.18865499e+04, -288.280137]
|
||||
equation-of-state:
|
||||
model: liquid-water-IAPWS95
|
||||
- name: Na+
|
||||
composition: {Na: 1.0, E: -1.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [293.15, 593.15]
|
||||
data:
|
||||
- [-5.799347558e+04, 3.05112604e+05, -5.922221591e+05, 4.019779827e+05, 804.419598,
|
||||
1.062524901e+04, -1.337962298e+05]
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 8.34e-03
|
||||
- name: Cl-
|
||||
composition: {Cl: 1.0, E: 1.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [298.0, 623.15]
|
||||
data:
|
||||
- [5.66962042e+04, -2.97835978e+05, 5.81426549e+05, -4.01759991e+05, -804.301136,
|
||||
-1.08738257e+04, 1.30650697e+05]
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 8.34e-03
|
||||
- name: H+
|
||||
composition: {H: 1.0, E: -1.0}
|
||||
thermo:
|
||||
model: piecewise-Gibbs
|
||||
reference-pressure: 1.0e+05
|
||||
h0: 0.0 cal/mol
|
||||
T-min: 273.15
|
||||
T-max: 625.15
|
||||
dimensionless: true
|
||||
data:
|
||||
273.15: 0.0
|
||||
298.15: 0.0
|
||||
623.15: 0.0
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 0.0
|
||||
- name: OH-
|
||||
composition: {O: 1.0, H: 1.0, E: 1.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [298.0, 623.15]
|
||||
data:
|
||||
- [4.467499961e+04, -2.349430414e+05, 4.60522826e+05, -3.206951836e+05, -638.5044716,
|
||||
-8683.955813, 1.028742667e+05]
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 8.34e-03
|
||||
61
test/data/Li7Si3_ls.yaml
Normal file
61
test/data/Li7Si3_ls.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 15:33:13 -0500
|
||||
input-files: [test/data/Li7Si3_ls.xml]
|
||||
|
||||
phases:
|
||||
- name: Li7Si3_and_Interstitials(S)
|
||||
elements: [Li, Si]
|
||||
thermo: compound-lattice
|
||||
composition:
|
||||
Li7Si3(S): 1.0
|
||||
Li7Si3_Interstitial: 1.0
|
||||
- name: Li7Si3(S)
|
||||
elements: [Li, Si]
|
||||
species:
|
||||
- species_LiSi(S): [Li7Si3(S)]
|
||||
thermo: fixed-stoichiometry
|
||||
- name: Li7Si3_Interstitial
|
||||
elements: [Li, Si]
|
||||
species:
|
||||
- species_LiSi(S): [Li(i), V(i)]
|
||||
thermo: lattice
|
||||
site-density: 0.01046344 gmol/cm^3
|
||||
state: {T: 725.0 K, P: 1.0 atm, X: {Li(i): 0.01, V(i): 0.99}}
|
||||
|
||||
species_LiSi(S):
|
||||
- name: Li7Si3(S)
|
||||
composition: {Li: 7.0, Si: 3.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [250.0, 700.0, 2700.0]
|
||||
data:
|
||||
- [295.73961, -6.753295, -44.538551, 29.738846, -1.022387, -348.88919, 554.35647]
|
||||
- [250.51429, 51.125155, -28.341244, 6.242135, 1.346861, -328.46578, 498.84106]
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
density: 1.39 g/cm^3
|
||||
- name: Li7d3Si(S)
|
||||
composition: {Li: 2.3333333333333, Si: 1.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [250.0, 700.0, 2700.0]
|
||||
data:
|
||||
- [98.57987, -2.2510983, -14.846184, 9.9129487, -0.34079567, -116.2964, 184.78549]
|
||||
- [83.504763, 17.041718, -9.4470813, 2.0807117, 0.44895367, -109.48859, 166.28035]
|
||||
- name: Li(i)
|
||||
composition: {Li: 1.0}
|
||||
thermo:
|
||||
model: constant-cp
|
||||
T0: 298.15 K
|
||||
h0: 0.0 J/gmol
|
||||
s0: 20.0 J/mol/K
|
||||
cp0: 20.0 J/mol/K
|
||||
- name: V(i)
|
||||
composition: {}
|
||||
thermo:
|
||||
model: constant-cp
|
||||
T0: 298.15 K
|
||||
h0: 89.8 J/mol
|
||||
s0: 0.0 J/mol/K
|
||||
cp0: 0.0 J/mol/K
|
||||
38
test/data/Li_Liquid.yaml
Normal file
38
test/data/Li_Liquid.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 15:54:52 -0500
|
||||
input-files: [test/data/Li_Liquid.xml]
|
||||
|
||||
phases:
|
||||
- name: Li(L)
|
||||
elements: [Li]
|
||||
species:
|
||||
- species_Li(L): [Li(L), Li(L)2]
|
||||
thermo: Margules
|
||||
state: {T: 300.0 K, P: 1.01325e+05 Pa, X: {Li(L): 0.5, Li(L)2: 0.5}}
|
||||
|
||||
species_Li(L):
|
||||
- name: Li(L)
|
||||
composition: {Li: 1.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [298.0, 700.0, 3000.0]
|
||||
data:
|
||||
- [26.3072, 30.4657, -69.1692, 44.1951, 0.0776, -6.0337, 59.8106]
|
||||
- [22.6832, 10.476, -6.5428, 1.3255, 0.8783, -2.0426, 62.8859]
|
||||
equation-of-state:
|
||||
model: density-temperature-polynomial
|
||||
data: [0.536504 g/L, -1.04279e-4 g/L/K, 3.84825e-9 g/L/K^2, -5.2853e-12 g/L/K^3]
|
||||
- name: Li(L)2
|
||||
composition: {Li: 1.0}
|
||||
note: This species is invented for the purposes of the test
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [298.0, 700.0, 3000.0]
|
||||
data:
|
||||
- [26.3072, 30.4657, -69.1692, 44.1951, 0.0776, -6.0337, 59.8106]
|
||||
- [22.6832, 10.476, -6.5428, 1.3255, 0.8783, -2.0426, 62.8859]
|
||||
equation-of-state:
|
||||
model: molar-volume-temperature-polynomial
|
||||
data: [0.536504 cm^3/mol, -1.04279e-4 cm^3/mol/K, 3.84825e-9 cm^3/mol/K^2, -5.2853e-12
|
||||
cm^3/mol/K^3]
|
||||
42
test/data/RedlichKisterVPSSTP_valid.yaml
Normal file
42
test/data/RedlichKisterVPSSTP_valid.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 14:09:10 -0500
|
||||
input-files: [test/data/RedlichKisterVPSSTP_valid.xml]
|
||||
|
||||
phases:
|
||||
- name: LiC6_and_Vacancies
|
||||
elements: [Li, C]
|
||||
species: [Li(C6), V(C6)]
|
||||
thermo: Redlich-Kister
|
||||
interactions:
|
||||
- species: [Li(C6), V(C6)]
|
||||
excess-enthalpy: [-3.268E6 J/kmol, 3.955E6 J/kmol, -4.573E6 J/kmol, 6.147E6 J/kmol,
|
||||
-3.339E6 J/kmol, 1.117E7 J/kmol, 2.997E5 J/kmol, -4.866E7 J/kmol, 1.362E5 J/kmol,
|
||||
1.373E8 J/kmol, -2.129E7 J/kmol, -1.722E8 J/kmol, 3.956E7 J/kmol, 9.302E7 J/kmol,
|
||||
-3.280E7 J/kmol]
|
||||
excess-entropy: [0.0 J/kmol/K]
|
||||
state: {T: 298.15 K, P: 1.01325e+05 Pa, X: {Li(C6): 0.6, V(C6): 0.4}}
|
||||
|
||||
species:
|
||||
- name: Li(C6)
|
||||
composition: {C: 6.0, Li: 1.0}
|
||||
thermo:
|
||||
model: constant-cp
|
||||
T0: 298.15 K
|
||||
h0: -11.65 kJ/mol
|
||||
s0: 0.0 J/mol/K
|
||||
cp0: 0.0 J/mol/K
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 0.036
|
||||
- name: V(C6)
|
||||
composition: {C: 6.0}
|
||||
thermo:
|
||||
model: constant-cp
|
||||
T0: 298.15 K
|
||||
h0: 0.0 kJ/mol
|
||||
s0: 0.0 J/mol/K
|
||||
cp0: 0.0 J/mol/K
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 0.036
|
||||
79
test/data/explicit-forward-order.yaml
Normal file
79
test/data/explicit-forward-order.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
generator: ck2yaml
|
||||
input-files: [explicit-forward-order.inp, dummy-thermo.dat]
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sun, 05 Dec 2021 22:01:27 -0500
|
||||
|
||||
units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol}
|
||||
|
||||
phases:
|
||||
- name: gas
|
||||
thermo: ideal-gas
|
||||
elements: [H, C, Ar]
|
||||
species: [H, AR, R1A, R1B, P1]
|
||||
kinetics: gas
|
||||
state: {T: 300.0, P: 1 atm}
|
||||
|
||||
species:
|
||||
- name: H
|
||||
composition: {H: 1}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22,
|
||||
2.54736599e+04, -0.446682853]
|
||||
- [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22,
|
||||
2.54736599e+04, -0.446682914]
|
||||
note: 'NOTE: All of this thermo data is bogus'
|
||||
- name: AR
|
||||
composition: {Ar: 1}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [300.0, 1000.0, 5000.0]
|
||||
data:
|
||||
- [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.366]
|
||||
- [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.366]
|
||||
note: '120186'
|
||||
- name: R1A
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: R1B
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: P1
|
||||
composition: {C: 2, H: 7}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
|
||||
reactions:
|
||||
- equation: R1A + R1B => H + P1 # Reaction 1
|
||||
duplicate: true
|
||||
rate-constant: {A: 1.0e+12, b: 0.0, Ea: 2.0e+04}
|
||||
orders: {R1A: 1.5, R1B: 0.5}
|
||||
- equation: H + P1 => R1A + R1B # Reaction 2
|
||||
rate-constant: {A: 5.0e+13, b: -2.0, Ea: 5000.0}
|
||||
orders: {P1: 0.2}
|
||||
- equation: R1A + R1B => H + P1 # Reaction 3
|
||||
duplicate: true
|
||||
rate-constant: {A: 1.0e+12, b: 0.0, Ea: 2.0e+04}
|
||||
orders: {R1A: 3.0, R1B: 0.0}
|
||||
16
test/data/liquid-water.yaml
Normal file
16
test/data/liquid-water.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sun, 19 Dec 2021 10:34:37 -0500
|
||||
input-files: [test/data/liquid-water.xml]
|
||||
|
||||
phases:
|
||||
- name: water
|
||||
elements: [O, H]
|
||||
species: [H2O]
|
||||
thermo: liquid-water-IAPWS95
|
||||
transport: water
|
||||
state: {T: 300.0 K, P: 1.01325e+05 Pa}
|
||||
|
||||
species:
|
||||
- name: H2O
|
||||
composition: {H: 2.0, O: 1.0}
|
||||
38
test/data/mock_ion.yaml
Normal file
38
test/data/mock_ion.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 15:40:33 -0500
|
||||
input-files: [test/data/mock_ion.xml]
|
||||
|
||||
phases:
|
||||
- name: mock_ion_phase
|
||||
elements: [K, Cl, E]
|
||||
species: [K+, Cl-]
|
||||
thermo: ions-from-neutral-molecule
|
||||
neutral-phase: mock_neutral
|
||||
- name: mock_neutral
|
||||
elements: [K, Cl]
|
||||
species: [KCl(L)]
|
||||
thermo: Margules
|
||||
|
||||
species:
|
||||
- name: K+
|
||||
composition: {K: 1.0, E: -1.0}
|
||||
equation-of-state:
|
||||
model: ions-from-neutral-molecule
|
||||
multipliers: {KCl(L): 1.2}
|
||||
- name: Cl-
|
||||
composition: {Cl: 1.0, E: 1.0}
|
||||
equation-of-state:
|
||||
model: ions-from-neutral-molecule
|
||||
multipliers: {KCl(L): 1.5}
|
||||
special-species: true
|
||||
- name: KCl(L)
|
||||
composition: {K: 1.0, Cl: 1.0}
|
||||
thermo:
|
||||
model: Shomate
|
||||
temperature-ranges: [700.0, 2000.0]
|
||||
data:
|
||||
- [73.59698, 0.0, 0.0, 0.0, 0.0, -443.7341, 175.7209]
|
||||
equation-of-state:
|
||||
model: constant-volume
|
||||
molar-volume: 37.57 cm^3/gmol
|
||||
60
test/data/pdss_hkft.yaml
Normal file
60
test/data/pdss_hkft.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 16:00:33 -0500
|
||||
input-files: [test/data/pdss_hkft.xml]
|
||||
|
||||
phases:
|
||||
- name: vpss_soln_pdss_hkft_phase
|
||||
elements: [Na, Cl, H, O, E]
|
||||
species: [H2O(L), Na+, Cl-, H+, OH-]
|
||||
thermo: ideal-solution-VPSS
|
||||
standard-concentration-basis: solvent_volume
|
||||
|
||||
species:
|
||||
- name: H2O(L)
|
||||
composition: {H: 2.0, O: 1.0}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [273.15, 600.0]
|
||||
data:
|
||||
- [72.5575005, -0.662445402, 2.56198746e-03, -4.36591923e-06, 2.78178981e-09,
|
||||
-4.18865499e+04, -288.280137]
|
||||
equation-of-state:
|
||||
model: liquid-water-IAPWS95
|
||||
- name: Na+
|
||||
composition: {Na: 1.0, E: -1.0}
|
||||
equation-of-state:
|
||||
model: HKFT
|
||||
h0: -5.7433e+04 cal/gmol
|
||||
s0: 13.96 cal/gmol/K
|
||||
a: [0.1839 cal/gmol/bar, -228.5 cal/gmol, 3.256 cal*K/gmol/bar, -2.726e+04 cal*K/gmol]
|
||||
c: [18.18 cal/gmol/K, -2.981e+04 cal*K/gmol]
|
||||
omega: 3.306e+04 cal/gmol
|
||||
- name: Cl-
|
||||
composition: {Cl: 1.0, E: 1.0}
|
||||
equation-of-state:
|
||||
model: HKFT
|
||||
g0: -3.1379e+04 cal/gmol
|
||||
s0: 13.56 cal/gmol/K
|
||||
a: [0.4032 cal/gmol/bar, 480.1 cal/gmol, 5.563 cal*K/gmol/bar, -2.847e+04 cal*K/gmol]
|
||||
c: [-4.4 cal/gmol/K, -5.714e+04 cal*K/gmol]
|
||||
omega: 1.456e+05 cal/gmol
|
||||
- name: H+
|
||||
composition: {H: 1.0, E: -1.0}
|
||||
equation-of-state:
|
||||
model: HKFT
|
||||
g0: 0.0 cal/gmol
|
||||
s0: 0.0 cal/gmol/K
|
||||
a: [0.0 cal/gmol/bar, 0.0 cal/gmol, 0.0 cal*K/gmol/bar, 0.0 cal*K/gmol]
|
||||
c: [0.0 cal/gmol/K, 0.0 cal*K/gmol]
|
||||
omega: 0.0 cal/gmol
|
||||
- name: OH-
|
||||
composition: {O: 1.0, H: 1.0, E: 1.0}
|
||||
equation-of-state:
|
||||
model: HKFT
|
||||
g0: -3.7595e+04 cal/gmol
|
||||
h0: -5.4977e+04 cal/gmol
|
||||
s0: -2.56 cal/gmol/K
|
||||
a: [0.12527 cal/gmol/bar, 7.38 cal/gmol, 1.8423 cal*K/gmol/bar, -2.7821e+04 cal*K/gmol]
|
||||
c: [4.15 cal/gmol/K, -1.0346e+05 cal*K/gmol]
|
||||
omega: 1.7246e+05 cal/gmol
|
||||
34
test/data/reaction-orders.yaml
Normal file
34
test/data/reaction-orders.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
description: |-
|
||||
Input file to test use of non-reactant species
|
||||
generator: cti2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 15:47:12 -0500
|
||||
input-files: [reaction-orders.cti]
|
||||
|
||||
units: {length: cm, quantity: mol, activation-energy: kJ/mol}
|
||||
|
||||
phases:
|
||||
- name: gas
|
||||
thermo: ideal-gas
|
||||
elements: [O, H]
|
||||
species:
|
||||
- gri30.yaml/species: [H2, O2, H2O, OH]
|
||||
kinetics: gas
|
||||
reactions: declared-species
|
||||
state:
|
||||
T: 300.0
|
||||
P: 1.01325e+05
|
||||
|
||||
reactions:
|
||||
- equation: H2 + O2 => 2 OH # Reaction 1
|
||||
rate-constant: {A: 1.0e+13, b: 0.0, Ea: 0.0}
|
||||
orders: {HO2: -0.25}
|
||||
negative-orders: true
|
||||
nonreactant-orders: true
|
||||
note: This reaction should be skipped due to the non-existent species 'HO2'
|
||||
- equation: 2 H2 + O2 => 2 H2O # Reaction 2
|
||||
rate-constant: {A: 1.0e+13, b: 0.0, Ea: 0.0}
|
||||
orders: {H2: -0.25, OH: 0.15}
|
||||
negative-orders: true
|
||||
nonreactant-orders: true
|
||||
note: test negative orders and non-reactant orders
|
||||
152
test/data/species-names.yaml
Normal file
152
test/data/species-names.yaml
Normal file
@@ -0,0 +1,152 @@
|
||||
generator: ck2yaml
|
||||
input-files: [species-names.inp]
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sun, 05 Dec 2021 22:38:00 -0500
|
||||
|
||||
units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol}
|
||||
|
||||
phases:
|
||||
- name: gas
|
||||
thermo: ideal-gas
|
||||
elements: [H, C]
|
||||
species: [(Parens), '@#$%^-2', 'co:lons:', '[xy2]*{.}', plus+, eq=uals,
|
||||
plus, trans_butene, co, amp&ersand]
|
||||
kinetics: gas
|
||||
state: {T: 300.0, P: 1 atm}
|
||||
|
||||
species:
|
||||
- name: (Parens)
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: '@#$%^-2'
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: 'co:lons:'
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: '[xy2]*{.}'
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: plus+
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
note: nottheend
|
||||
- name: eq=uals
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: plus
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: trans_butene
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: co
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
- name: amp&ersand
|
||||
composition: {C: 1, H: 4}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [200.0, 1000.0, 3500.0]
|
||||
data:
|
||||
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
|
||||
-1.02466476e+04, -4.64130376]
|
||||
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
|
||||
-9468.34459, 18.437318]
|
||||
|
||||
reactions:
|
||||
- equation: (Parens) + @#$%^-2 <=> 2 [xy2]*{.} # Reaction 1
|
||||
rate-constant: {A: 1.2345e+12, b: 1.0, Ea: 200.0}
|
||||
- equation: 2 (Parens) + [xy2]*{.} <=> 3 @#$%^-2 # Reaction 2
|
||||
rate-constant: {A: 5.4321e+10, b: 1.0, Ea: 500.0}
|
||||
- equation: plus+ + (Parens) <=> 2 plus+ # Reaction 3
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: 2 plus+ + eq=uals <=> 3 (Parens) # Reaction 4
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: plus + plus+ <=> 2 (Parens) # Reaction 5
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: plus + eq=uals <=> plus+ + (Parens) # Reaction 6
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: 'co:lons: + eq=uals <=> 2 (Parens)' # Reaction 7
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: plus+ (+plus) <=> eq=uals (+plus) # Reaction 8
|
||||
type: falloff
|
||||
low-P-rate-constant: {A: 8.888e+08, b: 8.8, Ea: 888.8}
|
||||
high-P-rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: plus+ (+(Parens)) <=> eq=uals (+(Parens)) # Reaction 9
|
||||
type: falloff
|
||||
low-P-rate-constant: {A: 8.888e+08, b: 8.8, Ea: 888.8}
|
||||
high-P-rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: plus+ (+plus+) <=> eq=uals (+plus+) # Reaction 10
|
||||
type: falloff
|
||||
low-P-rate-constant: {A: 8.888e+08, b: 8.8, Ea: 888.8}
|
||||
high-P-rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: 'trans_butene + co:lons: <=> 2 plus+' # Reaction 11
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: 'co + co:lons: <=> 2 plus+' # Reaction 12
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
- equation: amp&ersand <=> plus+ # Reaction 13
|
||||
rate-constant: {A: 9.999e+09, b: 9.9, Ea: 999.9}
|
||||
54
test/data/transport_models_test.yaml
Normal file
54
test/data/transport_models_test.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
generator: ctml2yaml
|
||||
cantera-version: 2.6.0a3
|
||||
date: Sat, 18 Dec 2021 15:56:48 -0500
|
||||
input-files: [test/data/transport_models_test.xml]
|
||||
|
||||
phases:
|
||||
- name: UnityLewis
|
||||
elements: [H, C]
|
||||
species:
|
||||
- gri30.yaml/species: [H, H2, CH3, CH4]
|
||||
thermo: ideal-gas
|
||||
transport: unity-Lewis-number
|
||||
skip-undeclared-third-bodies: true
|
||||
kinetics: gas
|
||||
reactions:
|
||||
- gri30.yaml/reactions: declared-species
|
||||
state: {T: 1200.0 K, P: 2666.4473684210525 Pa, X: {H: 2.0e-03, H2: 0.988, CH3: 2.0e-04,
|
||||
CH4: 0.01}}
|
||||
- name: CK_Mix
|
||||
elements: [H, C]
|
||||
species:
|
||||
- gri30.yaml/species: [H, H2, CH3, CH4]
|
||||
thermo: ideal-gas
|
||||
transport: mixture-averaged-CK
|
||||
skip-undeclared-third-bodies: true
|
||||
kinetics: gas
|
||||
reactions:
|
||||
- gri30.yaml/reactions: declared-species
|
||||
state: {T: 1200.0 K, P: 2666.4473684210525 Pa, X: {H: 2.0e-03, H2: 0.988, CH3: 2.0e-04,
|
||||
CH4: 0.01}}
|
||||
- name: CK_Multi
|
||||
elements: [H, C]
|
||||
species:
|
||||
- gri30.yaml/species: [H, H2, CH3, CH4]
|
||||
thermo: ideal-gas
|
||||
transport: multicomponent-CK
|
||||
skip-undeclared-third-bodies: true
|
||||
kinetics: gas
|
||||
reactions:
|
||||
- gri30.yaml/reactions: declared-species
|
||||
state: {T: 1200.0 K, P: 2666.4473684210525 Pa, X: {H: 2.0e-03, H2: 0.988, CH3: 2.0e-04,
|
||||
CH4: 0.01}}
|
||||
- name: HighP
|
||||
elements: [H, C]
|
||||
species:
|
||||
- gri30.yaml/species: [H, H2, CH3, CH4]
|
||||
thermo: ideal-gas
|
||||
transport: high-pressure
|
||||
skip-undeclared-third-bodies: true
|
||||
kinetics: gas
|
||||
reactions:
|
||||
- gri30.yaml/reactions: declared-species
|
||||
state: {T: 1200.0 K, P: 2666.4473684210525 Pa, X: {H: 2.0e-03, H2: 0.988, CH3: 2.0e-04,
|
||||
CH4: 0.01}}
|
||||
Reference in New Issue
Block a user