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

PrandtlDelta.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 "PrandtlDelta.H"
00027 #include <finiteVolume/wallDist.H>
00028 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00036 
00037 defineTypeNameAndDebug(PrandtlDelta, 0);
00038 addToRunTimeSelectionTable(LESdelta, PrandtlDelta, dictionary);
00039 
00040 
00041 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00042 
00043 void PrandtlDelta::calcDelta()
00044 {
00045     delta_ = min
00046     (
00047         static_cast<const volScalarField&>(geometricDelta_()),
00048         (kappa_/Cdelta_)*wallDist(mesh_).y()
00049     );
00050 }
00051 
00052 
00053 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00054 
00055 PrandtlDelta::PrandtlDelta
00056 (
00057     const word& name,
00058     const fvMesh& mesh,
00059     const dictionary& dd
00060 )
00061 :
00062     LESdelta(name, mesh),
00063     geometricDelta_(LESdelta::New(name, mesh, dd.subDict(type() + "Coeffs"))),
00064     kappa_(dd.lookupOrDefault<scalar>("kappa", 0.41)),
00065     Cdelta_
00066     (
00067         dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158)
00068     )
00069 {
00070     calcDelta();
00071 }
00072 
00073 
00074 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00075 
00076 void PrandtlDelta::read(const dictionary& d)
00077 {
00078     const dictionary& dd(d.subDict(type() + "Coeffs"));
00079 
00080     geometricDelta_().read(dd);
00081     d.readIfPresent<scalar>("kappa", kappa_);
00082     dd.readIfPresent<scalar>("Cdelta", Cdelta_);
00083     calcDelta();
00084 }
00085 
00086 
00087 void PrandtlDelta::correct()
00088 {
00089     geometricDelta_().correct();
00090 
00091     if (mesh_.changing())
00092     {
00093         calcDelta();
00094     }
00095 }
00096 
00097 
00098 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00099 
00100 } // End namespace Foam
00101 
00102 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines