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-2015 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 // ************************************************************************* //
Foam::eddyViscosity::validate
virtual void validate()
Validate the turbulence fields after construction.
Definition: eddyViscosity.C:125
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::eddyViscosity::~eddyViscosity
virtual ~eddyViscosity()
Destructor.
Definition: eddyViscosity.H:95
Foam::eddyViscosity::nut
virtual tmp< scalarField > nut(const label patchi) const
Return the turbulence viscosity on patch.
Definition: eddyViscosity.H:118
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::eddyViscosity::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
Definition: eddyViscosity.H:112
Foam::eddyViscosity::evNut
volScalarField & evNut()
Return non-const access to the turbulence viscosity.
Definition: eddyViscosity.H:106
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
Foam::eddyViscosity::read
virtual bool read()=0
Re-read model coefficients if they have changed.
Definition: eddyViscosity.C:75
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::eddyViscosity::correctNut
virtual void correctNut()=0
U
U
Definition: pEqn.H:46
Foam::eddyViscosity::eddyViscosity
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
Foam::linearViscousStress
Linear viscous stress turbulence model base class.
Definition: linearViscousStress.H:50
Foam::label
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
eddyViscosity.C
Foam::eddyViscosity::k
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
Foam::eddyViscosity::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: eddyViscosity.H:75
Foam::RASModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: RASModel.H:100
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::RASModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: RASModel.H:99
rho
rho
Definition: pEqn.H:3
Foam::RASModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: RASModel.H:101
Foam::eddyViscosity::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: eddyViscosity.H:73
patchi
label patchi
Definition: getPatchFieldScalar.H:1
Foam::eddyViscosity::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: eddyViscosity.H:74
Foam::eddyViscosity
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
Foam::eddyViscosity::correct
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
Definition: eddyViscosity.C:132
Foam::eddyViscosity::nut_
volScalarField nut_
Definition: eddyViscosity.H:63
Foam::eddyViscosity::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: eddyViscosity.C:83
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
linearViscousStress.H