| 19 | } |
| 20 | |
| 21 | void MassFlowController::updateMassFlowRate(double time) |
| 22 | { |
| 23 | if (!ready()) { |
| 24 | throw CanteraError("MassFlowController::updateMassFlowRate", |
| 25 | "Device is not ready; some parameters have not been set."); |
| 26 | } |
| 27 | double mdot = m_coeff; |
| 28 | if (m_tfunc) { |
| 29 | mdot *= m_tfunc->eval(time); |
| 30 | } |
| 31 | m_mdot = std::max(mdot, 0.0); |
| 32 | } |
| 33 | |
| 34 | void PressureController::updateMassFlowRate(double time) |
| 35 | { |