10 #define CT_FLOWCONTR_H
29 virtual bool ready() {
30 return FlowDevice::ready() && m_mdot >= 0.0;
38 m_mdot = m_func->
eval(time);
40 m_mdot = std::max(m_mdot, 0.0);
53 m_type = PressureController_Type;
56 virtual bool ready() {
57 return FlowDevice::ready() && m_master != 0 && m_coeffs.size() == 1;
66 throw CanteraError(
"PressureController::updateMassFlowRate",
67 "Device is not ready; some parameters have not been set.");
70 m_mdot = master_mdot + m_coeffs[0]*(
in().
pressure() -
72 m_mdot = std::max(m_mdot, 0.0);
93 virtual bool ready() {
94 return FlowDevice::ready() && (m_coeffs.size() == 1 || m_func);
101 "Device is not ready; some parameters have not been set.");
105 m_mdot = m_func->
eval(delta_P);
107 m_mdot = m_coeffs[0]*delta_P;
109 m_mdot = std::max(m_mdot, 0.0);
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
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. ...
const ReactorBase & out() const
Return a const reference to the downstream reactor.
A class for flow controllers where the flow rate is equal to the flow rate of a "master" mass flow co...
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.
ReactorBase & in() const
Return a reference to the upstream reactor.
Base class for exceptions thrown by Cantera classes.
doublereal massFlowRate(double time=-999.0)
virtual void updateMassFlowRate(doublereal time)
If a function of time has been specified for mdot, then update the stored mass flow rate...