Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 
virtual void updateMassFlowRate (doublereal time)
 Update the mass flow rate at time 'time'. More...
 
doublereal outletSpeciesMassFlowRate (size_t k)
 
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, doublereal *coeffs)
 set parameters More...
 
void setFunction (Cantera::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
 
Cantera::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 28 of file FlowDevice.h.

Member Function Documentation

int type ( )
inline

Return an integer indicating the type of flow device.

Definition at line 38 of file FlowDevice.h.

doublereal massFlowRate ( double  time = -999.0)
inline

Mass flow rate (kg/s).

Definition at line 45 of file FlowDevice.h.

References FlowDevice::updateMassFlowRate().

Referenced by PressureController::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 54 of file FlowDevice.h.

Referenced by FlowDevice::massFlowRate().

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 45 of file FlowDevice.cpp.

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

doublereal enthalpy_mass ( )

specific enthalpy

Definition at line 57 of file FlowDevice.cpp.

References ReactorBase::enthalpy_mass().

bool install ( ReactorBase in,
ReactorBase out 
)

Install a flow device between two reactors.

Parameters
inUpstream reactor.
outDownstream reactor.

Definition at line 9 of file FlowDevice.cpp.

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

ReactorBase& in ( ) const
inline

Return a reference to the upstream reactor.

Definition at line 77 of file FlowDevice.h.

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

const ReactorBase& out ( ) const
inline

Return a const reference to the downstream reactor.

Definition at line 82 of file FlowDevice.h.

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

virtual void setParameters ( int  n,
doublereal *  coeffs 
)
inlinevirtual

set parameters

Definition at line 87 of file FlowDevice.h.

void setFunction ( Cantera::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 40 of file FlowDevice.cpp.

void setMassFlowRate ( doublereal  mdot)
inline

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

Definition at line 98 of file FlowDevice.h.


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