atmTurbulentHeatFluxTemperatureFvPatchScalarField.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) 2020 ENERCON GmbH
9  Copyright (C) 2020-2021 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::atmTurbulentHeatFluxTemperatureFvPatchScalarField
29 
30 Group
31  grpAtmWallFunctions
32 
33 Description
34  This boundary condition provides a fixed heat constraint on temperature
35  (i.e. \c T) to specify temperature gradient through an input heat source
36  which can either be specified as absolute power [W], or as flux [W/m2].
37 
38  Required fields:
39  \verbatim
40  nut | Turbulent viscosity [m2/s]
41  k | Turbulent kinetic energy [m2/s2]
42  \endverbatim
43 
44 Usage
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  // Mandatory entries (unmodifiable)
50  type atmTurbulentHeatFluxTemperature;
51  heatSource flux;
52  alphaEff alphaEff;
53 
54  // Mandatory entries (runtime modifiable)
55  Cp0 0.001;
56  q uniform 10;
57 
58  // Optional (inherited) entries
59  ...
60  }
61  \endverbatim
62 
63  where the entries mean:
64  \table
65  Property | Description | Type | Reqd | Dflt
66  heatSource | Heat source type | word | yes | -
67  alphaEff | Name of turbulent thermal diff. field [kg/m/s] <!--
68  --> | word | yes | -
69  Cp0 | Specific heat capacity [m2/s2/K] <!--
70  --> | Function1<scalar> | yes | -
71  q | Heat source value [W (power) or W/m2 (flux)] <!--
72  --> | PatchFunction1<scalar> | yes | -
73  \endtable
74 
75  The inherited entries are elaborated in:
76  - \link fixedGradientFvPatchScalarField.H \endlink
77  - \link Function1.H \endlink
78  - \link PatchFunction1.H \endlink
79 
80  Options for the \c heatSource entry:
81  \verbatim
82  power | Absolute power heat source [W]
83  flux | Flux heat source [W/m2]
84  \endverbatim
85 
86 SourceFiles
87  atmTurbulentHeatFluxTemperatureFvPatchScalarField.C
88 
89 \*---------------------------------------------------------------------------*/
90 
91 #ifndef atmTurbulentHeatFluxTemperatureFvPatchScalarFields_H
92 #define atmTurbulentHeatFluxTemperatureFvPatchScalarFields_H
93 
94 #include "fvPatchFields.H"
96 #include "Function1.H"
97 #include "PatchFunction1.H"
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 namespace Foam
102 {
103 
104 /*---------------------------------------------------------------------------*\
105  Class atmTurbulentHeatFluxTemperatureFvPatchScalarField Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class atmTurbulentHeatFluxTemperatureFvPatchScalarField
109 :
110  public fixedGradientFvPatchScalarField
111 {
112  // Private Enumerations
113 
114  //- Options for the heat source input modes
115  enum heatSourceType
116  {
117  POWER,
118  FLUX
119  };
120 
121  //- Names for heatSourceType
122  static const Enum<heatSourceType> heatSourceTypeNames;
123 
124 
125  // Private Data
126 
127  //- Heat source type
128  const enum heatSourceType heatSource_;
129 
130  //- Name of effective thermal diffusivity field [kg/m/s]
131  word alphaEffName_;
132 
133  //- Specific heat capacity [m2/s2/K]
134  autoPtr<Function1<scalar>> Cp0_;
135 
136  //- Heat power [W] or flux [W/m2]
137  // Divided by density, rho, if used in kinematic form
138  autoPtr<PatchFunction1<scalar>> q_;
140 public:
141 
142  //- Runtime type information
143  TypeName("atmTurbulentHeatFluxTemperature");
144 
145 
146  // Constructors
147 
148  //- Construct from patch and internal field
150  (
151  const fvPatch&,
153  );
154 
155  //- Construct from patch, internal field and dictionary
157  (
158  const fvPatch&,
160  const dictionary&
161  );
162 
163  //- Construct by mapping given
164  //- atmTurbulentHeatFluxTemperatureFvPatchScalarField onto
165  //- a new patch
167  (
169  const fvPatch&,
171  const fvPatchFieldMapper&
172  );
173 
174  //- Construct as copy
176  (
178  );
179 
180  //- Construct and return a clone
181  virtual tmp<fvPatchScalarField> clone() const
182  {
184  (
186  );
187  }
188 
189  //- Construct as copy setting internal field reference
191  (
194  );
195 
196  //- Construct and return a clone setting internal field reference
198  (
200  ) const
201  {
203  (
205  (
206  *this,
207  iF
208  )
209  );
210  }
211 
212 
213  // Member Functions
214 
215  // Mapping
216 
217  //- Map (and resize as needed) from self given a mapping object
218  virtual void autoMap(const fvPatchFieldMapper&);
219 
220  //- Reverse map the given fvPatchField onto this fvPatchField
221  virtual void rmap
222  (
223  const fvPatchScalarField&,
224  const labelList&
225  );
226 
227 
228  // Evaluation
229 
230  //- Update the coefficients associated with the patch field
231  virtual void updateCoeffs();
232 
233 
234  // I-O
235 
236  //- Write
237  virtual void write(Ostream&) const;
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace Foam
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition provides a fixed heat constraint on temperature (i.e. T) to specify temperatu...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fvPatchField< scalar > fvPatchScalarField
A FieldMapper for finite-volume patch fields.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
TypeName("atmTurbulentHeatFluxTemperature")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
atmTurbulentHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.