Cantera  3.1.0
Loading...
Searching...
No Matches
MassFlowController Class Reference

A class for mass flow controllers. More...

#include <flowControllers.h>

Inheritance diagram for MassFlowController:
[legend]

Detailed Description

A class for mass flow controllers.

The mass flow rate is constant or specified as a function of time.

Definition at line 20 of file flowControllers.h.

Public Member Functions

string type () const override
 String indicating the flow device implemented.
 
void setMassFlowRate (double mdot)
 Set the fixed mass flow rate (kg/s) through the mass flow controller.
 
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 updateMassFlowRate (double time) override
 If a function of time has been specified for mdot, then update the stored mass flow rate.
 
 FlowDevice (const string &name="(none)")
 
 FlowDevice (const FlowDevice &)=delete
 
- Public Member Functions inherited from FlowDevice
 FlowDevice (const string &name="(none)")
 
 FlowDevice (const FlowDevice &)=delete
 
FlowDeviceoperator= (const FlowDevice &)=delete
 
virtual string type () const
 String indicating the flow device implemented.
 
string name () const
 Retrieve flow device name.
 
void setName (const string &name)
 Set flow device name.
 
bool setDefaultName (map< string, int > &counts)
 Set the default name of a flow device. Returns false if it was previously set.
 
double massFlowRate ()
 Mass flow rate (kg/s).
 
virtual void updateMassFlowRate (double time)
 Update the mass flow rate at time 'time'.
 
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 ()
 
ReactorBasein () const
 Return a reference to the upstream reactor.
 
const ReactorBaseout () const
 Return a const reference to the downstream reactor.
 
ReactorBaseout ()
 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.
 
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.
 
void setSimTime (double time)
 Set current reactor network time.
 

Additional Inherited Members

- Protected Attributes inherited from FlowDevice
string m_name
 Flow device name.
 
bool m_defaultNameSet = false
 true if default name has been previously set.
 
double m_mdot = Undef
 
Func1m_pfunc = nullptr
 Function set by setPressureFunction; used by updateMassFlowRate.
 
Func1m_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.
 

Member Function Documentation

◆ type()

string type ( ) const
inlineoverridevirtual

String indicating the flow device implemented.

Usually corresponds to the name of the derived class.

Reimplemented from FlowDevice.

Definition at line 25 of file flowControllers.h.

◆ setMassFlowRate()

void setMassFlowRate ( double  mdot)

Set the fixed mass flow rate (kg/s) through the mass flow controller.

Definition at line 13 of file flowControllers.cpp.

◆ setMassFlowCoeff()

void setMassFlowCoeff ( double  m)
inline

Set the mass flow coefficient.

m has units of kg/s. The mass flow rate is computed as:

\[\dot{m} = m 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} = m \]

Definition at line 40 of file flowControllers.h.

◆ getMassFlowCoeff()

double getMassFlowCoeff ( )
inline

Get the mass flow coefficient.

Definition at line 45 of file flowControllers.h.

◆ setPressureFunction()

void setPressureFunction ( Func1 f)
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 49 of file flowControllers.h.

◆ updateMassFlowRate()

void updateMassFlowRate ( double  time)
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()

FlowDevice ( const string &  name = "(none)")
inline

Definition at line 26 of file FlowDevice.h.


The documentation for this class was generated from the following files: