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 <incompressibleLESModels/GenEddyVisc.H>
00027 
00028 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00029 
00030 namespace Foam
00031 {
00032 namespace incompressible
00033 {
00034 namespace LESModels
00035 {
00036 
00037 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00038 
00039 GenEddyVisc::GenEddyVisc
00040 (
00041     const volVectorField& U,
00042     const surfaceScalarField& phi,
00043     transportModel& transport
00044 )
00045 :
00046     LESModel(word("GenEddyVisc"), U, phi, transport),
00047 
00048     ce_
00049     (
00050         dimensioned<scalar>::lookupOrAddToDict
00051         (
00052             "ce",
00053             coeffDict_,
00054             1.048
00055         )
00056     ),
00057 
00058     nuSgs_
00059     (
00060         IOobject
00061         (
00062             "nuSgs",
00063             runTime_.timeName(),
00064             mesh_,
00065             IOobject::MUST_READ,
00066             IOobject::AUTO_WRITE
00067         ),
00068         mesh_
00069     )
00070 {
00071 //    printCoeffs();
00072 }
00073 
00074 
00075 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00076 
00077 tmp<volSymmTensorField> GenEddyVisc::B() const
00078 {
00079     return ((2.0/3.0)*I)*k() - nuSgs_*twoSymm(fvc::grad(U()));
00080 }
00081 
00082 
00083 tmp<volSymmTensorField> GenEddyVisc::devBeff() const
00084 {
00085     return -nuEff()*dev(twoSymm(fvc::grad(U())));
00086 }
00087 
00088 
00089 tmp<fvVectorMatrix> GenEddyVisc::divDevBeff(volVectorField& U) const
00090 {
00091     return
00092     (
00093       - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(fvc::grad(U)().T()))
00094     );
00095 }
00096 
00097 
00098 void GenEddyVisc::correct(const tmp<volTensorField>& gradU)
00099 {
00100     LESModel::correct(gradU);
00101 }
00102 
00103 
00104 bool GenEddyVisc::read()
00105 {
00106     if (LESModel::read())
00107     {
00108         ce_.readIfPresent(coeffDict());
00109 
00110         return true;
00111     }
00112     else
00113     {
00114         return false;
00115     }
00116 }
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 } // End namespace LESModels
00122 } // End namespace incompressible
00123 } // End namespace Foam
00124 
00125 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines