BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / turbulenceModels / incompressible / RAS / laminar / laminar.C
blob68adca77b3f79374264bf36cd4316b78543aa62d
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 "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
33 namespace incompressible
35 namespace RASModels
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(laminar, 0);
41 addToRunTimeSelectionTable(RASModel, laminar, dictionary);
43 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
45 laminar::laminar
47     const volVectorField& U,
48     const surfaceScalarField& phi,
49     transportModel& transport,
50     const word& turbulenceModelName,
51     const word& modelName
54     RASModel(modelName, U, phi, transport, turbulenceModelName)
58 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
60 tmp<volScalarField> laminar::nut() const
62     return tmp<volScalarField>
63     (
64         new volScalarField
65         (
66             IOobject
67             (
68                 "nut",
69                 runTime_.timeName(),
70                 mesh_,
71                 IOobject::NO_READ,
72                 IOobject::NO_WRITE
73             ),
74             mesh_,
75             dimensionedScalar("nut", nu()().dimensions(), 0.0)
76         )
77     );
81 tmp<volScalarField> laminar::k() const
83     return tmp<volScalarField>
84     (
85         new volScalarField
86         (
87             IOobject
88             (
89                 "k",
90                 runTime_.timeName(),
91                 mesh_,
92                 IOobject::NO_READ,
93                 IOobject::NO_WRITE
94             ),
95             mesh_,
96             dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
97         )
98     );
102 tmp<volScalarField> laminar::epsilon() const
104     return tmp<volScalarField>
105     (
106         new volScalarField
107         (
108             IOobject
109             (
110                 "epsilon",
111                 runTime_.timeName(),
112                 mesh_,
113                 IOobject::NO_READ,
114                 IOobject::NO_WRITE
115             ),
116             mesh_,
117             dimensionedScalar
118             (
119                 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
120             )
121         )
122     );
126 tmp<volSymmTensorField> laminar::R() const
128     return tmp<volSymmTensorField>
129     (
130         new volSymmTensorField
131         (
132             IOobject
133             (
134                 "R",
135                 runTime_.timeName(),
136                 mesh_,
137                 IOobject::NO_READ,
138                 IOobject::NO_WRITE
139             ),
140             mesh_,
141             dimensionedSymmTensor
142             (
143                 "R", sqr(U_.dimensions()), symmTensor::zero
144             )
145         )
146     );
150 tmp<volSymmTensorField> laminar::devReff() const
152     return tmp<volSymmTensorField>
153     (
154         new volSymmTensorField
155         (
156             IOobject
157             (
158                 "devRhoReff",
159                 runTime_.timeName(),
160                 mesh_,
161                 IOobject::NO_READ,
162                 IOobject::NO_WRITE
163             ),
164            -nu()*dev(twoSymm(fvc::grad(U_)))
165         )
166     );
170 tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const
172     return
173     (
174       - fvm::laplacian(nuEff(), U)
175       - fvc::div(nuEff()*dev(T(fvc::grad(U))))
176     );
180 bool laminar::read()
182     return RASModel::read();
186 void laminar::correct()
188     turbulenceModel::correct();
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 } // End namespace RASModels
195 } // End namespace incompressible
196 } // End namespace Foam
198 // ************************************************************************* //