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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::fa::externalHeatFluxSource
28 
29 Group
30  grpFaOptionsSources
31 
32 Description
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 
52 Usage
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 
109 See also
110  - Foam::Function1
111 
112 SourceFiles
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 #include "faCFD.H"
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 namespace Foam
129 {
130 namespace fa
131 {
132 
133 /*---------------------------------------------------------------------------*\
134  Class externalHeatFluxSource Declaration
135 \*---------------------------------------------------------------------------*/
136 
137 class externalHeatFluxSource
138 :
139  public faceSetOption
140 {
141 public:
142 
143  // Public Enumeration
144 
145  //- Options for the heat transfer condition mode
146  enum operationMode
147  {
148  fixedPower,
149  fixedHeatFlux,
151  };
152 
153  //- Names for operationMode
155 
156 
157 private:
158 
159  // Private Data
160 
161  //- Operation mode
162  operationMode mode_;
163 
164  //- Name of temperature field
165  word TName_;
166 
167  //- Heat power [W]
168  scalar Q_;
169 
170  //- Heat flux [W/m2]
171  scalar q_;
172 
173  //- Heat transfer coefficient [W/m2K]
174  scalar h_;
175 
176  //- Ambient temperature [K]
178 
179  //- Optional surface emissivity for radiative transfer to ambient
180  scalar emissivity_;
181 
182 
183 public:
184 
185  //- Runtime type information
186  TypeName("externalHeatFluxSource");
187 
188 
189  // Constructors
190 
191  //- Construct from explicit source name and mesh
193  (
194  const word& sourceName,
195  const word& modelType,
196  const dictionary& dict,
197  const fvPatch& patch
198  );
199 
200  //- No copy construct
202 
203  //- No copy assignment
204  void operator=(const externalHeatFluxSource&) = delete;
205 
206 
207  //- Destructor
208  virtual ~externalHeatFluxSource() = default;
209 
210 
211  // Member Functions
212 
213  // Evaluation
214 
215  //- Add explicit contribution to compressible momentum equation
216  virtual void addSup
217  (
218  const areaScalarField& h,
221  const label fieldi
222  );
223 
224 
225  // IO
226 
227  //- Read source dictionary
228  virtual bool read(const dictionary& dict);
229 };
230 
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 } // End namespace fa
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Foam::Enum< operationMode >
Foam::faMatrix
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatrix.H:59
Foam::fa::externalHeatFluxSource::operationMode
operationMode
Options for the heat transfer condition mode.
Definition: externalHeatFluxSource.H:217
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
faCFD.H
Foam::fa::externalHeatFluxSource::fixedHeatTransferCoeff
Fixed heat transfer coefficient.
Definition: externalHeatFluxSource.H:221
Foam::fa::externalHeatFluxSource::fixedHeatFlux
Fixed heat flux [W/m2].
Definition: externalHeatFluxSource.H:220
Function1.H
Foam::fa::externalHeatFluxSource::~externalHeatFluxSource
virtual ~externalHeatFluxSource()=default
Destructor.
Foam::fa::faceSetOption
Intermediate abstract class for handling face-set options for the derived faOptions.
Definition: faceSetOption.H:134
Foam::fa::externalHeatFluxSource::TypeName
TypeName("externalHeatFluxSource")
Runtime type information.
Foam::fa::option::patch
const fvPatch & patch() const
Return const access to fvPatch.
Definition: faOptionI.H:42
rho
rho
Definition: readInitialConditions.H:88
Foam::fa::externalHeatFluxSource::addSup
virtual void addSup(const areaScalarField &h, const areaScalarField &rho, faMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible momentum equation.
Definition: externalHeatFluxSource.C:90
Foam::fa::externalHeatFluxSource::operator=
void operator=(const externalHeatFluxSource &)=delete
No copy assignment.
Foam::constant::universal::h
const dimensionedScalar h
Planck constant.
Definition: setRegionSolidFields.H:33
Foam::fa::externalHeatFluxSource::operationModeNames
static const Enum< operationMode > operationModeNames
Names for operationMode.
Definition: externalHeatFluxSource.H:225
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
areaFields.H
dict
dictionary dict
Definition: searchingEngine.H:14
faOption.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
faceSetOption.H
Foam::fa::externalHeatFluxSource::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: externalHeatFluxSource.C:172
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fa::externalHeatFluxSource::fixedPower
Fixed heat power [W].
Definition: externalHeatFluxSource.H:219
Foam::GeometricField< scalar, faPatchField, areaMesh >
Foam::fa::externalHeatFluxSource
Applies a heat flux condition for a specified faMesh region to temperature on an external wall for co...
Definition: externalHeatFluxSource.H:208
Foam::fa::externalHeatFluxSource::externalHeatFluxSource
externalHeatFluxSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvPatch &patch)
Construct from explicit source name and mesh.
Definition: externalHeatFluxSource.C:63