Loading...
Searching...
No Matches
TurbulenceModel.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2013-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::TurbulenceModel
28
29Description
30 Templated abstract base class for turbulence models
31
32SourceFiles
33 TurbulenceModel.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef TurbulenceModel_H
38#define TurbulenceModel_H
39
40#include "turbulenceModel.H"
41#include "autoPtr.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class TurbulenceModel Declaration
51\*---------------------------------------------------------------------------*/
52
53template
54<
55 class Alpha,
56 class Rho,
57 class BasicTurbulenceModel,
58 class TransportModel
59>
61:
62 public BasicTurbulenceModel
65public:
66
67 typedef Alpha alphaField;
68 typedef Rho rhoField;
69 typedef TransportModel transportModel;
70
72protected:
73
74 // Protected data
75
76 const alphaField& alpha_;
78
79
80 // Protected Member Functions
81
82 //- No copy construct
83 TurbulenceModel(const TurbulenceModel&) = delete;
84
85 //- No copy assignment
86 void operator=(const TurbulenceModel&) = delete;
87
88
89public:
90
91 // Declare run-time constructor selection table
94 (
95 autoPtr,
98 (
99 const alphaField& alpha,
100 const rhoField& rho,
101 const volVectorField& U,
103 const surfaceScalarField& phi,
105 const word& propertiesName
106 ),
108 );
109
110
111 // Constructors
112
113 //- Construct
116 const alphaField& alpha,
117 const rhoField& rho,
118 const volVectorField& U,
120 const surfaceScalarField& phi,
122 const word& propertiesName
123 );
124
125
126 // Selectors
127
128 //- Return a reference to the selected turbulence model
130 (
131 const alphaField& alpha,
132 const rhoField& rho,
133 const volVectorField& U,
135 const surfaceScalarField& phi,
138 );
139
140
141 //- Destructor
142 virtual ~TurbulenceModel() = default;
143
144
145 // Member Functions
146
147 //- Access function to phase fraction
148 const alphaField& alpha() const
149 {
150 return alpha_;
151 }
152
153 //- Access function to incompressible transport model
154 const transportModel& transport() const
156 return transport_;
157 }
158
159 //- Return the laminar viscosity
160 virtual tmp<volScalarField> nu() const
161 {
162 return transport_.nu();
164
165 //- Return the laminar viscosity on patchi
166 virtual tmp<scalarField> nu(const label patchi) const
167 {
168 return transport_.nu(patchi);
169 }
170};
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175} // End namespace Foam
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179#ifdef NoRepository
180 #include "TurbulenceModel.C"
181#endif
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#endif
186
187// ************************************************************************* //
declareRunTimeNewSelectionTable(autoPtr, TurbulenceModel, dictionary,(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName),(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName))
TurbulenceModel(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct.
void operator=(const TurbulenceModel &)=delete
No copy assignment.
TurbulenceModel(const TurbulenceModel &)=delete
No copy construct.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
static autoPtr< TurbulenceModel > New(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
virtual tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity on patchi.
virtual ~TurbulenceModel()=default
Destructor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
const volScalarField & rho() const
Return the density field.
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for managing temporary objects.
Definition tmp.H:75
Base-class for all transport models used by the incompressible turbulence models.
const volVectorField & U() const
Access function to velocity field.
static const word propertiesName
Default name of the turbulence properties dictionary.
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Macros to ease declaration of run-time selection tables.
#define declareRunTimeNewSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection for derived classes.