31 throw CanteraError(
"FlowDevice::install",
"Already installed");
46 for (ki = 0; ki < m_nspin; ki++) {
49 m_in2out.push_back(ko);
51 for (ko = 0; ko < m_nspout; ko++) {
54 m_out2in.push_back(ki);
91 size_t ki = m_out2in[k];
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Base class for exceptions thrown by Cantera classes.
double outletSpeciesMassFlowRate(size_t k)
Mass flow rate (kg/s) of outlet species k.
bool m_defaultNameSet
true if default name has been previously set.
bool install(ReactorBase &in, ReactorBase &out)
Install a flow device between two reactors.
Func1 * m_tfunc
Function set by setTimeFunction; used by updateMassFlowRate.
virtual string type() const
String indicating the flow device implemented.
double m_time
Current reactor network time.
bool setDefaultName(map< string, int > &counts)
Set the default name of a flow device. Returns false if it was previously set.
double enthalpy_mass()
specific enthalpy
ReactorBase & in() const
Return a reference to the upstream reactor.
virtual void setPressureFunction(Func1 *f)
Set a function of pressure that is used in determining the mass flow rate through the device.
const ReactorBase & out() const
Return a const reference to the downstream reactor.
double evalTimeFunction()
Return current value of the time function.
string m_name
Flow device name.
virtual void setTimeFunction(Func1 *g)
Set a function of time that is used in determining the mass flow rate through the device.
double evalPressureFunction()
Return current value of the pressure function.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
Base class for 'functor' classes that evaluate a function of one variable.
virtual double eval(double t) const
Evaluate the function.
size_t nSpecies() const
Returns the number of species in the phase.
string speciesName(size_t k) const
Name of the species with index k.
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Base class for stirred reactors.
double massFraction(size_t k) const
Return the mass fraction of the k-th species.
double pressure() const
Returns the current pressure (Pa) of the reactor.
void addOutlet(FlowDevice &outlet)
Connect an outlet FlowDevice to this reactor.
void addInlet(FlowDevice &inlet)
Connect an inlet FlowDevice to this reactor.
ThermoPhase & contents()
return a reference to the contents.
double enthalpy_mass() const
Returns the current enthalpy (J/kg) of the reactor's contents.
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"