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;
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.
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.
Func1 * m_tfunc
Function set by setTimeFunction; used by updateMassFlowRate.
double m_coeff
Coefficient set by derived classes; used by updateMassFlowRate.
double enthalpy_mass()
specific enthalpy
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.
virtual void setParameters(int n, const double *coeffs)
Set parameters.
double massFlowRate(double time=-999.0)
Mass flow rate (kg/s).
virtual void setPressureFunction(Func1 *f)
Set a function of pressure that is used in determining the mass flow rate through the device.
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.
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 terms that are used in internal routines and are unlikely to need m...
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,...
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
Namespace for the Cantera kernel.
const int MFC_Type
Magic numbers.
Contains declarations for string manipulation functions within Cantera.