Go to the documentation of this file.
15 ReactorBase::ReactorBase(
const string& name) : m_nsp(0),
49 m_inlet.push_back(&
inlet);
54 m_outlet.push_back(&
outlet);
72 void ReactorBase::addSurface(ReactorSurface* surf)
74 if (find(m_surfaces.begin(), m_surfaces.end(), surf) == m_surfaces.end()) {
75 m_surfaces.push_back(surf);
76 surf->setReactor(
this);
91 "Reactor is not part of a ReactorNet");
102 doublereal mout = 0.0;
103 for (
size_t i = 0; i < m_outlet.size(); i++) {
104 mout += m_outlet[i]->massFlowRate();
doublereal enthalpy_mass() const
Specific enthalpy. Units: J/kg.
FlowDevice & inlet(size_t n=0)
Return a reference to the n-th inlet FlowDevice connected to this reactor.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
void addOutlet(FlowDevice &outlet)
Connect an outlet FlowDevice to this reactor.
doublereal mass() const
Returns the mass (kg) of the reactor's contents.
WallBase & wall(size_t n)
Return a reference to the n-th Wall connected to this reactor.
virtual void syncState()
Set the state of the reactor to correspond to the state of the associated ThermoPhase object.
doublereal intEnergy_mass() const
Specific internal energy. Units: J/kg.
FlowDevice & outlet(size_t n=0)
Return a reference to the n-th outlet FlowDevice connected to this reactor.
void setNeedsReinit()
Called to trigger integrator reinitialization before further integration.
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...
size_t m_nsp
Number of homogeneous species in the mixture.
ReactorSurface * surface(size_t n)
Return a reference to the n-th ReactorSurface connected to this reactor.
ReactorNet * m_net
The ReactorNet that this reactor is part of.
void addWall(WallBase &w, int lr)
Insert a Wall between this reactor and another reactor.
void saveState(vector_fp &state) const
Save the current internal state of the phase.
Base class for a phase with thermodynamic properties.
std::string name() const
Return the name of this reactor.
virtual double pressure() const
Return the thermodynamic pressure (Pa).
size_t nSpecies() const
Returns the number of species in the phase.
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
ReactorNet & network()
The ReactorNet that this reactor belongs to.
A class representing a network of connected reactors.
virtual void setThermoMgr(thermo_t &thermo)
Specify the mixture contained in the reactor.
Base class for exceptions thrown by Cantera classes.
Namespace for the Cantera kernel.
void addInlet(FlowDevice &inlet)
Connect an inlet FlowDevice to this reactor.