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 
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 // ************************************************************************* //
Foam::TurbulenceModel< geometricOneField, volScalarField, compressibleTurbulenceModel, TransportModel >::transport_
const transportModel & transport_
Definition: TurbulenceModel.H:76
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
compressibleTurbulenceModel.H
Foam::tmp< volScalarField >
Foam::turbulenceModel::nut
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
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:54
Foam::TurbulenceModel< geometricOneField, volScalarField, compressibleTurbulenceModel, TransportModel >::alpha
const alphaField & alpha() const
Access function to phase fraction.
Definition: TurbulenceModel.H:147
Foam::CompressibleTurbulenceModel::~CompressibleTurbulenceModel
virtual ~CompressibleTurbulenceModel()=default
Destructor.
Foam::CompressibleTurbulenceModel::rhoField
volScalarField rhoField
Definition: CompressibleTurbulenceModel.H:68
Foam::turbulenceModel::alphaRhoPhi
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
Definition: turbulenceModel.H:150
Foam::TurbulenceModel
Templated abstract base class for turbulence models.
Definition: TurbulenceModel.H:59
Foam::CompressibleTurbulenceModel::mut
virtual tmp< scalarField > mut(const label patchi) const
Return the turbulence dynamic viscosity on patch.
Definition: CompressibleTurbulenceModel.H:139
Foam::compressibleTurbulenceModel::rho_
const volScalarField & rho_
Definition: compressibleTurbulenceModel.H:63
Foam::CompressibleTurbulenceModel::mu
virtual tmp< scalarField > mu(const label patchi) const
Return the laminar dynamic viscosity on patch.
Definition: CompressibleTurbulenceModel.H:114
Foam::CompressibleTurbulenceModel::transportModel
TransportModel transportModel
Definition: CompressibleTurbulenceModel.H:69
Foam::compressibleTurbulenceModel::rho
const volScalarField & rho() const
Return the density field.
Definition: compressibleTurbulenceModel.H:114
Foam::CompressibleTurbulenceModel::mu
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
Definition: CompressibleTurbulenceModel.H:108
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::TurbulenceModel< geometricOneField, volScalarField, compressibleTurbulenceModel, TransportModel >::transport
const transportModel & transport() const
Access function to incompressible transport model.
Definition: TurbulenceModel.H:153
Foam::CompressibleTurbulenceModel::nu
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Definition: CompressibleTurbulenceModel.H:120
Foam::CompressibleTurbulenceModel::New
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.
Definition: CompressibleTurbulenceModel.C:70
Foam::CompressibleTurbulenceModel::mut
virtual tmp< volScalarField > mut() const
Return the turbulence dynamic viscosity.
Definition: CompressibleTurbulenceModel.H:133
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
TurbulenceModel.H
Foam::compressibleTurbulenceModel::phi
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
Definition: compressibleTurbulenceModel.C:65
Foam::CompressibleTurbulenceModel::CompressibleTurbulenceModel
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.
Definition: CompressibleTurbulenceModel.C:35
Foam::CompressibleTurbulenceModel::muEff
virtual tmp< volScalarField > muEff() const
Return the effective dynamic viscosity.
Definition: CompressibleTurbulenceModel.H:145
Foam::CompressibleTurbulenceModel
Templated abstract base class for single-phase compressible turbulence models.
Definition: CompressibleTurbulenceModel.H:54
Foam::GeometricField< scalar, fvPatchField, volMesh >
CompressibleTurbulenceModel.C
Foam::CompressibleTurbulenceModel::alphaField
geometricOneField alphaField
Definition: CompressibleTurbulenceModel.H:67
Foam::CompressibleTurbulenceModel::muEff
virtual tmp< scalarField > muEff(const label patchi) const
Return the effective dynamic viscosity on patch.
Definition: CompressibleTurbulenceModel.H:151
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::turbulenceModel::U
const volVectorField & U() const
Access function to velocity field.
Definition: turbulenceModel.H:144
Foam::CompressibleTurbulenceModel::nu
virtual tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity on patchi.
Definition: CompressibleTurbulenceModel.H:126