26 virtual bool ready() {
27 return FlowDevice::ready() && m_mdot >= 0.0;
35 m_mdot = m_func->
eval(time);
37 m_mdot = std::max(m_mdot, 0.0);
50 m_type = PressureController_Type;
53 virtual bool ready() {
54 return FlowDevice::ready() && m_master != 0 && m_coeffs.size() == 1;
73 throw CanteraError(
"PressureController::updateMassFlowRate",
74 "Device is not ready; some parameters have not been set.");
78 m_mdot = std::max(m_mdot, 0.0);
99 virtual bool ready() {
100 return FlowDevice::ready() && (m_coeffs.size() == 1 || m_func);
117 "Device is not ready; some parameters have not been set.");
121 m_mdot = m_func->
eval(delta_P);
123 m_mdot = m_coeffs[0]*delta_P;
125 m_mdot = std::max(m_mdot, 0.0);
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Supply a mass flow rate that is a function of the pressure drop across the valve. ...
A class for flow controllers where the flow rate is equal to the flow rate of a "master" mass flow co...
void setPressureCoeff(double c)
Set the proportionality constant between pressure drop and mass flow rate.
const ReactorBase & out() const
Return a const reference to the downstream reactor.
virtual doublereal eval(doublereal t) const
Evaluate the function.
virtual void updateMassFlowRate(doublereal time)
Update the mass flow rate at time 'time'.
virtual void updateMassFlowRate(doublereal time)
Compute the currrent mass flow rate, based on the pressure difference.
A class for mass flow controllers.
Base class for exceptions thrown by Cantera classes.
void setPressureCoeff(double c)
Set the proportionality constant between pressure drop and mass flow rate.
doublereal massFlowRate(double time=-999.0)
Mass flow rate (kg/s).
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
ReactorBase & in() const
Return a reference to the upstream reactor.
Namespace for the Cantera kernel.
virtual void updateMassFlowRate(doublereal time)
If a function of time has been specified for mdot, then update the stored mass flow rate...