15 ReactorBase::ReactorBase(
const string& name) : m_nsp(0),
26 void ReactorBase::setThermoMgr(
thermo_t& thermo)
30 m_thermo->saveState(m_state);
31 m_enthalpy = m_thermo->enthalpy_mass();
32 m_intEnergy = m_thermo->intEnergy_mass();
33 m_pressure = m_thermo->pressure();
36 void ReactorBase::syncState()
38 m_thermo->saveState(m_state);
39 m_enthalpy = m_thermo->enthalpy_mass();
40 m_intEnergy = m_thermo->intEnergy_mass();
41 m_pressure = m_thermo->pressure();
43 m_net->setNeedsReinit();
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);
80 ReactorSurface* ReactorBase::surface(
size_t n)
91 "Reactor is not part of a ReactorNet");
100 doublereal ReactorBase::residenceTime()
102 doublereal mout = 0.0;
103 for (
size_t i = 0; i < m_outlet.size(); i++) {
104 mout += m_outlet[i]->massFlowRate();
Header file for class ReactorSurface.
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.
Base class for a phase with thermodynamic properties.
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Namespace for the Cantera kernel.