16ReactorBase::ReactorBase(
const string& name) : m_nsp(0),
31 m_thermo->saveState(m_state);
32 m_enthalpy = m_thermo->enthalpy_mass();
33 m_intEnergy = m_thermo->intEnergy_mass();
34 m_pressure = m_thermo->pressure();
37void ReactorBase::syncState()
39 m_thermo->saveState(m_state);
40 m_enthalpy = m_thermo->enthalpy_mass();
41 m_intEnergy = m_thermo->intEnergy_mass();
42 m_pressure = m_thermo->pressure();
44 m_net->setNeedsReinit();
50 m_inlet.push_back(&inlet);
55 m_outlet.push_back(&outlet);
75 if (find(m_surfaces.begin(), m_surfaces.end(), surf) == m_surfaces.end()) {
76 m_surfaces.push_back(surf);
86void ReactorBase::restoreState() {
88 throw CanteraError(
"ReactorBase::restoreState",
"No phase defined.");
90 m_thermo->restoreState(m_state);
99 "Reactor is not part of a ReactorNet");
108doublereal ReactorBase::residenceTime()
110 doublereal mout = 0.0;
111 for (
size_t i = 0; i < m_outlet.size(); i++) {
112 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.
size_t nSpecies() const
Returns the number of species in the phase.
A class representing a network of connected reactors.
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.
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Namespace for the Cantera kernel.