EddyDiffusivity.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::EddyDiffusivity
26 
27 Description
28  Templated abstract base class for single-phase compressible
29  turbulence models.
30 
31 SourceFiles
32  EddyDiffusivity.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef EddyDiffusivity_H
37 #define EddyDiffusivity_H
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class EddyDiffusivity Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 template<class BasicTurbulenceModel>
49 class EddyDiffusivity
50 :
51  public BasicTurbulenceModel
52 {
53 
54 protected:
55 
56  // Protected data
57 
58  // Model coefficients
59 
61 
62  // Fields
63 
65 
66 
67  // Protected Member Functions
68 
69  virtual void correctNut();
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
83  (
84  const word& type,
85  const alphaField& alpha,
86  const volScalarField& rho,
87  const volVectorField& U,
88  const surfaceScalarField& alphaRhoPhi,
89  const surfaceScalarField& phi,
90  const transportModel& trasport,
91  const word& propertiesName
92  );
93 
94 
95  //- Destructor
96  virtual ~EddyDiffusivity()
97  {}
98 
99 
100  // Member Functions
101 
102  //- Re-read model coefficients if they have changed
103  virtual bool read();
104 
105  //- Return the turbulent thermal diffusivity for enthalpy [kg/m/s]
106  virtual tmp<volScalarField> alphat() const
107  {
108  return alphat_;
109  }
110 
111  //- Return the turbulent thermal diffusivity for enthalpy for a patch
112  // [kg/m/s]
113  virtual tmp<scalarField> alphat(const label patchi) const
114  {
115  return alphat()().boundaryField()[patchi];
116  }
117 
118  //- Return the effective turbulent thermal diffusivity for temperature
119  // [J/m/s/K]
120  virtual tmp<volScalarField> kappaEff() const
121  {
122  return this->transport_.kappaEff(alphat());
123  }
124 
125  //- Return the effective turbulent thermal diffusivity for temperature
126  // [J/m/s/K]
127  virtual tmp<scalarField> kappaEff(const label patchi) const
128  {
129  return this->transport_.kappaEff(alphat(patchi), patchi);
130  }
131 
132  //- Return the effective turbulent thermal diffusivity for enthalpy
133  // [kg/m/s]
134  virtual tmp<volScalarField> alphaEff() const
135  {
136  return this->transport_.alphaEff(alphat());
137  }
138 
139  //- Return the effective turbulent thermal diffusivity for enthalpy
140  // for a patch [kg/m/s]
141  virtual tmp<scalarField> alphaEff(const label patchi) const
142  {
143  return this->transport_.alphaEff(alphat(patchi), patchi);
144  }
145 
146  //- Correct the turbulence thermal diffusivity for energy transport
147  virtual void correctEnergyTransport();
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158  #include "EddyDiffusivity.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
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 ~EddyDiffusivity()
Destructor.
virtual tmp< volScalarField > alphat() const
Return the turbulent thermal diffusivity for enthalpy [kg/m/s].
BasicTurbulenceModel::rhoField rhoField
BasicTurbulenceModel::alphaField alphaField
virtual void correctNut()
EddyDiffusivity(const word &type, const alphaField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &trasport, const word &propertiesName)
Construct.
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
Templated abstract base class for single-phase compressible turbulence models.
A class for handling words, derived from string.
Definition: word.H:59
virtual void correctEnergyTransport()
Correct the turbulence thermal diffusivity for energy transport.
dimensionedScalar Prt_
BasicTurbulenceModel::transportModel transportModel
volScalarField alphat_
label patchi
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
virtual tmp< volScalarField > alphaEff() const
Return the effective turbulent thermal diffusivity for enthalpy.
virtual bool read()
Re-read model coefficients if they have changed.
A class for managing temporary objects.
Definition: PtrList.H:54
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Namespace for OpenFOAM.