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

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