CompressibleTurbulenceModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 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::CompressibleTurbulenceModel
26 
27 Description
28  Templated abstract base class for single-phase compressible
29  turbulence models.
30 
31 SourceFiles
32  CompressibleTurbulenceModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef CompressibleTurbulenceModel_H
37 #define CompressibleTurbulenceModel_H
38 
39 #include "TurbulenceModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class CompressibleTurbulenceModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class TransportModel>
53 :
54  public TurbulenceModel
55  <
56  geometricOneField,
57  volScalarField,
58  compressibleTurbulenceModel,
59  TransportModel
60  >
61 {
62 
63 public:
64 
67  typedef TransportModel transportModel;
68 
69 
70  // Constructors
71 
72  //- Construct
74  (
75  const word& type,
76  const geometricOneField& alpha,
77  const volScalarField& rho,
78  const volVectorField& U,
80  const surfaceScalarField& phi,
81  const transportModel& trasport,
82  const word& propertiesName
83  );
84 
85 
86  // Selectors
87 
88  //- Return a reference to the selected turbulence model
90  (
91  const volScalarField& rho,
92  const volVectorField& U,
93  const surfaceScalarField& phi,
94  const transportModel& trasportModel,
96  );
97 
98 
99  //- Destructor
101  {}
102 
103 
104  // Member Functions
105 
106  //- Return the laminar dynamic viscosity
107  virtual tmp<volScalarField> mu() const
108  {
109  return this->transport_.mu();
110  }
111 
112  //- Return the laminar dynamic viscosity on patch
113  virtual tmp<scalarField> mu(const label patchi) const
114  {
115  return this->transport_.mu(patchi);
116  }
117 
118  //- Return the laminar viscosity
119  virtual tmp<volScalarField> nu() const
120  {
121  return this->transport_.mu()/this->rho_;
122  }
123 
124  //- Return the laminar viscosity on patchi
125  virtual tmp<scalarField> nu(const label patchi) const
126  {
127  return
128  this->transport_.mu(patchi)/this->rho_.boundaryField()[patchi];
129  }
130 
131  //- Return the turbulence dynamic viscosity
132  virtual tmp<volScalarField> mut() const
133  {
134  return this->rho_*this->nut();
135  }
136 
137  //- Return the turbulence dynamic viscosity on patch
138  virtual tmp<scalarField> mut(const label patchi) const
139  {
140  return this->rho_.boundaryField()[patchi]*this->nut(patchi);
141  }
142 
143  //- Return the effective dynamic viscosity
144  virtual tmp<volScalarField> muEff() const
145  {
146  return mut() + mu();
147  }
148 
149  //- Return the effective dynamic viscosity on patch
150  virtual tmp<scalarField> muEff(const label patchi) const
151  {
152  return mut(patchi) + mu(patchi);
153  }
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
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
const volVectorField & U() const
Access function to velocity field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Templated abstract base class for turbulence models.
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 string.
Definition: word.H:59
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
virtual tmp< volScalarField > mut() const
Return the turbulence dynamic viscosity.
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.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
static autoPtr< CompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const transportModel &trasportModel, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
label patchi
virtual tmp< volScalarField > muEff() const
Return the effective dynamic viscosity.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
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: PtrList.H:53
CompressibleTurbulenceModel(const word &type, const geometricOneField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &trasport, const word &propertiesName)
Construct.
Namespace for OpenFOAM.