From 5d6a97f89a02a76b39ee269544d22f8ab4e5a2a7 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 16 Jul 2013 22:09:55 +0000 Subject: [PATCH] [Cython/Examples] Update to use IdealGasReactor --- interfaces/cython/cantera/examples/reaction_path.py | 2 +- interfaces/cython/cantera/examples/reactors/combustor.py | 2 +- interfaces/cython/cantera/examples/reactors/mix1.py | 2 +- interfaces/cython/cantera/examples/reactors/piston.py | 4 ++-- interfaces/cython/cantera/examples/reactors/reactor1.py | 2 +- interfaces/cython/cantera/examples/reactors/reactor2.py | 4 ++-- interfaces/cython/cantera/examples/reactors/sensitivity1.py | 2 +- interfaces/cython/cantera/examples/reactors/surf_pfr.py | 2 +- interfaces/cython/cantera/test/test_kinetics.py | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/interfaces/cython/cantera/examples/reaction_path.py b/interfaces/cython/cantera/examples/reaction_path.py index 75d651646..f623c69cb 100644 --- a/interfaces/cython/cantera/examples/reaction_path.py +++ b/interfaces/cython/cantera/examples/reaction_path.py @@ -16,7 +16,7 @@ import cantera as ct # an object of a class derived from class Kinetics in some state. gas = ct.Solution('gri30.xml') gas.TPX = 1300.0, ct.one_atm, 'CH4:0.4, O2:1, N2:3.76' -r = ct.Reactor(gas) +r = ct.IdealGasReactor(gas) net = ct.ReactorNet([r]) T = r.T while T < 1900: diff --git a/interfaces/cython/cantera/examples/reactors/combustor.py b/interfaces/cython/cantera/examples/reactors/combustor.py index 62e97eb35..331494c38 100644 --- a/interfaces/cython/cantera/examples/reactors/combustor.py +++ b/interfaces/cython/cantera/examples/reactors/combustor.py @@ -34,7 +34,7 @@ igniter = ct.Reservoir(gas) # create the combustor, and fill it in initially with N2 gas.TPX = 300.0, ct.one_atm, 'N2:1.0' -combustor = ct.Reactor(gas) +combustor = ct.IdealGasReactor(gas) combustor.volume = 1.0 # create a reservoir for the exhaust diff --git a/interfaces/cython/cantera/examples/reactors/mix1.py b/interfaces/cython/cantera/examples/reactors/mix1.py index b592362f6..29c9cdf95 100644 --- a/interfaces/cython/cantera/examples/reactors/mix1.py +++ b/interfaces/cython/cantera/examples/reactors/mix1.py @@ -42,7 +42,7 @@ downstream = ct.Reservoir(gas_b) # reservoir, since the state will change with time if the inlet mass flow # rates change or if there is chemistry occurring. gas_b.TPX = 300.0, ct.one_atm, 'O2:0.21, N2:0.78, AR:0.01' -mixer = ct.Reactor(gas_b) +mixer = ct.IdealGasReactor(gas_b) # create two mass flow controllers connecting the upstream reservoirs to the # mixer, and set their mass flow rates to values corresponding to diff --git a/interfaces/cython/cantera/examples/reactors/piston.py b/interfaces/cython/cantera/examples/reactors/piston.py index f8a21bcb2..ab1e8a3ae 100644 --- a/interfaces/cython/cantera/examples/reactors/piston.py +++ b/interfaces/cython/cantera/examples/reactors/piston.py @@ -31,9 +31,9 @@ gas1.TPX = 900.0, ct.one_atm, 'H2:2, O2:1, AR:20' gas2 = ct.Solution('gri30.xml') gas2.TPX = 900.0, ct.one_atm, 'CO:2, H2O:0.01, O2:5' -r1 = ct.Reactor(gas1) +r1 = ct.IdealGasReactor(gas1) r1.volume = 0.5 -r2 = ct.Reactor(gas2) +r2 = ct.IdealGasReactor(gas2) r2.volume = 0.1 w = ct.Wall(r1, r2, K=1.0e3) diff --git a/interfaces/cython/cantera/examples/reactors/reactor1.py b/interfaces/cython/cantera/examples/reactors/reactor1.py index df21a3374..7a87ac3ce 100644 --- a/interfaces/cython/cantera/examples/reactors/reactor1.py +++ b/interfaces/cython/cantera/examples/reactors/reactor1.py @@ -11,7 +11,7 @@ gri3 = ct.Solution('gri30.xml') air = ct.Solution('air.xml') gri3.TPX = 1001.0, ct.one_atm, 'H2:2,O2:1,N2:4' -r = ct.Reactor(gri3) +r = ct.IdealGasReactor(gri3) env = ct.Reservoir(air) # Define a wall between the reactor and the environment, and diff --git a/interfaces/cython/cantera/examples/reactors/reactor2.py b/interfaces/cython/cantera/examples/reactors/reactor2.py index 4a58f25e6..e56e6be8e 100644 --- a/interfaces/cython/cantera/examples/reactors/reactor2.py +++ b/interfaces/cython/cantera/examples/reactors/reactor2.py @@ -30,7 +30,7 @@ ar = ct.Solution('argon.xml') ar.TP = 1000.0, 20.0 * ct.one_atm # create a reactor to represent the side of the cylinder filled with argon -r1 = ct.Reactor(ar) +r1 = ct.IdealGasReactor(ar) # create a reservoir for the environment, and fill it with air. env = ct.Reservoir(ct.Solution('air.xml')) @@ -40,7 +40,7 @@ gri3 = ct.Solution('gri30.xml') gri3.TPX = 500.0, 0.2 * ct.one_atm, 'CH4:1.1, O2:2, N2:7.52' # create a reactor for the methane/air side -r2 = ct.Reactor(gri3) +r2 = ct.IdealGasReactor(gri3) #----------------------------------------------------------------------------- # Now couple the reactors by defining common walls that may move (a piston) or diff --git a/interfaces/cython/cantera/examples/reactors/sensitivity1.py b/interfaces/cython/cantera/examples/reactors/sensitivity1.py index 1257daecb..951ba1367 100644 --- a/interfaces/cython/cantera/examples/reactors/sensitivity1.py +++ b/interfaces/cython/cantera/examples/reactors/sensitivity1.py @@ -12,7 +12,7 @@ temp = 1500.0 pres = ct.one_atm gri3.TPX = temp, pres, 'CH4:0.1, O2:2, N2:7.52' -r = ct.Reactor(gri3) +r = ct.IdealGasReactor(gri3) air = ct.Solution('air.xml') air.TP = temp, pres diff --git a/interfaces/cython/cantera/examples/reactors/surf_pfr.py b/interfaces/cython/cantera/examples/reactors/surf_pfr.py index 2ad71ecb1..e7a4cd7ec 100644 --- a/interfaces/cython/cantera/examples/reactors/surf_pfr.py +++ b/interfaces/cython/cantera/examples/reactors/surf_pfr.py @@ -76,7 +76,7 @@ for n in range(NReactors): # create a new reactor gas.TDY = TDY - r = ct.Reactor(gas, energy='off') + r = ct.IdealGasReactor(gas, energy='off') r.volume = rvol # create a reservoir to represent the reactor immediately upstream. Note diff --git a/interfaces/cython/cantera/test/test_kinetics.py b/interfaces/cython/cantera/test/test_kinetics.py index 43a59d9a3..293ff6bcf 100644 --- a/interfaces/cython/cantera/test/test_kinetics.py +++ b/interfaces/cython/cantera/test/test_kinetics.py @@ -257,7 +257,7 @@ class TestReactionPath(utilities.CanteraTest): def test_dot_output(self): gas = ct.Solution('gri30.xml') gas.TPX = 1300.0, ct.one_atm, 'CH4:0.4, O2:1, N2:3.76' - r = ct.Reactor(gas) + r = ct.IdealGasReactor(gas) net = ct.ReactorNet([r]) T = r.T while T < 1900: