kEpsilonLopesdaCosta.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) 2018 OpenFOAM Foundation
9 Copyright (C) 2020-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::RASModels::kEpsilonLopesdaCosta
29
30Group
31 grpRASTurbulence
32
33Description
34 Variant of the standard k-epsilon turbulence model with additional source
35 terms to handle the changes in turbulence in porous regions represented by
36 the powerLawLopesdaCosta porosity model.
37
38 Reference:
39 \verbatim
40 Costa, J. C. P. L. D. (2007).
41 Atmospheric flow over forested and non-forested complex terrain.
42 \endverbatim
43
44 The default model coefficients are
45 \verbatim
46 kEpsilonLopesdaCostaCoeffs
47 {
48 Cmu 0.09;
49 C1 1.44;
50 C2 1.92;
51 sigmak 1.0;
52 sigmaEps 1.3;
53 }
54 \endverbatim
55
56See also
57 Foam::RASModels::kEpsilon
58 Foam::porosityModels::powerLawLopesdaCosta
59
60SourceFiles
61 kEpsilonLopesdaCosta.C
62
63\*---------------------------------------------------------------------------*/
64
65#ifndef kEpsilonLopesdaCosta_H
66#define kEpsilonLopesdaCosta_H
67
68#include "RASModel.H"
69#include "eddyViscosity.H"
71
72// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73
74namespace Foam
75{
76namespace RASModels
77{
78
79/*---------------------------------------------------------------------------*\
80 Class kEpsilonLopesdaCosta Declaration
81\*---------------------------------------------------------------------------*/
82
83template<class BasicTurbulenceModel>
85:
86 public eddyViscosity<RASModel<BasicTurbulenceModel>>
87{
88 // Private Member Functions
89
90 //- No copy construct
92
93 //- No copy assignment
94 void operator=(const kEpsilonLopesdaCosta&) = delete;
95
96
97protected:
98
99 // Protected data
100
101 // Standard model coefficients
108
109 // Lopes da Costa porosity coefficients
116
117
118 // Fields
122
123
124 // Protected Member Functions
125
127 (
130 );
131
132 void setCdSigma
133 (
136 );
137
139
140 virtual void correctNut();
141
143 (
144 const volScalarField::Internal& magU,
145 const volScalarField::Internal& magU3
146 ) const;
147
149 (
150 const volScalarField::Internal& magU,
151 const volScalarField::Internal& magU3
152 ) const;
153
154
155public:
157 typedef typename BasicTurbulenceModel::alphaField alphaField;
158 typedef typename BasicTurbulenceModel::rhoField rhoField;
159 typedef typename BasicTurbulenceModel::transportModel transportModel;
160
161
162 //- Runtime type information
163 TypeName("kEpsilonLopesdaCosta");
164
165
166 // Constructors
167
168 //- Construct from components
170 (
171 const alphaField& alpha,
172 const rhoField& rho,
173 const volVectorField& U,
174 const surfaceScalarField& alphaRhoPhi,
175 const surfaceScalarField& phi,
176 const transportModel& transport,
177 const word& propertiesName = turbulenceModel::propertiesName,
178 const word& type = typeName
179 );
180
181
182 //- Destructor
183 virtual ~kEpsilonLopesdaCosta() = default;
184
185
186 // Member Functions
187
188 //- Re-read model coefficients if they have changed
189 virtual bool read();
190
191 //- Return the effective diffusivity for k
193 {
195 (
197 (
198 "DkEff",
199 (this->nut_/sigmak_ + this->nu())
200 )
201 );
202 }
203
204 //- Return the effective diffusivity for epsilon
206 {
208 (
210 (
211 "DepsilonEff",
212 (this->nut_/sigmaEps_ + this->nu())
213 )
214 );
215 }
216
217 //- Return the turbulence kinetic energy
218 virtual tmp<volScalarField> k() const
219 {
220 return k_;
221 }
222
223 //- Return the turbulence kinetic energy dissipation rate
224 virtual tmp<volScalarField> epsilon() const
225 {
226 return epsilon_;
227 }
228
229 //- Solve the turbulence equations and correct the turbulence viscosity
230 virtual void correct();
231};
232
233
234// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235
236} // End namespace RASModels
237} // End namespace Foam
238
239// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240
241#ifdef NoRepository
242 #include "kEpsilonLopesdaCosta.C"
243#endif
244
245// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246
247#endif
248
249// ************************************************************************* //
surfaceScalarField & phi
Graphite solid properties.
Definition: C.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Variant of the standard k-epsilon turbulence model with additional source terms to handle the changes...
BasicTurbulenceModel::alphaField alphaField
BasicTurbulenceModel::rhoField rhoField
virtual tmp< fvScalarMatrix > kSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
void setCdSigma(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
TypeName("kEpsilonLopesdaCosta")
Runtime type information.
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
virtual ~kEpsilonLopesdaCosta()=default
Destructor.
BasicTurbulenceModel::transportModel transportModel
virtual tmp< fvScalarMatrix > epsilonSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
void setPorosityCoefficient(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
virtual bool read()
Re-read model coefficients if they have changed.
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:58
Variant of the power law porosity model with spatially varying drag coefficient.
A class for managing temporary objects.
Definition: tmp.H:65
static const word propertiesName
Default name of the turbulence properties dictionary.
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 & nu
volScalarField & alpha
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73