singleComponentMixture.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) 2017-2026 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 Class
25  Foam::singleComponentMixture
26 
27 Description
28  Single component mixture
29 
30 SourceFiles
31  singleComponentMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef singleComponentMixture_H
36 #define singleComponentMixture_H
37 
38 #include "wordList.H"
39 #include "FieldListSlice.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class singleComponentMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
52 {
53 public:
54 
55  // Public Typedefs
56 
57  //- The type of thermodynamics this mixture is instantiated for
58  typedef ThermoType thermoType;
59 
60  //- Mixing type for thermodynamic properties
61  typedef ThermoType thermoMixtureType;
62 
63  //- Mixing type for transport properties
64  typedef ThermoType transportMixtureType;
65 
66 
67 private:
68 
69  // Private Data
70 
71  //- Thermo model
72  ThermoType mixture_;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct from a dictionary
81 
82 
83  // Member Functions
84 
85  //- Return the instantiated type name
86  // Note: This defines the same name as pureMixture so that
87  // non-reacting and reacting solvers are compatible
88  static word typeName()
89  {
90  return "pureMixture<" + ThermoType::typeName() + '>';
91  }
92 
93  //- Return the table of species
94  const speciesTable& species() const
95  {
96  return speciesTable::null;
97  }
98 
99  //- Access the specie active flags
100  const boolList& speciesActive() const
101  {
103  return boolList::null();
104  }
105 
106  //- Access the specie active flags
108  {
110  return const_cast<boolList&>(boolList::null());
111  }
112 
113  //- Return the mixture for thermodynamic properties
115  (
116  const scalarFieldListSlice&
117  ) const
118  {
119  return mixture_;
120  }
121 
122  //- Return the mixture for transport properties
124  (
125  const scalarFieldListSlice&
126  ) const
127  {
128  return mixture_;
129  }
130 
131  //- Return the mixture for transport properties
133  (
134  const scalarFieldListSlice&,
135  const thermoMixtureType&
136  ) const
137  {
138  return mixture_;
139  }
140 
141  //- Read dictionary
142  void read(const dictionary&);
143 
144  //- Return thermo based on index
145  inline const ThermoType& specieThermo(const label speciei) const
146  {
147  #ifdef FULLDEBUG
148  if (speciei != 0)
149  {
151  << "Specie index must be zero for a single component "
152  << "mixture" << exit(FatalError);
153  }
154  #endif
155  return mixture_;
156  }
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "singleComponentMixture.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
static const List< bool > & null()
Return a null List.
Definition: ListI.H:118
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A wordList with hashed indices for faster lookup by name.
static const hashedWordList null
An empty hashedWordList.
Single component mixture.
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
static word typeName()
Return the instantiated type name.
ThermoType transportMixtureType
Mixing type for transport properties.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
const boolList & speciesActive() const
Access the specie active flags.
void read(const dictionary &)
Read dictionary.
const speciesTable & species() const
Return the table of species.
singleComponentMixture(const dictionary &)
Construct from a dictionary.
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
A class for handling words, derived from string.
Definition: word.H:63
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
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
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
error FatalError