FreeFOAM The Cross-Platform CFD Toolkit
GenEddyVisc.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
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 
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 namespace incompressible
33 {
34 namespace LESModels
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 GenEddyVisc::GenEddyVisc
40 (
41  const volVectorField& U,
42  const surfaceScalarField& phi,
43  transportModel& transport
44 )
45 :
46  LESModel(word("GenEddyVisc"), U, phi, transport),
47 
48  ce_
49  (
51  (
52  "ce",
53  coeffDict_,
54  1.048
55  )
56  ),
57 
58  nuSgs_
59  (
60  IOobject
61  (
62  "nuSgs",
63  runTime_.timeName(),
64  mesh_,
67  ),
68  mesh_
69  )
70 {
71 // printCoeffs();
72 }
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
78 {
79  return ((2.0/3.0)*I)*k() - nuSgs_*twoSymm(fvc::grad(U()));
80 }
81 
82 
84 {
85  return -nuEff()*dev(twoSymm(fvc::grad(U())));
86 }
87 
88 
90 {
91  return
92  (
93  - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(fvc::grad(U)().T()))
94  );
95 }
96 
97 
99 {
100  LESModel::correct(gradU);
101 }
102 
103 
105 {
106  if (LESModel::read())
107  {
109 
110  return true;
111  }
112  else
113  {
114  return false;
115  }
116 }
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace LESModels
122 } // End namespace incompressible
123 } // End namespace Foam
124 
125 // ************************ vim: set sw=4 sts=4 et: ************************ //