Loading...
Searching...
No Matches
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-2025 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 Ts <TshellName>;
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 Ts | Name of shell temperature field | word | no | Ts(suffix)
90 emissivity | Surface emissivity for radiative flux to ambient <!--
91 --> | scalar | no | 0
92 Q | Fixed heat power [W] | Function1 | cndtnl | -
93 q | Fixed heat flux [W/m2] | Function1 | cndtnl | -
94 h | Heat transfer coefficient [W/m^2/K] | Function1 | 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 Ta)
107 \endverbatim
108
109 \b Naming changes from 2506 and earlier:
110 \table
111 Keyword | Description | Keyword (old) | Deflt (old)
112 Ts | Temperature (shell) | T | T
113 \endtable
114 If \c Ts is missing, the keyword \c T is still accepted.
115
116See also
117 - Foam::Function1
118
119SourceFiles
120 externalHeatFluxSource.C
121
122\*---------------------------------------------------------------------------*/
123
124#ifndef Foam_fa_externalHeatFluxSource_H
125#define Foam_fa_externalHeatFluxSource_H
126
127#include "areaFields.H"
128#include "Function1.H"
129#include "faceSetOption.H"
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133namespace Foam
134{
135namespace fa
136{
137
138/*---------------------------------------------------------------------------*\
139 Class externalHeatFluxSource Declaration
140\*---------------------------------------------------------------------------*/
141
143:
144 public fa::faceSetOption
145{
146public:
147
148 // Public Enumeration
149
150 //- Options for the heat transfer condition mode
151 enum operationMode
152 {
153 fixedPower,
156 };
157
158 //- Names for operationMode
159 static const Enum<operationMode> operationModeNames;
160
161
162private:
163
164 // Private Data
165
166 //- Operation mode
167 operationMode mode_;
168
169 //- Name of shell temperature field (default: "Ts"+suffix)
170 word TName_;
171
172 //- Heat power [W]
173 autoPtr<Function1<scalar>> Q_;
174
175 //- Heat flux [W/m2]
176 autoPtr<Function1<scalar>> q_;
177
178 //- Heat transfer coefficient [W/m2K]
179 autoPtr<Function1<scalar>> h_;
180
181 //- Ambient temperature [K]
182 autoPtr<Function1<scalar>> Ta_;
183
184 //- Surface emissivity for radiative transfer to ambient (default: 0)
185 scalar emissivity_;
186
187
188public:
189
190 //- Runtime type information
191 TypeName("externalHeatFluxSource");
192
193
194 // Constructors
195
196 //- Construct from explicit source name and mesh
198 (
199 const word& sourceName,
200 const word& modelType,
201 const dictionary& dict,
202 const fvMesh& mesh,
204 const word& defaultAreaName = word()
205 );
206
207 //- No copy construct
209
210 //- No copy assignment
211 void operator=(const externalHeatFluxSource&) = delete;
212
213
214 //- Destructor
215 virtual ~externalHeatFluxSource() = default;
216
217
218 // Member Functions
220 // Evaluation
221
222 //- Add explicit contribution to compressible momentum equation
223 virtual void addSup
224 (
225 const areaScalarField& h,
226 const areaScalarField& rho,
227 faMatrix<scalar>& eqn,
228 const label fieldi
229 );
231
232 // IO
234 //- Read source dictionary
235 virtual bool read(const dictionary& dict);
236};
237
238
239// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241} // End namespace fa
242} // End namespace Foam
243
244// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245
246#endif
247
248// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition Enum.H:57
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition faMatrix.H:108
Applies a heat flux condition for a specified faMesh region to temperature on an external wall for co...
virtual ~externalHeatFluxSource()=default
Destructor.
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.
externalHeatFluxSource(const externalHeatFluxSource &)=delete
No copy construct.
externalHeatFluxSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
Construct from explicit source name and mesh.
Intermediate abstract class for handling face-set options for the derived faOptions.
const fvMesh & mesh() const noexcept
Return const access to the volume mesh.
Definition faOption.H:385
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for finite-area.
Definition limitHeight.C:30
Namespace for OpenFOAM.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
dictionary dict
volScalarField & h
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68