FreeFOAM The Cross-Platform CFD Toolkit
GenSGSStress.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 compressible
33 {
34 namespace LESModels
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 GenSGSStress::GenSGSStress
40 (
41  const volScalarField& rho,
42  const volVectorField& U,
43  const surfaceScalarField& phi,
44  const basicThermo& thermoPhysicalModel
45 )
46 :
47  LESModel
48  (
49  word("GenSGSStress"),
50  rho,
51  U,
52  phi,
53  thermoPhysicalModel
54  ),
55 
56  ce_
57  (
59  (
60  "ce",
61  coeffDict_,
62  1.048
63  )
64  ),
65 
66  Prt_
67  (
69  (
70  "Prt",
71  coeffDict_,
72  1.0
73  )
74  ),
75 
76  B_
77  (
78  IOobject
79  (
80  "B",
81  runTime_.timeName(),
82  mesh_,
85  ),
86  mesh_
87  ),
88 
89  muSgs_
90  (
91  IOobject
92  (
93  "muSgs",
94  runTime_.timeName(),
95  mesh_,
98  ),
99  mesh_
100  ),
101 
102  alphaSgs_
103  (
104  IOobject
105  (
106  "alphaSgs",
107  runTime_.timeName(),
108  mesh_,
111  ),
112  mesh_
113  )
114 {}
115 
116 
117 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
118 
119 tmp<volSymmTensorField> GenSGSStress::devRhoBeff() const
120 {
122  (
124  (
125  IOobject
126  (
127  "devRhoReff",
128  runTime_.timeName(),
129  mesh_,
132  ),
133  rho()*B_ - mu()*dev(twoSymm(fvc::grad(U())))
134  )
135  );
136 }
137 
138 
139 tmp<fvVectorMatrix> GenSGSStress::divDevRhoBeff(volVectorField& U) const
140 {
141  return
142  (
143  fvc::div(rho()*B_ + 0.05*muSgs_*fvc::grad(U))
144  + fvc::laplacian(0.95*muSgs_, U, "laplacian(muEff,U)")
145  - fvm::laplacian(muEff(), U)
146  - fvc::div(mu()*dev2(fvc::grad(U)().T()))
147  );
148 }
149 
150 
152 {
153  LESModel::correct(gradU);
154 }
155 
156 
157 bool GenSGSStress::read()
158 {
159  if (LESModel::read())
160  {
161  ce_.readIfPresent(coeffDict());
162 
163  return true;
164  }
165  else
166  {
167  return false;
168  }
169 }
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace LESModels
175 } // End namespace compressible
176 } // End namespace Foam
177 
178 // ************************ vim: set sw=4 sts=4 et: ************************ //