ThermoPhaseModel.C
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) 2015-2018 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
26\*---------------------------------------------------------------------------*/
27
28#include "ThermoPhaseModel.H"
29
30#include "phaseSystem.H"
31
32#include "fvmDdt.H"
33#include "fvmDiv.H"
34#include "fvmSup.H"
35#include "fvmLaplacian.H"
36#include "fvcDdt.H"
37#include "fvcDiv.H"
38
39// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40
41template<class BasePhaseModel, class ThermoType>
43(
44 const phaseSystem& fluid,
45 const word& phaseName,
46 const label index
47)
48:
49 BasePhaseModel(fluid, phaseName, index),
50 thermo_(ThermoType::New(fluid.mesh(), this->name()))
51{
52 thermo_->validate
53 (
55 "h",
56 "e"
57 );
58}
59
60
61// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
62
63template<class BasePhaseModel, class ThermoType>
65{}
66
67
68// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69
70template<class BasePhaseModel, class ThermoType>
72{
73 return !thermo_().incompressible();
74}
75
76
77template<class BasePhaseModel, class ThermoType>
78const Foam::rhoThermo&
80{
81 return thermo_();
82}
83
84
85template<class BasePhaseModel, class ThermoType>
88{
89 return thermo_();
90}
91
92
93template<class BasePhaseModel, class ThermoType>
96{
97 return thermo_->rho();
98}
99
100
101template<class BasePhaseModel, class ThermoType>
104{
105 return thermo_->mu();
106}
107
108
109template<class BasePhaseModel, class ThermoType>
112(
113 const label patchi
114) const
115{
116 return thermo_->mu(patchi);
117}
118
119
120template<class BasePhaseModel, class ThermoType>
123{
124 return thermo_->nu();
125}
126
127
128template<class BasePhaseModel, class ThermoType>
131(
132 const label patchi
133) const
134{
135 return thermo_->nu(patchi);
136}
137
138
139template<class BasePhaseModel, class ThermoType>
142{
143 return thermo_->kappa();
144}
145
146
147template<class BasePhaseModel, class ThermoType>
150(
151 const label patchi
152) const
153{
154 return thermo_->kappa(patchi);
155}
156
157
158template<class BasePhaseModel, class ThermoType>
161{
162 return thermo_->alphahe();
163}
164
165
166template<class BasePhaseModel, class ThermoType>
169(
170 const label patchi
171) const
172{
173 return thermo_->alphahe(patchi);
174}
175
176
177template<class BasePhaseModel, class ThermoType>
180(
181 const volScalarField& alphat
182) const
183{
184 return thermo_->kappaEff(alphat);
185}
186
187
188template<class BasePhaseModel, class ThermoType>
191(
192 const scalarField& alphat,
193 const label patchi
194) const
195{
196 return thermo_->kappaEff(alphat, patchi);
197}
198
199
200template<class BasePhaseModel, class ThermoType>
203{
204 return thermo_->alpha();
205}
206
207
208template<class BasePhaseModel, class ThermoType>
211(
212 const label patchi
213) const
214{
215 return thermo_->alpha(patchi);
216}
217
218
219template<class BasePhaseModel, class ThermoType>
222(
223 const volScalarField& alphat
224) const
225{
226 return thermo_->alphaEff(alphat);
227}
228
229
230template<class BasePhaseModel, class ThermoType>
233(
234 const scalarField& alphat,
235 const label patchi
236) const
237{
238 return thermo_->alphaEff(alphat, patchi);
239}
240
241
242// ************************************************************************* //
twoPhaseSystem & fluid
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Class which represents a phase with a thermodynamic model. Provides access to the thermodynamic varia...
virtual const rhoThermo & thermo() const
Return the thermophysical model.
virtual tmp< volScalarField > alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
virtual tmp< volScalarField > nu() const
Return the laminar kinematic viscosity.
virtual bool compressible() const
Return whether the phase is compressible.
virtual ~ThermoPhaseModel()
Destructor.
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
virtual rhoThermo & thermoRef()
Access the thermophysical model.
virtual tmp< volScalarField > rho() const
Return the density field.
autoPtr< ThermoType > thermo_
Thermophysical model.
tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:76
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:58
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
Calculate the finiteVolume matrix for implicit and explicit sources.
kappaEff
Definition: TEqn.H:10
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
static const char *const typeName
The type name used in ensight case files.