34 virtual string type()
const {
53 if (m_mdot ==
Undef) {
55 "Flow device is not ready. Try initializing the reactor network.");
79 virtual bool ready() {
80 return (m_in != 0 && m_out != 0);
139 double m_mdot =
Undef;
158 vector<size_t> m_in2out, m_out2in;
Base class for exceptions thrown by Cantera classes.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
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 m_coeff
Coefficient set by derived classes; used by updateMassFlowRate.
void setSimTime(double time)
Set current reactor network time.
double enthalpy_mass()
specific enthalpy
void setName(const string &name)
Set flow device name.
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.
double massFlowRate()
Mass flow rate (kg/s).
const ReactorBase & out() const
Return a const reference to the downstream reactor.
double evalTimeFunction()
Return current value of the time function.
ReactorBase & out()
Return a mutable reference to the downstream reactor.
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.
virtual void updateMassFlowRate(double time)
Update the mass flow rate at time 'time'.
double evalPressureFunction()
Return current value of the pressure function.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
string name() const
Retrieve flow device name.
Base class for 'functor' classes that evaluate a function of one variable.
Base class for stirred reactors.
This file contains definitions of constants, types and terms that are used in internal routines and a...
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 and logging,...
Namespace for the Cantera kernel.
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...