16ReactorBase::ReactorBase(
const string& name) : m_name(name)
20ReactorBase::ReactorBase(shared_ptr<Solution> sol,
const string& name)
23 if (!sol || !(sol->thermo())) {
25 "Creation of empty reactor objects is deprecated in Cantera 3.1 and will "
26 "raise\nexceptions thereafter; reactor contents should be provided in the "
33ReactorBase::~ReactorBase()
54 if (!sol || !(sol->thermo())) {
56 "Missing or incomplete Solution object.");
65 }
catch (NotImplementedError&) {
74 "To be removed after Cantera 3.1. Superseded by 'setSolution'.");
91 "To be removed after Cantera 3.1. Superseded by 'setSolution'.");
98 "To be removed after Cantera 3.1. Superseded by 'setSolution'.");
115 m_inlet.push_back(&
inlet);
120 m_outlet.push_back(&
outlet);
125 m_wall.push_back(&w);
140 if (find(m_surfaces.begin(), m_surfaces.end(), surf) == m_surfaces.end()) {
141 m_surfaces.push_back(surf);
148 return m_surfaces[n];
153 throw CanteraError(
"ReactorBase::restoreState",
"No phase defined.");
164 "Reactor is not part of a ReactorNet");
176 for (
size_t i = 0; i < m_outlet.size(); i++) {
177 mout += m_outlet[i]->massFlowRate();
Header file for class ReactorSurface.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Base class for exceptions thrown by Cantera classes.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Public interface for kinetics managers.
void restoreState(const vector< double > &state)
Restore a state saved on a previous call to saveState.
size_t nSpecies() const
Returns the number of species in the phase.
void saveState(vector< double > &state) const
Save the current internal state of the phase.
virtual double pressure() const
Return the thermodynamic pressure (Pa).
Base class for stirred reactors.
virtual void setThermo(ThermoPhase &thermo)
Specify the mixture contained in the reactor.
FlowDevice & outlet(size_t n=0)
Return a reference to the n-th outlet FlowDevice connected to this reactor.
shared_ptr< Solution > m_solution
Composite thermo/kinetics/transport handler.
bool m_defaultNameSet
true if default name has been previously set.
WallBase & wall(size_t n)
Return a reference to the n-th Wall connected to this reactor.
void addOutlet(FlowDevice &outlet)
Connect an outlet FlowDevice to this reactor.
double m_pressure
Current pressure in the reactor [Pa].
virtual string type() const
String indicating the reactor model implemented.
ReactorNet * m_net
The ReactorNet that this reactor is part of.
void insert(shared_ptr< Solution > sol)
void addWall(WallBase &w, int lr)
Insert a Wall between this reactor and another reactor.
void setNetwork(ReactorNet *net)
Set the ReactorNet that this reactor belongs to.
bool setDefaultName(map< string, int > &counts)
Set the default name of a reactor. Returns false if it was previously set.
virtual void setKinetics(Kinetics &kin)
Specify the kinetics manager for the reactor.
FlowDevice & inlet(size_t n=0)
Return a reference to the n-th inlet FlowDevice connected to this reactor.
vector< int > m_lr
Vector of length nWalls(), indicating whether this reactor is on the left (0) or right (1) of each wa...
void addInlet(FlowDevice &inlet)
Connect an inlet FlowDevice to this reactor.
void setSolution(shared_ptr< Solution > sol)
Set the Solution specifying the ReactorBase content.
void setKineticsMgr(Kinetics &kin)
virtual void syncState()
Set the state of the reactor to correspond to the state of the associated ThermoPhase object.
double m_intEnergy
Current internal energy of the reactor [J/kg].
size_t m_nsp
Number of homogeneous species in the mixture.
string m_name
Reactor name.
double mass() const
Returns the mass (kg) of the reactor's contents.
void setThermoMgr(ThermoPhase &thermo)
Specify the mixture contained in the reactor.
void restoreState()
Set the state of the Phase object associated with this reactor to the reactor's current state.
ReactorNet & network()
The ReactorNet that this reactor belongs to.
double 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.
double m_enthalpy
Current specific enthalpy of the reactor [J/kg].
A class representing a network of connected reactors.
void setNeedsReinit()
Called to trigger integrator reinitialization before further integration.
A surface where reactions can occur that is in contact with the bulk fluid of a Reactor.
void setReactor(ReactorBase *reactor)
Set the reactor that this Surface interacts with.
Base class for a phase with thermodynamic properties.
double intEnergy_mass() const
Specific internal energy. Units: J/kg.
double enthalpy_mass() const
Specific enthalpy. Units: J/kg.
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Namespace for the Cantera kernel.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.