Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
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 IdealGasConstPressureReactor is a class for constant-pressure reactors
16
* that use temperature instead of total enthalpy as a state variable. The class
17
* name is historical; this formulation is applicable to non-ideal equations of
18
* state where the ThermoPhase implements the required enthalpy and heat
19
* capacity properties.
20
* @ingroup reactorGroup
21
*/
22
class
IdealGasConstPressureReactor
:
public
ConstPressureReactor
23
{
24
public
:
25
using
ConstPressureReactor::ConstPressureReactor;
// inherit constructors
26
27
string
type
()
const override
{
28
return
"IdealGasConstPressureReactor"
;
29
}
30
31
void
getState
(span<double> y)
override
;
32
33
void
initialize
(
double
t0=0.0)
override
;
34
void
eval
(
double
t, span<double> LHS, span<double> RHS)
override
;
35
void
evalSteady
(
double
t, span<double> LHS, span<double> RHS)
override
;
36
void
updateState
(span<const double> y)
override
;
37
vector<size_t>
initializeSteady
()
override
;
38
39
//! Return the index in the solution vector for this reactor of the
40
//! component named *nm*. Possible values for *nm* are "mass",
41
//! "temperature", the name of a homogeneous phase species, or the name of a
42
//! surface species.
43
size_t
componentIndex
(
const
string
& nm)
const override
;
44
string
componentName
(
size_t
k)
override
;
45
double
upperBound
(
size_t
k)
const override
;
46
double
lowerBound
(
size_t
k)
const override
;
47
48
protected
:
49
vector<double>
m_hk
;
//!< Species molar enthalpies
50
51
//! Initial mass [kg]; used for steady-state calculations
52
double
m_initialMass
;
53
54
//! Initial temperature [K]; used for steady-state calculations
55
double
m_initialTemperature
;
56
};
57
}
58
59
#endif
ConstPressureReactor.h
Cantera::IdealGasConstPressureReactor
Class IdealGasConstPressureReactor is a class for constant-pressure reactors that use temperature ins...
Definition
IdealGasConstPressureReactor.h:23
Cantera::IdealGasConstPressureReactor::upperBound
double upperBound(size_t k) const override
Get the upper bound on the k-th component of the local state vector.
Definition
IdealGasConstPressureReactor.cpp:157
Cantera::IdealGasConstPressureReactor::eval
void eval(double t, span< double > LHS, span< double > RHS) override
Evaluate the reactor governing equations.
Definition
IdealGasConstPressureReactor.cpp:46
Cantera::IdealGasConstPressureReactor::evalSteady
void evalSteady(double t, span< double > LHS, span< double > RHS) override
Evaluate the governing equations with modifications for the steady-state solver.
Definition
IdealGasConstPressureReactor.cpp:112
Cantera::IdealGasConstPressureReactor::type
string type() const override
String indicating the reactor model implemented.
Definition
IdealGasConstPressureReactor.h:27
Cantera::IdealGasConstPressureReactor::componentIndex
size_t componentIndex(const string &nm) const override
Return the index in the solution vector for this reactor of the component named nm.
Definition
IdealGasConstPressureReactor.cpp:133
Cantera::IdealGasConstPressureReactor::m_initialMass
double m_initialMass
Initial mass [kg]; used for steady-state calculations.
Definition
IdealGasConstPressureReactor.h:52
Cantera::IdealGasConstPressureReactor::initializeSteady
vector< size_t > initializeSteady() override
Initialize the reactor before solving a steady-state problem.
Definition
IdealGasConstPressureReactor.cpp:122
Cantera::IdealGasConstPressureReactor::lowerBound
double lowerBound(size_t k) const override
Get the lower bound on the k-th component of the local state vector.
Definition
IdealGasConstPressureReactor.cpp:167
Cantera::IdealGasConstPressureReactor::componentName
string componentName(size_t k) override
Return the name of the solution component with index i.
Definition
IdealGasConstPressureReactor.cpp:149
Cantera::IdealGasConstPressureReactor::initialize
void initialize(double t0=0.0) override
Initialize the reactor.
Definition
IdealGasConstPressureReactor.cpp:28
Cantera::IdealGasConstPressureReactor::m_initialTemperature
double m_initialTemperature
Initial temperature [K]; used for steady-state calculations.
Definition
IdealGasConstPressureReactor.h:55
Cantera::IdealGasConstPressureReactor::updateState
void updateState(span< const double > y) override
Set the state of the reactor to correspond to the state vector y.
Definition
IdealGasConstPressureReactor.cpp:34
Cantera::IdealGasConstPressureReactor::m_hk
vector< double > m_hk
Species molar enthalpies.
Definition
IdealGasConstPressureReactor.h:49
Cantera::IdealGasConstPressureReactor::getState
void getState(span< double > y) override
Get the current state of the reactor.
Definition
IdealGasConstPressureReactor.cpp:16
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
include
cantera
zeroD
IdealGasConstPressureReactor.h
Generated by
1.17.0