LESeddyViscosity.C
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) 2013-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "LESeddyViscosity.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 namespace LESModels
33 {
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
37 template<class BasicTurbulenceModel>
38 LESeddyViscosity<BasicTurbulenceModel>::LESeddyViscosity
39 (
40  const word& type,
41  const alphaField& alpha,
42  const rhoField& rho,
43  const volVectorField& U,
44  const surfaceScalarField& alphaRhoPhi,
45  const surfaceScalarField& phi,
46  const transportModel& transport,
47  const word& propertiesName
48 )
49 :
51  (
52  type,
53  alpha,
54  rho,
55  U,
56  alphaRhoPhi,
57  phi,
58  transport,
59  propertiesName
60  ),
61 
62  Ce_
63  (
65  (
66  "Ce",
67  this->coeffDict_,
68  1.048
69  )
70  )
71 {}
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
76 template<class BasicTurbulenceModel>
78 {
80  {
81  Ce_.readIfPresent(this->coeffDict());
82 
83  return true;
84  }
85  else
86  {
87  return false;
88  }
89 }
90 
91 
92 template<class BasicTurbulenceModel>
94 {
95  tmp<volScalarField> tk(this->k());
96 
97  return tmp<volScalarField>
98  (
99  new volScalarField
100  (
101  IOobject
102  (
103  IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
104  this->runTime_.timeName(),
105  this->mesh_,
108  ),
109  Ce_*tk()*sqrt(tk())/this->delta()
110  )
111  );
112 }
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace LESModels
118 } // End namespace Foam
119 
120 // ************************************************************************* //
scalar delta
Templated abstract base class for LES SGS models.
Definition: LESModel.H:56
surfaceScalarField & phi
BasicTurbulenceModel::transportModel transportModel
dimensionedScalar sqrt(const dimensionedScalar &ds)
label k
Boltzmann constant.
Generic dimensioned Type class.
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:49
BasicTurbulenceModel::alphaField alphaField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
bool read(const char *, int32_t &)
Definition: int32IO.C:85
virtual tmp< volScalarField > epsilon() const
Return sub-grid disipation rate.
A class for handling words, derived from string.
Definition: word.H:59
static word groupName(Name name, const word &group)
virtual bool read()
Read model coefficients if they have changed.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
U
Definition: pEqn.H:72
BasicTurbulenceModel::rhoField rhoField
A class for managing temporary objects.
Definition: PtrList.H:53
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.