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

GenSGSStress.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 "GenSGSStress.H"
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 namespace compressible
00034 {
00035 namespace LESModels
00036 {
00037 
00038 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00039 
00040 GenSGSStress::GenSGSStress
00041 (
00042     const volScalarField& rho,
00043     const volVectorField& U,
00044     const surfaceScalarField& phi,
00045     const basicThermo& thermoPhysicalModel
00046 )
00047 :
00048     LESModel
00049     (
00050         word("GenSGSStress"),
00051         rho,
00052         U,
00053         phi,
00054         thermoPhysicalModel
00055     ),
00056 
00057     ce_
00058     (
00059         dimensioned<scalar>::lookupOrAddToDict
00060         (
00061             "ce",
00062             coeffDict_,
00063             1.048
00064         )
00065     ),
00066 
00067     Prt_
00068     (
00069         dimensioned<scalar>::lookupOrAddToDict
00070         (
00071             "Prt",
00072             coeffDict_,
00073             1.0
00074         )
00075     ),
00076 
00077     B_
00078     (
00079         IOobject
00080         (
00081             "B",
00082             runTime_.timeName(),
00083             mesh_,
00084             IOobject::MUST_READ,
00085             IOobject::AUTO_WRITE
00086         ),
00087         mesh_
00088     ),
00089 
00090     muSgs_
00091     (
00092         IOobject
00093         (
00094             "muSgs",
00095             runTime_.timeName(),
00096             mesh_,
00097             IOobject::MUST_READ,
00098             IOobject::AUTO_WRITE
00099         ),
00100         mesh_
00101     ),
00102 
00103     alphaSgs_
00104     (
00105         IOobject
00106         (
00107             "alphaSgs",
00108             runTime_.timeName(),
00109             mesh_,
00110             IOobject::MUST_READ,
00111             IOobject::AUTO_WRITE
00112         ),
00113         mesh_
00114     )
00115 {}
00116 
00117 
00118 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00119 
00120 tmp<volSymmTensorField> GenSGSStress::devRhoBeff() const
00121 {
00122     return tmp<volSymmTensorField>
00123     (
00124         new volSymmTensorField
00125         (
00126             IOobject
00127             (
00128                 "devRhoReff",
00129                 runTime_.timeName(),
00130                 mesh_,
00131                 IOobject::NO_READ,
00132                 IOobject::NO_WRITE
00133             ),
00134             rho()*B_ - mu()*dev(twoSymm(fvc::grad(U())))
00135         )
00136     );
00137 }
00138 
00139 
00140 tmp<fvVectorMatrix> GenSGSStress::divDevRhoBeff(volVectorField& U) const
00141 {
00142     return
00143     (
00144         fvc::div(rho()*B_ + 0.05*muSgs_*fvc::grad(U))
00145       + fvc::laplacian(0.95*muSgs_, U, "laplacian(muEff,U)")
00146       - fvm::laplacian(muEff(), U)
00147       - fvc::div(mu()*dev2(fvc::grad(U)().T()))
00148     );
00149 }
00150 
00151 
00152 void GenSGSStress::correct(const tmp<volTensorField>& gradU)
00153 {
00154     LESModel::correct(gradU);
00155 }
00156 
00157 
00158 bool GenSGSStress::read()
00159 {
00160     if (LESModel::read())
00161     {
00162         ce_.readIfPresent(coeffDict());
00163 
00164         return true;
00165     }
00166     else
00167     {
00168         return false;
00169     }
00170 }
00171 
00172 
00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00174 
00175 } // End namespace LESModels
00176 } // End namespace compressible
00177 } // End namespace Foam
00178 
00179 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd