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 as copy setting internal field reference
182  (
185  );
186 
187  //- Return a clone
188  virtual tmp<fvPatchField<scalar>> clone() const
189  {
190  return fvPatchField<scalar>::Clone(*this);
191  }
192 
193  //- Clone with an internal field reference
195  (
197  ) const
198  {
199  return fvPatchField<scalar>::Clone(*this, iF);
200  }
201 
202 
203  // Member Functions
204 
205  // Mapping
206 
207  //- Map (and resize as needed) from self given a mapping object
208  virtual void autoMap(const fvPatchFieldMapper&);
209 
210  //- Reverse map the given fvPatchField onto this fvPatchField
211  virtual void rmap
212  (
213  const fvPatchScalarField&,
214  const labelList&
215  );
216 
217 
218  // Evaluation
219 
220  //- Update the coefficients associated with the patch field
221  virtual void updateCoeffs();
222 
223 
224  // I-O
225 
226  //- Write
227  virtual void write(Ostream&) const;
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
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...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
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.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
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...
atmTurbulentHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.