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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::RASModels::kEpsilonLopesdaCosta
29 
30 Group
31  grpRASTurbulence
32 
33 Description
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 
56 See also
57  Foam::RASModels::kEpsilon
58  Foam::porosityModels::powerLawLopesdaCosta
59 
60 SourceFiles
61  kEpsilonLopesdaCosta.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef kEpsilonLopesdaCosta_H
66 #define kEpsilonLopesdaCosta_H
67 
68 #include "RASModel.H"
69 #include "eddyViscosity.H"
70 #include "powerLawLopesdaCosta.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 namespace RASModels
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class kEpsilonLopesdaCosta Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 template<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 
97 protected:
98 
99  // Protected data
100 
101  // Standard model coefficients
102 
108 
109  // Lopes da Costa porosity coefficients
110 
116 
117 
118  // Fields
119 
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 
155 public:
156 
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
192  tmp<volScalarField> DkEff() const
193  {
194  return tmp<volScalarField>
195  (
196  new volScalarField
197  (
198  "DkEff",
199  (this->nut_/sigmak_ + this->nu())
200  )
201  );
202  }
203 
204  //- Return the effective diffusivity for epsilon
206  {
207  return tmp<volScalarField>
208  (
209  new volScalarField
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  //- Return the (estimated) specific dissipation rate
230  virtual tmp<volScalarField> omega() const
231  {
233  (
234  IOobject
235  (
236  IOobject::groupName("omega", this->alphaRhoPhi_.group()),
237  this->runTime_.timeName(),
238  this->mesh_
239  ),
240  epsilon_/(Cmu_*k_)
241  );
242  }
243 
244  //- Solve the turbulence equations and correct the turbulence viscosity
245  virtual void correct();
246 };
247 
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 } // End namespace RASModels
252 } // End namespace Foam
253 
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 
256 #ifdef NoRepository
257  #include "kEpsilonLopesdaCosta.C"
258 #endif
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 #endif
263 
264 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::RASModels::kEpsilonLopesdaCosta::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kEpsilonLopesdaCosta.C:380
Foam::RASModels::kEpsilonLopesdaCosta::CdSigma_
volScalarField::Internal CdSigma_
Definition: kEpsilonLopesdaCosta.H:110
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::RASModels::kEpsilonLopesdaCosta::betap_
volScalarField::Internal betap_
Definition: kEpsilonLopesdaCosta.H:111
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
powerLawLopesdaCosta.H
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::RASModels::kEpsilonLopesdaCosta
Variant of the standard k-epsilon turbulence model with additional source terms to handle the changes...
Definition: kEpsilonLopesdaCosta.H:83
Foam::RASModels::kEpsilonLopesdaCosta::C4_
volScalarField::Internal C4_
Definition: kEpsilonLopesdaCosta.H:113
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::RASModels::kEpsilonLopesdaCosta::setCdSigma
void setCdSigma(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
Definition: kEpsilonLopesdaCosta.C:71
Foam::RASModels::kEpsilonLopesdaCosta::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: kEpsilonLopesdaCosta.H:158
Foam::RASModels::kEpsilonLopesdaCosta::C1_
volScalarField::Internal C1_
Definition: kEpsilonLopesdaCosta.H:103
Foam::RASModels::kEpsilonLopesdaCosta::epsilonSource
virtual tmp< fvScalarMatrix > epsilonSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
Definition: kEpsilonLopesdaCosta.C:162
Foam::RASModels::kEpsilonLopesdaCosta::epsilon_
volScalarField epsilon_
Definition: kEpsilonLopesdaCosta.H:120
Foam::RASModels::kEpsilonLopesdaCosta::correct
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: kEpsilonLopesdaCosta.C:392
Foam::RASModels::kEpsilonLopesdaCosta::sigmak_
volScalarField sigmak_
Definition: kEpsilonLopesdaCosta.H:105
rho
rho
Definition: readInitialConditions.H:88
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
kEpsilonLopesdaCosta.C
eddyViscosity.H
Foam::RASModels::kEpsilonLopesdaCosta::C5_
volScalarField::Internal C5_
Definition: kEpsilonLopesdaCosta.H:114
Foam::RASModels::kEpsilonLopesdaCosta::kSource
virtual tmp< fvScalarMatrix > kSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
Definition: kEpsilonLopesdaCosta.C:150
Foam::RASModels::kEpsilonLopesdaCosta::DepsilonEff
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: kEpsilonLopesdaCosta.H:204
Foam::RASModels::kEpsilonLopesdaCosta::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kEpsilonLopesdaCosta.H:223
Foam::GeometricField< scalar, fvPatchField, volMesh >::Internal
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
Definition: GeometricField.H:107
Foam::RASModels::kEpsilonLopesdaCosta::correctNut
virtual void correctNut()
Definition: kEpsilonLopesdaCosta.C:138
Foam::RASModels::kEpsilonLopesdaCosta::~kEpsilonLopesdaCosta
virtual ~kEpsilonLopesdaCosta()=default
Destructor.
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::RASModels::kEpsilonLopesdaCosta::setPorosityCoefficients
void setPorosityCoefficients()
Definition: kEpsilonLopesdaCosta.C:98
Foam::RASModels::kEpsilonLopesdaCosta::C2_
volScalarField::Internal C2_
Definition: kEpsilonLopesdaCosta.H:104
Foam::RASModels::kEpsilonLopesdaCosta::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kEpsilonLopesdaCosta.H:217
RASModel.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RASModels::kEpsilonLopesdaCosta::Cmu_
volScalarField Cmu_
Definition: kEpsilonLopesdaCosta.H:102
Foam::RASModels::kEpsilonLopesdaCosta::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEpsilonLopesdaCosta.H:191
Foam::RASModels::kEpsilonLopesdaCosta::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: kEpsilonLopesdaCosta.H:156
U
U
Definition: pEqn.H:72
Foam::RASModels::kEpsilonLopesdaCosta::omega
virtual tmp< volScalarField > omega() const
Return the (estimated) specific dissipation rate.
Definition: kEpsilonLopesdaCosta.H:229
Foam::RASModels::kEpsilonLopesdaCosta::k_
volScalarField k_
Definition: kEpsilonLopesdaCosta.H:119
Foam::RASModels::kEpsilonLopesdaCosta::setPorosityCoefficient
void setPorosityCoefficient(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
Definition: kEpsilonLopesdaCosta.C:45
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::RASModels::kEpsilonLopesdaCosta::sigmaEps_
volScalarField sigmaEps_
Definition: kEpsilonLopesdaCosta.H:106
Foam::eddyViscosity
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:55
Foam::RASModels::kEpsilonLopesdaCosta::TypeName
TypeName("kEpsilonLopesdaCosta")
Runtime type information.
Foam::eddyViscosity< RASModel< BasicTurbulenceModel > >::nut_
volScalarField nut_
Definition: eddyViscosity.H:66
Foam::IOobject::groupName
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Foam::C
Graphite solid properties.
Definition: C.H:50
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::RASModels::kEpsilonLopesdaCosta::betad_
volScalarField::Internal betad_
Definition: kEpsilonLopesdaCosta.H:112
Foam::porosityModels::powerLawLopesdaCosta
Variant of the power law porosity model with spatially varying drag coefficient.
Definition: powerLawLopesdaCosta.H:124
Foam::RASModels::kEpsilonLopesdaCosta::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: kEpsilonLopesdaCosta.H:157