EddyDiffusivity.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2018 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  //- Turbulent thermal diffusivity for enthalpy [kg/m/s]
106  virtual tmp<volScalarField> alphat() const
107  {
108  return alphat_;
109  }
110 
111  //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
112  virtual tmp<scalarField> alphat(const label patchi) const
113  {
114  return alphat()().boundaryField()[patchi];
115  }
116 
117  //- Effective thermal turbulent diffusivity for temperature
118  // of mixture [J/m/s/K]
119  virtual tmp<volScalarField> kappaEff() const
120  {
121  return this->transport_.kappaEff(alphat());
122  }
123 
124  //- Effective thermal turbulent diffusivity for temperature
125  // of mixture for patch [J/m/s/K]
126  virtual tmp<scalarField> kappaEff(const label patchi) const
127  {
128  return this->transport_.kappaEff(alphat(patchi), patchi);
129  }
130 
131  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
132  virtual tmp<volScalarField> alphaEff() const
133  {
134  return this->transport_.alphaEff(alphat());
135  }
136 
137  //- Effective thermal turbulent diffusivity of mixture
138  // for patch [kg/m/s]
139  virtual tmp<scalarField> alphaEff(const label patchi) const
140  {
141  return this->transport_.alphaEff(alphat(patchi), patchi);
142  }
143 
144  //- Correct the turbulence thermal diffusivity for energy transport
145  virtual void correctEnergyTransport();
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #ifdef NoRepository
156  #include "EddyDiffusivity.C"
157 #endif
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
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.
surfaceScalarField & phi
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.
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
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent diffusivity for temperature.
volScalarField alphat_
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
virtual tmp< volScalarField > alphat() const
Turbulent thermal diffusivity for enthalpy [kg/m/s].
label patchi
U
Definition: pEqn.H:72
virtual bool read()
Re-read model coefficients if they have changed.
A class for managing temporary objects.
Definition: PtrList.H:53
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
Namespace for OpenFOAM.