dynamicLagrangian.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) 2011-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::LESModels::dynamicLagrangian
26 
27 Description
28  Dynamic SGS model with Lagrangian averaging
29 
30  Reference:
31  \verbatim
32  Meneveau, C., Lund, T. S., & Cabot, W. H. (1996).
33  A Lagrangian dynamic subgrid-scale model of turbulence.
34  Journal of Fluid Mechanics, 319, 353-385.
35  \endverbatim
36 
37 SourceFiles
38  dynamicLagrangian.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef dynamicLagrangian_H
43 #define dynamicLagrangian_H
44 
45 #include "LESeddyViscosity.H"
46 #include "simpleFilter.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace LESModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class dynamicLagrangian Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class BasicTurbulenceModel>
61 :
62  public LESeddyViscosity<BasicTurbulenceModel>
63 {
64 protected:
65 
66  // Protected data
67 
70 
72 
76 
79 
80 
81  // Protected Member Functions
82 
83  //- Update sub-grid eddy-viscosity
84  void correctNut(const tmp<volTensorField>& gradU);
85 
86  virtual void correctNut();
87 
88 
89 public:
90 
91  typedef typename BasicTurbulenceModel::alphaField alphaField;
92  typedef typename BasicTurbulenceModel::rhoField rhoField;
93  typedef typename BasicTurbulenceModel::transportModel transportModel;
94 
95  //- Runtime type information
96  TypeName("dynamicLagrangian");
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const alphaField& alpha,
105  const rhoField& rho,
106  const volVectorField& U,
107  const surfaceScalarField& alphaRhoPhi,
108  const surfaceScalarField& phi,
109  const transportModel& transport,
110  const word& propertiesName = turbulenceModel::propertiesName,
111  const word& type = typeName
112  );
113 
114  //- Disallow default bitwise copy construction
115  dynamicLagrangian(const dynamicLagrangian&) = delete;
116 
117 
118  //- Destructor
119  virtual ~dynamicLagrangian()
120  {}
121 
122 
123  // Member Functions
124 
125  //- Read model coefficients if they have changed
126  virtual bool read();
127 
128  //- Return SGS kinetic energy
129  tmp<volScalarField> k(const tmp<volTensorField>& gradU) const
130  {
131  return
132  pow(2.0*flm_/fmm_, 2.0/3.0)
133  * pow(this->Ce_, -2.0/3.0)
134  * sqr(this->delta())*magSqr(dev(symm(gradU)));
135  }
136 
137  //- Return SGS kinetic energy
138  virtual tmp<volScalarField> k() const
139  {
140  return k(fvc::grad(this->U_));
141  }
142 
143  //- Return the effective diffusivity for k
144  tmp<volScalarField> DkEff() const
145  {
146  return volScalarField::New
147  (
148  "DkEff",
149  this->nut_ + this->nu()
150  );
151  }
152 
153  //- Correct Eddy-Viscosity and related properties
154  virtual void correct();
155 
156 
157  // Member Operators
158 
159  //- Disallow default bitwise assignment
160  void operator=(const dynamicLagrangian&) = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace LESModels
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
172  #include "dynamicLagrangian.C"
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
Eddy viscosity LES SGS model base class.
Abstract class for LES filters.
Definition: LESfilter.H:54
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
surfaceScalarField & phi
Dynamic SGS model with Lagrangian averaging.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
TypeName("dynamicLagrangian")
Runtime type information.
dynamicLagrangian(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.
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
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< volScalarField > k() const
Return SGS kinetic energy.
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
Definition: word.H:59
const volScalarField & delta() const
Access function to filter width.
Definition: LESModel.H:193
virtual ~dynamicLagrangian()
Destructor.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
virtual bool read()
Read model coefficients if they have changed.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
U
Definition: pEqn.H:72
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Simple top-hat filter used in dynamic LES models.
Definition: simpleFilter.H:50
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
BasicTurbulenceModel::rhoField rhoField
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
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
virtual void correct()
Correct Eddy-Viscosity and related properties.
BasicTurbulenceModel::alphaField alphaField
void operator=(const dynamicLagrangian &)=delete
Disallow default bitwise assignment.
volScalarField & nu
BasicTurbulenceModel::transportModel transportModel
Namespace for OpenFOAM.