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) 2020-2026 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::turbulenceThermophysicalTransportModels::eddyDiffusivity
26 
27 Description
28  Eddy-diffusivity based temperature gradient heat flux model
29  for single specie RAS or LES of turbulent flow.
30 
31  The heat flux source is implemented as an implicit energy correction to the
32  temperature gradient based flux source. At convergence the energy
33  correction is 0.
34 
35 Usage
36  \verbatim
37  LES
38  {
39  model eddyDiffusivity;
40  Prt 0.85;
41  }
42  \endverbatim
43 
44 SourceFiles
45  eddyDiffusivity.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef eddyDiffusivity_H
50 #define eddyDiffusivity_H
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace turbulenceThermophysicalTransportModels
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class eddyDiffusivity Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class TurbulenceThermophysicalTransportModel>
64 class eddyDiffusivity
65 :
66  public TurbulenceThermophysicalTransportModel
67 {
68 
69 protected:
70 
71  // Protected data
72 
73  // Model coefficients
74 
75  //- Turbulent Prandtl number []
77 
78  // Fields
79 
80  //- Turbulent thermal diffusivity of enthalpy [kg/m/s]
82 
83 
84  // Protected Member Functions
85 
86  virtual void correctAlphat();
87 
88  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
89  // Used for the implicit energy correction on the temperature laplacian
91  {
92  return volScalarField::New
93  (
94  "alphaEff",
95  this->thermo().kappa()/this->thermo().Cpv() + alphat()
96  );
97  }
98 
99 
100 public:
101 
102  typedef typename TurbulenceThermophysicalTransportModel::alphaField
103  alphaField;
104 
105  typedef typename
108 
109  typedef typename TurbulenceThermophysicalTransportModel::thermoModel
110  thermoModel;
111 
112 
113  //- Runtime type information
114  TypeName("eddyDiffusivity");
115 
116 
117  // Constructors
118 
119  //- Construct from a momentum transport model and a thermo model
121  (
122  const momentumTransportModel& momentumTransport,
123  const thermoModel& thermo,
124  const word& type = typeName
125  );
126 
127 
128  //- Destructor
129  virtual ~eddyDiffusivity()
130  {}
131 
132 
133  // Member Functions
134 
135  //- Read thermophysicalTransport dictionary
136  virtual bool read();
137 
138  //- Turbulent thermal diffusivity for enthalpy [kg/m/s]
139  virtual tmp<volScalarField> alphat() const
140  {
141  return alphat_;
142  }
143 
144  //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
145  virtual tmp<scalarField> alphat(const label patchi) const
146  {
147  return alphat()().boundaryField()[patchi];
148  }
149 
150  //- Effective thermal turbulent conductivity
151  // of mixture [W/m/K]
152  virtual tmp<volScalarField> kappaEff() const
153  {
154  return this->thermo().kappa() + this->thermo().Cp()*alphat();
155  }
156 
157  //- Effective thermal turbulent conductivity
158  // of mixture for patch [W/m/K]
159  virtual tmp<scalarField> kappaEff(const label patchi) const
160  {
161  return
162  this->thermo().kappa().boundaryField()[patchi]
163  + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
164  }
165 
166  //- Effective thermal turbulent diffusivity
167  // of mixture for a patch [kg/m/s]
168  virtual tmp<scalarField> alphaEff(const label patchi) const
169  {
170  return
171  this->thermo().kappa().boundaryField()[patchi]
172  /this->thermo().Cpv().boundaryField()[patchi]
173  + alphat(patchi);
174  }
175 
176  //- Mass diffusivity
177  // for a given specie mass-fraction [kg/m/s]
178  virtual tmp<volScalarField> D(const volScalarField& Yi) const;
179 
180  //- Mass diffusivity
181  // for a given specie mass-fraction for patch [kg/m/s]
182  virtual tmp<scalarField> D
183  (
184  const volScalarField& Yi,
185  const label patchi
186  ) const;
187 
188  //- Effective mass diffusion coefficient
189  // for a given specie mass-fraction [kg/m/s]
190  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const;
191 
192  //- Effective mass diffusion coefficient
193  // for a given specie mass-fraction for patch [kg/m/s]
194  virtual tmp<scalarField> DEff
195  (
196  const volScalarField& Yi,
197  const label patchi
198  ) const;
199 
200  //- Return the heat flux [W/m^2]
201  virtual tmp<surfaceScalarField> q() const;
202 
203  //- Return the patch heat flux [W/m^2]
204  virtual tmp<scalarField> q(const label patchi) const;
205 
206  //- Return the source term for the energy equation
207  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
208 
209  //- Return the specie flux for the given specie mass-fraction [kg/m^2/s]
210  virtual tmp<surfaceScalarField> j(const volScalarField& Yi) const;
211 
212  //- Return the specie flux
213  // for the given specie mass-fraction for patch [kg/m^2/s]
214  virtual tmp<scalarField> j
215  (
216  const volScalarField& Yi,
217  const label patchi
218  ) const;
219 
220  //- Return the source term for the given specie mass-fraction equation
221  virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
222 
223  //- Correct the eddyDiffusivity viscosity
224  virtual void predict();
225 };
226 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 } // End namespace turbulenceThermophysicalTransportModels
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #ifdef NoRepository
236  #include "eddyDiffusivity.C"
237 #endif
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #endif
242 
243 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
A class for managing temporary objects.
Definition: tmp.H:55
Eddy-diffusivity based temperature gradient heat flux model for single specie RAS or LES of turbulent...
dimensionedScalar Prt_
Turbulent Prandtl number [].
TypeName("eddyDiffusivity")
Runtime type information.
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusion coefficient.
volScalarField alphat_
Turbulent thermal diffusivity of enthalpy [kg/m/s].
TurbulenceThermophysicalTransportModel::thermoModel thermoModel
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
eddyDiffusivity(const momentumTransportModel &momentumTransport, const thermoModel &thermo, const word &type=typeName)
Construct from a momentum transport model and a thermo model.
virtual tmp< volScalarField > alphat() const
Turbulent thermal diffusivity for enthalpy [kg/m/s].
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
virtual void predict()
Correct the eddyDiffusivity viscosity.
virtual tmp< surfaceScalarField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction [kg/m^2/s].
TurbulenceThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
TurbulenceThermophysicalTransportModel::alphaField alphaField
tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
virtual tmp< volScalarField > D(const volScalarField &Yi) const
Mass diffusivity.
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent conductivity.
virtual bool read()
Read thermophysicalTransport dictionary.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Definition: word.H:63
label patchi
compressibleMomentumTransportModel momentumTransportModel
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Namespace for OpenFOAM.
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
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
fluidMulticomponentThermo & thermo
Definition: createFields.H:15