Cantera  3.2.0a2
Loading...
Searching...
No Matches
PressureController Class Reference

A class for flow controllers where the flow rate is equal to the flow rate of a primary mass flow controller plus a correction proportional to the pressure difference between the inlet and outlet. More...

#include <flowControllers.h>

Inheritance diagram for PressureController:
[legend]

Detailed Description

A class for flow controllers where the flow rate is equal to the flow rate of a primary mass flow controller plus a correction proportional to the pressure difference between the inlet and outlet.

The device coefficient c sets the proportionality constant between pressure drop and mass flow rate and has units of kg/s/Pa. The mass flow rate is computed as:

\[\dot{m} = \dot{m}_{primary} + c f(\Delta P) \]

where f is a functions of pressure drop that is set by setPressureFunction. If no functions is specified, the mass flow rate defaults to:

\[\dot{m} = \dot{m}_{primary} + c \Delta P \]

Definition at line 85 of file flowControllers.h.

Public Member Functions

string type () const override
 String indicating the connector implemented.
 
bool ready () override
 
void setPrimary (shared_ptr< ConnectorNode > primary) override
 Set the primary mass flow controller.
 
void setPrimary (FlowDevice *primary)
 Set the primary mass flow controller.
 
void setTimeFunction (Func1 *g) override
 Set a function of time that is used in determining the mass flow rate through the device.
 
void setTimeFunction (shared_ptr< Func1 > f) override
 Set a function of time to modulate the mass flow rate.
 
void setPressureCoeff (double c)
 Set the proportionality constant between pressure drop and mass flow rate.
 
double getPressureCoeff ()
 Get the pressure coefficient.
 
void updateMassFlowRate (double time) override
 Update the mass flow rate at time 'time'.
 
 FlowDevice (shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name="(none)")
 
- Public Member Functions inherited from FlowDevice
 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 ()
 
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.
 
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
 
- Public Member Functions inherited from ConnectorNode
 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
 
ConnectorNodeoperator= (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.
 

Protected Attributes

FlowDevicem_primary = nullptr
 
- Protected Attributes inherited from FlowDevice
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.
 
- Protected Attributes inherited from ConnectorNode
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.
 

Member Function Documentation

◆ type()

string type ( ) const
inlineoverridevirtual

String indicating the connector implemented.

Usually corresponds to the name of the derived class.

Reimplemented from FlowDevice.

Definition at line 90 of file flowControllers.h.

◆ ready()

bool ready ( )
inlineoverridevirtual

Reimplemented from FlowDevice.

Definition at line 94 of file flowControllers.h.

◆ setPrimary() [1/2]

void setPrimary ( shared_ptr< ConnectorNode primary)
overridevirtual

Set the primary mass flow controller.

Since
New in Cantera 3.2.

Reimplemented from FlowDevice.

Definition at line 52 of file flowControllers.cpp.

◆ setPrimary() [2/2]

void setPrimary ( FlowDevice primary)
inline

Set the primary mass flow controller.

Since
New in Cantera 3.0.
Deprecated:
To be removed after Cantera 3.2. Replaceable by version using shared pointer.

Definition at line 104 of file flowControllers.h.

◆ setTimeFunction() [1/2]

void setTimeFunction ( Func1 g)
inlineoverridevirtual

Set a function of time that is used in determining the mass flow rate through the device.

The evaluation of mass flow depends on the derived flow device class.

Deprecated:
To be removed after Cantera 3.2. Replaceable by version using shared pointer.

Reimplemented from FlowDevice.

Definition at line 111 of file flowControllers.h.

◆ setTimeFunction() [2/2]

void setTimeFunction ( shared_ptr< Func1 g)
inlineoverridevirtual

Set a function of time to modulate the mass flow rate.

Set a function of time that is used in determining the mass flow rate through the device. The evaluation of mass flow depends on the derived flow device class.

Since
Changed in Cantera 3.2. Previous version used a raw pointer.

Reimplemented from FlowDevice.

Definition at line 115 of file flowControllers.h.

◆ setPressureCoeff()

void setPressureCoeff ( double  c)
inline

Set the proportionality constant between pressure drop and mass flow rate.

Definition at line 120 of file flowControllers.h.

◆ getPressureCoeff()

double getPressureCoeff ( )
inline

Get the pressure coefficient.

Definition at line 125 of file flowControllers.h.

◆ updateMassFlowRate()

void updateMassFlowRate ( double  time)
overridevirtual

Update the mass flow rate at time 'time'.

This must be overloaded in derived classes to update m_mdot.

Reimplemented from FlowDevice.

Definition at line 34 of file flowControllers.cpp.

◆ FlowDevice()

FlowDevice ( shared_ptr< ReactorBase r0,
shared_ptr< ReactorBase r1,
const string &  name = "(none)" 
)

Definition at line 27 of file FlowDevice.cpp.

Member Data Documentation

◆ m_primary

FlowDevice* m_primary = nullptr
protected

Definition at line 132 of file flowControllers.h.


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