v2f.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) 2012-2023 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::RASModels::v2f
26 
27 Description
28  Lien and Kalitzin's v2-f turbulence model for incompressible and
29  compressible flows, with a limit imposed on the turbulent viscosity given
30  by Davidson et al.
31 
32  The model solves for turbulence kinetic energy k and turbulence dissipation
33  rate epsilon, with additional equations for the turbulence stress normal to
34  streamlines, v2, and elliptic damping function, f.
35 
36  The variant implemented employs N=6, such that f=0 on walls.
37 
38  Wall boundary conditions are:
39 
40  k = kLowReWallFunction
41  epsilon = epsilonWallFunction
42  v2 = v2WallFunction
43  f = fWallFunction
44 
45  These are applicable to both low- and high-Reynolds number flows.
46 
47  Inlet values can be approximated by:
48 
49  v2 = 2/3 k
50  f = zero-gradient
51 
52  References:
53  \verbatim
54  Lien, F. S., & Kalitzin, G. (2001).
55  Computations of transonic flow with the v2f turbulence model.
56  International Journal of Heat and Fluid Flow, 22(1), 53-61.
57 
58  Davidson, L., Nielsen, P., & Sveningsson, A. (2003).
59  Modifications of the v2-f model for computing the flow in a
60  3D wall jet.
61  Turbulence, Heat and Mass Transfer, 4, 577-584
62  \endverbatim
63 
64  The default model coefficients are
65  \verbatim
66  v2fCoeffs
67  {
68  Cmu 0.22;
69  CmuKEps 0.09;
70  C1 1.4;
71  C2 0.3;
72  CL 0.23;
73  Ceta 70;
74  Ceps2 1.9;
75  Ceps3 -0.33;
76  sigmaEps 1.3;
77  sigmaK 1;
78  }
79  \endverbatim
80 
81  Note:
82  If the kLowReWallFunction is employed, a velocity variant of the
83  turbulent viscosity wall function should be used, e.g. nutUWallFunction.
84  Turbulence k variants (nutk...) for this case will not behave correctly.
85 
86 See also
87  Foam::RASModels::v2fBase
88  Foam::RASModels::kEpsilon
89  Foam::kLowReWallFunctionFvPatchScalarField
90  Foam::epsilonWallFunctionFvPatchScalarField
91  Foam::v2WallFunctionFvPatchScalarField
92  Foam::fWallFunctionFvPatchScalarField
93 
94 SourceFiles
95  v2f.C
96 
97 \*---------------------------------------------------------------------------*/
98 
99 #ifndef v2f_H
100 #define v2f_H
101 
102 #include "v2fBase.H"
103 #include "RASModel.H"
104 #include "eddyViscosity.H"
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 namespace Foam
109 {
110 namespace RASModels
111 {
112 
113 /*---------------------------------------------------------------------------*\
114  Class v2f Declaration
115 \*---------------------------------------------------------------------------*/
116 
117 template<class BasicMomentumTransportModel>
118 class v2f
119 :
120  public eddyViscosity<RASModel<BasicMomentumTransportModel>>,
121  public v2fBase
122 {
123 
124 protected:
125 
126  // Protected data
127 
128  // Model coefficients
129 
140 
141 
142  // Fields
143 
144  //- Turbulence kinetic energy
146 
147  //- Turbulence dissipation
149 
150  //- Turbulence stress normal to streamlines
152 
153  //- Damping function
155 
156 
157  // Bounding values
158 
161 
162 
163  // Protected Member Functions
164 
165  //- Bound epsilon and return Cmu*sqr(k) for nut
167 
168  //- Correct the eddy-viscosity nut
169  virtual void correctNut();
170 
171  //- Return time scale, Ts
172  tmp<volScalarField> Ts() const;
173 
174  //- Return length scale, Ls
175  tmp<volScalarField> Ls() const;
176 
177 
178 public:
179 
180  typedef typename BasicMomentumTransportModel::alphaField alphaField;
181  typedef typename BasicMomentumTransportModel::rhoField rhoField;
182 
183 
184  //- Runtime type information
185  TypeName("v2f");
186 
187 
188  // Constructors
189 
190  //- Construct from components
191  v2f
192  (
193  const alphaField& alpha,
194  const rhoField& rho,
195  const volVectorField& U,
196  const surfaceScalarField& alphaRhoPhi,
197  const surfaceScalarField& phi,
198  const viscosity& viscosity,
199  const word& type = typeName
200  );
201 
202 
203  //- Destructor
204  virtual ~v2f()
205  {}
206 
207 
208  // Member Functions
209 
210  //- Read RASProperties dictionary
211  virtual bool read();
212 
213  //- Return the effective diffusivity for k
214  tmp<volScalarField> DkEff() const
215  {
216  return volScalarField::New
217  (
218  "DkEff",
219  this->nut_/sigmaK_ + this->nu()
220  );
221  }
222 
223  //- Return the effective diffusivity for epsilon
225  {
226  return volScalarField::New
227  (
228  "DepsilonEff",
229  this->nut_/sigmaEps_ + this->nu()
230  );
231  }
232 
233  //- Return the turbulence kinetic energy
234  virtual tmp<volScalarField> k() const
235  {
236  return k_;
237  }
238 
239  //- Return the turbulence kinetic energy dissipation rate
240  virtual tmp<volScalarField> epsilon() const
241  {
242  return epsilon_;
243  }
244 
245  //- Return the turbulence specific dissipation rate
246  virtual tmp<volScalarField> omega() const
247  {
248  return volScalarField::New
249  (
250  "omega",
251  epsilon_/(Cmu_*k_)
252  );
253  }
254 
255  //- Return turbulence stress normal to streamlines
256  virtual tmp<volScalarField> v2() const
257  {
258  return v2_;
259  }
260 
261  //- Return the damping function
262  virtual tmp<volScalarField> f() const
263  {
264  return f_;
265  }
266 
267  //- Solve the turbulence equations and correct the turbulence viscosity
268  virtual void correct();
269 };
270 
271 
272 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
273 
274 } // End namespace RASModels
275 } // End namespace Foam
276 
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
278 
279 #ifdef NoRepository
280  #include "v2f.C"
281 #endif
282 
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 
285 #endif
286 
287 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Abstract base-class for v2-f models to provide BCs access to the v2 and f fields.
Definition: v2fBase.H:55
Lien and Kalitzin's v2-f turbulence model for incompressible and compressible flows,...
Definition: v2f.H:121
BasicMomentumTransportModel::alphaField alphaField
Definition: v2f.H:179
dimensionedScalar Ceta_
Definition: v2f.H:134
volScalarField epsilon_
Turbulence dissipation.
Definition: v2f.H:147
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: v2f.H:213
volScalarField k_
Turbulence kinetic energy.
Definition: v2f.H:144
dimensionedScalar C1_
Definition: v2f.H:131
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: v2f.H:233
dimensionedScalar sigmaEps_
Definition: v2f.H:138
virtual tmp< volScalarField > omega() const
Return the turbulence specific dissipation rate.
Definition: v2f.H:245
v2f(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
Definition: v2f.C:78
dimensionedScalar CmuKEps_
Definition: v2f.H:130
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: v2f.C:282
dimensionedScalar Ceps2_
Definition: v2f.H:135
tmp< volScalarField > boundEpsilon()
Bound epsilon and return Cmu*sqr(k) for nut.
Definition: v2f.C:41
dimensionedScalar CL_
Definition: v2f.H:133
dimensionedScalar Ceps3_
Definition: v2f.H:136
virtual tmp< volScalarField > v2() const
Return turbulence stress normal to streamlines.
Definition: v2f.H:255
dimensionedScalar fMin_
Definition: v2f.H:159
TypeName("v2f")
Runtime type information.
dimensionedScalar v2Min_
Definition: v2f.H:158
dimensionedScalar C2_
Definition: v2f.H:132
virtual tmp< volScalarField > f() const
Return the damping function.
Definition: v2f.H:261
tmp< volScalarField > Ts() const
Return time scale, Ts.
Definition: v2f.C:50
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: v2f.H:223
virtual void correctNut()
Correct the eddy-viscosity nut.
Definition: v2f.C:66
volScalarField f_
Damping function.
Definition: v2f.H:153
dimensionedScalar Cmu_
Definition: v2f.H:129
dimensionedScalar sigmaK_
Definition: v2f.H:137
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: v2f.H:239
virtual ~v2f()
Destructor.
Definition: v2f.H:203
tmp< volScalarField > Ls() const
Return length scale, Ls.
Definition: v2f.C:57
virtual bool read()
Read RASProperties dictionary.
Definition: v2f.C:257
volScalarField v2_
Turbulence stress normal to streamlines.
Definition: v2f.H:150
BasicMomentumTransportModel::rhoField rhoField
Definition: v2f.H:180
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
BasicMomentumTransportModel::alphaField alphaField
BasicMomentumTransportModel::rhoField rhoField
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488