BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / turbulenceModels / compressible / LES / GenEddyVisc / GenEddyVisc.C
blob0a3abf0fb3a546fcbf358fed0f8dd3ce21cec54c
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 "GenEddyVisc.H"
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 namespace Foam
32 namespace compressible
34 namespace LESModels
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameWithName(GenEddyVisc, "GenEddyVisc");
42 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
44 GenEddyVisc::GenEddyVisc
46     const volScalarField& rho,
47     const volVectorField& U,
48     const surfaceScalarField& phi,
49     const basicThermo& thermoPhysicalModel,
50     const word& turbulenceModelName,
51     const word& modelName
54     LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
56     ce_
57     (
58         dimensioned<scalar>::lookupOrAddToDict
59         (
60             "ce",
61             coeffDict_,
62             1.048
63         )
64     ),
66     Prt_
67     (
68         dimensioned<scalar>::lookupOrAddToDict
69         (
70             "Prt",
71             coeffDict_,
72             1.0
73         )
74     ),
76     muSgs_
77     (
78         IOobject
79         (
80             "muSgs",
81             runTime_.timeName(),
82             mesh_,
83             IOobject::MUST_READ,
84             IOobject::AUTO_WRITE
85         ),
86         mesh_
87     ),
89     alphaSgs_
90     (
91         IOobject
92         (
93             "alphaSgs",
94             runTime_.timeName(),
95             mesh_,
96             IOobject::MUST_READ,
97             IOobject::AUTO_WRITE
98         ),
99         mesh_
100     )
102 //    printCoeffs();
106 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
108 tmp<volSymmTensorField> GenEddyVisc::B() const
110     return ((2.0/3.0)*I)*k() - (muSgs_/rho())*dev(twoSymm(fvc::grad(U())));
114 tmp<volSymmTensorField> GenEddyVisc::devRhoBeff() const
116     return -muEff()*dev(twoSymm(fvc::grad(U())));
120 tmp<fvVectorMatrix> GenEddyVisc::divDevRhoBeff(volVectorField& U) const
122     return
123     (
124       - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(T(fvc::grad(U))))
125     );
129 void GenEddyVisc::correct(const tmp<volTensorField>& gradU)
131     LESModel::correct(gradU);
135 bool GenEddyVisc::read()
137     if (LESModel::read())
138     {
139         ce_.readIfPresent(coeffDict());
140         Prt_.readIfPresent(coeffDict());
142         return true;
143     }
144     else
145     {
146         return false;
147     }
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace LESModels
154 } // End namespace compressible
155 } // End namespace Foam
157 // ************************************************************************* //