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