[1D/Test] Add test for ImpingingJet and ReactingSurface1D

This commit is contained in:
Ray Speth 2016-03-26 15:19:46 -04:00
parent 3e371c8093
commit dfb4d62e12
2 changed files with 64 additions and 0 deletions

View file

@ -714,3 +714,43 @@ class TestBurnerFlame(utilities.CanteraTest):
def test_case5(self):
self.solve(phi=1.0, T=400, width=0.2, P=0.01)
class TestImpingingJet(utilities.CanteraTest):
def run_reacting_surface(self, xch4, tsurf, mdot, width):
# Simplified version of the example 'catalytic_combustion.py'
gas = ct.Solution('../data/ptcombust-simple.cti', 'gas')
surf_phase = ct.Interface('../data/ptcombust-simple.cti',
'Pt_surf', [gas])
tinlet = 300.0 # inlet temperature
comp = {'CH4': xch4, 'O2':0.21, 'N2':0.79}
gas.TPX = tinlet, ct.one_atm, comp
surf_phase.TP = tsurf, ct.one_atm
# integrate the coverage equations holding the gas composition fixed
# to generate a good starting estimate for the coverages.
surf_phase.advance_coverages(1.0)
sim = ct.ImpingingJet(gas=gas, width=width, surface=surf_phase)
sim.set_refine_criteria(10.0, 0.3, 0.4, 0.0)
sim.inlet.mdot = mdot
sim.inlet.T = tinlet
sim.inlet.X = comp
sim.surface.T = tsurf
sim.solve(loglevel=0, auto=True)
self.assertTrue(all(np.diff(sim.T) > 0))
self.assertTrue(all(np.diff(sim.Y[gas.species_index('CH4')]) < 0))
self.assertTrue(all(np.diff(sim.Y[gas.species_index('CO2')]) > 0))
def test_reacting_surface_case1(self):
self.run_reacting_surface(xch4=0.095, tsurf=900.0, mdot=0.06, width=0.1)
def test_reacting_surface_case2(self):
self.run_reacting_surface(xch4=0.07, tsurf=1200.0, mdot=0.2, width=0.05)
def test_reacting_surface_case3(self):
self.run_reacting_surface(xch4=0.2, tsurf=800.0, mdot=0.1, width=0.2)

View file

@ -0,0 +1,24 @@
ideal_gas(name = "gas",
elements = "O H C N Ar",
species = """gri30: H2 H O O2 OH H2O HO2 H2O2 CH3 CH4 CO CO2
CH2O CH3O CH3OH C2H6 N2""",
transport = 'Mix',
reactions = 'gri30: all',
options = ['skip_undeclared_elements',
'skip_undeclared_species',
'skip_undeclared_third_bodies'],
initial_state = state(temperature = 300.0, pressure = OneAtm,
mole_fractions = 'CH4:0.095, O2:0.21, N2:0.79')
)
ideal_interface(name = "Pt_surf",
elements = " Pt H O C ",
species = """ ptcombust: all """,
phases = "gas",
site_density = (2.7063e-9, 'mol/cm2'),
reactions = "ptcombust: all",
options = ['skip_undeclared_elements',
'skip_undeclared_species'],
initial_state = state(temperature = 900.0,
coverages = 'O(S):0.0, PT(S):0.5, H(S):0.5')
)