externalHeatFluxSource.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) 2019-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::fa::externalHeatFluxSource
28
29Group
30 grpFaOptionsSources
31
32Description
33 Applies a heat flux condition for a specified \c faMesh region
34 to temperature on an external wall for compressible flows
35 in one of three modes:
36
37 - fixed power: supply \c Q
38 - fixed heat flux: supply \c q
39 - fixed heat transfer coefficient: supply \c h and \c Ta
40
41 where
42 \vartable
43 Q | Power [W]
44 q | Heat flux [W/m^2]
45 h | Heat transfer coefficient [W/m^2/K]
46 Ta | Ambient temperature [K]
47 \endvartable
48
49 The ambient temperature \c Ta is specified
50 as a \c Foam::Function1 of time but uniform in space.
51
52Usage
53 Minimal example by using \c constant/faOptions:
54 \verbatim
55 externalHeatFluxSource1
56 {
57 // Mandatory entries (unmodifiable)
58 type externalHeatFluxSource;
59
60 // Mandatory entries (runtime modifiable)
61 mode <mode>;
62
63 // Optional entries (runtime modifiable)
64 T <Tname>;
65 emissivity 0;
66
67 // Conditional mandatory entries (runtime modifiable)
68
69 // when mode=power
70 Q 1.0;
71
72 // when mode=flux
73 q 1.0;
74
75 // when mode=coefficient
76 h 1.0;
77 Ta <Function1>;
78
79 // Mandatory/Optional (inherited) entries
80 ...
81 }
82 \endverbatim
83
84 where the entries mean:
85 \table
86 Property | Description | Type | Reqd | Dflt
87 type | Type name: externalHeatFluxSource | word | yes | -
88 mode | Mode of heat flux condition | word | yes | -
89 T | Name of operand temperature field | word | no | T
90 emissivity | Surface emissivity for radiative flux to ambient <!--
91 --> | scalar | no | 0
92 Q | Fixed heat power [W] | scalar | cndtnl | -
93 q | Fixed heat flux [W/m2] | scalar | cndtnl | -
94 h | Heat transfer coefficient [W/m^2/K] | scalar | cndtnl | -
95 Ta | Ambient temperature [K] | Function1 | cndtnl | -
96 \endtable
97
98 The inherited entries are elaborated in:
99 - \link faOption.H \endlink
100 - \link faceSetOption.H \endlink
101
102 Options for the \c mode entry:
103 \verbatim
104 power | Use fixed power (supply Q)
105 flux | Use fixed heat flux (supply q)
106 coefficient | Use fixes heat transfer coefficient (supply h and T)
107 \endverbatim
108
109See also
110 - Foam::Function1
111
112SourceFiles
113 externalHeatFluxSource.C
114
115\*---------------------------------------------------------------------------*/
116
117#ifndef fa_externalHeatFluxSource_H
118#define fa_externalHeatFluxSource_H
119
120#include "faOption.H"
121#include "Function1.H"
122#include "areaFields.H"
123#include "faceSetOption.H"
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127namespace Foam
128{
129namespace fa
130{
131
132/*---------------------------------------------------------------------------*\
133 Class externalHeatFluxSource Declaration
134\*---------------------------------------------------------------------------*/
135
136class externalHeatFluxSource
137:
138 public fa::faceSetOption
139{
140public:
141
142 // Public Enumeration
143
144 //- Options for the heat transfer condition mode
145 enum operationMode
146 {
147 fixedPower,
150 };
151
152 //- Names for operationMode
153 static const Enum<operationMode> operationModeNames;
154
155
156private:
157
158 // Private Data
159
160 //- Operation mode
161 operationMode mode_;
162
163 //- Name of temperature field
164 word TName_;
165
166 //- Heat power [W]
167 scalar Q_;
168
169 //- Heat flux [W/m2]
170 scalar q_;
171
172 //- Heat transfer coefficient [W/m2K]
173 scalar h_;
174
175 //- Ambient temperature [K]
176 autoPtr<Function1<scalar>> Ta_;
177
178 //- Optional surface emissivity for radiative transfer to ambient
179 scalar emissivity_;
180
181
182public:
183
184 //- Runtime type information
185 TypeName("externalHeatFluxSource");
186
187
188 // Constructors
189
190 //- Construct from explicit source name and mesh
192 (
193 const word& sourceName,
194 const word& modelType,
195 const dictionary& dict,
196 const fvPatch& patch
197 );
198
199 //- No copy construct
200 externalHeatFluxSource(const externalHeatFluxSource&) = delete;
201
202 //- No copy assignment
203 void operator=(const externalHeatFluxSource&) = delete;
204
205
206 //- Destructor
207 virtual ~externalHeatFluxSource() = default;
208
209
210 // Member Functions
211
212 // Evaluation
213
214 //- Add explicit contribution to compressible momentum equation
215 virtual void addSup
217 const areaScalarField& h,
220 const label fieldi
221 );
222
223
224 // IO
225
226 //- Read source dictionary
227 virtual bool read(const dictionary& dict);
228};
229
230
231// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232
233} // End namespace fa
234} // End namespace Foam
235
236// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237
238#endif
239
240// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
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 special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatrix.H:76
Applies a heat flux condition for a specified faMesh region to temperature on an external wall for co...
virtual ~externalHeatFluxSource()=default
Destructor.
externalHeatFluxSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvPatch &patch)
Construct from explicit source name and mesh.
void operator=(const externalHeatFluxSource &)=delete
No copy assignment.
TypeName("externalHeatFluxSource")
Runtime type information.
static const Enum< operationMode > operationModeNames
Names for operationMode.
virtual void addSup(const areaScalarField &h, const areaScalarField &rho, faMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible momentum equation.
virtual bool read(const dictionary &dict)
Read source dictionary.
operationMode
Options for the heat transfer condition mode.
@ fixedHeatTransferCoeff
Fixed heat transfer coefficient.
@ fixedHeatFlux
Fixed heat flux [W/m2].
externalHeatFluxSource(const externalHeatFluxSource &)=delete
No copy construct.
Intermediate abstract class for handling face-set options for the derived faOptions.
const fvPatch & patch() const noexcept
Return const access to fvPatch.
Definition: faOptionI.H:42
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
dictionary dict
volScalarField & h
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73