[Cython/Examples] Update to use IdealGasReactor
This commit is contained in:
parent
a616d4f55f
commit
5d6a97f89a
9 changed files with 11 additions and 11 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue