diff --git a/interfaces/python/Cantera/Reactor.py b/interfaces/python/Cantera/Reactor.py index c72b331e0..7985258f7 100644 --- a/interfaces/python/Cantera/Reactor.py +++ b/interfaces/python/Cantera/Reactor.py @@ -369,6 +369,23 @@ class Reactor(ReactorBase): verbose = verbose, type = 2) +class IdealGasReactor(ReactorBase): + """ + Similar to :class:`.Reactor`, but with a set of governing equations + optimized specifically for ideal gas mixtures. + """ + def __init__(self, contents = None, name = '', + volume = 1.0, energy = 'on', + verbose = 0): + global _reactorcount + if name == '': + name = 'IdealGasReactor_'+`_reactorcount` + _reactorcount += 1 + ReactorBase.__init__(self, contents = contents, name = name, + volume = volume, energy = energy, + verbose = verbose, type = 5) + + class FlowReactor(ReactorBase): def __init__(self, contents = None, name = '', volume = 1.0, energy = 'on', @@ -438,6 +455,23 @@ class ConstPressureReactor(ReactorBase): verbose = verbose, type = 4) +class IdealGasConstPressureReactor(ReactorBase): + """ + Similar to :class:`.ConstPressureReactor`, but with a set of governing + equations optimized specifically for ideal gas mixtures. + """ + def __init__(self, contents = None, name = '', + volume = 1.0, energy = 'on', + verbose = 0): + global _reactorcount + if name == '': + name = 'IdealGasConstPRessureReactor_'+`_reactorcount` + _reactorcount += 1 + ReactorBase.__init__(self, contents = contents, name = name, + volume = volume, energy = energy, + verbose = verbose, type = 6) + + class Reservoir(ReactorBase): """ A reservoir is a reactor with a constant state. The temperature, diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index b317185a2..d0d49803f 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -10,6 +10,7 @@ #include "cantera/zeroD/ConstPressureReactor.h" #include "cantera/zeroD/ReactorNet.h" #include "cantera/zeroD/Reservoir.h" +#include "cantera/zeroD/ReactorFactory.h" #include "cantera/zeroD/Wall.h" #include "cantera/zeroD/flowControllers.h" #include "Cabinet.h" @@ -37,18 +38,7 @@ extern "C" { int reactor_new(int type) { try { - ReactorBase* r=0; - if (type == ReactorType) { - r = new Reactor(); - } else if (type == FlowReactorType) { - r = new FlowReactor(); - } else if (type == ConstPressureReactorType) { - r = new ConstPressureReactor(); - } else if (type == ReservoirType) { - r = new Reservoir(); - } else { - r = new ReactorBase(); - } + ReactorBase* r = ReactorFactory::factory()->newReactor(type); return ReactorCabinet::add(r); } catch (...) { return handleAllExceptions(-1, ERR);