13MassFlowController::MassFlowController() : FlowDevice() {
16void MassFlowController::setMassFlowRate(
double mdot)
24void MassFlowController::updateMassFlowRate(
double time)
27 throw CanteraError(
"MassFlowController::updateMassFlowRate",
28 "Device is not ready; some parameters have not been set.");
30 double mdot = m_coeff;
32 mdot *= m_tfunc->eval(time);
34 m_mdot = std::max(mdot, 0.0);
37PressureController::PressureController() :
FlowDevice(), m_master(0) {
43 throw CanteraError(
"PressureController::updateMassFlowRate",
44 "Device is not ready; some parameters have not been set.");
55 m_mdot = std::max(mdot, 0.0);
65 "Device is not ready; some parameters have not been set.");
77 m_mdot = std::max(mdot, 0.0);
Base class for exceptions thrown by Cantera classes.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Func1 * m_tfunc
Function set by setTimeFunction; used by updateMassFlowRate.
double m_coeff
Coefficient set by derived classes; used by updateMassFlowRate.
ReactorBase & in() const
Return a reference to the upstream reactor.
double massFlowRate()
Mass flow rate (kg/s).
const ReactorBase & out() const
Return a const reference to the downstream reactor.
virtual void updateMassFlowRate(double time)
Update the mass flow rate at time 'time'.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
virtual doublereal eval(doublereal t) const
Evaluate the function.
virtual void updateMassFlowRate(double time)
Update the mass flow rate at time 'time'.
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
virtual void updateMassFlowRate(double time)
Compute the current mass flow rate, based on the pressure difference.
Some flow devices derived from class FlowDevice.
Namespace for the Cantera kernel.