FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

GenEddyVisc.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include <compressibleLESModels/GenEddyVisc.H>
00027 
00028 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00029 
00030 namespace Foam
00031 {
00032 namespace compressible
00033 {
00034 namespace LESModels
00035 {
00036 
00037 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00038 
00039 GenEddyVisc::GenEddyVisc
00040 (
00041     const volScalarField& rho,
00042     const volVectorField& U,
00043     const surfaceScalarField& phi,
00044     const basicThermo& thermoPhysicalModel
00045 )
00046 :
00047     LESModel
00048     (
00049         word("GenEddyVisc"), rho, U, phi, thermoPhysicalModel
00050     ),
00051 
00052     ce_
00053     (
00054         dimensioned<scalar>::lookupOrAddToDict
00055         (
00056             "ce",
00057             coeffDict_,
00058             1.048
00059         )
00060     ),
00061 
00062     Prt_
00063     (
00064         dimensioned<scalar>::lookupOrAddToDict
00065         (
00066             "Prt",
00067             coeffDict_,
00068             1.0
00069         )
00070     ),
00071 
00072     k_
00073     (
00074         IOobject
00075         (
00076             "k",
00077             runTime_.timeName(),
00078             mesh_,
00079             IOobject::MUST_READ,
00080             IOobject::AUTO_WRITE
00081         ),
00082         mesh_
00083     ),
00084 
00085     muSgs_
00086     (
00087         IOobject
00088         (
00089             "muSgs",
00090             runTime_.timeName(),
00091             mesh_,
00092             IOobject::MUST_READ,
00093             IOobject::AUTO_WRITE
00094         ),
00095         mesh_
00096     ),
00097 
00098     alphaSgs_
00099     (
00100         IOobject
00101         (
00102             "alphaSgs",
00103             runTime_.timeName(),
00104             mesh_,
00105             IOobject::MUST_READ,
00106             IOobject::AUTO_WRITE
00107         ),
00108         mesh_
00109     )
00110 {}
00111 
00112 
00113 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00114 
00115 tmp<volSymmTensorField> GenEddyVisc::B() const
00116 {
00117     return ((2.0/3.0)*I)*k_ - (muSgs_/rho())*dev(twoSymm(fvc::grad(U())));
00118 }
00119 
00120 
00121 tmp<volSymmTensorField> GenEddyVisc::devRhoBeff() const
00122 {
00123     return -muEff()*dev(twoSymm(fvc::grad(U())));
00124 }
00125 
00126 
00127 tmp<fvVectorMatrix> GenEddyVisc::divDevRhoBeff(volVectorField& U) const
00128 {
00129     return
00130     (
00131       - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
00132     );
00133 }
00134 
00135 
00136 void GenEddyVisc::correct(const tmp<volTensorField>& gradU)
00137 {
00138     LESModel::correct(gradU);
00139 }
00140 
00141 
00142 bool GenEddyVisc::read()
00143 {
00144     if (LESModel::read())
00145     {
00146         ce_.readIfPresent(coeffDict());
00147         Prt_.readIfPresent(coeffDict());
00148 
00149         return true;
00150     }
00151     else
00152     {
00153         return false;
00154     }
00155 }
00156 
00157 
00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00159 
00160 } // End namespace LESModels
00161 } // End namespace compressible
00162 } // End namespace Foam
00163 
00164 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines