6 #ifndef CT_REACTORBASE_H 7 #define CT_REACTORBASE_H 19 const int ReservoirType = 1;
20 const int ReactorType = 2;
21 const int FlowReactorType = 3;
22 const int ConstPressureReactorType = 4;
23 const int IdealGasReactorType = 5;
24 const int IdealGasConstPressureReactorType = 6;
26 enum class SensParameterType {
31 struct SensitivityParameter
36 SensParameterType type;
96 return m_inlet.size();
102 return m_outlet.size();
107 return m_wall.size();
121 void addSurface(ReactorSurface* surf);
125 ReactorSurface*
surface(
size_t n);
140 throw CanteraError(
"ReactorBase::restoreState",
"No phase defined.");
154 "Reactor contents not defined.");
162 "Reactor contents not defined.");
215 return m_state.data() + 2;
237 doublereal m_enthalpy;
238 doublereal m_intEnergy;
239 doublereal m_pressure;
241 std::vector<FlowDevice*> m_inlet, m_outlet;
242 std::vector<Wall*> m_wall;
243 std::vector<ReactorSurface*> m_surfaces;
virtual int type() const
Return a constant indicating the type of this Reactor.
doublereal volume() const
Returns the current volume (m^3) of the reactor.
A class representing a network of connected reactors.
const doublereal * massFractions() const
Return the vector of species mass fractions.
virtual void initialize(doublereal t0=0.0)
Initialize the reactor.
void restoreState(const vector_fp &state)
Restore a state saved on a previous call to saveState.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
An error indicating that an unimplemented function has been called.
doublereal intEnergy_mass() const
Returns the current internal energy (J/kg) of the reactor's contents.
ReactorNet * m_net
The ReactorNet that this reactor is part of.
ReactorNet & network()
The ReactorNet that this reactor belongs to.
size_t nInlets()
Return the number of inlet FlowDevice objects connected to this reactor.
void addOutlet(FlowDevice &outlet)
Connect an outlet FlowDevice to this reactor.
void addInlet(FlowDevice &inlet)
Connect an inlet FlowDevice to this reactor.
doublereal density() const
Returns the current density (kg/m^3) of the reactor's contents.
doublereal mass() const
Returns the mass (kg) of the reactor's contents.
Base class for a phase with thermodynamic properties.
std::vector< int > vector_int
Vector of ints.
size_t nWalls()
Return the number of Wall objects connected to this reactor.
Wall & wall(size_t n)
Return a reference to the n-th Wall connected to this reactor.
Represents a wall between between two ReactorBase objects.
virtual void syncState()
Set the state of the reactor to correspond to the state of the associated ThermoPhase object...
void setInitialVolume(doublereal vol)
Set the initial reactor volume. By default, the volume is 1.0 m^3.
Base class for exceptions thrown by Cantera classes.
Base class for stirred reactors.
void restoreState()
Set the state of the Phase object associated with this reactor to the reactor's current state...
void addWall(Wall &w, int lr)
Insert a Wall between this reactor and another reactor.
virtual void setThermoMgr(thermo_t &thermo)
Specify the mixture contained in the reactor.
doublereal massFraction(size_t k) const
Return the mass fraction of the k-th species.
thermo_t & contents()
return a reference to the contents.
FlowDevice & inlet(size_t n=0)
Return a reference to the n-th inlet FlowDevice connected to this reactor.
void setNetwork(ReactorNet *net)
Set the ReactorNet that this reactor belongs to.
doublereal residenceTime()
Return the residence time (s) of the contents of this reactor, based on the outlet mass flow rates an...
ReactorSurface * surface(size_t n)
Return a reference to the n-th ReactorSurface connected to this reactor.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
size_t m_nsp
Number of homogeneous species in the mixture.
size_t nOutlets()
Return the number of outlet FlowDevice objects connected to this reactor.
FlowDevice & outlet(size_t n=0)
Return a reference to the n-th outlet FlowDevice connected to this reactor.
doublereal temperature() const
Returns the current temperature (K) of the reactor's contents.
Namespace for the Cantera kernel.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
void setName(const std::string &name)
Set the name of this reactor.
std::string name() const
Return the name of this reactor.
doublereal enthalpy_mass() const
Returns the current enthalpy (J/kg) of the reactor's contents.