Skip to content

Commit

Permalink
[ctml2yaml] Add test_sofc to ctml2yaml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Aug 19, 2019
1 parent 6d5df9f commit 037dae9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion interfaces/cython/cantera/test/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ def test_lithium_ion_battery(self):
self.checkKinetics(ctiCathodeInt, yamlCathodeInt, [300], [1e5])



class ctml2yamlTest(utilities.CanteraTest):
@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -868,3 +867,26 @@ def test_ptcombust(self):
self.checkKinetics(ctmlGas, yamlGas, [500, 1200], [1e4, 3e5])
self.checkThermo(ctmlSurf, yamlSurf, [400, 800, 1600])
self.checkKinetics(ctmlSurf, yamlSurf, [500, 1200], [1e4, 3e5])

def test_sofc(self):
ctml2yaml.convert(Path(self.cantera_data).joinpath('sofc.xml'),
Path(self.test_work_dir).joinpath('sofc.yaml'))
ctmlGas, yamlGas = self.checkConversion('sofc')
ctmlMetal, yamlMetal = self.checkConversion('sofc', phaseid='metal')
ctmlOxide, yamlOxide = self.checkConversion('sofc', phaseid='oxide_bulk')
ctmlMSurf, yamlMSurf = self.checkConversion('sofc', ct.Interface,
phaseid='metal_surface', ctmlphases=[ctmlGas, ctmlMetal],
yamlphases=[yamlGas, yamlMetal])
ctmlOSurf, yamlOSurf = self.checkConversion('sofc', ct.Interface,
phaseid='oxide_surface', ctmlphases=[ctmlGas, ctmlOxide],
yamlphases=[yamlGas, yamlOxide])
ctml_tpb, yaml_tpb = self.checkConversion('sofc', ct.Interface,
phaseid='tpb', ctmlphases=[ctmlMetal, ctmlMSurf, ctmlOSurf],
yamlphases=[yamlMetal, yamlMSurf, yamlOSurf])

self.checkThermo(ctmlMSurf, yamlMSurf, [900, 1000, 1100])
self.checkThermo(ctmlOSurf, yamlOSurf, [900, 1000, 1100])
ctmlMetal.electric_potential = yamlMetal.electric_potential = 2
self.checkKinetics(ctml_tpb, yaml_tpb, [900, 1000, 1100], [1e5])
ctmlMetal.electric_potential = yamlMetal.electric_potential = 4
self.checkKinetics(ctml_tpb, yaml_tpb, [900, 1000, 1100], [1e5])

0 comments on commit 037dae9

Please sign in to comment.