CompressibleTurbulenceModel.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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::CompressibleTurbulenceModel
29 
30 Description
31  Templated abstract base class for single-phase compressible
32  turbulence models.
33 
34 SourceFiles
35  CompressibleTurbulenceModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef CompressibleTurbulenceModel_H
40 #define CompressibleTurbulenceModel_H
41 
42 #include "TurbulenceModel.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class CompressibleTurbulenceModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class TransportModel>
56 :
57  public TurbulenceModel
58  <
59  geometricOneField,
60  volScalarField,
61  compressibleTurbulenceModel,
62  TransportModel
63  >
64 {
65 
66 public:
67 
69  typedef volScalarField rhoField;
70  typedef TransportModel transportModel;
71 
72 
73  // Constructors
74 
75  //- Construct
77  (
78  const word& type,
79  const geometricOneField& alpha,
80  const volScalarField& rho,
81  const volVectorField& U,
83  const surfaceScalarField& phi,
85  const word& propertiesName
86  );
87 
88 
89  // Selectors
90 
91  //- Return a reference to the selected turbulence model
93  (
94  const volScalarField& rho,
95  const volVectorField& U,
96  const surfaceScalarField& phi,
99  );
100 
101 
102  //- Destructor
103  virtual ~CompressibleTurbulenceModel() = default;
104 
105 
106  // Member Functions
107 
108  //- Return the laminar dynamic viscosity
109  virtual tmp<volScalarField> mu() const
110  {
111  return this->transport_.mu();
112  }
113 
114  //- Return the laminar dynamic viscosity on patch
115  virtual tmp<scalarField> mu(const label patchi) const
116  {
117  return this->transport_.mu(patchi);
118  }
119 
120  //- Return the laminar viscosity
121  virtual tmp<volScalarField> nu() const
122  {
123  return this->transport_.mu()/this->rho_;
124  }
125 
126  //- Return the laminar viscosity on patchi
127  virtual tmp<scalarField> nu(const label patchi) const
128  {
129  return
130  this->transport_.mu(patchi)/this->rho_.boundaryField()[patchi];
131  }
132 
133  //- Return the turbulence dynamic viscosity
134  virtual tmp<volScalarField> mut() const
135  {
136  return this->rho_*this->nut();
137  }
138 
139  //- Return the turbulence dynamic viscosity on patch
140  virtual tmp<scalarField> mut(const label patchi) const
141  {
142  return this->rho_.boundaryField()[patchi]*this->nut(patchi);
143  }
144 
145  //- Return the effective dynamic viscosity
146  virtual tmp<volScalarField> muEff() const
147  {
148  return mut() + mu();
149  }
150 
151  //- Return the effective dynamic viscosity on patch
152  virtual tmp<scalarField> muEff(const label patchi) const
153  {
154  return mut(patchi) + mu(patchi);
155  }
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #ifdef NoRepository
167 #endif
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
const volVectorField & U() const
Access function to velocity field.
Templated abstract base class for turbulence models.
const transportModel & transport() const
Access function to incompressible transport model.
virtual ~CompressibleTurbulenceModel()=default
Destructor.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:63
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
virtual tmp< volScalarField > mut() const
Return the turbulence dynamic viscosity.
static autoPtr< CompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
Templated abstract base class for single-phase compressible turbulence models.
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
const volScalarField & rho() const
Return the density field.
CompressibleTurbulenceModel(const word &type, const geometricOneField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
virtual tmp< volScalarField > muEff() const
Return the effective dynamic viscosity.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Namespace for OpenFOAM.