mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[ctml2yaml] Add conversion for more transport models
This commit is contained in:
@@ -291,10 +291,10 @@ class Phase:
|
||||
"Water": "water",
|
||||
"none": None,
|
||||
None: None,
|
||||
"UnityLewis": "unity-Lewis-number", # added
|
||||
"CK_Mix": "mixture-averaged-CK", # added
|
||||
"CK_Multi": "multicomponent-CK", # added
|
||||
"HighP": "high-pressure", # added
|
||||
"UnityLewis": "unity-Lewis-number",
|
||||
"CK_Mix": "mixture-averaged-CK",
|
||||
"CK_Multi": "multicomponent-CK",
|
||||
"HighP": "high-pressure",
|
||||
}
|
||||
|
||||
_state_properties_mapping = {
|
||||
|
||||
@@ -1171,3 +1171,10 @@ class ctml2yamlTest(utilities.CanteraTest):
|
||||
# self.assertEqual(ctmlPhase.species_names, yamlPhase.species_names)
|
||||
ctmlPhase, yamlPhase = self.checkConversion("IdealMolalSolnPhaseExample")
|
||||
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])
|
||||
|
||||
def test_transport_models(self):
|
||||
ctml2yaml.convert(Path(self.test_data_dir).joinpath("transport_models_test.xml"),
|
||||
Path(self.test_work_dir).joinpath("transport_models_test.yaml"))
|
||||
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])
|
||||
|
||||
65
test/data/transport_models_test.xml
Normal file
65
test/data/transport_models_test.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0"?>
|
||||
<ctml>
|
||||
<validate species="yes" reactions="yes"/>
|
||||
|
||||
<phase id="UnityLewis" dim="3">
|
||||
<elementArray datasrc="elements.xml">H C</elementArray>
|
||||
<speciesArray datasrc="gri30.xml#species_data">H H2 CH3 CH4</speciesArray>
|
||||
<reactionArray datasrc="gri30.xml#reaction_data">
|
||||
<skip species="undeclared" third_bodies="undeclared"/>
|
||||
</reactionArray>
|
||||
<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="UnityLewis"/>
|
||||
</phase>
|
||||
<phase id="CK_Mix" dim="3">
|
||||
<elementArray datasrc="elements.xml">H C</elementArray>
|
||||
<speciesArray datasrc="gri30.xml#species_data">H H2 CH3 CH4</speciesArray>
|
||||
<reactionArray datasrc="gri30.xml#reaction_data">
|
||||
<skip species="undeclared" third_bodies="undeclared"/>
|
||||
</reactionArray>
|
||||
<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="CK_Mix"/>
|
||||
</phase>
|
||||
<phase id="CK_Multi" dim="3">
|
||||
<elementArray datasrc="elements.xml">H C</elementArray>
|
||||
<speciesArray datasrc="gri30.xml#species_data">H H2 CH3 CH4</speciesArray>
|
||||
<reactionArray datasrc="gri30.xml#reaction_data">
|
||||
<skip species="undeclared" third_bodies="undeclared"/>
|
||||
</reactionArray>
|
||||
<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="CK_Multi"/>
|
||||
</phase>
|
||||
<phase id="HighP" dim="3">
|
||||
<elementArray datasrc="elements.xml">H C</elementArray>
|
||||
<speciesArray datasrc="gri30.xml#species_data">H H2 CH3 CH4</speciesArray>
|
||||
<reactionArray datasrc="gri30.xml#reaction_data">
|
||||
<skip species="undeclared" third_bodies="undeclared"/>
|
||||
</reactionArray>
|
||||
<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="HighP"/>
|
||||
</phase>
|
||||
</ctml>
|
||||
Reference in New Issue
Block a user