ReynoldsStress.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) 2015-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::ReynoldsStress
26 
27 Group
28  grpTurbulence
29 
30 Description
31  Reynolds-stress turbulence model base class
32 
33 SourceFiles
34  ReynoldsStress.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef ReynoldsStress_H
39 #define ReynoldsStress_H
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ReynoldsStress Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class BasicTurbulenceModel>
51 class ReynoldsStress
52 :
53  public BasicTurbulenceModel
54 {
55 
56 protected:
57 
58  // Protected data
59 
60  // Model coefficients
61 
63 
64  // Fields
65 
68 
69 
70  // Protected Member Functions
71 
74 
75  //- Update the eddy-viscosity
76  virtual void correctNut() = 0;
77 
78 
79 public:
80 
81  typedef typename BasicTurbulenceModel::alphaField alphaField;
82  typedef typename BasicTurbulenceModel::rhoField rhoField;
83  typedef typename BasicTurbulenceModel::transportModel transportModel;
84 
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const word& modelName,
92  const alphaField& alpha,
93  const rhoField& rho,
94  const volVectorField& U,
95  const surfaceScalarField& alphaRhoPhi,
96  const surfaceScalarField& phi,
97  const transportModel& transport,
98  const word& propertiesName
99  );
100 
101 
102  //- Destructor
103  virtual ~ReynoldsStress()
104  {}
105 
106 
107  // Member Functions
108 
109  //- Re-read model coefficients if they have changed
110  virtual bool read() = 0;
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;
126 
127  //- Return the Reynolds stress tensor
128  virtual tmp<volSymmTensorField> R() const;
129 
130  //- Return the effective stress tensor
131  virtual tmp<volSymmTensorField> devRhoReff() const;
132 
133  //- Return the source term for the momentum equation
135 
136  //- Return the source term for the momentum equation
138  (
139  const volScalarField& rho,
140  volVectorField& U
141  ) const;
142 
143  //- Validate the turbulence fields after construction
144  // Update turbulence viscosity and other derived fields as requires
145  virtual void validate();
146 
147  //- Solve the turbulence equations and correct the turbulence viscosity
148  virtual void correct() = 0;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
159  #include "ReynoldsStress.C"
160 #endif
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
BasicTurbulenceModel::alphaField alphaField
surfaceScalarField & phi
U
Definition: pEqn.H:83
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
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 void correctNut()=0
Update the eddy-viscosity.
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
BasicTurbulenceModel::transportModel transportModel
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
virtual bool read()=0
Re-read model coefficients if they have changed.
void correctWallShearStress(volSymmTensorField &R) const
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A class for handling words, derived from string.
Definition: word.H:59
BasicTurbulenceModel::rhoField rhoField
virtual void validate()
Validate the turbulence fields after construction.
dimensionedScalar couplingFactor_
volScalarField nut_
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
virtual ~ReynoldsStress()
Destructor.
ReynoldsStress(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.
label patchi
volSymmTensorField R_
void boundNormalStress(volSymmTensorField &R) const
A class for managing temporary objects.
Definition: PtrList.H:54
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Namespace for OpenFOAM.
Reynolds-stress turbulence model base class.