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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::TurbulenceModel
28 
29 Description
30  Templated abstract base class for turbulence models
31 
32 SourceFiles
33  TurbulenceModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef TurbulenceModel_H
38 #define TurbulenceModel_H
39 
40 #include "turbulenceModel.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class TurbulenceModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template
54 <
55  class Alpha,
56  class Rho,
57  class BasicTurbulenceModel,
58  class TransportModel
59 >
60 class TurbulenceModel
61 :
62  public BasicTurbulenceModel
63 {
64 
65 public:
66 
67  typedef Alpha alphaField;
68  typedef Rho rhoField;
69  typedef TransportModel transportModel;
70 
71 
72 protected:
73 
74  // Protected data
75 
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 
89 public:
90 
91  // Declare run-time constructor selection table
92 
94  (
95  autoPtr,
97  dictionary,
98  (
99  const alphaField& alpha,
100  const rhoField& rho,
101  const volVectorField& U,
102  const surfaceScalarField& alphaRhoPhi,
103  const surfaceScalarField& phi,
104  const transportModel& transport,
105  const word& propertiesName
106  ),
107  (alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
108  );
109 
110 
111  // Constructors
112 
113  //- Construct
115  (
116  const alphaField& alpha,
117  const rhoField& rho,
118  const volVectorField& U,
119  const surfaceScalarField& alphaRhoPhi,
120  const surfaceScalarField& phi,
121  const transportModel& transport,
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,
134  const surfaceScalarField& alphaRhoPhi,
135  const surfaceScalarField& phi,
136  const transportModel& transport,
137  const word& propertiesName = turbulenceModel::propertiesName
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
155  {
156  return transport_;
157  }
158 
159  //- Return the laminar viscosity
160  virtual tmp<volScalarField> nu() const
161  {
162  return transport_.nu();
163  }
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 };
171 
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 // ************************************************************************* //
Foam::TurbulenceModel::transport_
const transportModel & transport_
Definition: TurbulenceModel.H:76
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::TurbulenceModel::~TurbulenceModel
virtual ~TurbulenceModel()=default
Destructor.
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::geometricOneField
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Definition: geometricOneField.H:55
Foam::TurbulenceModel::operator=
void operator=(const TurbulenceModel &)=delete
No copy assignment.
Foam::TurbulenceModel::alpha
const alphaField & alpha() const
Access function to phase fraction.
Definition: TurbulenceModel.H:147
rho
rho
Definition: readInitialConditions.H:88
Foam::TurbulenceModel::New
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.
Foam::TurbulenceModel
Templated abstract base class for turbulence models.
Definition: TurbulenceModel.H:59
Foam::TurbulenceModel::transportModel
TransportModel transportModel
Definition: TurbulenceModel.H:68
TurbulenceModel.C
Foam::TurbulenceModel::rhoField
Rho rhoField
Definition: TurbulenceModel.H:67
Foam::TurbulenceModel::alphaField
Alpha alphaField
Definition: TurbulenceModel.H:66
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::TurbulenceModel::alpha_
const alphaField & alpha_
Definition: TurbulenceModel.H:75
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::TurbulenceModel::transport
const transportModel & transport() const
Access function to incompressible transport model.
Definition: TurbulenceModel.H:153
Foam::TurbulenceModel::declareRunTimeNewSelectionTable
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))
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::TurbulenceModel::nu
virtual tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity on patchi.
Definition: TurbulenceModel.H:165
Foam::TurbulenceModel::nu
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Definition: TurbulenceModel.H:159
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::TurbulenceModel::TurbulenceModel
TurbulenceModel(const TurbulenceModel &)=delete
No copy construct.
Foam::GeometricField< scalar, fvPatchField, volMesh >
turbulenceModel.H
autoPtr.H