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