27 FlowDevice(shared_ptr<ReactorBase> r0, shared_ptr<ReactorBase> r1,
28 const string&
name=
"(none)");
31 string type()
const override {
37 if (m_mdot ==
Undef) {
39 "Flow device is not ready. Try initializing the reactor network.");
68 virtual void setPrimary(shared_ptr<ConnectorNode> primary) {
88 virtual bool ready() {
89 return (m_in != 0 && m_out != 0);
167 double m_mdot =
Undef;
186 vector<size_t> m_in2out, m_out2in;
Base class for exceptions thrown by Cantera classes.
Base class for walls and flow devices connecting reactors.
string name() const
Retrieve connector name.
ConnectorNode(const string &name="(none)")
Transitional constructor.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
double outletSpeciesMassFlowRate(size_t k)
Mass flow rate (kg/s) of outlet species k.
bool install(ReactorBase &in, ReactorBase &out)
Install a flow device between two reactors.
Func1 * m_tfunc
Function set by setTimeFunction; used by updateMassFlowRate.
double m_time
Current reactor network time.
virtual void setMassFlowRate(double mdot)
Set the fixed mass flow rate (kg/s) through a flow device.
double m_coeff
Coefficient set by derived classes; used by updateMassFlowRate.
void setSimTime(double time)
Set current reactor network time.
string type() const override
String indicating the connector implemented.
double enthalpy_mass()
specific enthalpy
double deviceCoefficient() const
Get the device coefficient (defined by derived class).
ReactorBase & in() const
Return a reference to the upstream reactor.
virtual void setTimeFunction(shared_ptr< Func1 > g)
Set a function of time to modulate the mass flow rate.
virtual void setPressureFunction(Func1 *f)
Set a function of pressure that is used in determining the mass flow rate through the device.
double massFlowRate()
Mass flow rate (kg/s).
void setDeviceCoefficient(double c)
Set the device coefficient (defined by derived class).
const ReactorBase & out() const
Return a const reference to the downstream reactor.
double evalTimeFunction()
Return current value of the time function.
ReactorBase & out()
Return a mutable reference to the downstream reactor.
virtual void setPressureFunction(shared_ptr< Func1 > f)
Set a function of pressure to modify the pressure response.
virtual void setTimeFunction(Func1 *g)
Set a function of time that is used in determining the mass flow rate through the device.
virtual void updateMassFlowRate(double time)
Update the mass flow rate at time 'time'.
double evalPressureFunction()
Return current value of the pressure function.
Func1 * m_pfunc
Function set by setPressureFunction; used by updateMassFlowRate.
virtual void setPrimary(shared_ptr< ConnectorNode > primary)
Set the primary mass flow controller.
Base class for 'functor' classes that evaluate a function of one variable.
An error indicating that an unimplemented function has been called.
Base class for reactor objects.
This file contains definitions of constants, types and terms that are used in internal routines and a...
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Namespace for the Cantera kernel.
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...