singleComponentMixture.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) 2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::singleComponentMixture
28
29Description
30 Single component mixture
31
32SourceFiles
33 singleComponentMixture.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef singleComponentMixture_H
38#define singleComponentMixture_H
39
40#include "basicSpecieMixture.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class singleComponentMixture Declaration
49\*---------------------------------------------------------------------------*/
50
51template<class ThermoType>
53:
55{
56 // Private data
57
58 //- Thermo model
59 ThermoType thermo_;
60
61
62public:
63
64 //- The type of thermodynamics this mixture is instantiated for
65 typedef ThermoType thermoType;
66
67
68 // Constructors
69
70 //- Construct from dictionary, mesh and phase name
72 (
74 const fvMesh& mesh,
75 const word& phaseName
76 );
77
78
79 //- Destructor
80 virtual ~singleComponentMixture() = default;
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 //- Get the mixture for the given cell
94 const ThermoType& cellMixture(const label celli) const
95 {
96 return thermo_;
97 }
98
99 //- Get the mixture for the given patch face
100 const ThermoType& patchFaceMixture
101 (
102 const label patchi,
103 const label facei
104 ) const
105 {
106 return thermo_;
107 }
108
109 //- Get the volumetric mixture for the given cell
110 const ThermoType& cellVolMixture
111 (
112 const scalar p,
113 const scalar T,
114 const label celli
115 )
116 {
117 return thermo_;
118 }
119
120 //- Get the volumetric mixture for the given patch face
121 const ThermoType& patchFaceVolMixture
122 (
123 const scalar p,
124 const scalar T,
125 const label patchi,
126 const label facei
127 ) const
128 {
129 return thermo_;
130 }
131
132 //- Read dictionary
133 void read(const dictionary&);
134
135 //- Return thermo based on index
136 inline const ThermoType& getLocalThermo(const label speciei) const
137 {
138 #ifdef FULLDEBUG
139 if (speciei != 0)
140 {
142 << "Specie index must be zero for a single component "
143 << "mixture" << exit(FatalError);
144 }
145 #endif
146 return thermo_;
147 }
148};
149
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153} // End namespace Foam
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157#ifdef NoRepository
158 #include "singleComponentMixture.C"
159#endif
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163#endif
164
165// ************************************************************************* //
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Single component mixture.
const ThermoType & cellMixture(const label celli) const
Get the mixture for the given cell.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
static word typeName()
Return the instantiated type name.
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Get the mixture for the given patch face.
virtual ~singleComponentMixture()=default
Destructor.
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Get the volumetric mixture for the given patch face.
void read(const dictionary &)
Read dictionary.
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli)
Get the volumetric mixture for the given cell.
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & T
const dictionary & thermoDict
Definition: EEqn.H:16
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Namespace for OpenFOAM.
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130