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"
27 #include <OpenFOAM/Time.H>
28 #include <finiteVolume/volFields.H>
29 #include <finiteVolume/fvcGrad.H>
30 #include <finiteVolume/fvcDiv.H>
33 
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 namespace compressible
40 {
41 
42 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43 
44 defineTypeNameAndDebug(laminar, 0);
45 addToRunTimeSelectionTable(turbulenceModel, laminar, turbulenceModel);
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
49 laminar::laminar
50 (
51  const volScalarField& rho,
52  const volVectorField& U,
53  const surfaceScalarField& phi,
54  const basicThermo& thermophysicalModel
55 )
56 :
57  turbulenceModel(rho, U, phi, thermophysicalModel)
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
62 
63 autoPtr<laminar> laminar::New
64 (
65  const volScalarField& rho,
66  const volVectorField& U,
67  const surfaceScalarField& phi,
68  const basicThermo& thermophysicalModel
69 )
70 {
71  return autoPtr<laminar>(new laminar(rho, U, phi, thermophysicalModel));
72 }
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
77 tmp<volScalarField> laminar::mut() const
78 {
79  return tmp<volScalarField>
80  (
81  new volScalarField
82  (
83  IOobject
84  (
85  "mut",
86  runTime_.timeName(),
87  mesh_,
90  ),
91  mesh_,
92  dimensionedScalar("mut", mu().dimensions(), 0.0)
93  )
94  );
95 }
96 
97 
99 {
100  return tmp<volScalarField>
101  (
102  new volScalarField
103  (
104  IOobject
105  (
106  "k",
107  runTime_.timeName(),
108  mesh_,
111  ),
112  mesh_,
113  dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
114  )
115  );
116 }
117 
118 
119 tmp<volScalarField> laminar::epsilon() const
120 {
121  return tmp<volScalarField>
122  (
123  new volScalarField
124  (
125  IOobject
126  (
127  "epsilon",
128  runTime_.timeName(),
129  mesh_,
132  ),
133  mesh_,
135  (
136  "epsilon", sqr(U_.dimensions())/dimTime, 0.0
137  )
138  )
139  );
140 }
141 
142 
143 tmp<volSymmTensorField> laminar::R() const
144 {
146  (
148  (
149  IOobject
150  (
151  "R",
152  runTime_.timeName(),
153  mesh_,
156  ),
157  mesh_,
159  (
160  "R", sqr(U_.dimensions()), symmTensor::zero
161  )
162  )
163  );
164 }
165 
166 
167 tmp<volSymmTensorField> laminar::devRhoReff() const
168 {
170  (
172  (
173  IOobject
174  (
175  "devRhoReff",
176  runTime_.timeName(),
177  mesh_,
180  ),
181  -mu()*dev(twoSymm(fvc::grad(U_)))
182  )
183  );
184 }
185 
186 
187 tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
188 {
189  return
190  (
191  - fvm::laplacian(muEff(), U)
192  - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
193  );
194 }
195 
196 
197 bool laminar::read()
198 {
199  return true;
200 }
201 
202 
204 {
206 }
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace incompressible
212 } // End namespace Foam
213 
214 // ************************ vim: set sw=4 sts=4 et: ************************ //