FreeFOAM The Cross-Platform CFD Toolkit
laminar.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 
26 #include "laminar.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace compressible
34 {
35 namespace RASModels
36 {
37 
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 
40 defineTypeNameAndDebug(laminar, 0);
41 addToRunTimeSelectionTable(RASModel, laminar, dictionary);
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
45 laminar::laminar
46 (
47  const volScalarField& rho,
48  const volVectorField& U,
49  const surfaceScalarField& phi,
50  const basicThermo& thermophysicalModel
51 )
52 :
53  RASModel(typeName, rho, U, phi, thermophysicalModel)
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
58 
59 tmp<volScalarField> laminar::mut() const
60 {
61  return tmp<volScalarField>
62  (
63  new volScalarField
64  (
65  IOobject
66  (
67  "mut",
68  runTime_.timeName(),
69  mesh_,
72  ),
73  mesh_,
74  dimensionedScalar("mut", mu().dimensions(), 0.0)
75  )
76  );
77 }
78 
79 
81 {
82  return tmp<volScalarField>
83  (
84  new volScalarField
85  (
86  IOobject
87  (
88  "k",
89  runTime_.timeName(),
90  mesh_,
93  ),
94  mesh_,
95  dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
96  )
97  );
98 }
99 
100 
101 tmp<volScalarField> laminar::epsilon() const
102 {
103  return tmp<volScalarField>
104  (
105  new volScalarField
106  (
107  IOobject
108  (
109  "epsilon",
110  runTime_.timeName(),
111  mesh_,
114  ),
115  mesh_,
117  (
118  "epsilon", sqr(U_.dimensions())/dimTime, 0.0
119  )
120  )
121  );
122 }
123 
124 
125 tmp<volSymmTensorField> laminar::R() const
126 {
128  (
130  (
131  IOobject
132  (
133  "R",
134  runTime_.timeName(),
135  mesh_,
138  ),
139  mesh_,
141  (
142  "R", sqr(U_.dimensions()), symmTensor::zero
143  )
144  )
145  );
146 }
147 
148 
149 tmp<volSymmTensorField> laminar::devRhoReff() const
150 {
152  (
154  (
155  IOobject
156  (
157  "devRhoReff",
158  runTime_.timeName(),
159  mesh_,
162  ),
163  -mu()*dev(twoSymm(fvc::grad(U_)))
164  )
165  );
166 }
167 
168 
169 tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
170 {
171  return
172  (
173  - fvm::laplacian(muEff(), U)
174  - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
175  );
176 }
177 
178 
179 bool laminar::read()
180 {
181  return RASModel::read();
182 }
183 
184 
186 {}
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace RASModels
192 } // End namespace compressible
193 } // End namespace Foam
194 
195 // ************************ vim: set sw=4 sts=4 et: ************************ //