temperatureCoupledBase.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) 2011-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::temperatureCoupledBase
29 
30 Description
31  Common functions used in temperature coupled boundaries.
32 
33  The thermal conductivity \c kappa may be obtained by the following methods:
34  - 'lookup' : lookup volScalarField (or volSymmTensorField) with name
35  defined by 'kappa'
36  - 'fluidThermo' : use fluidThermo and default
37  compressible::turbulenceModel to calculate kappa
38  - 'solidThermo' : use solidThermo kappa()
39  - 'directionalSolidThermo': uses look up for volSymmTensorField for
40  transformed kappa vector. Field name definable in 'alphaAni',
41  named 'Anialpha' in solid solver by default
42  - 'phaseSystem' : used for multiphase thermos
43 
44  \par Keywords provided by this class:
45  \table
46  Property | Description | Required | Default
47  kappaMethod | Thermal conductivity method | yes |
48  kappa | Name of thermal conductivity field | no | none
49  alpha | Name of thermal diffusivity field | no | none
50  alphaAni | Name of non-isotropic alpha | no | none
51  \endtable
52 
53 Usage
54  \verbatim
55  nonIsotropicWall
56  {
57  ...
58  kappaMethod directionalSolidThermo;
59  kappa none;
60  alphaAni Anialpha;
61  ...
62  }
63  \endverbatim
64 
65 SourceFiles
66  temperatureCoupledBase.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef temperatureCoupledBase_H
71 #define temperatureCoupledBase_H
72 
73 #include "scalarField.H"
74 #include "Enum.H"
75 #include "fvPatch.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class temperatureCoupledBase Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class temperatureCoupledBase
87 {
88 public:
89 
90  // Public Enumerations
91 
92  //- Type of supplied Kappa
93  enum KMethodType
94  {
98  mtLookup
99  };
100 
101 
102 protected:
103 
104  // Protected Data
105 
106  static const Enum<KMethodType> KMethodTypeNames_;
107 
108  //- Underlying patch
109  const fvPatch& patch_;
110 
111  //- How to get K
112  const KMethodType method_;
113 
114  //- Name of thermal conductivity field (if looked up from database)
115  const word kappaName_;
116 
117  //- Name of the non-Isotropic alpha (default: Anialpha)
118  const word alphaAniName_;
119 
120  //- Name of thermal diffusivity
122 
123 
124 public:
125 
126  // Constructors
127 
128  //- Construct from patch and K name
130  (
131  const fvPatch& patch,
132  const word& calculationMethod,
133  const word& kappaName,
134  const word& alphaAniName,
135  const word& alphaName
136  );
137 
138  //- Construct from patch and dictionary
140  (
141  const fvPatch& patch,
143  );
144 
145  //- Construct from patch and temperatureCoupledBase
147  (
148  const fvPatch& patch,
149  const temperatureCoupledBase& base
150  );
151 
152 
153  //- Destructor
154  virtual ~temperatureCoupledBase() = default;
155 
156 
157  // Member functions
158 
159  //- Method to obtain K
160  word KMethod() const
161  {
162  return KMethodTypeNames_[method_];
163  }
164 
165  //- Name of thermal conductivity field
166  const word& kappaName() const
167  {
168  return kappaName_;
169  }
170 
171  //- Name of thermal diffusivity field
172  const word& alphaName() const
173  {
174  return alphaName_;
175  }
176 
177  //- Given patch temperature calculate corresponding K field
178  virtual tmp<scalarField> kappa(const scalarField& Tp) const;
179 
180  //- Given patch temperature calculate corresponding alphaEff field
181  virtual tmp<scalarField> alpha(const scalarField& Tp) const;
182 
183  //- Write
184  void write(Ostream& os) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
Foam::temperatureCoupledBase::~temperatureCoupledBase
virtual ~temperatureCoupledBase()=default
Destructor.
Foam::temperatureCoupledBase::mtDirectionalSolidThermo
Definition: temperatureCoupledBase.H:121
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::Enum< KMethodType >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::temperatureCoupledBase::alphaAniName_
const word alphaAniName_
Name of the non-Isotropic alpha (default: Anialpha)
Definition: temperatureCoupledBase.H:142
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
scalarField.H
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:110
Foam::temperatureCoupledBase::KMethodTypeNames_
static const Enum< KMethodType > KMethodTypeNames_
Definition: temperatureCoupledBase.H:130
Foam::temperatureCoupledBase::mtSolidThermo
Definition: temperatureCoupledBase.H:120
Foam::temperatureCoupledBase::mtLookup
Definition: temperatureCoupledBase.H:122
Foam::temperatureCoupledBase::method_
const KMethodType method_
How to get K.
Definition: temperatureCoupledBase.H:136
Foam::Field< scalar >
Foam::temperatureCoupledBase::KMethodType
KMethodType
Type of supplied Kappa.
Definition: temperatureCoupledBase.H:117
Foam::temperatureCoupledBase::patch_
const fvPatch & patch_
Underlying patch.
Definition: temperatureCoupledBase.H:133
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::temperatureCoupledBase::mtFluidThermo
Definition: temperatureCoupledBase.H:119
Foam::temperatureCoupledBase::alpha
virtual tmp< scalarField > alpha(const scalarField &Tp) const
Given patch temperature calculate corresponding alphaEff field.
Definition: temperatureCoupledBase.C:284
Foam::temperatureCoupledBase::kappaName
const word & kappaName() const
Name of thermal conductivity field.
Definition: temperatureCoupledBase.H:190
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::temperatureCoupledBase::KMethod
word KMethod() const
Method to obtain K.
Definition: temperatureCoupledBase.H:184
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::temperatureCoupledBase::alphaName_
const word alphaName_
Name of thermal diffusivity.
Definition: temperatureCoupledBase.H:145
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::temperatureCoupledBase::kappaName_
const word kappaName_
Name of thermal conductivity field (if looked up from database)
Definition: temperatureCoupledBase.H:139
Foam::temperatureCoupledBase::alphaName
const word & alphaName() const
Name of thermal diffusivity field.
Definition: temperatureCoupledBase.H:196
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::temperatureCoupledBase::kappa
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
Definition: temperatureCoupledBase.C:138
fvPatch.H
Foam::temperatureCoupledBase::write
void write(Ostream &os) const
Write.
Definition: temperatureCoupledBase.C:426
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::temperatureCoupledBase::temperatureCoupledBase
temperatureCoupledBase(const fvPatch &patch, const word &calculationMethod, const word &kappaName, const word &alphaAniName, const word &alphaName)
Construct from patch and K name.
Definition: temperatureCoupledBase.C:53
Enum.H