Better bounding on topo change
[foam-extend-3.2.git] / src / turbulenceModels / compressible / turbulenceModel / laminar / laminar.C
blob8fd0d8ff3ade061299ddef49cb30ed4371364672
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "laminar.H"
27 #include "foamTime.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
57     turbulenceModel(rho, U, phi, thermophysicalModel)
61 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
63 autoPtr<laminar> laminar::New
65     const volScalarField& rho,
66     const volVectorField& U,
67     const surfaceScalarField& phi,
68     const basicThermo& thermophysicalModel
71     return autoPtr<laminar>(new laminar(rho, U, phi, thermophysicalModel));
75 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
77 tmp<volScalarField> laminar::mut() const
79     return tmp<volScalarField>
80     (
81         new volScalarField
82         (
83             IOobject
84             (
85                 "mut",
86                 runTime_.timeName(),
87                 U_.db(),
88                 IOobject::NO_READ,
89                 IOobject::NO_WRITE
90             ),
91             mesh_,
92             dimensionedScalar("mut", mu().dimensions(), 0.0)
93         )
94     );
98 tmp<volScalarField> laminar::k() const
100     return tmp<volScalarField>
101     (
102         new volScalarField
103         (
104             IOobject
105             (
106                 "k",
107                 runTime_.timeName(),
108                 U_.db(),
109                 IOobject::NO_READ,
110                 IOobject::NO_WRITE
111             ),
112             mesh_,
113             dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
114         )
115     );
119 tmp<volScalarField> laminar::epsilon() const
121     return tmp<volScalarField>
122     (
123         new volScalarField
124         (
125             IOobject
126             (
127                 "epsilon",
128                 runTime_.timeName(),
129                 U_.db(),
130                 IOobject::NO_READ,
131                 IOobject::NO_WRITE
132             ),
133             mesh_,
134             dimensionedScalar
135             (
136                 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
137             )
138         )
139     );
143 tmp<volSymmTensorField> laminar::R() const
145     return tmp<volSymmTensorField>
146     (
147         new volSymmTensorField
148         (
149             IOobject
150             (
151                 "R",
152                 runTime_.timeName(),
153                 U_.db(),
154                 IOobject::NO_READ,
155                 IOobject::NO_WRITE
156             ),
157             mesh_,
158             dimensionedSymmTensor
159             (
160                 "R", sqr(U_.dimensions()), symmTensor::zero
161             )
162         )
163     );
167 tmp<volSymmTensorField> laminar::devRhoReff() const
169     return tmp<volSymmTensorField>
170     (
171         new volSymmTensorField
172         (
173             IOobject
174             (
175                 "devRhoReff",
176                 runTime_.timeName(),
177                 U_.db(),
178                 IOobject::NO_READ,
179                 IOobject::NO_WRITE
180             ),
181            -mu()*dev(twoSymm(fvc::grad(U_)))
182         )
183     );
187 tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
189     return
190     (
191       - fvm::laplacian(muEff(), U)
192       - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
193     );
197 bool laminar::read()
199     return true;
203 void laminar::correct()
205     turbulenceModel::correct();
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 } // End namespace incompressible
212 } // End namespace Foam
214 // ************************************************************************* //