ThermalDiffusivity.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::ThermalDiffusivity
29 
30 Description
31  Templated wrapper class to provide compressible turbulence models
32  thermal diffusivity based thermal transport.
33 
34 SourceFiles
35  ThermalDiffusivity.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef ThermalDiffusivity_H
40 #define ThermalDiffusivity_H
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class ThermalDiffusivity Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class BasicTurbulenceModel>
52 class ThermalDiffusivity
53 :
54  public BasicTurbulenceModel
55 {
56 
57 public:
58 
59  typedef typename BasicTurbulenceModel::alphaField alphaField;
61  typedef typename BasicTurbulenceModel::transportModel transportModel;
62 
63 
64  // Constructors
65 
66  //- Construct
68  (
69  const word& type,
70  const alphaField& alpha,
71  const volScalarField& rho,
72  const volVectorField& U,
73  const surfaceScalarField& alphaRhoPhi,
74  const surfaceScalarField& phi,
75  const transportModel& transport,
76  const word& propertiesName
77  );
78 
79 
80  // Selectors
81 
82  //- Return a reference to the selected turbulence model
84  (
85  const alphaField& alpha,
86  const volScalarField& rho,
87  const volVectorField& U,
88  const surfaceScalarField& alphaRhoPhi,
89  const surfaceScalarField& phi,
91  const word& propertiesName = turbulenceModel::propertiesName
92  );
93 
94 
95  //- Return a reference to the selected turbulence model
97  (
98  const volScalarField& rho,
99  const volVectorField& U,
100  const surfaceScalarField& phi,
102  const word& propertiesName = turbulenceModel::propertiesName
103  );
104 
105 
106  //- Destructor
107  virtual ~ThermalDiffusivity() = default;
108 
109 
110  // Member Functions
111 
112  //- Return the thermal diffusivity for temperature [J/m/s/K]
113  virtual tmp<volScalarField> kappa() const
114  {
115  return this->transport_.kappa();
116  }
117 
118  //- Return the laminar thermal diffusivity for temperature on patch
119  // [J/m/s/K]
120  virtual tmp<scalarField> kappa(const label patchi) const
121  {
122  return this->transport_.kappa(patchi);
123  }
124 
125  //- Return the laminar thermal diffusivity for enthalpy [kg/m/s]
126  virtual tmp<volScalarField> alpha() const
127  {
128  return this->transport_.alpha();
129  }
130 
131  //- Return the laminar thermal diffusivity for enthalpy on patch
132  // [kg/m/s]
133  virtual tmp<scalarField> alpha(const label patchi) const
134  {
135  return this->transport_.alpha(patchi);
136  }
137 
138  //- Return the turbulent thermal diffusivity for enthalpy [kg/m/s]
139  virtual tmp<volScalarField> alphat() const;
140 
141  //- Return the turbulent thermal diffusivity for enthalpy for a patch
142  // [kg/m/s]
143  virtual tmp<scalarField> alphat(const label patchi) const;
144 
145  //- Return the effective turbulent thermal diffusivity for temperature
146  // [J/m/s/K]
147  virtual tmp<volScalarField> kappaEff() const
148  {
149  return kappa();
150  }
151 
152  //- Return the effective turbulent thermal diffusivity for temperature
153  // [J/m/s/K]
154  virtual tmp<scalarField> kappaEff(const label patchi) const
155  {
156  return kappa(patchi);
157  }
158 
159  //- Return the effective turbulent thermal diffusivity for enthalpy
160  // [kg/m/s]
161  virtual tmp<volScalarField> alphaEff() const
162  {
163  return this->transport_.alphahe();
164  }
165 
166  //- Return the effective turbulent thermal diffusivity for enthalpy
167  // for a patch [kg/m/s]
168  virtual tmp<scalarField> alphaEff(const label patchi) const
169  {
170  return this->transport_.alphahe(patchi);
171  }
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
182  #include "ThermalDiffusivity.C"
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::ThermalDiffusivity::rhoField
volScalarField rhoField
Definition: ThermalDiffusivity.H:59
Foam::ThermalDiffusivity::kappa
virtual tmp< volScalarField > kappa() const
Return the thermal diffusivity for temperature [J/m/s/K].
Definition: ThermalDiffusivity.H:112
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
ThermalDiffusivity.C
Foam::ThermalDiffusivity::~ThermalDiffusivity
virtual ~ThermalDiffusivity()=default
Destructor.
rho
rho
Definition: readInitialConditions.H:88
Foam::ThermalDiffusivity::ThermalDiffusivity
ThermalDiffusivity(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: ThermalDiffusivity.C:34
Foam::ThermalDiffusivity::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: ThermalDiffusivity.H:58
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ThermalDiffusivity::New
static autoPtr< ThermalDiffusivity > New(const alphaField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transportModel, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
Definition: ThermalDiffusivity.C:64
Foam::ThermalDiffusivity::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: ThermalDiffusivity.H:60
Foam::ThermalDiffusivity::kappaEff
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
Definition: ThermalDiffusivity.H:146
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::ThermalDiffusivity::alphaEff
virtual tmp< volScalarField > alphaEff() const
Return the effective turbulent thermal diffusivity for enthalpy.
Definition: ThermalDiffusivity.H:160
Foam::ThermalDiffusivity::alphat
virtual tmp< volScalarField > alphat() const
Return the turbulent thermal diffusivity for enthalpy [kg/m/s].
Definition: ThermalDiffusivity.C:121
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::GeometricField< scalar, fvPatchField, volMesh >
Foam::ThermalDiffusivity::alpha
virtual tmp< volScalarField > alpha() const
Return the laminar thermal diffusivity for enthalpy [kg/m/s].
Definition: ThermalDiffusivity.H:125