[Cython/1D] Fixed DiffusionFlame to work with phases not containing carbon

This commit is contained in:
Ray Speth 2013-01-17 15:30:36 +00:00
parent 64aef5fac7
commit aac9435a0e

View file

@ -1063,9 +1063,11 @@ class CounterflowDiffusionFlame(FlameBase):
if stoich is None:
if oxidizer == 'O2':
nH = self.gas.nAtoms(fuel, 'H')
nC = self.gas.nAtoms(fuel, 'C')
stoich = 1.0 * nC + 0.25 * nH
stoich = 0.0
if 'H' in self.gas.elementNames:
stoich += 0.25 * self.gas.nAtoms(fuel, 'H')
if 'C' in self.gas.elementNames:
stoich += self.gas.nAtoms(fuel, 'C')
else:
raise Exception('oxidizer/fuel stoichiometric ratio must be '
'specified since the oxidizer is not O2')