Cantera  2.5.1
IdealGasConstPressureReactor.h
1 //! @file ConstPressureReactor.h
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at https://cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CT_IDEALGASCONSTP_REACTOR_H
7 #define CT_IDEALGASCONSTP_REACTOR_H
8 
9 #include "ConstPressureReactor.h"
10 
11 namespace Cantera
12 {
13 
14 /**
15  * Class ConstPressureReactor is a class for constant-pressure reactors. The
16  * reactor may have an arbitrary number of inlets and outlets, each of which may
17  * be connected to a "flow device" such as a mass flow controller, a pressure
18  * regulator, etc. Additional reactors may be connected to the other end of the
19  * flow device, allowing construction of arbitrary reactor networks.
20  */
22 {
23 public:
25 
26  virtual std::string typeStr() const {
27  return "IdealGasConstPressureReactor";
28  }
29 
30  /*!
31  * @deprecated To be changed after Cantera 2.5.
32  */
33  virtual int type() const {
34  warn_deprecated("IdealGasConstPressureReactor::type",
35  "To be changed after Cantera 2.5. "
36  "Return string instead of magic number; use "
37  "IdealGasConstPressureReactor::typeStr during "
38  "transition");
39  return IdealGasConstPressureReactorType;
40  }
41 
42  virtual void setThermoMgr(ThermoPhase& thermo);
43 
44  virtual void getState(doublereal* y);
45 
46  virtual void initialize(doublereal t0 = 0.0);
47  virtual void evalEqs(doublereal t, doublereal* y,
48  doublereal* ydot, doublereal* params);
49 
50  virtual void updateState(doublereal* y);
51 
52  //! Return the index in the solution vector for this reactor of the
53  //! component named *nm*. Possible values for *nm* are "mass",
54  //! "temperature", the name of a homogeneous phase species, or the name of a
55  //! surface species.
56  virtual size_t componentIndex(const std::string& nm) const;
57  std::string componentName(size_t k);
58 
59 protected:
60  vector_fp m_hk; //!< Species molar enthalpies
61 };
62 }
63 
64 #endif
Class ConstPressureReactor is a class for constant-pressure reactors.
Class ConstPressureReactor is a class for constant-pressure reactors.
virtual size_t componentIndex(const std::string &nm) const
Return the index in the solution vector for this reactor of the component named nm.
virtual void updateState(doublereal *y)
Set the state of the reactor to correspond to the state vector y.
virtual std::string typeStr() const
String indicating the reactor model implemented.
virtual void getState(doublereal *y)
Get the the current state of the reactor.
std::string componentName(size_t k)
Return the name of the solution component with index i.
virtual void initialize(doublereal t0=0.0)
Initialize the reactor.
virtual void evalEqs(doublereal t, doublereal *y, doublereal *ydot, doublereal *params)
virtual void setThermoMgr(ThermoPhase &thermo)
Specify the mixture contained in the reactor.
vector_fp m_hk
Species molar enthalpies.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:180
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264