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-2020 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 "basicSpecieMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class singleComponentMixture Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class ThermoType>
51 :
52  public basicSpecieMixture
53 {
54 
55 public:
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 dictionary, mesh and phase name
80  singleComponentMixture(const dictionary&, const fvMesh&, const word&);
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  const thermoMixtureType& cellThermoMixture(const label) const
98  {
99  return mixture_;
100  }
101 
102  const thermoMixtureType& patchFaceThermoMixture
103  (
104  const label,
105  const label
106  ) const
107  {
108  return mixture_;
109  }
111  const transportMixtureType& cellTransportMixture(const label) const
112  {
113  return mixture_;
114  }
115 
116  const transportMixtureType& patchFaceTransportMixture
117  (
118  const label,
119  const label
120  ) const
121  {
122  return mixture_;
123  }
124 
125  const transportMixtureType& cellTransportMixture
126  (
127  const label,
128  const thermoMixtureType&
129  ) const
130  {
131  return mixture_;
132  }
133 
134  const transportMixtureType& patchFaceTransportMixture
135  (
136  const label,
137  const label,
138  const thermoMixtureType&
139  ) const
140  {
141  return mixture_;
142  }
143 
144  //- Read dictionary
145  void read(const dictionary&);
146 
147  //- Return thermo based on index
148  inline const ThermoType& specieThermo(const label speciei) const
149  {
150  #ifdef FULLDEBUG
151  if (speciei != 0)
152  {
154  << "Specie index must be zero for a single component "
155  << "mixture" << exit(FatalError);
156  }
157  #endif
158  return mixture_;
159  }
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #ifdef NoRepository
170  #include "singleComponentMixture.C"
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
void read(const dictionary &)
Read dictionary.
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
const thermoMixtureType & cellThermoMixture(const label) const
Specialisation of basicMixture for a mixture consisting of a number for molecular species...
const thermoMixtureType & patchFaceThermoMixture(const label, const label) const
virtual ~singleComponentMixture()
Destructor.
static word typeName()
Return the instantiated type name.
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
ThermoType transportMixtureType
Mixing type for transport properties.
A class for handling words, derived from string.
Definition: word.H:59
const transportMixtureType & cellTransportMixture(const label) const
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
singleComponentMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
const transportMixtureType & patchFaceTransportMixture(const label, const label) const
Single component mixture.
Namespace for OpenFOAM.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.