24 throw CanteraError(
"MassFlowController::updateMassFlowRate",
25 "Device is not ready; some parameters have not been set.");
31 m_mdot = std::max(mdot, 0.0);
37 throw CanteraError(
"PressureController::updateMassFlowRate",
38 "Device is not ready; some parameters have not been set.");
49 m_mdot = std::max(mdot, 0.0);
56 "Device is not ready; some parameters have not been set.");
68 m_mdot = std::max(mdot, 0.0);
Base class for exceptions thrown by Cantera classes.
Func1 * m_tfunc
Function set by setTimeFunction; used by updateMassFlowRate.
double m_coeff
Coefficient set by derived classes; used by updateMassFlowRate.
double massFlowRate()
Mass flow rate (kg/s).
virtual void updateMassFlowRate(double time)
Update the mass flow rate at time 'time'.
ReactorBase & in() const
Return a reference to the upstream reactor.
const ReactorBase & out() const
Return a const reference to the downstream reactor.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
virtual double eval(double t) const
Evaluate the function.
void setMassFlowRate(double mdot)
Set the fixed mass flow rate (kg/s) through the mass flow controller.
void updateMassFlowRate(double time) override
If a function of time has been specified for mdot, then update the stored mass flow rate.
void updateMassFlowRate(double time) override
Update the mass flow rate at time 'time'.
double pressure() const
Returns the current pressure (Pa) of the reactor.
void updateMassFlowRate(double time) override
Compute the current mass flow rate, based on the pressure difference.
Some flow devices derived from class FlowDevice.
Namespace for the Cantera kernel.