ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / turbulenceModels / compressible / turbulenceModel / laminar / laminar.C
blobbb538f7b219fc602388eb5862f85931b2e9b55f4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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 "Time.H"
28 #include "volFields.H"
29 #include "fvcGrad.H"
30 #include "fvcDiv.H"
31 #include "fvmLaplacian.H"
32 #include "addToRunTimeSelectionTable.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 namespace Foam
39 namespace compressible
42 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
44 defineTypeNameAndDebug(laminar, 0);
45 addToRunTimeSelectionTable(turbulenceModel, laminar, turbulenceModel);
47 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
49 laminar::laminar
51     const volScalarField& rho,
52     const volVectorField& U,
53     const surfaceScalarField& phi,
54     const basicThermo& thermophysicalModel,
55     const word& turbulenceModelName
58     turbulenceModel(rho, U, phi, thermophysicalModel, turbulenceModelName)
62 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
64 autoPtr<laminar> laminar::New
66     const volScalarField& rho,
67     const volVectorField& U,
68     const surfaceScalarField& phi,
69     const basicThermo& thermophysicalModel,
70     const word& turbulenceModelName
73     return autoPtr<laminar>
74     (
75         new laminar(rho, U, phi, thermophysicalModel, turbulenceModelName)
76     );
80 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
82 tmp<volScalarField> laminar::mut() const
84     return tmp<volScalarField>
85     (
86         new volScalarField
87         (
88             IOobject
89             (
90                 "mut",
91                 runTime_.timeName(),
92                 mesh_,
93                 IOobject::NO_READ,
94                 IOobject::NO_WRITE
95             ),
96             mesh_,
97             dimensionedScalar("mut", mu().dimensions(), 0.0)
98         )
99     );
103 tmp<volScalarField> laminar::alphat() const
105     return tmp<volScalarField>
106     (
107         new volScalarField
108         (
109             IOobject
110             (
111                 "alphat",
112                 runTime_.timeName(),
113                 mesh_,
114                 IOobject::NO_READ,
115                 IOobject::NO_WRITE
116             ),
117             mesh_,
118             dimensionedScalar("alphat", alpha().dimensions(), 0.0)
119         )
120     );
124 tmp<volScalarField> laminar::k() const
126     return tmp<volScalarField>
127     (
128         new volScalarField
129         (
130             IOobject
131             (
132                 "k",
133                 runTime_.timeName(),
134                 mesh_,
135                 IOobject::NO_READ,
136                 IOobject::NO_WRITE
137             ),
138             mesh_,
139             dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
140         )
141     );
145 tmp<volScalarField> laminar::epsilon() const
147     return tmp<volScalarField>
148     (
149         new volScalarField
150         (
151             IOobject
152             (
153                 "epsilon",
154                 runTime_.timeName(),
155                 mesh_,
156                 IOobject::NO_READ,
157                 IOobject::NO_WRITE
158             ),
159             mesh_,
160             dimensionedScalar
161             (
162                 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
163             )
164         )
165     );
169 tmp<volSymmTensorField> laminar::R() const
171     return tmp<volSymmTensorField>
172     (
173         new volSymmTensorField
174         (
175             IOobject
176             (
177                 "R",
178                 runTime_.timeName(),
179                 mesh_,
180                 IOobject::NO_READ,
181                 IOobject::NO_WRITE
182             ),
183             mesh_,
184             dimensionedSymmTensor
185             (
186                 "R", sqr(U_.dimensions()), symmTensor::zero
187             )
188         )
189     );
193 tmp<volSymmTensorField> laminar::devRhoReff() const
195     return tmp<volSymmTensorField>
196     (
197         new volSymmTensorField
198         (
199             IOobject
200             (
201                 "devRhoReff",
202                 runTime_.timeName(),
203                 mesh_,
204                 IOobject::NO_READ,
205                 IOobject::NO_WRITE
206             ),
207            -mu()*dev(twoSymm(fvc::grad(U_)))
208         )
209     );
213 tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
215     return
216     (
217       - fvm::laplacian(muEff(), U)
218       - fvc::div(muEff()*dev2(T(fvc::grad(U))))
219     );
223 void laminar::correct()
225     turbulenceModel::correct();
229 bool laminar::read()
231     return true;
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 } // End namespace incompressible
238 } // End namespace Foam
240 // ************************************************************************* //