6 #ifndef CT_FLOWDEVICE_H
7 #define CT_FLOWDEVICE_H
34 virtual string type()
const {
40 if (m_mdot ==
Undef) {
42 "Flow device is not ready. Try initializing the reactor network.");
66 virtual bool ready() {
67 return (m_in != 0 && m_out != 0);
118 double m_mdot =
Undef;
137 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 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.
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
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).
double evalTimeFunction()
Return current value of the time function.
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'.
ReactorBase & in() const
Return a reference to the upstream reactor.
double evalPressureFunction()
Return current value of the pressure function.
const ReactorBase & out() const
Return a const reference to the downstream reactor.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
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...