odeChemistryModelI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "OSspecific.H"
27 
28 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
32 {
33  mkDir(this->mesh().time().path()/"TDAC"/this->group());
34  return autoPtr<OFstream>
35  (
36  new OFstream
37  (
38  this->mesh().time().path()/"TDAC"/this->group()/name
39  )
40  );
41 }
42 
43 
45 {
46  return nSpecie_;
47 }
48 
49 
51 {
52  nSpecie_ = newNs;
53 }
54 
55 
57 {
58  // nEqns = number of species + temperature + pressure
59  return nSpecie_ + 2;
60 }
61 
62 
65 {
66  return Yvf_;
67 }
68 
69 
71 {
72  return reduction_;
73 }
74 
75 
77 (
78  const label si
79 ) const
80 {
81  if (reduction_)
82  {
83  return sToc_[si];
84  }
85  else
86  {
87  return si;
88  }
89 }
90 
91 
93 (
94  const label ci
95 ) const
96 {
97  if (reduction_)
98  {
99  return cTos_[ci];
100  }
101  else
102  {
103  return ci;
104  }
105 }
106 
107 
108 // ************************************************************************* //
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
const Time & time() const
Return time.
Definition: IOobject.C:318
word group() const
Return group (extension part of name)
Definition: IOobject.C:324
Output to file stream.
Definition: OFstream.H:86
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
const fvMesh & mesh() const
Return const access to the mesh.
autoPtr< OFstream > logFile(const word &name) const
Create and return a TDAC log file of the given name.
void setNSpecie(const label newNs)
Allow the reduction method to reset the number of species.
bool reduction() const
Return true if mechanism reduction is active.
virtual label nEqns() const
Number of ODE's to solve.
label sToc(const label si) const
Return the index in the complete set of species.
virtual label nSpecie() const
The number of species.
label cTos(const label ci) const
Return the index in the simplified set of species.
const PtrList< volScalarField > & Y() const
Return a reference to the list of mass fraction fields.
fileName path() const
Return complete path.
Definition: regIOobject.C:199
A class for handling words, derived from string.
Definition: word.H:62
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:290
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47