Loading...
Searching...
No Matches
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"
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>
68// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69
70template<class BasePhaseModel, class ThermoType>
73 return !thermo_().incompressible();
74}
75
76
77template<class BasePhaseModel, class ThermoType>
78const Foam::rhoThermo&
81 return thermo_();
82}
83
84
85template<class BasePhaseModel, class ThermoType>
89 return thermo_();
90}
91
92
93template<class BasePhaseModel, class ThermoType>
97 return thermo_->rho();
98}
99
100
101template<class BasePhaseModel, class ThermoType>
105 return thermo_->mu();
106}
107
108
109template<class BasePhaseModel, class ThermoType>
112(
113 const label patchi
114) const
116 return thermo_->mu(patchi);
117}
118
119
120template<class BasePhaseModel, class ThermoType>
124 return thermo_->nu();
125}
126
127
128template<class BasePhaseModel, class ThermoType>
131(
132 const label patchi
133) const
135 return thermo_->nu(patchi);
136}
137
138
139template<class BasePhaseModel, class ThermoType>
143 return thermo_->kappa();
144}
145
146
147template<class BasePhaseModel, class ThermoType>
150(
151 const label patchi
152) const
154 return thermo_->kappa(patchi);
155}
156
157
158template<class BasePhaseModel, class ThermoType>
162 return thermo_->alphahe();
163}
164
165
166template<class BasePhaseModel, class ThermoType>
169(
170 const label patchi
171) const
173 return thermo_->alphahe(patchi);
174}
175
176
177template<class BasePhaseModel, class ThermoType>
180(
181 const volScalarField& alphat
182) const
184 return thermo_->kappaEff(alphat);
185}
186
187
188template<class BasePhaseModel, class ThermoType>
191(
192 const scalarField& alphat,
193 const label patchi
194) const
196 return thermo_->kappaEff(alphat, patchi);
197}
198
199
200template<class BasePhaseModel, class ThermoType>
204 return thermo_->alpha();
205}
206
207
208template<class BasePhaseModel, class ThermoType>
211(
212 const label patchi
213) const
215 return thermo_->alpha(patchi);
216}
217
218
219template<class BasePhaseModel, class ThermoType>
222(
223 const volScalarField& alphat
224) const
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 const char *const typeName
Typename for Field.
Definition Field.H:93
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
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 > kappaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity for temperature.
ThermoPhaseModel(const phaseSystem &fluid, const word &phaseName, const label index)
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity 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.
Class to represent a system of phases and model interfacial transfers between them.
Definition phaseSystem.H:72
Basic thermodynamic properties based on density.
Definition rhoThermo.H:54
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
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.
auto & name
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127