diff --git a/interfaces/cython/cantera/examples/reactors/reactor1.py b/interfaces/cython/cantera/examples/reactors/reactor1.py index c2f263c26e..a7347a3dc2 100644 --- a/interfaces/cython/cantera/examples/reactors/reactor1.py +++ b/interfaces/cython/cantera/examples/reactors/reactor1.py @@ -7,13 +7,13 @@ import cantera as ct -gri3 = ct.Solution('gri30.xml') -gri3.TPX = 1001.0, ct.one_atm, 'H2:2,O2:1,N2:4' -r = ct.IdealGasConstPressureReactor(gri3) +gas = ct.Solution('gri30.xml') +gas.TPX = 1001.0, ct.one_atm, 'H2:2,O2:1,N2:4' +r = ct.IdealGasConstPressureReactor(gas) sim = ct.ReactorNet([r]) time = 0.0 -states = ct.SolutionArray(gri3, extra=['t']) +states = ct.SolutionArray(gas, extra=['t']) print('%10s %10s %10s %14s' % ('t [s]','T [K]','P [Pa]','u [J/kg]')) for n in range(100): @@ -33,15 +33,15 @@ plt.xlabel('Time (ms)') plt.ylabel('Temperature (K)') plt.subplot(2, 2, 2) - plt.plot(states.t, states.X[:,gri3.species_index('OH')]) + plt.plot(states.t, states.X[:,gas.species_index('OH')]) plt.xlabel('Time (ms)') plt.ylabel('OH Mole Fraction') plt.subplot(2, 2, 3) - plt.plot(states.t, states.X[:,gri3.species_index('H')]) + plt.plot(states.t, states.X[:,gas.species_index('H')]) plt.xlabel('Time (ms)') plt.ylabel('H Mole Fraction') plt.subplot(2, 2, 4) - plt.plot(states.t, states.X[:,gri3.species_index('H2')]) + plt.plot(states.t, states.X[:,gas.species_index('H2')]) plt.xlabel('Time (ms)') plt.ylabel('H2 Mole Fraction') plt.tight_layout() diff --git a/interfaces/cython/cantera/examples/reactors/reactor2.py b/interfaces/cython/cantera/examples/reactors/reactor2.py index 74c820cfa8..9f72f49ec2 100644 --- a/interfaces/cython/cantera/examples/reactors/reactor2.py +++ b/interfaces/cython/cantera/examples/reactors/reactor2.py @@ -36,12 +36,12 @@ env = ct.Reservoir(ct.Solution('air.xml')) # use GRI-Mech 3.0 for the methane/air mixture, and set its initial state -gri3 = ct.Solution('gri30.xml') -gri3.TP = 500.0, 0.2 * ct.one_atm -gri3.set_equivalence_ratio(1.1, 'CH4:1.0', 'O2:2, N2:7.52') +gas = ct.Solution('gri30.xml') +gas.TP = 500.0, 0.2 * ct.one_atm +gas.set_equivalence_ratio(1.1, 'CH4:1.0', 'O2:2, N2:7.52') # create a reactor for the methane/air side -r2 = ct.IdealGasReactor(gri3) +r2 = ct.IdealGasReactor(gas) #----------------------------------------------------------------------------- # Now couple the reactors by defining common walls that may move (a piston) or @@ -68,7 +68,7 @@ csvfile.writerow(['time (s)','T1 (K)','P1 (Bar)','V1 (m3)', 'T2 (K)','P2 (Bar)','V2 (m3)']) states1 = ct.SolutionArray(ar, extra=['t', 'V']) -states2 = ct.SolutionArray(gri3, extra=['t', 'V']) +states2 = ct.SolutionArray(gas, extra=['t', 'V']) for n in range(n_steps): time += 4.e-4 diff --git a/interfaces/cython/cantera/examples/reactors/sensitivity1.py b/interfaces/cython/cantera/examples/reactors/sensitivity1.py index 1fa30b642f..8604c12ffe 100644 --- a/interfaces/cython/cantera/examples/reactors/sensitivity1.py +++ b/interfaces/cython/cantera/examples/reactors/sensitivity1.py @@ -7,12 +7,12 @@ import cantera as ct -gri3 = ct.Solution('gri30.xml') +gas = ct.Solution('gri30.xml') temp = 1500.0 pres = ct.one_atm -gri3.TPX = temp, pres, 'CH4:0.1, O2:2, N2:7.52' -r = ct.IdealGasConstPressureReactor(gri3, name='R1') +gas.TPX = temp, pres, 'CH4:0.1, O2:2, N2:7.52' +r = ct.IdealGasConstPressureReactor(gas, name='R1') sim = ct.ReactorNet([r]) # enable sensitivity with respect to the rates of the first 10