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
11 namespace Cantera
12{
13
14//! Adiabatic flow in a constant-area duct.
15 class FlowReactor : public Reactor
16{
17 public:
18 FlowReactor();
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
55 protected:
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
Reactor.h
Cantera::FlowReactor
Adiabatic flow in a constant-area duct.
Definition: FlowReactor.h:16
Cantera::FlowReactor::componentIndex
virtual size_t componentIndex(const std::string &nm) const
Return the index in the solution vector for this reactor of the component named nm.
Definition: FlowReactor.cpp:105
Cantera::FlowReactor::updateState
virtual void updateState(doublereal *y)
Set the state of the reactor to correspond to the state vector y.
Definition: FlowReactor.cpp:48
Cantera::FlowReactor::eval
virtual void eval(double t, double *LHS, double *RHS)
Evaluate the reactor governing equations.
Definition: FlowReactor.cpp:81
Cantera::FlowReactor::typeStr
virtual std::string typeStr() const
String indicating the reactor model implemented.
Definition: FlowReactor.h:20
Cantera::FlowReactor::getState
virtual void getState(doublereal *y)
Get the the current state of the reactor.
Definition: FlowReactor.cpp:28
Cantera::FlowReactor::type
virtual std::string type() const
String indicating the reactor model implemented.
Definition: FlowReactor.h:26
Cantera::FlowReactor::initialize
virtual void initialize(doublereal t0=0.0)
Initialize the reactor.
Definition: FlowReactor.cpp:42
Cantera::Reactor
Class Reactor is a general-purpose class for stirred reactors.
Definition: Reactor.h:41
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::warn_deprecated
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