1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "turbulenceModel.H"
27 #include "volFields.H"
28 #include "surfaceFields.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace incompressible
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 defineTypeNameAndDebug(turbulenceModel, 0);
40 defineRunTimeSelectionTable(turbulenceModel, turbulenceModel);
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 turbulenceModel::turbulenceModel
46 const volVectorField& U,
47 const surfaceScalarField& phi,
48 transportModel& transport,
49 const word& turbulenceModelName
68 transportModel_(transport)
72 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
74 autoPtr<turbulenceModel> turbulenceModel::New
76 const volVectorField& U,
77 const surfaceScalarField& phi,
78 transportModel& transport,
79 const word& turbulenceModelName
82 // get model name, but do not register the dictionary
83 // otherwise it is registered in the database twice
90 "turbulenceProperties",
93 IOobject::MUST_READ_IF_MODIFIED,
97 ).lookup("simulationType")
100 Info<< "Selecting turbulence model type " << modelType << endl;
102 turbulenceModelConstructorTable::iterator cstrIter =
103 turbulenceModelConstructorTablePtr_->find(modelType);
105 if (cstrIter == turbulenceModelConstructorTablePtr_->end())
109 "turbulenceModel::New(const volVectorField&, "
110 "const surfaceScalarField&, transportModel&, const word&)"
111 ) << "Unknown turbulenceModel type "
112 << modelType << nl << nl
113 << "Valid turbulenceModel types:" << endl
114 << turbulenceModelConstructorTablePtr_->sortedToc()
118 return autoPtr<turbulenceModel>
120 cstrIter()(U, phi, transport, turbulenceModelName)
125 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
127 void turbulenceModel::correct()
129 transportModel_.correct();
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 } // End namespace incompressible
136 } // End namespace Foam
138 // ************************************************************************* //