OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "GenEddyVisc.H"
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 namespace compressible
00034 {
00035 namespace LESModels
00036 {
00037 
00038 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00039 
00040 GenEddyVisc::GenEddyVisc
00041 (
00042     const volScalarField& rho,
00043     const volVectorField& U,
00044     const surfaceScalarField& phi,
00045     const basicThermo& thermoPhysicalModel
00046 )
00047 :
00048     LESModel
00049     (
00050         word("GenEddyVisc"), rho, U, phi, thermoPhysicalModel
00051     ),
00052 
00053     ce_
00054     (
00055         dimensioned<scalar>::lookupOrAddToDict
00056         (
00057             "ce",
00058             coeffDict_,
00059             1.048
00060         )
00061     ),
00062 
00063     Prt_
00064     (
00065         dimensioned<scalar>::lookupOrAddToDict
00066         (
00067             "Prt",
00068             coeffDict_,
00069             1.0
00070         )
00071     ),
00072 
00073     k_
00074     (
00075         IOobject
00076         (
00077             "k",
00078             runTime_.timeName(),
00079             mesh_,
00080             IOobject::MUST_READ,
00081             IOobject::AUTO_WRITE
00082         ),
00083         mesh_
00084     ),
00085 
00086     muSgs_
00087     (
00088         IOobject
00089         (
00090             "muSgs",
00091             runTime_.timeName(),
00092             mesh_,
00093             IOobject::MUST_READ,
00094             IOobject::AUTO_WRITE
00095         ),
00096         mesh_
00097     ),
00098 
00099     alphaSgs_
00100     (
00101         IOobject
00102         (
00103             "alphaSgs",
00104             runTime_.timeName(),
00105             mesh_,
00106             IOobject::MUST_READ,
00107             IOobject::AUTO_WRITE
00108         ),
00109         mesh_
00110     )
00111 {}
00112 
00113 
00114 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00115 
00116 tmp<volSymmTensorField> GenEddyVisc::B() const
00117 {
00118     return ((2.0/3.0)*I)*k_ - (muSgs_/rho())*dev(twoSymm(fvc::grad(U())));
00119 }
00120 
00121 
00122 tmp<volSymmTensorField> GenEddyVisc::devRhoBeff() const
00123 {
00124     return -muEff()*dev(twoSymm(fvc::grad(U())));
00125 }
00126 
00127 
00128 tmp<fvVectorMatrix> GenEddyVisc::divDevRhoBeff(volVectorField& U) const
00129 {
00130     return
00131     (
00132       - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
00133     );
00134 }
00135 
00136 
00137 void GenEddyVisc::correct(const tmp<volTensorField>& gradU)
00138 {
00139     LESModel::correct(gradU);
00140 }
00141 
00142 
00143 bool GenEddyVisc::read()
00144 {
00145     if (LESModel::read())
00146     {
00147         ce_.readIfPresent(coeffDict());
00148         Prt_.readIfPresent(coeffDict());
00149 
00150         return true;
00151     }
00152     else
00153     {
00154         return false;
00155     }
00156 }
00157 
00158 
00159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00160 
00161 } // End namespace LESModels
00162 } // End namespace compressible
00163 } // End namespace Foam
00164 
00165 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd