diff --git a/interfaces/cython/cantera/examples/onedim/adiabatic_flame.py b/interfaces/cython/cantera/examples/onedim/adiabatic_flame.py index 2662f4a54..317cedb00 100644 --- a/interfaces/cython/cantera/examples/onedim/adiabatic_flame.py +++ b/interfaces/cython/cantera/examples/onedim/adiabatic_flame.py @@ -17,7 +17,8 @@ tol_ts = [1.0e-4, 1.0e-13] # [rtol atol] for time stepping loglevel = 1 # amount of diagnostic output (0 to 8) refine_grid = True # 'True' to enable refinement, 'False' to disable -# IdealGasMix object used to compute mixture properties +# IdealGasMix object used to compute mixture properties, set to the state of the +# upstream fuel-air mixture gas = ct.Solution('h2o2.xml') gas.TPX = Tin, p, reactants @@ -26,10 +27,6 @@ f = ct.FreeFlame(gas, initial_grid) f.flame.set_steady_tolerances(default=tol_ss) f.flame.set_transient_tolerances(default=tol_ts) -# Set properties of the upstream fuel-air mixture -f.inlet.T = Tin -f.inlet.X = reactants - f.show_solution() # Solve with the energy equation disabled diff --git a/interfaces/cython/cantera/examples/onedim/burner_flame.py b/interfaces/cython/cantera/examples/onedim/burner_flame.py index 6b3eb2c26..3a23fe440 100644 --- a/interfaces/cython/cantera/examples/onedim/burner_flame.py +++ b/interfaces/cython/cantera/examples/onedim/burner_flame.py @@ -20,9 +20,6 @@ gas = ct.Solution('h2o2.xml') gas.TPX = tburner, p, reactants f = ct.BurnerFlame(gas, initial_grid) - -f.burner.T = tburner -f.burner.X = reactants f.burner.mdot = mdot f.set_initial_guess() diff --git a/interfaces/cython/cantera/examples/onedim/flame_fixed_T.py b/interfaces/cython/cantera/examples/onedim/flame_fixed_T.py index 9588473c9..a9a303cb2 100644 --- a/interfaces/cython/cantera/examples/onedim/flame_fixed_T.py +++ b/interfaces/cython/cantera/examples/onedim/flame_fixed_T.py @@ -72,10 +72,8 @@ gas.TPX = tburner, p, comp # create the BurnerFlame object. f = ct.BurnerFlame(gas=gas, grid=initial_grid) -# set the properties at the burner +# set the mass flow rate at the burner f.burner.mdot = mdot -f.burner.X = comp -f.burner.T = tburner # read in the fixed temperature profile [zloc, tvalues] = getTempData('tdata.dat') diff --git a/interfaces/cython/cantera/examples/onedim/flamespeed_sensitivity.py b/interfaces/cython/cantera/examples/onedim/flamespeed_sensitivity.py index ae222760d..b3e2caf89 100644 --- a/interfaces/cython/cantera/examples/onedim/flamespeed_sensitivity.py +++ b/interfaces/cython/cantera/examples/onedim/flamespeed_sensitivity.py @@ -27,10 +27,6 @@ f = ct.FreeFlame(gas, initial_grid) f.flame.set_steady_tolerances(default=tol_ss) f.flame.set_transient_tolerances(default=tol_ts) -# Set properties of the upstream fuel-air mixture -f.inlet.T = Tin -f.inlet.X = reactants - # Solve with the energy equation disabled f.energy_enabled = False f.set_max_jac_age(10, 10) diff --git a/interfaces/cython/cantera/examples/onedim/premixed_counterflow_flame.py b/interfaces/cython/cantera/examples/onedim/premixed_counterflow_flame.py index a6e6d1178..d01087662 100644 --- a/interfaces/cython/cantera/examples/onedim/premixed_counterflow_flame.py +++ b/interfaces/cython/cantera/examples/onedim/premixed_counterflow_flame.py @@ -37,11 +37,8 @@ gas.TPX = T_in, p, comp # Create the flame simulation object sim = ct.CounterflowPremixedFlame(gas=gas, grid=initial_grid) -# set the properties at the inlet +# set the boundary flow rates sim.reactants.mdot = mdot_reactants -sim.reactants.X = comp -sim.reactants.T = T_in - sim.products.mdot = mdot_products sim.flame.set_steady_tolerances(default=tol_ss) diff --git a/interfaces/cython/cantera/examples/onedim/stagnation_flame.py b/interfaces/cython/cantera/examples/onedim/stagnation_flame.py index e84f766b4..18003378d 100644 --- a/interfaces/cython/cantera/examples/onedim/stagnation_flame.py +++ b/interfaces/cython/cantera/examples/onedim/stagnation_flame.py @@ -58,10 +58,8 @@ gas.TPX = tburner, p, comp # catalytic_combustion.py for how to do this.) sim = ct.ImpingingJet(gas=gas, grid=initial_grid) -# set the properties at the inlet +# set the mass flow rate at the inlet sim.inlet.mdot = mdot[0] -sim.inlet.X = comp -sim.inlet.T = tburner # set the surface state sim.surface.T = tsurf diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 3985cfada..5da9ea2ff 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -375,6 +375,10 @@ class FreeFlame(FlameBase): super(FreeFlame, self).__init__((self.inlet, self.flame, self.outlet), gas, grid) + # Setting X needs to be deferred until linked to the flow domain + self.inlet.T = gas.T + self.inlet.X = gas.X + def set_initial_guess(self): """ Set the initial guess for the solution. The adiabatic flame @@ -422,13 +426,16 @@ class BurnerFlame(FlameBase): ``self.outlet``. """ self.burner = Inlet1D(name='burner', phase=gas) - self.burner.T = gas.T self.outlet = Outlet1D(name='outlet', phase=gas) self.flame = AxisymmetricStagnationFlow(gas, name='flame') super(BurnerFlame, self).__init__((self.burner, self.flame, self.outlet), gas, grid) + # Setting X needs to be deferred until linked to the flow domain + self.burner.T = gas.T + self.burner.X = gas.X + def set_initial_guess(self): """ Set the initial guess for the solution. The adiabatic flame @@ -744,7 +751,6 @@ class ImpingingJet(FlameBase): are stored as ``self.inlet``, ``self.flame``, and ``self.surface``. """ self.inlet = Inlet1D(name='inlet', phase=gas) - self.inlet.T = gas.T self.flame = AxisymmetricStagnationFlow(gas, name='flame') if surface is None: @@ -758,6 +764,10 @@ class ImpingingJet(FlameBase): super(ImpingingJet, self).__init__( (self.inlet, self.flame, self.surface), gas, grid) + # Setting X needs to be deferred until linked to the flow domain + self.inlet.T = gas.T + self.inlet.X = gas.X + def set_initial_guess(self, products='inlet'): """ Set the initial guess for the solution. If products = 'equil', then @@ -821,6 +831,9 @@ class CounterflowPremixedFlame(FlameBase): super(CounterflowPremixedFlame, self).__init__( (self.reactants, self.flame, self.products), gas, grid) + # Setting X needs to be deferred until linked to the flow domain + self.reactants.X = gas.X + def set_initial_guess(self, equilibrate=True): """ Set the initial guess for the solution.