Loading...
Searching...
No Matches
twoPhaseMixtureThermo.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) 2013-2017 OpenFOAM Foundation
9 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::twoPhaseMixtureThermo
29
30Description
31
32SourceFiles
33 twoPhaseMixtureThermoI.H
34 twoPhaseMixtureThermo.C
35 twoPhaseMixtureThermoIO.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef twoPhaseMixtureThermo_H
40#define twoPhaseMixtureThermo_H
41
42#include "rhoThermo.H"
43#include "psiThermo.H"
44#include "twoPhaseMixture.H"
45#include "interfaceProperties.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
52/*---------------------------------------------------------------------------*\
53 Class twoPhaseMixtureThermo Declaration
54\*---------------------------------------------------------------------------*/
55
57:
58 public psiThermo,
59 public twoPhaseMixture,
60 public interfaceProperties
61{
62 // Private data
63
64 //- Thermo-package of phase 1
65 autoPtr<rhoThermo> thermo1_;
66
67 //- Thermo-package of phase 2
68 autoPtr<rhoThermo> thermo2_;
69
70
71public:
72
73 //- Runtime type information
74 TypeName("twoPhaseMixtureThermo");
76
77 // Constructors
78
79 //- Construct from components
81 (
82 const volVectorField& U,
84 );
85
86
87 //- Destructor
88 virtual ~twoPhaseMixtureThermo();
89
90
91 // Member Functions
92
93 const rhoThermo& thermo1() const
94 {
95 return *thermo1_;
96 }
97
98 const rhoThermo& thermo2() const
99 {
100 return *thermo2_;
101 }
102
104 {
105 return *thermo1_;
106 }
107
109 {
110 return *thermo2_;
111 }
112
113 //- Correct the thermodynamics of each phase
114 virtual void correctThermo();
115
116 //- Update mixture properties
117 virtual void correct();
118
119 //- Return the name of the thermo physics
120 virtual word thermoName() const;
122 //- Return true if the equation of state is incompressible
123 // i.e. rho != f(p)
124 virtual bool incompressible() const;
125
126 //- Return true if the equation of state is isochoric
127 // i.e. rho = const
128 virtual bool isochoric() const;
129
130
131 // Access to thermodynamic state variables
132
133 //- Enthalpy/Internal energy [J/kg]
134 // Non-const access allowed for transport equations
135 virtual volScalarField& he()
136 {
139 }
140
141 //- Enthalpy/Internal energy [J/kg]
142 virtual const volScalarField& he() const
143 {
146 }
147
148 //- Enthalpy/Internal energy
149 // for given pressure and temperature [J/kg]
150 virtual tmp<volScalarField> he
151 (
152 const volScalarField& p,
153 const volScalarField& T
154 ) const;
156 //- Enthalpy/Internal energy for cell-set [J/kg]
157 virtual tmp<scalarField> he
158 (
159 const scalarField& p,
160 const scalarField& T,
161 const labelList& cells
162 ) const;
163
164 //- Enthalpy/Internal energy for patch [J/kg]
165 virtual tmp<scalarField> he
166 (
167 const scalarField& p,
168 const scalarField& T,
169 const label patchi
170 ) const;
171
172 //- Chemical enthalpy [J/kg]
173 virtual tmp<volScalarField> hc() const;
174
175 //- Temperature from enthalpy/internal energy for cell-set
176 virtual tmp<scalarField> THE
177 (
178 const scalarField& h,
179 const scalarField& p,
180 const scalarField& T0, // starting temperature
181 const labelList& cells
182 ) const;
183
184 //- Temperature from enthalpy/internal energy for patch
185 virtual tmp<scalarField> THE
186 (
187 const scalarField& h,
188 const scalarField& p,
189 const scalarField& T0, // starting temperature
190 const label patchi
191 ) const;
192
193
194 // Fields derived from thermodynamic state variables
195
196 //- Heat capacity at constant pressure [J/kg/K]
197 virtual tmp<volScalarField> Cp() const;
198
199 //- Heat capacity at constant pressure for patch [J/kg/K]
200 virtual tmp<scalarField> Cp
201 (
202 const scalarField& p,
203 const scalarField& T,
204 const label patchi
205 ) const;
206
207 //- Heat capacity using pressure and temperature
208 virtual tmp<scalarField> Cp
210 const scalarField& p,
211 const scalarField& T,
212 const labelList& cells
213 ) const
214 {
216 return nullptr;
217 }
218
219 //- Heat capacity at constant volume [J/kg/K]
220 virtual tmp<volScalarField> Cv() const;
221
222 //- Heat capacity at constant volume for patch [J/kg/K]
223 virtual tmp<scalarField> Cv
224 (
225 const scalarField& p,
226 const scalarField& T,
227 const label patchi
228 ) const;
229
230 //- Density from pressure and temperature
232 (
233 const scalarField& p,
235 const labelList& cells
236 ) const
237 {
239 return nullptr;
240 }
241
242 //- Gamma = Cp/Cv []
243 virtual tmp<volScalarField> gamma() const;
244
245 //- Gamma = Cp/Cv for patch []
246 virtual tmp<scalarField> gamma
247 (
248 const scalarField& p,
250 const label patchi
251 ) const;
252
253 //- Heat capacity at constant pressure/volume [J/kg/K]
254 virtual tmp<volScalarField> Cpv() const;
255
256 //- Heat capacity at constant pressure/volume for patch [J/kg/K]
257 virtual tmp<scalarField> Cpv
258 (
259 const scalarField& p,
260 const scalarField& T,
261 const label patchi
262 ) const;
264 //- Heat capacity ratio []
265 virtual tmp<volScalarField> CpByCpv() const;
266
267 //- Heat capacity ratio for patch []
269 (
270 const scalarField& p,
271 const scalarField& T,
272 const label patchi
273 ) const;
274
275 //- Molecular weight [kg/kmol]
276 virtual tmp<volScalarField> W() const;
277
279 // Fields derived from transport state variables
280
281 //- Kinematic viscosity of mixture [m^2/s]
282 virtual tmp<volScalarField> nu() const;
283
284 //- Kinematic viscosity of mixture for patch [m^2/s]
285 virtual tmp<scalarField> nu(const label patchi) const;
286
287 //- Thermal diffusivity for temperature of mixture [J/m/s/K]
288 virtual tmp<volScalarField> kappa() const;
289
290 //- Thermal diffusivity of mixture for patch [J/m/s/K]
291 virtual tmp<scalarField> kappa
293 const label patchi
294 ) const;
295
296
297 //- Thermal diffusivity for energy of mixture [kg/m/s]
298 virtual tmp<volScalarField> alphahe() const;
299
300 //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
301 virtual tmp<scalarField> alphahe(const label patchi) const;
302
303 //- Effective thermal diffusivity of mixture [J/m/s/K]
305 (
306 const volScalarField& alphat
307 ) const;
308
309 //- Effective thermal diffusivity of mixture for patch [J/m/s/K]
311 (
312 const scalarField& alphat,
313 const label patchi
314 ) const;
315
316 //- Effective thermal diffusivity of mixture [J/m/s/K]
318 (
319 const volScalarField& alphat
320 ) const;
321
322 //- Effective thermal diffusivity of mixture for patch [J/m/s/K]
324 (
325 const scalarField& alphat,
326 const label patchi
327 ) const;
328
329
330 // IO
331
332 //- Read base transportProperties dictionary
333 virtual bool read();
334};
335
336
337// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
338
339} // End namespace Foam
340
341// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
342
343#endif
344
345// ************************************************************************* //
this_type & constCast() const noexcept
Return non-const reference to this field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
virtual volScalarField & p()
Pressure [Pa].
psiThermo(const psiThermo &)
Construct as copy (not implemented).
Basic thermodynamic properties based on density.
Definition rhoThermo.H:54
A class for managing temporary objects.
Definition tmp.H:75
virtual tmp< scalarField > he(const scalarField &p, const scalarField &T, const label patchi) const
Enthalpy/Internal energy for patch [J/kg].
virtual void correctThermo()
Correct the thermodynamics of each phase.
virtual word thermoName() const
Return the name of the thermo physics.
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
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
Thermal diffusivity of mixture for patch [J/m/s/K].
virtual bool incompressible() const
Return true if the equation of state is incompressible.
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].
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
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.
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 ~twoPhaseMixtureThermo()
Destructor.
const rhoThermo & thermo1() const
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].
const rhoThermo & thermo2() const
virtual tmp< scalarField > alphaEff(const scalarField &alphat, const label patchi) const
Effective thermal diffusivity of mixture for patch [J/m/s/K].
virtual tmp< scalarField > rhoEoS(const scalarField &p, const scalarField &T, const labelList &cells) const
Density from pressure and temperature.
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
virtual tmp< scalarField > kappaEff(const scalarField &alphat, const label patchi) const
Effective thermal diffusivity of mixture for patch [J/m/s/K].
virtual void correct()
Update mixture properties.
TypeName("twoPhaseMixtureThermo")
Runtime type information.
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()
Enthalpy/Internal energy [J/kg].
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
virtual bool read()
Read base transportProperties dictionary.
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
twoPhaseMixtureThermo(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
virtual tmp< volScalarField > he(const volScalarField &p, const volScalarField &T) const
Enthalpy/Internal energy.
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
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
Enthalpy/Internal energy [J/kg].
virtual tmp< scalarField > nu(const label patchi) const
Kinematic viscosity of mixture for patch [m^2/s].
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
virtual bool isochoric() const
Return true if the equation of state is isochoric.
twoPhaseMixture(const fvMesh &mesh, const dictionary &dict)
Construct from components.
A class for handling words, derived from Foam::string.
Definition word.H:66
U
Definition pEqn.H:72
volScalarField & p
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
const cellShapeList & cells
kappaEff
Definition TEqn.H:10
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< scalar, fvPatchField, volMesh > volScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & h
scalar T0
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68