Cantera 2.6.0
Public Member Functions | List of all members
Valve Class Reference

Supply a mass flow rate that is a function of the pressure drop across the valve. More...

#include <flowControllers.h>

Inheritance diagram for Valve:
[legend]
Collaboration diagram for Valve:
[legend]

Public Member Functions

virtual std::string typeStr () const
 String indicating the flow device implemented. More...
 
virtual std::string type () const
 String indicating the flow device implemented. More...
 
void setValveCoeff (double c)
 Set the proportionality constant between pressure drop and mass flow rate. More...
 
double getValveCoeff ()
 Get the valve coefficient. More...
 
virtual void updateMassFlowRate (double time)
 Compute the current mass flow rate, based on the pressure difference. More...
 
- Public Member Functions inherited from FlowDevice
 FlowDevice (const FlowDevice &)=delete
 
FlowDeviceoperator= (const FlowDevice &)=delete
 
double massFlowRate ()
 Mass flow rate (kg/s). More...
 
double outletSpeciesMassFlowRate (size_t k)
 Mass flow rate (kg/s) of outlet species k. More...
 
double enthalpy_mass ()
 specific enthalpy More...
 
bool install (ReactorBase &in, ReactorBase &out)
 Install a flow device between two reactors. More...
 
virtual bool ready ()
 
ReactorBasein () const
 Return a reference to the upstream reactor. More...
 
const ReactorBaseout () const
 Return a const reference to the downstream reactor. More...
 
virtual void setPressureFunction (Func1 *f)
 Set a function of pressure that is used in determining the mass flow rate through the device. More...
 
virtual void setTimeFunction (Func1 *g)
 Set a function of time that is used in determining the mass flow rate through the device. More...
 

Additional Inherited Members

- Protected Attributes inherited from FlowDevice
double m_mdot
 
Func1m_pfunc
 Function set by setPressureFunction; used by updateMassFlowRate. More...
 
Func1m_tfunc
 Function set by setTimeFunction; used by updateMassFlowRate. More...
 
double m_coeff
 Coefficient set by derived classes; used by updateMassFlowRate. More...
 

Detailed Description

Supply a mass flow rate that is a function of the pressure drop across the valve.

The default behavior is a linearly proportional to the pressure difference. Note that real valves do not have this behavior, so this class does not model real, physical valves.

Definition at line 129 of file flowControllers.h.

Constructor & Destructor Documentation

◆ Valve()

Valve ( )

Definition at line 58 of file flowControllers.cpp.

Member Function Documentation

◆ typeStr()

virtual std::string typeStr ( ) const
inlinevirtual

String indicating the flow device implemented.

Usually corresponds to the name of the derived class.

Deprecated:
To be removed after Cantera 2.6. Use type() instead.

Reimplemented from FlowDevice.

Definition at line 134 of file flowControllers.h.

References Cantera::warn_deprecated().

◆ type()

virtual std::string type ( ) const
inlinevirtual

String indicating the flow device implemented.

Usually corresponds to the name of the derived class.

Reimplemented from FlowDevice.

Definition at line 140 of file flowControllers.h.

◆ setValveCoeff()

void setValveCoeff ( double  c)
inline

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

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

\[\dot{m} = c g(t) f(\Delta P) \]

where g and f are functions of time and pressure drop that are set by setTimeFunction and setPressureFunction, respectively. If no functions are specified, the mass flow rate defaults to:

\[\dot{m} = c \Delta P \]

Definition at line 154 of file flowControllers.h.

References FlowDevice::m_coeff.

◆ getValveCoeff()

double getValveCoeff ( )
inline

Get the valve coefficient.

Definition at line 159 of file flowControllers.h.

References FlowDevice::m_coeff.

◆ updateMassFlowRate()

void updateMassFlowRate ( double  time)
virtual

Compute the current mass flow rate, based on the pressure difference.

Reimplemented from FlowDevice.

Definition at line 61 of file flowControllers.cpp.

References Func1::eval(), FlowDevice::in(), FlowDevice::m_coeff, FlowDevice::m_pfunc, FlowDevice::m_tfunc, FlowDevice::out(), and ReactorBase::pressure().


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