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 -------------------------------------------------------------------------------
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
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 
155 public:
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  }
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 // ************************************************************************* //
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:46
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:51
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
virtual tmp< fvScalarMatrix > epsilonSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:63
void setCdSigma(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
BasicTurbulenceModel::transportModel transportModel
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
virtual ~kEpsilonLopesdaCosta()=default
Destructor.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
U
Definition: pEqn.H:72
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Variant of the standard k-epsilon turbulence model with additional source terms to handle the changes...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
BasicTurbulenceModel::alphaField alphaField
volScalarField & nu
Namespace for OpenFOAM.
TypeName("kEpsilonLopesdaCosta")
Runtime type information.