Cantera  2.5.1
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

 FlowDevice (const FlowDevice &)=delete
 
FlowDeviceoperator= (const FlowDevice &)=delete
 
virtual std::string typeStr () const
 String indicating the flow device implemented. More...
 
virtual int type () const
 Return an integer indicating the type of flow device. More...
 
double massFlowRate (double time=-999.0)
 Mass flow rate (kg/s). More...
 
virtual void updateMassFlowRate (double time)
 Update the mass flow rate at time 'time'. 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 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...
 
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...
 
void setMassFlowRate (double mdot)
 Set the fixed mass flow rate (kg/s) through the flow device. More...
 

Protected Attributes

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...
 
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 30 of file FlowDevice.h.

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.

Reimplemented in Valve, PressureController, and MassFlowController.

Definition at line 41 of file FlowDevice.h.

Referenced by FlowDevice::setFunction().

◆ type()

virtual int type ( ) const
inlinevirtual

Return an integer indicating the type of flow device.

Deprecated:
To be changed after Cantera 2.5.

Definition at line 49 of file FlowDevice.h.

References FlowDevice::m_type, and Cantera::warn_deprecated().

◆ massFlowRate()

double massFlowRate ( double  time = -999.0)
inline

Mass flow rate (kg/s).

Deprecated:
The 'time' argument will be removed after Cantera 2.5. Evaluating the mass flow rate at times other than the current time for the reactor network may lead to subtly incorrect results.

Definition at line 61 of file FlowDevice.h.

References Cantera::Undef, FlowDevice::updateMassFlowRate(), and Cantera::warn_deprecated().

Referenced by PressureController::updateMassFlowRate().

◆ updateMassFlowRate()

virtual void updateMassFlowRate ( double  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 78 of file FlowDevice.h.

Referenced by FlowDevice::massFlowRate(), and PressureController::updateMassFlowRate().

◆ outletSpeciesMassFlowRate()

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

References Cantera::npos.

◆ enthalpy_mass()

double enthalpy_mass ( )

specific enthalpy

Definition at line 71 of file FlowDevice.cpp.

◆ install()

bool install ( ReactorBase in,
ReactorBase out 
)

Install a flow device between two reactors.

Parameters
inUpstream reactor.
outDownstream reactor.

Definition at line 18 of file FlowDevice.cpp.

References ReactorBase::addOutlet(), Phase::nSpecies(), Phase::speciesIndex(), and Phase::speciesName().

◆ in()

ReactorBase& in ( ) const
inline

Return a reference to the upstream reactor.

Definition at line 99 of file FlowDevice.h.

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

◆ out()

const ReactorBase& out ( ) const
inline

Return a const reference to the downstream reactor.

Definition at line 104 of file FlowDevice.h.

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

◆ setParameters()

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

Set parameters.

Generic function formerly used in the Matlab interface.

Deprecated:
To be removed after Cantera 2.5.

Definition at line 110 of file FlowDevice.h.

References FlowDevice::m_coeff, and Cantera::warn_deprecated().

◆ setFunction()

void setFunction ( Func1 f)
inline

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.

Deprecated:
To be removed after Cantera 2.5.

Definition at line 122 of file FlowDevice.h.

References FlowDevice::setPressureFunction(), FlowDevice::setTimeFunction(), FlowDevice::typeStr(), and Cantera::warn_deprecated().

◆ setPressureFunction()

void setPressureFunction ( Func1 f)
virtual

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 in MassFlowController.

Definition at line 49 of file FlowDevice.cpp.

Referenced by FlowDevice::setFunction().

◆ setTimeFunction()

void setTimeFunction ( Func1 g)
virtual

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.

Reimplemented in PressureController.

Definition at line 54 of file FlowDevice.cpp.

Referenced by FlowDevice::setFunction().

◆ setMassFlowRate()

void setMassFlowRate ( double  mdot)
inline

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

Deprecated:
To be removed after Cantera 2.5.

Definition at line 146 of file FlowDevice.h.

References Cantera::warn_deprecated().

Member Data Documentation

◆ m_pfunc

Func1* m_pfunc
protected

Function set by setPressureFunction; used by updateMassFlowRate.

Definition at line 159 of file FlowDevice.h.

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

◆ m_tfunc

Func1* m_tfunc
protected

Function set by setTimeFunction; used by updateMassFlowRate.

Definition at line 162 of file FlowDevice.h.

Referenced by Valve::updateMassFlowRate().

◆ m_coeff

double m_coeff
protected

◆ m_type

int m_type
protected
Deprecated:
To be removed after Cantera 2.5.

Definition at line 167 of file FlowDevice.h.

Referenced by FlowDevice::type().


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