Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / turbulenceModels / compressible / RAS / laminar / laminar.C
blobd4808910a2a1ef2c44998811e78fa7da6397979d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "laminar.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
33 namespace compressible
35 namespace RASModels
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(laminar, 0);
41 addToRunTimeSelectionTable(RASModel, laminar, dictionary);
43 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
45 laminar::laminar
47     const volScalarField& rho,
48     const volVectorField& U,
49     const surfaceScalarField& phi,
50     const basicThermo& thermophysicalModel,
51     const word& turbulenceModelName,
52     const word& modelName
55     RASModel(modelName, rho, U, phi, thermophysicalModel, turbulenceModelName)
59 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
61 tmp<volScalarField> laminar::mut() const
63     return tmp<volScalarField>
64     (
65         new volScalarField
66         (
67             IOobject
68             (
69                 "mut",
70                 runTime_.timeName(),
71                 mesh_,
72                 IOobject::NO_READ,
73                 IOobject::NO_WRITE
74             ),
75             mesh_,
76             dimensionedScalar("mut", mu().dimensions(), 0.0)
77         )
78     );
82 tmp<volScalarField> laminar::alphat() const
84     return tmp<volScalarField>
85     (
86         new volScalarField
87         (
88             IOobject
89             (
90                 "alphat",
91                 runTime_.timeName(),
92                 mesh_,
93                 IOobject::NO_READ,
94                 IOobject::NO_WRITE
95             ),
96             mesh_,
97             dimensionedScalar("alphat", alpha().dimensions(), 0.0)
98         )
99     );
103 tmp<volScalarField> laminar::k() const
105     return tmp<volScalarField>
106     (
107         new volScalarField
108         (
109             IOobject
110             (
111                 "k",
112                 runTime_.timeName(),
113                 mesh_,
114                 IOobject::NO_READ,
115                 IOobject::NO_WRITE
116             ),
117             mesh_,
118             dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
119         )
120     );
124 tmp<volScalarField> laminar::epsilon() const
126     return tmp<volScalarField>
127     (
128         new volScalarField
129         (
130             IOobject
131             (
132                 "epsilon",
133                 runTime_.timeName(),
134                 mesh_,
135                 IOobject::NO_READ,
136                 IOobject::NO_WRITE
137             ),
138             mesh_,
139             dimensionedScalar
140             (
141                 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
142             )
143         )
144     );
148 tmp<volSymmTensorField> laminar::R() const
150     return tmp<volSymmTensorField>
151     (
152         new volSymmTensorField
153         (
154             IOobject
155             (
156                 "R",
157                 runTime_.timeName(),
158                 mesh_,
159                 IOobject::NO_READ,
160                 IOobject::NO_WRITE
161             ),
162             mesh_,
163             dimensionedSymmTensor
164             (
165                 "R", sqr(U_.dimensions()), symmTensor::zero
166             )
167         )
168     );
172 tmp<volSymmTensorField> laminar::devRhoReff() const
174     return tmp<volSymmTensorField>
175     (
176         new volSymmTensorField
177         (
178             IOobject
179             (
180                 "devRhoReff",
181                 runTime_.timeName(),
182                 mesh_,
183                 IOobject::NO_READ,
184                 IOobject::NO_WRITE
185             ),
186            -mu()*dev(twoSymm(fvc::grad(U_)))
187         )
188     );
192 tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
194     return
195     (
196       - fvm::laplacian(muEff(), U)
197       - fvc::div(muEff()*dev2(T(fvc::grad(U))))
198     );
202 bool laminar::read()
204     return RASModel::read();
208 void laminar::correct()
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 } // End namespace RASModels
215 } // End namespace compressible
216 } // End namespace Foam
218 // ************************************************************************* //