A class for mass flow controllers. More...
#include <flowControllers.h>
A class for mass flow controllers.
The mass flow rate is constant or specified as a function of time.
The device coefficient c specifies the mass flow coefficient with units of kg/s. The mass flow rate is computed as:
\[\dot{m} = c g(t) \]
where g is a function of time that is set by setTimeFunction
. If no function is specified, the mass flow rate defaults to:
\[\dot{m} = c \]
Definition at line 28 of file flowControllers.h.
Public Member Functions | |
string | type () const override |
String indicating the connector implemented. | |
void | setMassFlowRate (double mdot) override |
Set the fixed mass flow rate (kg/s) through a flow device. | |
void | setMassFlowCoeff (double m) |
Set the mass flow coefficient. | |
double | getMassFlowCoeff () |
Get the mass flow coefficient. | |
void | setPressureFunction (Func1 *f) override |
Set a function of pressure that is used in determining the mass flow rate through the device. | |
void | setPressureFunction (shared_ptr< Func1 > f) override |
Set a function of pressure to modify the pressure response. | |
void | updateMassFlowRate (double time) override |
If a function of time has been specified for mdot, then update the stored mass flow rate. | |
FlowDevice (shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name="(none)") | |
![]() | |
FlowDevice (shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name="(none)") | |
string | type () const override |
String indicating the connector implemented. | |
double | massFlowRate () |
Mass flow rate (kg/s). | |
virtual void | updateMassFlowRate (double time) |
Update the mass flow rate at time 'time'. | |
virtual void | setMassFlowRate (double mdot) |
Set the fixed mass flow rate (kg/s) through a flow device. | |
double | deviceCoefficient () const |
Get the device coefficient (defined by derived class). | |
void | setDeviceCoefficient (double c) |
Set the device coefficient (defined by derived class). | |
virtual void | setPrimary (shared_ptr< ConnectorNode > primary) |
Set the primary mass flow controller. | |
double | outletSpeciesMassFlowRate (size_t k) |
Mass flow rate (kg/s) of outlet species k. | |
double | enthalpy_mass () |
specific enthalpy | |
bool | install (ReactorBase &in, ReactorBase &out) |
Install a flow device between two reactors. | |
virtual bool | ready () |
ReactorBase & | in () const |
Return a reference to the upstream reactor. | |
const ReactorBase & | out () const |
Return a const reference to the downstream reactor. | |
ReactorBase & | out () |
Return a mutable reference to the downstream reactor. | |
double | evalPressureFunction () |
Return current value of the pressure function. | |
virtual void | setPressureFunction (Func1 *f) |
Set a function of pressure that is used in determining the mass flow rate through the device. | |
virtual void | setPressureFunction (shared_ptr< Func1 > f) |
Set a function of pressure to modify the pressure response. | |
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 | setTimeFunction (shared_ptr< Func1 > g) |
Set a function of time to modulate the mass flow rate. | |
void | setSimTime (double time) |
Set current reactor network time. | |
ConnectorNode (const string &name="(none)") | |
Transitional constructor. | |
ConnectorNode (shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name="(none)") | |
Instantiate a ConnectorNode object with associated ReactorBase objects. | |
ConnectorNode (const ConnectorNode &)=delete | |
![]() | |
ConnectorNode (const string &name="(none)") | |
Transitional constructor. | |
ConnectorNode (shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name="(none)") | |
Instantiate a ConnectorNode object with associated ReactorBase objects. | |
ConnectorNode (const ConnectorNode &)=delete | |
ConnectorNode & | operator= (const ConnectorNode &)=delete |
virtual string | type () const |
String indicating the connector implemented. | |
string | name () const |
Retrieve connector name. | |
void | setName (const string &name) |
Set connector name. | |
void | setDefaultName (map< string, int > &counts) |
Set the default name of a connector. Returns false if it was previously set. | |
Additional Inherited Members | |
![]() | |
double | m_mdot = Undef |
Func1 * | m_pfunc = nullptr |
Function set by setPressureFunction; used by updateMassFlowRate. | |
Func1 * | m_tfunc = nullptr |
Function set by setTimeFunction; used by updateMassFlowRate. | |
double | m_coeff = 1.0 |
Coefficient set by derived classes; used by updateMassFlowRate. | |
double | m_time = 0. |
Current reactor network time. | |
![]() | |
pair< shared_ptr< ReactorBase >, shared_ptr< ReactorBase > > | m_nodes |
Pair of reactors forming end points of the connector. | |
string | m_name |
ConnectorNode name. | |
bool | m_defaultNameSet = false |
true if default name has been previously set. | |
|
inlineoverridevirtual |
String indicating the connector implemented.
Usually corresponds to the name of the derived class.
Reimplemented from FlowDevice.
Definition at line 33 of file flowControllers.h.
|
overridevirtual |
Set the fixed mass flow rate (kg/s) through a flow device.
Reimplemented from FlowDevice.
Definition at line 13 of file flowControllers.cpp.
|
inline |
Set the mass flow coefficient.
m has units of kg/s. The mass flow rate is computed as:
where g is a function of time that is set by setTimeFunction
. If no function is specified, the mass flow rate defaults to:
\[\dot{m} = m \]
Definition at line 47 of file flowControllers.h.
|
inline |
Get the mass flow coefficient.
Definition at line 52 of file flowControllers.h.
|
inlineoverridevirtual |
Set a function of pressure that is used in determining the mass flow rate through the device.
The evaluation of mass flow depends on the derived flow device class.
Reimplemented from FlowDevice.
Definition at line 56 of file flowControllers.h.
|
inlineoverridevirtual |
Set a function of pressure to modify the pressure response.
Set a function of pressure that is used in determining the mass flow rate through the device. The evaluation of mass flow depends on the derived flow device class.
Reimplemented from FlowDevice.
Definition at line 60 of file flowControllers.h.
|
overridevirtual |
If a function of time has been specified for mdot, then update the stored mass flow rate.
Otherwise, mdot is a constant, and does not need updating.
Reimplemented from FlowDevice.
Definition at line 21 of file flowControllers.cpp.
FlowDevice | ( | shared_ptr< ReactorBase > | r0, |
shared_ptr< ReactorBase > | r1, | ||
const string & | name = "(none)" |
||
) |
Definition at line 27 of file FlowDevice.cpp.