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

mixedSmagorinsky.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 "mixedSmagorinsky.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 namespace incompressible
00034 {
00035 namespace LESModels
00036 {
00037 
00038 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00039 
00040 defineTypeNameAndDebug(mixedSmagorinsky, 0);
00041 addToRunTimeSelectionTable(LESModel, mixedSmagorinsky, dictionary);
00042 
00043 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00044 
00045 mixedSmagorinsky::mixedSmagorinsky
00046 (
00047     const volVectorField& U,
00048     const surfaceScalarField& phi,
00049     transportModel& transport
00050 )
00051 :
00052     LESModel(typeName, U, phi, transport),
00053     scaleSimilarity(U, phi, transport),
00054     Smagorinsky(U, phi, transport)
00055 {
00056     printCoeffs();
00057 }
00058 
00059 
00060 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00061 
00062 tmp<volScalarField> mixedSmagorinsky::k() const
00063 {
00064     return
00065     (
00066         scaleSimilarity::k()
00067       + Smagorinsky::k()
00068     );
00069 }
00070 
00071 
00072 tmp<volScalarField> mixedSmagorinsky::epsilon() const
00073 {
00074     return
00075     (
00076         scaleSimilarity::epsilon()
00077       + Smagorinsky::epsilon()
00078     );
00079 }
00080 
00081 
00082 tmp<volSymmTensorField> mixedSmagorinsky::B() const
00083 {
00084     return
00085     (
00086         scaleSimilarity::B()
00087       + Smagorinsky::B()
00088     );
00089 }
00090 
00091 
00092 tmp<volSymmTensorField> mixedSmagorinsky::devBeff() const
00093 {
00094     return
00095     (
00096         scaleSimilarity::devBeff()
00097       + Smagorinsky::devBeff()
00098     );
00099 }
00100 
00101 
00102 tmp<fvVectorMatrix> mixedSmagorinsky::divDevBeff
00103 (
00104     volVectorField& U
00105 ) const
00106 {
00107     return
00108     (
00109         scaleSimilarity::divDevBeff(U)
00110       + Smagorinsky::divDevBeff(U)
00111     );
00112 }
00113 
00114 
00115 void mixedSmagorinsky::correct(const tmp<volTensorField>& gradU)
00116 {
00117     scaleSimilarity::correct(gradU);
00118     Smagorinsky::correct(gradU);
00119 }
00120 
00121 
00122 bool mixedSmagorinsky::read()
00123 {
00124     if (LESModel::read())
00125     {
00126         scaleSimilarity::read();
00127         Smagorinsky::read();
00128 
00129         return true;
00130     }
00131     else
00132     {
00133         return false;
00134     }
00135 }
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 } // End namespace LESModels
00141 } // End namespace incompressible
00142 } // End namespace Foam
00143 
00144 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines