EddyDiffusivity.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) 2015-2016 OpenFOAM Foundation
9 Copyright (C) 2019 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::EddyDiffusivity
29
30Description
31 Templated abstract base class for single-phase compressible
32 turbulence models.
33
34SourceFiles
35 EddyDiffusivity.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef EddyDiffusivity_H
40#define EddyDiffusivity_H
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class EddyDiffusivity Declaration
49\*---------------------------------------------------------------------------*/
50
51template<class BasicTurbulenceModel>
53:
54 public BasicTurbulenceModel
55{
56
57protected:
58
59 // Protected data
60
61 // Model coefficients
64
65 // Fields
68
69
70 // Protected Member Functions
71
72 virtual void correctNut();
73
74
75public:
77 typedef typename BasicTurbulenceModel::alphaField alphaField;
78 typedef typename BasicTurbulenceModel::rhoField rhoField;
79 typedef typename BasicTurbulenceModel::transportModel transportModel;
80
81
82 // Constructors
83
84 //- Construct
86 (
87 const word& type,
88 const alphaField& alpha,
89 const volScalarField& rho,
90 const volVectorField& U,
91 const surfaceScalarField& alphaRhoPhi,
93 const transportModel& transport,
94 const word& propertiesName
95 );
96
97
98 //- Destructor
99 virtual ~EddyDiffusivity() = default;
100
101
102 // Member Functions
103
104 //- Re-read model coefficients if they have changed
105 virtual bool read();
106
107 //- Return the turbulent thermal diffusivity for enthalpy [kg/m/s]
108 virtual tmp<volScalarField> alphat() const
109 {
110 return alphat_;
111 }
112
113 //- Return the turbulent thermal diffusivity for enthalpy for a patch
114 // [kg/m/s]
115 virtual tmp<scalarField> alphat(const label patchi) const
116 {
117 return alphat()().boundaryField()[patchi];
118 }
119
120 //- Return the effective turbulent thermal diffusivity for temperature
121 // [J/m/s/K]
122 virtual tmp<volScalarField> kappaEff() const
123 {
124 return this->transport_.kappaEff(alphat());
125 }
126
127 //- Return the effective turbulent thermal diffusivity for temperature
128 // [J/m/s/K]
129 virtual tmp<scalarField> kappaEff(const label patchi) const
130 {
131 return this->transport_.kappaEff(alphat(patchi), patchi);
132 }
133
134 //- Return the effective turbulent thermal diffusivity for enthalpy
135 // [kg/m/s]
136 virtual tmp<volScalarField> alphaEff() const
137 {
138 return this->transport_.alphaEff(alphat());
139 }
140
141 //- Return the effective turbulent thermal diffusivity for enthalpy
142 // for a patch [kg/m/s]
143 virtual tmp<scalarField> alphaEff(const label patchi) const
144 {
145 return this->transport_.alphaEff(alphat(patchi), patchi);
146 }
147
148 //- Correct the turbulence thermal diffusivity for energy transport
149 virtual void correctEnergyTransport();
150};
151
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155} // End namespace Foam
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159#ifdef NoRepository
160 #include "EddyDiffusivity.C"
161#endif
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
surfaceScalarField & phi
Templated abstract base class for single-phase compressible turbulence models.
virtual tmp< volScalarField > alphat() const
Return the turbulent thermal diffusivity for enthalpy [kg/m/s].
BasicTurbulenceModel::alphaField alphaField
virtual void correctEnergyTransport()
Correct the turbulence thermal diffusivity for energy transport.
dimensionedScalar Prt_
BasicTurbulenceModel::rhoField rhoField
volScalarField alphat_
virtual ~EddyDiffusivity()=default
Destructor.
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
virtual tmp< volScalarField > alphaEff() const
Return the effective turbulent thermal diffusivity for enthalpy.
virtual void correctNut()
BasicTurbulenceModel::transportModel transportModel
virtual bool read()
Re-read model coefficients if they have changed.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
volScalarField & alpha