Cantera
2.5.1
|
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors. More...
#include <FlowDevice.h>
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 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 () |
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 | 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 |
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... | |
int | m_type |
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 |
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Definition at line 30 of file FlowDevice.h.
|
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().
|
inlinevirtual |
Return an integer indicating the type of flow device.
Definition at line 49 of file FlowDevice.h.
References FlowDevice::m_type, and Cantera::warn_deprecated().
|
inline |
Mass flow rate (kg/s).
Definition at line 61 of file FlowDevice.h.
References Cantera::Undef, FlowDevice::updateMassFlowRate(), and Cantera::warn_deprecated().
Referenced by PressureController::updateMassFlowRate().
|
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().
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.
double enthalpy_mass | ( | ) |
specific enthalpy
Definition at line 71 of file FlowDevice.cpp.
bool install | ( | ReactorBase & | in, |
ReactorBase & | out | ||
) |
Install a flow device between two reactors.
in | Upstream reactor. |
out | Downstream reactor. |
Definition at line 18 of file FlowDevice.cpp.
References ReactorBase::addOutlet(), Phase::nSpecies(), Phase::speciesIndex(), and Phase::speciesName().
|
inline |
Return a reference to the upstream reactor.
Definition at line 99 of file FlowDevice.h.
Referenced by PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().
|
inline |
Return a const reference to the downstream reactor.
Definition at line 104 of file FlowDevice.h.
Referenced by PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().
|
inlinevirtual |
Set parameters.
Generic function formerly used in the Matlab interface.
Definition at line 110 of file FlowDevice.h.
References FlowDevice::m_coeff, and Cantera::warn_deprecated().
|
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.
Definition at line 122 of file FlowDevice.h.
References FlowDevice::setPressureFunction(), FlowDevice::setTimeFunction(), FlowDevice::typeStr(), and Cantera::warn_deprecated().
|
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().
|
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().
|
inline |
Set the fixed mass flow rate (kg/s) through the flow device.
Definition at line 146 of file FlowDevice.h.
References Cantera::warn_deprecated().
|
protected |
Function set by setPressureFunction; used by updateMassFlowRate.
Definition at line 159 of file FlowDevice.h.
Referenced by PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().
|
protected |
Function set by setTimeFunction; used by updateMassFlowRate.
Definition at line 162 of file FlowDevice.h.
Referenced by Valve::updateMassFlowRate().
|
protected |
Coefficient set by derived classes; used by updateMassFlowRate.
Definition at line 165 of file FlowDevice.h.
Referenced by MassFlowController::getMassFlowCoeff(), PressureController::getPressureCoeff(), Valve::getValveCoeff(), MassFlowController::setMassFlowCoeff(), FlowDevice::setParameters(), PressureController::setPressureCoeff(), Valve::setPressureCoeff(), Valve::setValveCoeff(), PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().
|
protected |
Definition at line 167 of file FlowDevice.h.
Referenced by FlowDevice::type().