eddyViscosity.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::eddyViscosity
26 
27 Group
28  grpTurbulence
29 
30 Description
31  Eddy viscosity turbulence model base class
32 
33 SourceFiles
34  eddyViscosity.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef eddyViscosity_H
39 #define eddyViscosity_H
40 
41 #include "linearViscousStress.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class eddyViscosity Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class BasicTurbulenceModel>
53 class eddyViscosity
54 :
55  public linearViscousStress<BasicTurbulenceModel>
56 {
57 
58 protected:
59 
60  // Protected data
61 
62  // Fields
63 
65 
66 
67  // Protected Member Functions
68 
69  virtual void correctNut() = 0;
70 
71 
72 public:
73 
74  typedef typename BasicTurbulenceModel::alphaField alphaField;
75  typedef typename BasicTurbulenceModel::rhoField rhoField;
76  typedef typename BasicTurbulenceModel::transportModel transportModel;
77 
78 
79  // Constructors
80 
81  //- Construct from components
83  (
84  const word& modelName,
85  const alphaField& alpha,
86  const rhoField& rho,
87  const volVectorField& U,
88  const surfaceScalarField& alphaRhoPhi,
89  const surfaceScalarField& phi,
90  const transportModel& transport,
91  const word& propertiesName
92  );
93 
94 
95  //- Destructor
96  virtual ~eddyViscosity()
97  {}
98 
99 
100  // Member Functions
101 
102  //- Re-read model coefficients if they have changed
103  virtual bool read() = 0;
104 
105  //- Return non-const access to the turbulence viscosity
106  // to allow modification by means other than derivation
108  {
109  return nut_;
110  }
111 
112  //- Return the turbulence viscosity
113  virtual tmp<volScalarField> nut() const
114  {
115  return nut_;
116  }
117 
118  //- Return the turbulence viscosity on patch
119  virtual tmp<scalarField> nut(const label patchi) const
120  {
121  return nut_.boundaryField()[patchi];
122  }
123 
124  //- Return the turbulence kinetic energy
125  virtual tmp<volScalarField> k() const = 0;
126 
127  //- Return the Reynolds stress tensor
128  virtual tmp<volSymmTensorField> R() const;
129 
130  //- Validate the turbulence fields after construction
131  // Update turbulence viscosity and other derived fields as requires
132  virtual void validate();
133 
134  //- Solve the turbulence equations and correct the turbulence viscosity
135  virtual void correct() = 0;
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #ifdef NoRepository
146  #include "eddyViscosity.C"
147 #endif
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
surfaceScalarField & phi
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
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
BasicTurbulenceModel::rhoField rhoField
Definition: eddyViscosity.H:74
Linear viscous stress turbulence model base class.
volScalarField nut_
Definition: eddyViscosity.H:63
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
BasicTurbulenceModel::transportModel transportModel
Definition: eddyViscosity.H:75
virtual bool read()=0
Re-read model coefficients if they have changed.
Definition: eddyViscosity.C:75
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: eddyViscosity.C:83
A class for handling words, derived from string.
Definition: word.H:59
virtual void correctNut()=0
BasicTurbulenceModel::alphaField alphaField
Definition: eddyViscosity.H:73
virtual ~eddyViscosity()
Destructor.
Definition: eddyViscosity.H:95
label patchi
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
virtual void validate()
Validate the turbulence fields after construction.
A class for managing temporary objects.
Definition: PtrList.H:54
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
volScalarField & evNut()
Return non-const access to the turbulence viscosity.
eddyViscosity(const word &modelName, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct from components.
Definition: eddyViscosity.C:34
Namespace for OpenFOAM.