1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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 \*---------------------------------------------------------------------------*/
28 #include "volFields.H"
31 #include "fvmLaplacian.H"
32 #include "addToRunTimeSelectionTable.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 namespace incompressible
42 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
44 defineTypeNameAndDebug(laminar, 0);
45 addToRunTimeSelectionTable(turbulenceModel, laminar, turbulenceModel);
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 const volVectorField& U,
52 const surfaceScalarField& phi,
53 transportModel& transport,
54 const word& turbulenceModelName
57 turbulenceModel(U, phi, transport, turbulenceModelName)
61 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
63 autoPtr<laminar> laminar::New
65 const volVectorField& U,
66 const surfaceScalarField& phi,
67 transportModel& transport,
68 const word& turbulenceModelName
71 return autoPtr<laminar>
73 new laminar(U, phi, transport, turbulenceModelName)
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80 tmp<volScalarField> laminar::nut() const
82 return tmp<volScalarField>
95 dimensionedScalar("nut", nu()().dimensions(), 0.0)
101 tmp<volScalarField> laminar::nuEff() const
103 return tmp<volScalarField>(new volScalarField("nuEff", nu()));
107 tmp<volScalarField> laminar::k() const
109 return tmp<volScalarField>
122 dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
128 tmp<volScalarField> laminar::epsilon() const
130 return tmp<volScalarField>
145 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
152 tmp<volSymmTensorField> laminar::R() const
154 return tmp<volSymmTensorField>
156 new volSymmTensorField
167 dimensionedSymmTensor
169 "R", sqr(U_.dimensions()), symmTensor::zero
176 tmp<volSymmTensorField> laminar::devReff() const
178 return tmp<volSymmTensorField>
180 new volSymmTensorField
190 -nu()*dev(twoSymm(fvc::grad(U_)))
196 tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const
200 - fvm::laplacian(nuEff(), U)
201 - fvc::div(nuEff()*dev(T(fvc::grad(U))))
206 void laminar::correct()
208 turbulenceModel::correct();
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 } // End namespace incompressible
221 } // End namespace Foam
223 // ************************************************************************* //