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

LESdelta.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 "LESdelta.H"
00027 #include <finiteVolume/calculatedFvPatchFields.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 
00034 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00035 
00036 defineTypeNameAndDebug(LESdelta, 0);
00037 defineRunTimeSelectionTable(LESdelta, dictionary);
00038 
00039 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00040 
00041 LESdelta::LESdelta(const word& name, const fvMesh& mesh)
00042 :
00043     mesh_(mesh),
00044     delta_
00045     (
00046         IOobject
00047         (
00048             name,
00049             mesh.time().timeName(),
00050             mesh,
00051             IOobject::NO_READ,
00052             IOobject::NO_WRITE
00053         ),
00054         mesh,
00055         dimensionedScalar(name, dimLength, SMALL),
00056         calculatedFvPatchScalarField::typeName
00057     )
00058 {}
00059 
00060 
00061 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
00062 
00063 autoPtr<LESdelta> LESdelta::New
00064 (
00065     const word& name,
00066     const fvMesh& mesh,
00067     const dictionary& dict
00068 )
00069 {
00070     word deltaType(dict.lookup("delta"));
00071 
00072     dictionaryConstructorTable::iterator cstrIter =
00073         dictionaryConstructorTablePtr_->find(deltaType);
00074 
00075     if (cstrIter == dictionaryConstructorTablePtr_->end())
00076     {
00077         FatalErrorIn
00078         (
00079             "LESdelta::New(const fvMesh&, const dictionary&)"
00080         )   << "Unknown LESdelta type " << deltaType << endl << endl
00081             << "Valid LESdelta types are :" << endl
00082             << dictionaryConstructorTablePtr_->sortedToc()
00083             << exit(FatalError);
00084     }
00085 
00086     return autoPtr<LESdelta>(cstrIter()(name, mesh, dict));
00087 }
00088 
00089 
00090 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00091 
00092 } // End namespace Foam
00093 
00094 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines