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-2023 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  //- Destructor
84  virtual ~singleComponentMixture();
85 
86 
87  // Member Functions
88 
89  //- Return the instantiated type name
90  // Note: This defines the same name as pureMixture so that
91  // non-reacting and reacting solvers are compatible
92  static word typeName()
93  {
94  return "pureMixture<" + ThermoType::typeName() + '>';
95  }
96 
97  //- Return the specie names
98  wordList specieNames() const
99  {
100  return wordList();
101  }
102 
103  //- Return the mixture for thermodynamic properties
105  (
106  const scalarFieldListSlice&
107  ) const
108  {
109  return mixture_;
110  }
111 
112  //- Return the mixture for transport properties
114  (
115  const scalarFieldListSlice&
116  ) const
117  {
118  return mixture_;
119  }
120 
121  //- Return the mixture for transport properties
123  (
124  const scalarFieldListSlice&,
125  const thermoMixtureType&
126  ) const
127  {
128  return mixture_;
129  }
130 
131  //- Read dictionary
132  void read(const dictionary&);
133 
134  //- Return thermo based on index
135  inline const ThermoType& specieThermo(const label speciei) const
136  {
137  #ifdef FULLDEBUG
138  if (speciei != 0)
139  {
141  << "Specie index must be zero for a single component "
142  << "mixture" << exit(FatalError);
143  }
144  #endif
145  return mixture_;
146  }
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #ifdef NoRepository
157  #include "singleComponentMixture.C"
158 #endif
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
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.
wordList specieNames() const
Return the specie names.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
void read(const dictionary &)
Read dictionary.
singleComponentMixture(const dictionary &)
Construct from a dictionary.
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
virtual ~singleComponentMixture()
Destructor.
A class for handling words, derived from string.
Definition: word.H:62
#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
List< word > wordList
A List of words.
Definition: fileName.H:54
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
error FatalError