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

scaleSimilarity.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/scaleSimilarity.H>
00027 
00028 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00029 
00030 namespace Foam
00031 {
00032 namespace incompressible
00033 {
00034 namespace LESModels
00035 {
00036 
00037 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00038 
00039 defineTypeNameAndDebug(scaleSimilarity, 0);
00040 
00041 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00042 
00043 scaleSimilarity::scaleSimilarity
00044 (
00045     const volVectorField& U,
00046     const surfaceScalarField& phi,
00047     transportModel& transport
00048 )
00049 :
00050     LESModel(typeName, U, phi, transport),
00051     filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
00052     filter_(filterPtr_())
00053 {
00054     printCoeffs();
00055 }
00056 
00057 
00058 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00059 
00060 tmp<volScalarField> scaleSimilarity::k() const
00061 {
00062     return(0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))));
00063 }
00064 
00065 
00066 tmp<volScalarField> scaleSimilarity::epsilon() const
00067 {
00068     volSymmTensorField D = symm(fvc::grad(U()));
00069 
00070     return((filter_(sqr(U())) - sqr(filter_(U()))) && D);
00071 }
00072 
00073 
00074 tmp<volSymmTensorField> scaleSimilarity::B() const
00075 {
00076     return(filter_(sqr(U())) - sqr(filter_(U())));
00077 }
00078 
00079 
00080 tmp<volSymmTensorField> scaleSimilarity::devBeff() const
00081 {
00082     return dev(B());
00083 }
00084 
00085 
00086 tmp<fvVectorMatrix> scaleSimilarity::divDevBeff(volVectorField& U) const
00087 {
00088     return fvm::Su(fvc::div(devBeff()), U);
00089 }
00090 
00091 
00092 void scaleSimilarity::correct(const tmp<volTensorField>&)
00093 {}
00094 
00095 
00096 bool scaleSimilarity::read()
00097 {
00098     if (LESModel::read())
00099     {
00100         filter_.read(coeffDict());
00101 
00102         return true;
00103     }
00104     else
00105     {
00106         return false;
00107     }
00108 }
00109 
00110 
00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00112 
00113 } // End namespace LESModels
00114 } // End namespace incompressible
00115 } // End namespace Foam
00116 
00117 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines