Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
MoleReactor.h
Go to the documentation of this file.
1
//! @file MoleReactor.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_MOLEREACTOR_H
7
#define CT_MOLEREACTOR_H
8
9
#include "
Reactor.h
"
10
11
namespace
Cantera
12
{
13
14
/**
15
* MoleReactor is meant to serve the same purpose as the reactor class but with a state
16
* vector composed of moles. It also serves as the base class for other mole reactors.
17
* @since New in %Cantera 3.0
18
* @ingroup reactorGroup
19
*/
20
class
MoleReactor :
public
Reactor
21
{
22
public
:
23
MoleReactor(shared_ptr<Solution> sol,
const
string
&
name
=
"(none)"
);
24
MoleReactor(shared_ptr<Solution> sol,
bool
clone,
const
string
&
name
=
"(none)"
);
25
26
string
type
()
const override
{
27
return
"MoleReactor"
;
28
}
29
30
void
getState
(span<double> y)
override
;
31
void
updateDefaultTolerances
(span<double> atol,
double
baseAtol)
override
;
32
void
updateState
(span<const double> y)
override
;
33
void
eval
(
double
t, span<double> LHS, span<double> RHS)
override
;
34
size_t
componentIndex
(
const
string
& nm)
const override
;
35
string
componentName
(
size_t
k)
override
;
36
double
upperBound
(
size_t
k)
const override
;
37
double
lowerBound
(
size_t
k)
const override
;
38
void
resetBadValues
(span<double> y)
override
;
39
40
protected
:
41
//! Get moles of the system from mass fractions stored by thermo object
42
//! @param y vector for moles to be put into
43
void
getMoles
(span<double> y);
44
45
//! Set internal mass variable based on moles given
46
//! @param y vector of moles of the system
47
void
setMassFromMoles
(span<const double> y);
48
49
//! const value for the species start index
50
const
size_t
m_sidx
= 2;
51
};
52
53
}
54
55
#endif
Reactor.h
Cantera::MoleReactor::upperBound
double upperBound(size_t k) const override
Get the upper bound on the k-th component of the local state vector.
Definition
MoleReactor.cpp:207
Cantera::MoleReactor::resetBadValues
void resetBadValues(span< double > y) override
Reset physically or mathematically problematic values, such as negative species concentrations.
Definition
MoleReactor.cpp:224
Cantera::MoleReactor::eval
void eval(double t, span< double > LHS, span< double > RHS) override
Evaluate the reactor governing equations.
Definition
MoleReactor.cpp:122
Cantera::MoleReactor::type
string type() const override
String indicating the reactor model implemented.
Definition
MoleReactor.h:26
Cantera::MoleReactor::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
MoleReactor.cpp:180
Cantera::MoleReactor::getMoles
void getMoles(span< double > y)
Get moles of the system from mass fractions stored by thermo object.
Definition
MoleReactor.cpp:33
Cantera::MoleReactor::m_sidx
const size_t m_sidx
const value for the species start index
Definition
MoleReactor.h:50
Cantera::MoleReactor::lowerBound
double lowerBound(size_t k) const override
Get the lower bound on the k-th component of the local state vector.
Definition
MoleReactor.cpp:212
Cantera::MoleReactor::componentName
string componentName(size_t k) override
Return the name of the solution component with index i.
Definition
MoleReactor.cpp:196
Cantera::MoleReactor::updateState
void updateState(span< const double > y) override
Set the state of the reactor to correspond to the state vector y.
Definition
MoleReactor.cpp:78
Cantera::MoleReactor::updateDefaultTolerances
void updateDefaultTolerances(span< double > atol, double baseAtol) override
Update default absolute tolerances based on this reactor's state variables.
Definition
MoleReactor.cpp:64
Cantera::MoleReactor::setMassFromMoles
void setMassFromMoles(span< const double > y)
Set internal mass variable based on moles given.
Definition
MoleReactor.cpp:43
Cantera::MoleReactor::getState
void getState(span< double > y) override
Get the current state of the reactor.
Definition
MoleReactor.cpp:53
Cantera::ReactorBase::name
string name() const
Return the name of this reactor.
Definition
ReactorBase.h:81
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
include
cantera
zeroD
MoleReactor.h
Generated by
1.17.0