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

lowReOneEqEddy.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 "lowReOneEqEddy.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 namespace compressible
00035 {
00036 namespace LESModels
00037 {
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 defineTypeNameAndDebug(lowReOneEqEddy, 0);
00042 addToRunTimeSelectionTable(LESModel, lowReOneEqEddy, dictionary);
00043 
00044 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00045 
00046 void lowReOneEqEddy::updateSubGridScaleFields()
00047 {
00048     // High Re eddy viscosity
00049     muSgs_ = ck_*rho()*sqrt(k_)*delta();
00050 
00051     // low Re no corrected eddy viscosity
00052     muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu()));
00053     muSgs_.correctBoundaryConditions();
00054 
00055     alphaSgs_ = muSgs_/Prt_;
00056     alphaSgs_.correctBoundaryConditions();
00057 }
00058 
00059 
00060 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00061 
00062 lowReOneEqEddy::lowReOneEqEddy
00063 (
00064     const volScalarField& rho,
00065     const volVectorField& U,
00066     const surfaceScalarField& phi,
00067     const basicThermo& thermoPhysicalModel
00068 )
00069 :
00070     LESModel(typeName, rho, U, phi, thermoPhysicalModel),
00071     GenEddyVisc(rho, U, phi, thermoPhysicalModel),
00072 
00073     ck_
00074     (
00075         dimensioned<scalar>::lookupOrAddToDict
00076         (
00077             "ck",
00078             coeffDict_,
00079             0.07
00080         )
00081     ),
00082     beta_
00083     (
00084         dimensioned<scalar>::lookupOrAddToDict
00085         (
00086             "beta",
00087             coeffDict_,
00088             0.01
00089         )
00090     )
00091 {
00092     updateSubGridScaleFields();
00093 
00094     printCoeffs();
00095 }
00096 
00097 
00098 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00099 
00100 void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU)
00101 {
00102     const volTensorField& gradU = tgradU();
00103 
00104     GenEddyVisc::correct(gradU);
00105 
00106     volScalarField divU = fvc::div(phi()/fvc::interpolate(rho()));
00107     volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU)));
00108 
00109     solve
00110     (
00111         fvm::ddt(rho(), k_)
00112       + fvm::div(phi(), k_)
00113       - fvm::laplacian(DkEff(), k_)
00114      ==
00115         G
00116       - fvm::SuSp(2.0/3.0*rho()*divU, k_)
00117       - fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_)
00118     );
00119 
00120     bound(k_, k0());
00121 
00122     updateSubGridScaleFields();
00123 }
00124 
00125 
00126 bool lowReOneEqEddy::read()
00127 {
00128     if (GenEddyVisc::read())
00129     {
00130         ck_.readIfPresent(coeffDict());
00131         beta_.readIfPresent(coeffDict());
00132 
00133         return true;
00134     }
00135     else
00136     {
00137         return false;
00138     }
00139 }
00140 
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 } // End namespace LESModels
00145 } // End namespace compressible
00146 } // End namespace Foam
00147 
00148 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd