Cantera  2.3.0
Public Member Functions | Protected Attributes | Private Attributes | List of all members
FlowDevice Class Reference

Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors. More...

#include <FlowDevice.h>

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

Public Member Functions

int type ()
 Return an integer indicating the type of flow device. More...
 
doublereal massFlowRate (double time=-999.0)
 Mass flow rate (kg/s). More...
 
virtual void updateMassFlowRate (doublereal time)
 Update the mass flow rate at time 'time'. More...
 
doublereal outletSpeciesMassFlowRate (size_t k)
 Mass flow rate (kg/s) of outlet species k. More...
 
doublereal 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 setParameters (int n, const double *coeffs)
 set parameters. More...
 
void setFunction (Func1 *f)
 Set a function of a single variable that is used in determining the mass flow rate through the device. More...
 
void setMassFlowRate (doublereal mdot)
 Set the fixed mass flow rate (kg/s) through the flow device. More...
 

Protected Attributes

doublereal m_mdot
 
Func1m_func
 
vector_fp m_coeffs
 
int m_type
 

Private Attributes

size_t m_nspin
 
size_t m_nspout
 
ReactorBasem_in
 
ReactorBasem_out
 
std::vector< size_t > m_in2out
 
std::vector< size_t > m_out2in
 

Detailed Description

Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.

Definition at line 27 of file FlowDevice.h.

Member Function Documentation

◆ type()

int type ( )
inline

Return an integer indicating the type of flow device.

Definition at line 37 of file FlowDevice.h.

◆ massFlowRate()

doublereal massFlowRate ( double  time = -999.0)
inline

Mass flow rate (kg/s).

Definition at line 42 of file FlowDevice.h.

References FlowDevice::updateMassFlowRate().

Referenced by PressureController::updateMassFlowRate().

◆ updateMassFlowRate()

virtual void updateMassFlowRate ( doublereal  time)
inlinevirtual

Update the mass flow rate at time 'time'.

This must be overloaded in subclassess to update m_mdot.

Reimplemented in Valve, PressureController, and MassFlowController.

Definition at line 51 of file FlowDevice.h.

Referenced by FlowDevice::massFlowRate().

◆ outletSpeciesMassFlowRate()

doublereal outletSpeciesMassFlowRate ( size_t  k)

Mass flow rate (kg/s) of outlet species k.

Returns zero if this species is not present in the upstream mixture.

Definition at line 49 of file FlowDevice.cpp.

References ReactorBase::massFraction(), and Cantera::npos.

◆ enthalpy_mass()

doublereal enthalpy_mass ( )

specific enthalpy

Definition at line 61 of file FlowDevice.cpp.

References ReactorBase::enthalpy_mass().

◆ install()

bool install ( ReactorBase in,
ReactorBase out 
)

Install a flow device between two reactors.

Parameters
inUpstream reactor.
outDownstream reactor.

Definition at line 13 of file FlowDevice.cpp.

References ReactorBase::addInlet(), ReactorBase::addOutlet(), ReactorBase::contents(), FlowDevice::in(), Phase::nSpecies(), FlowDevice::out(), Phase::speciesIndex(), and Phase::speciesName().

◆ in()

ReactorBase& in ( ) const
inline

Return a reference to the upstream reactor.

Definition at line 72 of file FlowDevice.h.

Referenced by FlowDevice::install(), PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().

◆ out()

const ReactorBase& out ( ) const
inline

Return a const reference to the downstream reactor.

Definition at line 77 of file FlowDevice.h.

Referenced by FlowDevice::install(), PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().

◆ setParameters()

virtual void setParameters ( int  n,
const double *  coeffs 
)
inlinevirtual

set parameters.

Generic function used only in the Matlab interface. From Python or C++, device-specific functions like Valve::setPressureCoeff should be used instead.

Definition at line 84 of file FlowDevice.h.

◆ setFunction()

void setFunction ( Func1 f)

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

The meaning of this function depends on the parameterization of the derived type.

Definition at line 44 of file FlowDevice.cpp.

◆ setMassFlowRate()

void setMassFlowRate ( doublereal  mdot)
inline

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

Definition at line 95 of file FlowDevice.h.


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