TDACChemistryModelI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
30 template<class ReactionThermo, class ThermoType>
31 inline bool
33 {
34  return variableTimeStep_;
35 }
36 
37 
38 template<class ReactionThermo, class ThermoType>
39 inline Foam::label
41 {
42  return timeSteps_;
43 }
44 
45 
46 template<class ReactionThermo, class ThermoType>
49 logFile(const word& name) const
50 {
51  mkDir(this->mesh().time().path()/"TDAC"/this->group());
52  return autoPtr<OFstream>
53  (
54  new OFstream
55  (
56  this->mesh().time().path()/"TDAC"/this->group()/name
57  )
58  );
59 }
60 
61 
62 template<class ReactionThermo, class ThermoType>
65 {
66  return this->Y_;
67 }
68 
69 
70 template<class ReactionThermo, class ThermoType>
71 inline
74 {
75  return mechRed_;
76 }
77 
78 
79 template<class ReactionThermo, class ThermoType>
81 (
82  const label i
83 )
84 {
85  this->thermo().composition().setActive(i);
86 }
87 
88 
89 template<class ReactionThermo, class ThermoType>
91 (
92  const label i
93 ) const
94 {
95  return this->thermo().composition().active(i);
96 }
97 
98 
99 template<class ReactionThermo, class ThermoType>
101 setNsDAC(const label newNsDAC)
102 {
103  NsDAC_ = newNsDAC;
104 }
105 
106 
107 template<class ReactionThermo, class ThermoType>
109 setNSpecie(const label newNs)
110 {
111  this->nSpecie_ = newNs;
112 }
113 
114 
115 template<class ReactionThermo, class ThermoType>
119 {
120  return simplifiedToCompleteIndex_;
121 }
122 
123 
124 template<class ReactionThermo, class ThermoType>
128 {
129  return completeToSimplifiedIndex_;
130 }
131 
132 
133 template<class ReactionThermo, class ThermoType>
134 inline const Foam::Field<Foam::label>&
137 {
138  return completeToSimplifiedIndex_;
139 }
140 
141 
142 template<class ReactionThermo, class ThermoType>
143 inline Foam::Field<bool>&
145 {
146  return reactionsDisabled_;
147 }
148 
149 
150 template<class ReactionThermo, class ThermoType>
151 inline Foam::scalarField&
153 {
154  return completeC_;
155 }
156 
157 
158 template<class ReactionThermo, class ThermoType>
159 inline Foam::scalarField&
161 {
162  return simplifiedC_;
163 }
164 
165 
166 template<class ReactionThermo, class ThermoType>
169 {
170  return specieComp_;
171 }
172 
173 
174 template<class ReactionThermo, class ThermoType>
177 {
178  for (auto& res : tabulationResults_)
179  {
180  res = 2;
181  }
182 }
183 
184 
185 // ************************************************************************* //
Foam::TDACChemistryModel::completeC
scalarField & completeC()
Definition: TDACChemistryModelI.H:152
Foam::TDACChemistryModel::timeSteps
label timeSteps() const
Return the number of chemistry evaluations (used by ISAT)
Definition: TDACChemistryModelI.H:40
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::TDACChemistryModel::Y
PtrList< volScalarField > & Y()
Definition: TDACChemistryModelI.H:64
Foam::constant::atomic::group
constexpr const char *const group
Group name for atomic constants.
Definition: atomicConstants.H:52
Foam::TDACChemistryModel::setNsDAC
void setNsDAC(const label newNsDAC)
Definition: TDACChemistryModelI.H:101
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:55
thermo
psiReactionThermo & thermo
Definition: createFields.H:28
Foam::TDACChemistryModel::active
bool active(const label i) const
Definition: TDACChemistryModelI.H:91
Foam::TDACChemistryModel::reactionsDisabled
Field< bool > & reactionsDisabled()
Definition: TDACChemistryModelI.H:144
Foam::TDACChemistryModel::completeToSimplifiedIndex
Field< label > & completeToSimplifiedIndex()
Definition: TDACChemistryModelI.H:127
Foam::TDACChemistryModel::resetTabulationResults
void resetTabulationResults()
Definition: TDACChemistryModelI.H:176
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::TDACChemistryModel::simplifiedToCompleteIndex
DynamicList< label > & simplifiedToCompleteIndex()
Definition: TDACChemistryModelI.H:118
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::TDACChemistryModel::setActive
void setActive(const label i)
Definition: TDACChemistryModelI.H:81
Foam::TDACChemistryModel::setNSpecie
void setNSpecie(const label newNs)
Definition: TDACChemistryModelI.H:109
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::TDACChemistryModel::logFile
autoPtr< OFstream > logFile(const word &name) const
Create and return a TDAC log file of the given name.
Definition: TDACChemistryModelI.H:49
Foam::TDACChemistryModel::variableTimeStep
bool variableTimeStep() const
Return true if the time-step is variable and/or non-uniform.
Definition: TDACChemistryModelI.H:32
Foam::OFstream
Output to file stream, using an OSstream.
Definition: OFstream.H:53
Foam::TDACChemistryModel::simplifiedC
scalarField & simplifiedC()
Definition: TDACChemistryModelI.H:160
Foam::autoPtr< Foam::OFstream >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::TDACChemistryModel::mechRed
autoPtr< chemistryReductionMethod< ReactionThermo, ThermoType > > & mechRed()
Definition: TDACChemistryModelI.H:73
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::TDACChemistryModel::specieComp
List< List< specieElement > > & specieComp()
Definition: TDACChemistryModelI.H:168
Foam::mkDir
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: MSwindows.C:507