Cantera
2.4.0
|
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 |
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 () |
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... | |
void | setMassFlowRate (doublereal mdot) |
Set the fixed mass flow rate (kg/s) through the flow device. More... | |
Protected Attributes | |
doublereal | m_mdot |
Func1 * | m_func |
vector_fp | m_coeffs |
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 27 of file FlowDevice.h.
|
inline |
Return an integer indicating the type of flow device.
Definition at line 39 of file FlowDevice.h.
|
inline |
Mass flow rate (kg/s).
Definition at line 44 of file FlowDevice.h.
References FlowDevice::updateMassFlowRate().
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 53 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 49 of file FlowDevice.cpp.
References ReactorBase::massFraction(), and Cantera::npos.
doublereal enthalpy_mass | ( | ) |
specific enthalpy
Definition at line 61 of file FlowDevice.cpp.
References ReactorBase::enthalpy_mass().
bool install | ( | ReactorBase & | in, |
ReactorBase & | out | ||
) |
Install a flow device between two reactors.
in | Upstream reactor. |
out | Downstream 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().
|
inline |
Return a reference to the upstream reactor.
Definition at line 74 of file FlowDevice.h.
Referenced by FlowDevice::install(), PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().
|
inline |
Return a const reference to the downstream reactor.
Definition at line 79 of file FlowDevice.h.
Referenced by FlowDevice::install(), PressureController::updateMassFlowRate(), and Valve::updateMassFlowRate().
|
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 86 of file FlowDevice.h.
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.
|
inline |
Set the fixed mass flow rate (kg/s) through the flow device.
Definition at line 97 of file FlowDevice.h.