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 | Copyright (C) 2013-2016 OpenFOAM Foundation
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 Class
25  Foam::TurbulenceModel
26 
27 Description
28  Templated abstract base class for turbulence models
29 
30 SourceFiles
31  TurbulenceModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef TurbulenceModel_H
36 #define TurbulenceModel_H
37 
38 #include "turbulenceModel.H"
39 #include "autoPtr.H"
40 #include "runTimeSelectionTables.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class TurbulenceModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template
52 <
53  class Alpha,
54  class Rho,
55  class BasicTurbulenceModel,
56  class TransportModel
57 >
58 class TurbulenceModel
59 :
60  public BasicTurbulenceModel
61 {
62 
63 public:
64 
65  typedef Alpha alphaField;
66  typedef Rho rhoField;
67  typedef TransportModel transportModel;
68 
69 
70 protected:
71 
72  // Protected data
73 
74  const alphaField& alpha_;
75  const transportModel& transport_;
76 
77 
78 private:
79 
80  // Private Member Functions
81 
82  //- Disallow default bitwise copy construct
84 
85  //- Disallow default bitwise assignment
86  void operator=(const TurbulenceModel&);
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()
143  {}
144 
145 
146  // Member Functions
147 
148  //- Access function to phase fraction
149  const alphaField& alpha() const
150  {
151  return alpha_;
152  }
153 
154  //- Access function to incompressible transport model
155  const transportModel& transport() const
156  {
157  return transport_;
158  }
159 
160  //- Return the laminar viscosity
161  tmp<volScalarField> nu() const
162  {
163  return transport_.nu();
164  }
165 
166  //- Return the laminar viscosity on patchi
167  tmp<scalarField> nu(const label patchi) const
168  {
169  return transport_.nu(patchi);
170  }
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #ifdef NoRepository
181  #include "TurbulenceModel.C"
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
surfaceScalarField & phi
const transportModel & transport() const
Access function to incompressible transport model.
U
Definition: pEqn.H:83
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
tmp< volScalarField > nu() const
Return the laminar viscosity.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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.
TransportModel transportModel
Templated abstract base class for turbulence models.
const alphaField & alpha_
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
Definition: word.H:59
virtual ~TurbulenceModel()
Destructor.
const alphaField & alpha() const
Access function to phase fraction.
label patchi
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))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:54
const transportModel & transport_
Namespace for OpenFOAM.