Go to the documentation of this file.
6 #ifndef CT_FLOWDEVICE_H
7 #define CT_FLOWDEVICE_H
22 const int PressureController_Type = 2;
23 const int Valve_Type = 3;
51 "To be changed after Cantera 2.5. "
52 "Return string instead of magic number; use "
53 "FlowDevice::typeStr during transition.");
64 " is deprecated and will be removed after Cantera 2.5.");
68 if (m_mdot ==
Undef) {
70 "Flow device is not ready. Try initializing the reactor network.");
94 virtual bool ready() {
95 return (m_in != 0 && m_out != 0);
112 "To be removed after Cantera 2.5. "
113 "Use device-specific functions (e.g. "
114 "Valve::setValveCoeff) instead.");
124 "To be removed after Cantera 2.5. "
125 "Use FlowDevice::setTimeFunction or "
126 "FlowDevice::setPressureFunction instead.");
127 if (
typeStr()==
"MassFlowController") {
129 }
else if (
typeStr()==
"Valve") {
148 "To be removed after Cantera 2.5. "
149 "Use device-specific functions (e.g. "
150 "MassFlowController::setMassFlowRate or "
151 "Valve::setValveCoeff) instead.");
170 size_t m_nspin, m_nspout;
173 std::vector<size_t> m_in2out, m_out2in;
double outletSpeciesMassFlowRate(size_t k)
Mass flow rate (kg/s) of outlet species k.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Base class for stirred reactors.
Func1 * m_tfunc
Function set by setTimeFunction; used by updateMassFlowRate.
bool install(ReactorBase &in, ReactorBase &out)
Install a flow device between two reactors.
virtual void updateMassFlowRate(double time)
Update the mass flow rate at time 'time'.
virtual void setTimeFunction(Func1 *g)
Set a function of time that is used in determining the mass flow rate through the device.
ReactorBase & in() const
Return a reference to the upstream reactor.
double massFlowRate(double time=-999.0)
Mass flow rate (kg/s).
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
const int MFC_Type
Magic numbers.
double m_coeff
Coefficient set by derived classes; used by updateMassFlowRate.
Base class for 'functor' classes that evaluate a function of one variable.
virtual void setParameters(int n, const double *coeffs)
Set parameters.
void setFunction(Func1 *f)
Set a function of a single variable that is used in determining the mass flow rate through the device...
virtual int type() const
Return an integer indicating the type of flow device.
void setMassFlowRate(double mdot)
Set the fixed mass flow rate (kg/s) through the flow device.
virtual std::string typeStr() const
String indicating the flow device implemented.
Base class for exceptions thrown by Cantera classes.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
virtual void setPressureFunction(Func1 *f)
Set a function of pressure that is used in determining the mass flow rate through the device.
Namespace for the Cantera kernel.
const ReactorBase & out() const
Return a const reference to the downstream reactor.
double enthalpy_mass()
specific enthalpy