1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "turbulenceModel.H"
28 #include "volFields.H"
29 #include "surfaceFields.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 namespace compressible
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(turbulenceModel, 0);
41 defineRunTimeSelectionTable(turbulenceModel, turbulenceModel);
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 turbulenceModel::turbulenceModel
47 const volScalarField& rho,
48 const volVectorField& U,
49 const surfaceScalarField& phi,
50 const basicThermo& thermophysicalModel
59 thermophysicalModel_(thermophysicalModel)
63 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
65 autoPtr<turbulenceModel> turbulenceModel::New
67 const volScalarField& rho,
68 const volVectorField& U,
69 const surfaceScalarField& phi,
70 const basicThermo& thermophysicalModel
75 // Enclose the creation of the dictionary to ensure it is deleted
76 // before the turbulenceModel is created otherwise the dictionary is
77 // entered in the database twice
83 "turbulenceProperties",
91 dict.lookup("simulationType") >> modelName;
94 Info<< "Selecting turbulence model type " << modelName << endl;
96 turbulenceModelConstructorTable::iterator cstrIter =
97 turbulenceModelConstructorTablePtr_->find(modelName);
99 if (cstrIter == turbulenceModelConstructorTablePtr_->end())
103 "turbulenceModel::New(const volScalarField&, "
104 "const volVectorField&, const surfaceScalarField&, "
106 ) << "Unknown turbulenceModel type " << modelName
108 << "Valid turbulenceModel types are :" << endl
109 << turbulenceModelConstructorTablePtr_->toc()
113 return autoPtr<turbulenceModel>
115 cstrIter()(rho, U, phi, thermophysicalModel)
120 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
122 void turbulenceModel::correct()
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace compressible
129 } // End namespace Foam
131 // ************************************************************************* //