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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::EddyDiffusivity
29 
30 Description
31  Templated abstract base class for single-phase compressible
32  turbulence models.
33 
34 SourceFiles
35  EddyDiffusivity.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef EddyDiffusivity_H
40 #define EddyDiffusivity_H
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class EddyDiffusivity Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class BasicTurbulenceModel>
52 class EddyDiffusivity
53 :
54  public BasicTurbulenceModel
55 {
56 
57 protected:
58 
59  // Protected data
60 
61  // Model coefficients
62 
64 
65  // Fields
66 
68 
69 
70  // Protected Member Functions
71 
72  virtual void correctNut();
73 
74 
75 public:
76 
77  typedef typename BasicTurbulenceModel::alphaField alphaField;
78  typedef typename BasicTurbulenceModel::rhoField rhoField;
79  typedef typename BasicTurbulenceModel::transportModel transportModel;
80 
81 
82  // Constructors
83 
84  //- Construct
86  (
87  const word& type,
88  const alphaField& alpha,
89  const volScalarField& rho,
90  const volVectorField& U,
91  const surfaceScalarField& alphaRhoPhi,
92  const surfaceScalarField& phi,
93  const transportModel& transport,
94  const word& propertiesName
95  );
96 
97 
98  //- Destructor
99  virtual ~EddyDiffusivity() = default;
100 
101 
102  // Member Functions
103 
104  //- Re-read model coefficients if they have changed
105  virtual bool read();
106 
107  //- Return the turbulent thermal diffusivity for enthalpy [kg/m/s]
108  virtual tmp<volScalarField> alphat() const
109  {
110  return alphat_;
111  }
112 
113  //- Return the turbulent thermal diffusivity for enthalpy for a patch
114  // [kg/m/s]
115  virtual tmp<scalarField> alphat(const label patchi) const
116  {
117  return alphat()().boundaryField()[patchi];
118  }
119 
120  //- Return the effective turbulent thermal diffusivity for temperature
121  // [J/m/s/K]
122  virtual tmp<volScalarField> kappaEff() const
123  {
124  return this->transport_.kappaEff(alphat());
125  }
126 
127  //- Return the effective turbulent thermal diffusivity for temperature
128  // [J/m/s/K]
129  virtual tmp<scalarField> kappaEff(const label patchi) const
130  {
131  return this->transport_.kappaEff(alphat(patchi), patchi);
132  }
133 
134  //- Return the effective turbulent thermal diffusivity for enthalpy
135  // [kg/m/s]
136  virtual tmp<volScalarField> alphaEff() const
137  {
138  return this->transport_.alphaEff(alphat());
139  }
140 
141  //- Return the effective turbulent thermal diffusivity for enthalpy
142  // for a patch [kg/m/s]
143  virtual tmp<scalarField> alphaEff(const label patchi) const
144  {
145  return this->transport_.alphaEff(alphat(patchi), patchi);
146  }
147 
148  //- Correct the turbulence thermal diffusivity for energy transport
149  virtual void correctEnergyTransport();
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #ifdef NoRepository
160  #include "EddyDiffusivity.C"
161 #endif
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::EddyDiffusivity::alphaEff
virtual tmp< volScalarField > alphaEff() const
Return the effective turbulent thermal diffusivity for enthalpy.
Definition: EddyDiffusivity.H:135
Foam::EddyDiffusivity::correctNut
virtual void correctNut()
Definition: EddyDiffusivity.C:34
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::EddyDiffusivity::EddyDiffusivity
EddyDiffusivity(const word &type, const alphaField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct.
Definition: EddyDiffusivity.C:47
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::EddyDiffusivity::correctEnergyTransport
virtual void correctEnergyTransport()
Correct the turbulence thermal diffusivity for energy transport.
Definition: EddyDiffusivity.C:105
Foam::EddyDiffusivity::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: EddyDiffusivity.H:78
rho
rho
Definition: readInitialConditions.H:88
Foam::ThermalDiffusivity::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: ThermalDiffusivity.H:58
Foam::EddyDiffusivity
Templated abstract base class for single-phase compressible turbulence models.
Definition: EddyDiffusivity.H:51
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::EddyDiffusivity::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: EddyDiffusivity.C:91
Foam::EddyDiffusivity::~EddyDiffusivity
virtual ~EddyDiffusivity()=default
Destructor.
Foam::ThermalDiffusivity::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: ThermalDiffusivity.H:60
U
U
Definition: pEqn.H:72
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::EddyDiffusivity::Prt_
dimensionedScalar Prt_
Definition: EddyDiffusivity.H:62
Foam::EddyDiffusivity::kappaEff
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
Definition: EddyDiffusivity.H:121
Foam::EddyDiffusivity::alphat_
volScalarField alphat_
Definition: EddyDiffusivity.H:66
Foam::EddyDiffusivity::alphat
virtual tmp< volScalarField > alphat() const
Return the turbulent thermal diffusivity for enthalpy [kg/m/s].
Definition: EddyDiffusivity.H:107
Foam::EddyDiffusivity::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: EddyDiffusivity.H:76
Foam::EddyDiffusivity::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: EddyDiffusivity.H:77
Foam::GeometricField< scalar, fvPatchField, volMesh >
EddyDiffusivity.C