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

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