twoPhaseMixtureEThermo.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) 2016-2021 OpenCFD Ltd.
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::twoPhaseMixtureEThermo
28
29Description
30
31SourceFiles
32 twoPhaseMixtureEThermo.C
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef twoPhaseMixtureEThermo_H
37#define twoPhaseMixtureEThermo_H
38
39#include "volFields.H"
40
41#include "basicThermo.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class twoPhaseMixtureEThermo Declaration
51\*---------------------------------------------------------------------------*/
54:
55 public basicThermo,
57{
58
59protected:
60
61 // Protected Data
62
63 //- Saturation Temperature
65
66public:
68 TypeName("twoPhaseMixtureEThermo");
69
70 // Constructor
72 (
73 const volVectorField& U,
75 );
76
77
78 //- Destructor
79 virtual ~twoPhaseMixtureEThermo() = default;
80
81
82 // Member Functions
83
84
85 //- Return access to the internal energy field [J/Kg]
86 virtual volScalarField& he()
87 {
89 return p();
90 }
91
92 //- Return access to the internal energy field [J/Kg]
93 virtual const volScalarField& he() const
94 {
96 return p();
97 }
98
99 //- Enthalpy/Internal energy
100 //- for given pressure and temperature [J/kg]
101 virtual tmp<volScalarField> he
102 (
103 const volScalarField& p,
104 const volScalarField& T
105 ) const;
106
107 //- Enthalpy/Internal energy for cell-set [J/kg]
108 virtual tmp<scalarField> he
109 (
110 const scalarField& p,
111 const scalarField& T,
112 const labelList& cells
113 ) const;
114
115 //- Enthalpy/Internal energy for patch [J/kg]
116 virtual tmp<scalarField> he
117 (
118 const scalarField& p,
119 const scalarField& T,
120 const label patchi
121 ) const;
122
123 //- Chemical enthalpy [J/kg]
124 virtual tmp<volScalarField> hc() const;
125
126 //- Temperature from enthalpy/internal energy for cell-set
127 virtual tmp<scalarField> THE
128 (
129 const scalarField& h,
130 const scalarField& p,
131 const scalarField& T0, // starting temperature
132 const labelList& cells
133 ) const;
134
135 //- Temperature from enthalpy/internal energy for patch
136 virtual tmp<scalarField> THE
137 (
138 const scalarField& h,
139 const scalarField& p,
140 const scalarField& T0, // starting temperature
141 const label patchi
142 ) const;
143
144
145 //- Return true if the equation of state is incompressible
146 //- i.e. rho != f(p)
147 bool incompressible() const
148 {
149 return true;
150 }
151
152 //- Return true if the equation of state is isochoric
153 //- i.e. rho = const
154 bool isochoric() const
155 {
156 return false;
157 }
158
159 //- Return rho of the mixture
160 virtual tmp<volScalarField> rho() const;
161
162 //- Return rho for patch
163 virtual tmp<scalarField> rho(const label patchi) const;
164
165 //- Return Cp of the mixture
166 virtual tmp<volScalarField> Cp() const;
167
168 //- Heat capacity at constant pressure for patch [J/kg/K]
169 virtual tmp<scalarField> Cp
170 (
171 const scalarField& p,
172 const scalarField& T,
173 const label patchi
174 ) const;
175
176 //- Heat capacity using pressure and temperature
177 virtual tmp<scalarField> Cp
178 (
179 const scalarField& p,
180 const scalarField& T,
181 const labelList& cells
182 ) const
183 {
185 return tmp<scalarField>::New(p);
186 }
187
188 //- Return Cv of the mixture
189 virtual tmp<volScalarField> Cv() const;
190
191 //- Heat capacity at constant volume for patch [J/kg/K]
192 virtual tmp<scalarField> Cv
193 (
194 const scalarField& p,
195 const scalarField& T,
196 const label patchI
197 ) const;
198
199 //- Density from pressure and temperature
201 (
202 const scalarField& p,
203 const scalarField& T,
204 const labelList& cells
205 ) const
206 {
208 return tmp<scalarField>::New(p);
209 }
210
211 //- Gamma = Cp/Cv []
212 virtual tmp<volScalarField> gamma() const;
213
214 //- Gamma = Cp/Cv for patch []
215 virtual tmp<scalarField> gamma
216 (
217 const scalarField& p,
218 const scalarField& T,
219 const label patchi
220 ) const;
221
222 //- Heat capacity at constant pressure/volume [J/kg/K]
223 virtual tmp<volScalarField> Cpv() const;
224
225 //- Heat capacity at constant pressure/volume for patch [J/kg/K]
226 virtual tmp<scalarField> Cpv
227 (
228 const scalarField& p,
229 const scalarField& T,
230 const label patchi
231 ) const;
232
233 //- Heat capacity ratio []
234 virtual tmp<volScalarField> CpByCpv() const;
235
236 //- Heat capacity ratio for patch []
238 (
239 const scalarField& p,
240 const scalarField& T,
241 const label patchi
242 ) const;
243
244 //- Molecular weight [kg/kmol]
245 virtual tmp<volScalarField> W() const;
246
247 //- Thermal diffusivity for temperature of mixture [J/m/s/K]
248 virtual tmp<volScalarField> kappa() const;
249
250 //- Thermal diffusivity for temperature
251 //- of mixture for patch [J/m/s/K]
252 virtual tmp<scalarField> kappa
253 (
254 const label patchi
255 ) const;
256
257 //- Thermal diffusivity for energy of mixture [kg/m/s]
258 virtual tmp<volScalarField> alphahe() const;
259
260 //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
261 virtual tmp<scalarField> alphahe(const label patchi) const;
262
263 //- Effective thermal diffusivity for temperature
264 //- of mixture [J/m/s/K]
266 (
267 const volScalarField&
268 ) const;
269
270 //- Effective thermal diffusivity for temperature
271 //- of mixture for patch [J/m/s/K]
273 (
274 const scalarField& alphat,
275 const label patchi
276 ) const;
277
278 //- Effective thermal diffusivity of mixture [kg/m/s]
280 (
281 const volScalarField& alphat
282 ) const;
283
284 //- Effective thermal diffusivity of mixture for patch [kg/m/s]
286 (
287 const scalarField& alphat,
288 const label patchi
289 ) const;
290
291
292 //- Correct the thermo fields
293 virtual void correct();
294
295 //- Return the name of the thermo physics
296 virtual word thermoName() const;
297
298 //- Read properties
299 virtual bool read();
300
301
302 // Access to thermodynamic state variables
303
304 //- Return const-access to the saturation temperature
305 const dimensionedScalar& TSat() const
306 {
307 return TSat_;
308 }
309
310 //- Return transport properties dictionary
312 {
313 return *this;
314 }
315};
316
317
318// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
319
320} // End namespace Foam
321
322// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
323
324#endif
325
326// ************************************************************************* //
surfaceScalarField & phi
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:66
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:622
virtual volScalarField & p()
Pressure [Pa].
Definition: basicThermo.C:610
A two-phase incompressible transportModel.
const volVectorField & U() const
Return const-access to the mixture velocity.
A two-phase incompressible transportModel.
A class for managing temporary objects.
Definition: tmp.H:65
virtual tmp< scalarField > Cv(const scalarField &p, const scalarField &T, const label patchI) const
Heat capacity at constant volume for patch [J/kg/K].
virtual tmp< scalarField > he(const scalarField &p, const scalarField &T, const label patchi) const
Enthalpy/Internal energy for patch [J/kg].
virtual word thermoName() const
Return the name of the thermo physics.
const incompressibleTwoPhaseMixture & transportPropertiesDict()
Return transport properties dictionary.
virtual tmp< volScalarField > Cv() const
Return Cv of the mixture.
virtual tmp< volScalarField > rho() const
Return rho of the mixture.
virtual tmp< volScalarField > W() const
Molecular weight [kg/kmol].
virtual tmp< volScalarField > gamma() const
Gamma = Cp/Cv [].
virtual tmp< scalarField > kappa(const label patchi) const
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
virtual tmp< scalarField > CpByCpv(const scalarField &p, const scalarField &T, const label patchi) const
Heat capacity ratio for patch [].
virtual tmp< scalarField > alphahe(const label patchi) const
Thermal diffusivity for energy of mixture for patch [kg/m/s].
dimensionedScalar TSat_
Saturation Temperature.
virtual tmp< scalarField > rho(const label patchi) const
Return rho for patch.
virtual tmp< scalarField > THE(const scalarField &h, const scalarField &p, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.
const dimensionedScalar & TSat() const
Return const-access to the saturation temperature.
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
virtual tmp< scalarField > he(const scalarField &p, const scalarField &T, const labelList &cells) const
Enthalpy/Internal energy for cell-set [J/kg].
virtual tmp< scalarField > Cp(const scalarField &p, const scalarField &T, const labelList &cells) const
Heat capacity using pressure and temperature.
virtual tmp< scalarField > Cpv(const scalarField &p, const scalarField &T, const label patchi) const
Heat capacity at constant pressure/volume for patch [J/kg/K].
virtual tmp< scalarField > alphaEff(const scalarField &alphat, const label patchi) const
Effective thermal diffusivity of mixture for patch [kg/m/s].
virtual tmp< scalarField > rhoEoS(const scalarField &p, const scalarField &T, const labelList &cells) const
Density from pressure and temperature.
virtual tmp< volScalarField > Cp() const
Return Cp of the mixture.
virtual tmp< scalarField > kappaEff(const scalarField &alphat, const label patchi) const
virtual void correct()
Correct the thermo fields.
virtual tmp< scalarField > Cp(const scalarField &p, const scalarField &T, const label patchi) const
Heat capacity at constant pressure for patch [J/kg/K].
virtual volScalarField & he()
Return access to the internal energy field [J/Kg].
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
virtual bool read()
Read properties.
virtual ~twoPhaseMixtureEThermo()=default
Destructor.
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [kg/m/s].
virtual tmp< volScalarField > he(const volScalarField &p, const volScalarField &T) const
twoPhaseMixtureEThermo(const volVectorField &U, const surfaceScalarField &phi)
TypeName("twoPhaseMixtureEThermo")
virtual tmp< scalarField > gamma(const scalarField &p, const scalarField &T, const label patchi) const
Gamma = Cp/Cv for patch [].
virtual tmp< scalarField > THE(const scalarField &h, const scalarField &p, const scalarField &T0, const label patchi) const
Temperature from enthalpy/internal energy for patch.
virtual const volScalarField & he() const
Return access to the internal energy field [J/Kg].
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > kappaEff(const volScalarField &) const
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
const cellShapeList & cells
kappaEff
Definition: TEqn.H:10
Namespace for OpenFOAM.
volScalarField & h
scalar T0
Definition: createFields.H:22
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73