kEpsilonLopesdaCosta.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::RASModels::kEpsilonLopesdaCosta
26 
27 Description
28  Variant of the standard k-epsilon turbulence model with additional source
29  terms to handle the changes in turbulence in porous regions represented by
30  the powerLawLopesdaCosta porosity model.
31 
32  Reference:
33  \verbatim
34  Costa, J. C. P. L. D. (2007).
35  Atmospheric flow over forested and non-forested complex terrain.
36  \endverbatim
37 
38  The default model coefficients are
39  \verbatim
40  kEpsilonLopesdaCostaCoeffs
41  {
42  Cmu 0.09;
43  C1 1.44;
44  C2 1.92;
45  sigmak 1.0;
46  sigmaEps 1.3;
47  }
48  \endverbatim
49 
50 See also
51  Foam::RASModels::kEpsilon
52  Foam::porosityModels::powerLawLopesdaCosta
53 
54 SourceFiles
55  kEpsilonLopesdaCosta.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef kEpsilonLopesdaCosta_H
60 #define kEpsilonLopesdaCosta_H
61 
62 #include "RASModel.H"
63 #include "eddyViscosity.H"
64 #include "powerLawLopesdaCosta.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 namespace RASModels
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class kEpsilonLopesdaCosta Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 template<class BasicTurbulenceModel>
79 :
80  public eddyViscosity<RASModel<BasicTurbulenceModel>>
81 {
82 protected:
83 
84  // Protected data
85 
86  // Standard model coefficients
87 
93 
94  // Lopes da Costa porosity coefficients
95 
101 
102 
103  // Fields
107 
108 
109  // Protected Member Functions
110 
112  (
115  );
116 
117  void setCdSigma
118  (
121  );
122 
124 
125  virtual void correctNut();
126 
128  (
129  const volScalarField::Internal& magU,
130  const volScalarField::Internal& magU3
131  ) const;
132 
134  (
135  const volScalarField::Internal& magU,
136  const volScalarField::Internal& magU3
137  ) const;
138 
139 
140 public:
142  typedef typename BasicTurbulenceModel::alphaField alphaField;
143  typedef typename BasicTurbulenceModel::rhoField rhoField;
144  typedef typename BasicTurbulenceModel::transportModel transportModel;
145 
146 
147  //- Runtime type information
148  TypeName("kEpsilonLopesdaCosta");
149 
150 
151  // Constructors
152 
153  //- Construct from components
155  (
156  const alphaField& alpha,
157  const rhoField& rho,
158  const volVectorField& U,
159  const surfaceScalarField& alphaRhoPhi,
160  const surfaceScalarField& phi,
161  const transportModel& transport,
162  const word& propertiesName = turbulenceModel::propertiesName,
163  const word& type = typeName
164  );
165 
166  //- Disallow default bitwise copy construction
168 
169 
170  //- Destructor
171  virtual ~kEpsilonLopesdaCosta()
172  {}
173 
174 
175  // Member Functions
176 
177  //- Re-read model coefficients if they have changed
178  virtual bool read();
179 
180  //- Return the effective diffusivity for k
181  tmp<volScalarField> DkEff() const
182  {
183  return volScalarField::New
184  (
185  "DkEff",
186  (this->nut_/sigmak_ + this->nu())
187  );
188  }
189 
190  //- Return the effective diffusivity for epsilon
192  {
193  return volScalarField::New
194  (
195  "DepsilonEff",
196  (this->nut_/sigmaEps_ + this->nu())
197  );
198  }
199 
200  //- Return the turbulence kinetic energy
201  virtual tmp<volScalarField> k() const
202  {
203  return k_;
204  }
205 
206  //- Return the turbulence kinetic energy dissipation rate
207  virtual tmp<volScalarField> epsilon() const
208  {
209  return epsilon_;
210  }
211 
212  //- Solve the turbulence equations and correct the turbulence viscosity
213  virtual void correct();
214 
215 
216  // Member Operators
217 
218  //- Disallow default bitwise assignment
219  void operator=(const kEpsilonLopesdaCosta&) = delete;
220 };
221 
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 } // End namespace RASModels
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #ifdef NoRepository
231  #include "kEpsilonLopesdaCosta.C"
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
void setPorosityCoefficient(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
Graphite solid properties.
Definition: C.H:48
surfaceScalarField & phi
Variant of the power law porosity model with spatially varying drag coefficient.
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
BasicTurbulenceModel::rhoField rhoField
virtual tmp< fvScalarMatrix > kSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
virtual bool read()
Re-read model coefficients if they have changed.
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:49
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Mesh &, const dimensionSet &, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return a temporary field constructed from name, mesh, dimensionSet.
virtual tmp< fvScalarMatrix > epsilonSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
static const word propertiesName
Default name of the turbulence properties dictionary.
kEpsilonLopesdaCosta(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:59
void setCdSigma(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
BasicTurbulenceModel::transportModel transportModel
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
void operator=(const kEpsilonLopesdaCosta &)=delete
Disallow default bitwise assignment.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
U
Definition: pEqn.H:72
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Variant of the standard k-epsilon turbulence model with additional source terms to handle the changes...
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
BasicTurbulenceModel::alphaField alphaField
volScalarField & nu
Namespace for OpenFOAM.
TypeName("kEpsilonLopesdaCosta")
Runtime type information.