Cantera 2.6.0
FlowReactor.h
Go to the documentation of this file.
1//! @file FlowReactor.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_FLOWREACTOR_H
7#define CT_FLOWREACTOR_H
8
9#include "Reactor.h"
10
11namespace Cantera
12{
13
14//! Adiabatic flow in a constant-area duct.
15class FlowReactor : public Reactor
16{
17public:
19
20 virtual std::string typeStr() const {
21 warn_deprecated("FlowReactor::typeStr",
22 "To be removed after Cantera 2.6. Use type() instead.");
23 return "FlowReactor";
24 }
25
26 virtual std::string type() const {
27 return "FlowReactor";
28 }
29
30 virtual void getState(doublereal* y);
31
32 virtual void initialize(doublereal t0 = 0.0);
33 virtual void eval(double t, double* LHS, double* RHS);
34 virtual void updateState(doublereal* y);
35
36 void setMassFlowRate(double mdot);
37
38 void setTimeConstant(doublereal tau) {
39 m_fctr = 1.0/tau;
40 }
41
42 double speed() const {
43 return m_speed;
44 }
45 double distance() const {
46 return m_dist;
47 }
48
49 //! Return the index in the solution vector for this reactor of the
50 //! component named *nm*. Possible values for *nm* are "X" (position),
51 //! "U", the name of a homogeneous phase species, or the name of a surface
52 //! species.
53 virtual size_t componentIndex(const std::string& nm) const;
54
55protected:
56 doublereal m_speed, m_dist, m_T;
57 doublereal m_fctr;
58 doublereal m_rho0, m_speed0, m_P0, m_h0;
59};
60}
61
62#endif
Adiabatic flow in a constant-area duct.
Definition: FlowReactor.h:16
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.
Definition: FlowReactor.cpp:48
virtual void eval(double t, double *LHS, double *RHS)
Evaluate the reactor governing equations.
Definition: FlowReactor.cpp:81
virtual std::string typeStr() const
String indicating the reactor model implemented.
Definition: FlowReactor.h:20
virtual void getState(doublereal *y)
Get the the current state of the reactor.
Definition: FlowReactor.cpp:28
virtual std::string type() const
String indicating the reactor model implemented.
Definition: FlowReactor.h:26
virtual void initialize(doublereal t0=0.0)
Initialize the reactor.
Definition: FlowReactor.cpp:42
Class Reactor is a general-purpose class for stirred reactors.
Definition: Reactor.h:41
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.
Definition: AnyMap.cpp:1901