Cantera 2.6.0

Public Member Functions | Protected Attributes | Private Attributes | List of all members
FlowDevice Class Reference
Zero-dimensional reactor networks

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
FlowDevice & | operator= (const FlowDevice &)=delete
virtual std::string | typeStr () const
| String indicating the flow device implemented. More...
virtual std::string | type () const
| String indicating the flow device implemented. More...
double | massFlowRate ()
| 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 ()
ReactorBase & | in () const
| Return a reference to the upstream reactor. More...
const ReactorBase & | out () 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...

## Protected Attributes
double | m_mdot
Func1 * | m_pfunc
| Function set by setPressureFunction; used by updateMassFlowRate. More...
Func1 * | m_tfunc
| Function set by setTimeFunction; used by updateMassFlowRate. More...
double | m_coeff
| Coefficient set by derived classes; used by updateMassFlowRate. More...

## Private Attributes
size_t | m_nspin
size_t | m_nspout
ReactorBase * | m_in
ReactorBase * | m_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 23 of file FlowDevice.h.

## Constructor & Destructor Documentation

## ◆ FlowDevice()

FlowDevice | ( |  | ) |

Definition at line 14 of file FlowDevice.cpp.

## ◆ ~FlowDevice()

virtual ~FlowDevice | ( |  | ) |
| inline virtual

Definition at line 28 of file FlowDevice.h.

## Member Function Documentation

## ◆ typeStr()

virtual std::string typeStr | ( |  | ) | const
| inline virtual

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 in MassFlowController, PressureController, and Valve.

Definition at line 35 of file FlowDevice.h.

References Cantera::warn_deprecated().

## ◆ type()

virtual std::string type | ( |  | ) | const
| inline virtual

String indicating the flow device implemented.

Usually corresponds to the name of the derived class.

Reimplemented in MassFlowController, PressureController, and Valve.

Definition at line 43 of file FlowDevice.h.

## ◆ massFlowRate()

double massFlowRate | ( |  | ) |
| inline

Mass flow rate (kg/s).

Definition at line 48 of file FlowDevice.h.

References Cantera::Undef.

Referenced by ConstPressureReactor::eval(), IdealGasConstPressureReactor::eval(), IdealGasReactor::eval(), and PressureController::updateMassFlowRate().

## ◆ updateMassFlowRate()

virtual void updateMassFlowRate | ( | double | time | ) |
| inline virtual

Update the mass flow rate at time 'time'.

This must be overloaded in subclassess to update m_mdot.

Reimplemented in MassFlowController, PressureController, and Valve.

Definition at line 59 of file FlowDevice.h.

Referenced by 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.

Referenced by ConstPressureReactor::eval(), IdealGasConstPressureReactor::eval(), and IdealGasReactor::eval().

## ◆ enthalpy_mass()

double enthalpy_mass | ( |  | ) |

specific enthalpy

Definition at line 71 of file FlowDevice.cpp.

Referenced by ConstPressureReactor::eval(), IdealGasConstPressureReactor::eval(), and IdealGasReactor::eval().

## ◆ install()

bool install | ( | ReactorBase & | in,
|  | ReactorBase & | out
| ) |  |

Install a flow device between two reactors.

Parameters

  in | Upstream reactor.
  out | Downstream reactor.

Definition at line 18 of file FlowDevice.cpp.

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

## ◆ ready()

virtual bool ready | ( |  | ) |
| inline virtual

Definition at line 75 of file FlowDevice.h.

## ◆ in()

ReactorBase & in | ( |  | ) | const
| inline

Return a reference to the upstream reactor.

Definition at line 80 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 85 of file FlowDevice.h.

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

## ◆ 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.

## ◆ 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.

## Member Data Documentation

## ◆ m_mdot

double m_mdot
| protected

Definition at line 100 of file FlowDevice.h.

## ◆ m_pfunc

Func1* m_pfunc
| protected

Function set by setPressureFunction; used by updateMassFlowRate.

Definition at line 103 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 106 of file FlowDevice.h.

Referenced by Valve::updateMassFlowRate().

## ◆ m_coeff

double m_coeff
| protected

Coefficient set by derived classes; used by updateMassFlowRate.

Definition at line 109 of file FlowDevice.h.

Referenced by MassFlowController::getMassFlowCoeff(), PressureController::getPressureCoeff(), Valve::getValveCoeff(), MassFlowController::setMassFlowCoeff(), PressureController::setPressureCoeff(), Valve::setValveCoeff(), PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().

## ◆ m_nspin

size_t m_nspin
| private

Definition at line 112 of file FlowDevice.h.

## ◆ m_nspout

size_t m_nspout
| private

Definition at line 112 of file FlowDevice.h.

## ◆ m_in

ReactorBase* m_in
| private

Definition at line 113 of file FlowDevice.h.

## ◆ m_out

ReactorBase* m_out
| private

Definition at line 114 of file FlowDevice.h.

## ◆ m_in2out

std::vector<size_t> m_in2out
| private

Definition at line 115 of file FlowDevice.h.

## ◆ m_out2in

std::vector<size_t> m_out2in
| private

Definition at line 115 of file FlowDevice.h.

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

- FlowDevice.h
- FlowDevice.cpp