FreeFOAM The Cross-Platform CFD Toolkit
LESdelta.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "LESdelta.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 defineTypeNameAndDebug(LESdelta, 0);
37 defineRunTimeSelectionTable(LESdelta, dictionary);
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
41 LESdelta::LESdelta(const word& name, const fvMesh& mesh)
42 :
43  mesh_(mesh),
44  delta_
45  (
46  IOobject
47  (
48  name,
49  mesh.time().timeName(),
50  mesh,
51  IOobject::NO_READ,
52  IOobject::NO_WRITE
53  ),
54  mesh,
55  dimensionedScalar(name, dimLength, SMALL),
56  calculatedFvPatchScalarField::typeName
57  )
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
62 
64 (
65  const word& name,
66  const fvMesh& mesh,
67  const dictionary& dict
68 )
69 {
70  word deltaType(dict.lookup("delta"));
71 
72  dictionaryConstructorTable::iterator cstrIter =
73  dictionaryConstructorTablePtr_->find(deltaType);
74 
75  if (cstrIter == dictionaryConstructorTablePtr_->end())
76  {
78  (
79  "LESdelta::New(const fvMesh&, const dictionary&)"
80  ) << "Unknown LESdelta type " << deltaType << endl << endl
81  << "Valid LESdelta types are :" << endl
82  << dictionaryConstructorTablePtr_->sortedToc()
83  << exit(FatalError);
84  }
85 
86  return autoPtr<LESdelta>(cstrIter()(name, mesh, dict));
87 }
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 } // End namespace Foam
93 
94 // ************************ vim: set sw=4 sts=4 et: ************************ //