6#ifndef CT_REACTORBASE_H
7#define CT_REACTORBASE_H
29enum class SensParameterType {
34struct SensitivityParameter
39 SensParameterType type;
61 "To be removed after Cantera 2.6. Use type() instead.");
67 virtual std::string
type()
const {
125 return m_inlet.size();
131 return m_outlet.size();
136 return m_wall.size();
178 "Reactor contents not defined.");
186 "Reactor contents not defined.");
239 return m_state.data() + 2;
265 std::vector<FlowDevice*> m_inlet, m_outlet;
267 std::vector<WallBase*> m_wall;
268 std::vector<ReactorSurface*> m_surfaces;
Base class for exceptions thrown by Cantera classes.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Public interface for kinetics managers.
An error indicating that an unimplemented function has been called.
Base class for stirred reactors.
virtual void setKineticsMgr(Kinetics &kin)
Specify chemical kinetics governing the reactor.
doublereal massFraction(size_t k) const
Return the mass fraction of the k-th species.
FlowDevice & outlet(size_t n=0)
Return a reference to the n-th outlet FlowDevice connected to this reactor.
size_t nWalls()
Return the number of Wall objects connected to this reactor.
std::string name() const
Return the name of this reactor.
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.
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
virtual std::string typeStr() const
String indicating the reactor model implemented.
virtual void initialize(doublereal t0=0.0)
Initialize the reactor.
double m_pressure
Current pressure in the reactor [Pa].
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 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...
FlowDevice & inlet(size_t n=0)
Return a reference to the n-th inlet FlowDevice connected to this reactor.
double m_vol
Current volume of the reactor [m^3].
virtual void setChemistry(bool cflag=true)
Enable or disable changes in reactor composition due to chemical reactions.
void addInlet(FlowDevice &inlet)
Connect an inlet FlowDevice to this reactor.
virtual void syncState()
Set the state of the reactor to correspond to the state of the associated ThermoPhase object.
void setName(const std::string &name)
Set the name of this reactor.
double m_intEnergy
Current internal energy of the reactor [J/kg].
virtual std::string type() const
String indicating the reactor model implemented.
void setInitialVolume(doublereal vol)
Set the initial reactor volume. By default, the volume is 1.0 m^3.
virtual void setEnergy(int eflag=1)
Set the energy equation on or off.
size_t m_nsp
Number of homogeneous species in the mixture.
vector_int m_lr
Vector of length nWalls(), indicating whether this reactor is on the left (0) or right (1) of each wa...
doublereal volume() const
Returns the current volume (m^3) of the reactor.
virtual 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.
doublereal density() const
Returns the current density (kg/m^3) of the reactor's contents.
ReactorNet & network()
The ReactorNet that this reactor belongs to.
doublereal intEnergy_mass() const
Returns the current internal energy (J/kg) of the reactor's contents.
size_t nOutlets()
Return the number of outlet FlowDevice objects connected to this reactor.
doublereal temperature() const
Returns the current temperature (K) of the reactor's contents.
size_t nInlets()
Return the number of inlet FlowDevice objects connected to this reactor.
doublereal enthalpy_mass() const
Returns the current enthalpy (J/kg) of the reactor's contents.
ReactorSurface * surface(size_t n)
Return a reference to the n-th ReactorSurface connected to this reactor.
const doublereal * massFractions() const
Return the vector of species mass fractions.
double m_enthalpy
Current specific enthalpy of the reactor [J/kg].
ThermoPhase & contents()
return a reference to the contents.
doublereal mass() const
Returns the mass (kg) of the reactor's contents.
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.
Base class for a phase with thermodynamic properties.
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
This file contains definitions for utility functions and text for modules, inputfiles,...
Namespace for the Cantera kernel.
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.
std::vector< int > vector_int
Vector of ints.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.