mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-03 09:53:05 -05:00
[ctml2yaml] Add negative reaction orders option
This commit is contained in:
@@ -666,6 +666,9 @@ class Reaction:
|
||||
if orders:
|
||||
reaction_attribs["orders"] = orders
|
||||
|
||||
if reaction.get("negative_orders") == "yes":
|
||||
reaction_attribs["negative-orders"] = True
|
||||
|
||||
if reaction.get("duplicate", "") == "yes":
|
||||
reaction_attribs["duplicate"] = True
|
||||
|
||||
|
||||
@@ -955,6 +955,34 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
def test_chemically_activated(self):
|
||||
ctml2yaml.convert(Path(self.test_data_dir).joinpath("chemically-activated-reaction.xml"),
|
||||
Path(self.test_work_dir).joinpath("chemically-activated-reaction.yaml"))
|
||||
ctmlGas, yamlGas = self.checkConversion('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(Path(self.test_data_dir).joinpath("explicit-forward-order.xml"),
|
||||
Path(self.test_work_dir).joinpath("explicit-forward-order.yaml"))
|
||||
ctmlGas, yamlGas = self.checkConversion("explicit-forward-order")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
def test_explicit_reverse_rate(self):
|
||||
ctml2yaml.convert(Path(self.test_data_dir).joinpath("explicit-reverse-rate.xml"),
|
||||
Path(self.test_work_dir).joinpath("explicit-reverse-rate.yaml"))
|
||||
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(Path(self.test_data_dir).joinpath("explicit-third-bodies.xml"),
|
||||
Path(self.test_work_dir).joinpath("explicit-third-bodies.yaml"))
|
||||
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(Path(self.test_data_dir).joinpath("frac.xml"),
|
||||
Path(self.test_work_dir).joinpath("frac.yaml"))
|
||||
ctmlGas, yamlGas = self.checkConversion("frac")
|
||||
self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000])
|
||||
self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5])
|
||||
|
||||
Reference in New Issue
Block a user