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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::RASModels::kEpsilonLopesdaCosta
28 
29 Group
30  grpRASTurbulence
31 
32 Description
33  Variant of the standard k-epsilon turbulence model with additional source
34  terms to handle the changes in turbulence in porous regions represented by
35  the powerLawLopesdaCosta porosity model.
36 
37  Reference:
38  \verbatim
39  Costa, J. C. P. L. D. (2007).
40  Atmospheric flow over forested and non-forested complex terrain.
41  \endverbatim
42 
43  The default model coefficients are
44  \verbatim
45  kEpsilonLopesdaCostaCoeffs
46  {
47  Cmu 0.09;
48  C1 1.44;
49  C2 1.92;
50  sigmak 1.0;
51  sigmaEps 1.3;
52  }
53  \endverbatim
54 
55 See also
56  Foam::RASModels::kEpsilon
57  Foam::porosityModels::powerLawLopesdaCosta
58 
59 SourceFiles
60  kEpsilonLopesdaCosta.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef kEpsilonLopesdaCosta_H
65 #define kEpsilonLopesdaCosta_H
66 
67 #include "RASModel.H"
68 #include "eddyViscosity.H"
69 #include "powerLawLopesdaCosta.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace RASModels
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class kEpsilonLopesdaCosta Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 template<class BasicTurbulenceModel>
84 :
85  public eddyViscosity<RASModel<BasicTurbulenceModel>>
86 {
87  // Private Member Functions
88 
89  //- No copy construct
91 
92  //- No copy assignment
93  void operator=(const kEpsilonLopesdaCosta&) = delete;
94 
95 
96 protected:
97 
98  // Protected data
99 
100  // Standard model coefficients
101 
107 
108  // Lopes da Costa porosity coefficients
109 
115 
116 
117  // Fields
118 
121 
122 
123  // Protected Member Functions
124 
126  (
129  );
130 
131  void setCdSigma
132  (
135  );
136 
138 
139  virtual void correctNut();
140 
142  (
143  const volScalarField::Internal& magU,
144  const volScalarField::Internal& magU3
145  ) const;
146 
148  (
149  const volScalarField::Internal& magU,
150  const volScalarField::Internal& magU3
151  ) const;
152 
153 
154 public:
155 
156  typedef typename BasicTurbulenceModel::alphaField alphaField;
157  typedef typename BasicTurbulenceModel::rhoField rhoField;
158  typedef typename BasicTurbulenceModel::transportModel transportModel;
159 
160 
161  //- Runtime type information
162  TypeName("kEpsilonLopesdaCosta");
163 
164 
165  // Constructors
166 
167  //- Construct from components
169  (
170  const alphaField& alpha,
171  const rhoField& rho,
172  const volVectorField& U,
173  const surfaceScalarField& alphaRhoPhi,
174  const surfaceScalarField& phi,
175  const transportModel& transport,
176  const word& propertiesName = turbulenceModel::propertiesName,
177  const word& type = typeName
178  );
179 
180 
181  //- Destructor
182  virtual ~kEpsilonLopesdaCosta() = default;
183 
184 
185  // Member Functions
186 
187  //- Re-read model coefficients if they have changed
188  virtual bool read();
189 
190  //- Return the effective diffusivity for k
191  tmp<volScalarField> DkEff() const
192  {
193  return tmp<volScalarField>
194  (
195  new volScalarField
196  (
197  "DkEff",
198  (this->nut_/sigmak_ + this->nu())
199  )
200  );
201  }
202 
203  //- Return the effective diffusivity for epsilon
205  {
206  return tmp<volScalarField>
207  (
208  new volScalarField
209  (
210  "DepsilonEff",
211  (this->nut_/sigmaEps_ + this->nu())
212  )
213  );
214  }
215 
216  //- Return the turbulence kinetic energy
217  virtual tmp<volScalarField> k() const
218  {
219  return k_;
220  }
221 
222  //- Return the turbulence kinetic energy dissipation rate
223  virtual tmp<volScalarField> epsilon() const
224  {
225  return epsilon_;
226  }
227 
228  //- Solve the turbulence equations and correct the turbulence viscosity
229  virtual void correct();
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 } // End namespace RASModels
236 } // End namespace Foam
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #ifdef NoRepository
241  #include "kEpsilonLopesdaCosta.C"
242 #endif
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 #endif
247 
248 // ************************************************************************* //
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:109
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:110
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
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:82
Foam::RASModels::kEpsilonLopesdaCosta::C4_
volScalarField::Internal C4_
Definition: kEpsilonLopesdaCosta.H:112
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:157
Foam::RASModels::kEpsilonLopesdaCosta::C1_
volScalarField::Internal C1_
Definition: kEpsilonLopesdaCosta.H:102
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:119
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:104
rho
rho
Definition: readInitialConditions.H:96
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
kEpsilonLopesdaCosta.C
eddyViscosity.H
Foam::RASModels::kEpsilonLopesdaCosta::C5_
volScalarField::Internal C5_
Definition: kEpsilonLopesdaCosta.H:113
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:203
Foam::RASModels::kEpsilonLopesdaCosta::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kEpsilonLopesdaCosta.H:222
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:103
Foam::RASModels::kEpsilonLopesdaCosta::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kEpsilonLopesdaCosta.H:216
RASModel.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RASModels::kEpsilonLopesdaCosta::Cmu_
volScalarField Cmu_
Definition: kEpsilonLopesdaCosta.H:101
Foam::RASModels::kEpsilonLopesdaCosta::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEpsilonLopesdaCosta.H:190
Foam::RASModels::kEpsilonLopesdaCosta::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: kEpsilonLopesdaCosta.H:155
U
U
Definition: pEqn.H:72
Foam::RASModels::kEpsilonLopesdaCosta::k_
volScalarField k_
Definition: kEpsilonLopesdaCosta.H:118
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::RASModels::kEpsilonLopesdaCosta::sigmaEps_
volScalarField sigmaEps_
Definition: kEpsilonLopesdaCosta.H:105
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::C
Graphite solid properties.
Definition: C.H:50
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::RASModels::kEpsilonLopesdaCosta::betad_
volScalarField::Internal betad_
Definition: kEpsilonLopesdaCosta.H:111
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:156