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,2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::temperatureCoupledBase
29
30Description
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 - 'function' : kappa, alpha directly specified as Function1
43 - 'phaseSystem' : used for multiphase thermos
44
45 \par Keywords provided by this class:
46 \table
47 Property | Description | Required | Default
48 kappaMethod | Thermal conductivity method | yes |
49 kappa | Name of thermal conductivity field | no |
50 alpha | Name of thermal diffusivity field | no |
51 alphaAni | Name of non-isotropic alpha | no |
52 kappaValue | Function1 supplying kappa | no |
53 alphaValue | Function1 supplying alpha | no |
54 \endtable
55
56Usage
57 \verbatim
58 nonIsotropicWall
59 {
60 ...
61 kappaMethod directionalSolidThermo;
62 alphaAni Anialpha;
63 ...
64 }
65 \endverbatim
66
67 \verbatim
68 specifiedWall
69 {
70 ...
71 kappaMethod function;
72 kappaFunction constant 1.0;
73 alphaFunction constant 100.0;
74 ...
75 }
76 \endverbatim
77
78SourceFiles
79 temperatureCoupledBase.C
80
81\*---------------------------------------------------------------------------*/
82
83#ifndef temperatureCoupledBase_H
84#define temperatureCoupledBase_H
85
86#include "scalarField.H"
87#include "Enum.H"
88#include "fvPatch.H"
89#include "PatchFunction1.H"
90#include "fvPatchFieldMapper.H"
91
92// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93
94namespace Foam
95{
96
97/*---------------------------------------------------------------------------*\
98 Class temperatureCoupledBase Declaration
99\*---------------------------------------------------------------------------*/
100
101class temperatureCoupledBase
102{
103public:
104
105 // Public Enumerations
106
107 //- Type of supplied Kappa
108 enum KMethodType
109 {
113 mtLookup,
115 };
116
117
118protected:
119
120 // Protected Data
121
122 static const Enum<KMethodType> KMethodTypeNames_;
123
124 //- Underlying patch
125 const fvPatch& patch_;
126
127 //- How to get K
128 const KMethodType method_;
129
130 //- Name of thermal conductivity field (if looked up from database)
131 const word kappaName_;
132
133 //- Name of the non-Isotropic alpha (default: Anialpha)
134 const word alphaAniName_;
136 //- Name of thermal diffusivity
137 const word alphaName_;
138
139 //- Function1 for kappa
141
142 //- Function1 for alpha
146public:
148 // Constructors
150 //- Construct from patch and K name
152 (
153 const fvPatch& patch,
154 const word& calculationMethod,
155 const word& kappaName,
156 const word& alphaAniName,
157 const word& alphaName
158 );
160 //- Construct from patch and dictionary
163 const fvPatch& patch,
164 const dictionary& dict
165 );
166
167 //- Construct from patch and temperatureCoupledBase
169 (
170 const fvPatch& patch,
172 );
173
174 //- Construct as copy
176 (
178 );
179
180
181 //- Destructor
182 virtual ~temperatureCoupledBase() = default;
183
184
185 // Member functions
186
187 //- Method to obtain K
188 word KMethod() const
189 {
191 }
192
193 //- Name of thermal conductivity field
194 const word& kappaName() const
195 {
196 return kappaName_;
197 }
198
199 //- Name of thermal diffusivity field
200 const word& alphaName() const
201 {
202 return alphaName_;
203 }
204
205 //- Map (and resize as needed) from self given a mapping object
206 virtual void autoMap
207 (
208 const fvPatchFieldMapper&
209 ) = 0;
210
211 //- Reverse map the given fvPatchField onto this fvPatchField
212 virtual void rmap
213 (
214 const fvPatchField<scalar>&,
215 const labelList&
216 ) = 0;
217
218 //- Given patch temperature calculate corresponding K field
219 virtual tmp<scalarField> kappa(const scalarField& Tp) const;
220
221 //- Given patch temperature calculate corresponding alphaEff field
222 virtual tmp<scalarField> alpha(const scalarField& Tp) const;
223
224 //- Write
225 void write(Ostream& os) const;
226};
227
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231} // End namespace Foam
232
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235#endif
236
237// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
Common functions used in temperature coupled boundaries.
autoPtr< PatchFunction1< scalar > > alphaFunction1_
Function1 for alpha.
const word alphaName_
Name of thermal diffusivity.
const word & kappaName() const
Name of thermal conductivity field.
virtual ~temperatureCoupledBase()=default
Destructor.
virtual void autoMap(const fvPatchFieldMapper &)=0
Map (and resize as needed) from self given a mapping object.
const word & alphaName() const
Name of thermal diffusivity field.
KMethodType
Type of supplied Kappa.
const word alphaAniName_
Name of the non-Isotropic alpha (default: Anialpha)
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
word KMethod() const
Method to obtain K.
const fvPatch & patch_
Underlying patch.
static const Enum< KMethodType > KMethodTypeNames_
const KMethodType method_
How to get K.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
const word kappaName_
Name of thermal conductivity field (if looked up from database)
autoPtr< PatchFunction1< scalar > > kappaFunction1_
Function1 for kappa.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
runTime write()
volScalarField & alpha
dictionary dict