outletMappedUniformInletHeatAdditionFvPatchField.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) 2016 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::outletMappedUniformInletHeatAdditionFvPatchField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33 
34  This temperature boundary condition averages the temperature over the
35  "outlet" patch specified by name "outletPatchName" and applies an extra
36  heat source. This is set as a uniform temperature value on this patch.
37  Additionally TMin/TMax limits can be applied
38 
39  \heading Patch usage
40 
41  \table
42  Property | Description | Required | Default value
43  outletPatch | name of outlet patch | yes |
44  Q | Heat addition | yes
45  phi | flux field name | no | phi
46  TMin | min temperature limit | no | 0.0
47  TMax | max temperature limit | no | 5000.0
48  \endtable
49 
50  Example of the boundary condition specification:
51  \verbatim
52  myPatch
53  {
54  type outletMappedUniformInletHeatAddition;
55  outletPatch aPatch;
56  Q 10; // Heat addition in W
57  phi phi;
58  value uniform 0;
59  }
60  \endverbatim
61 
62 SeeAlso
63  Foam::fixedValueFvPatchField
64 
65 SourceFiles
66  outletMappedUniformInletHeatAdditionFvPatchField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef outletMappedUniformInletHeatAdditionFvPatchField_H
71 #define outletMappedUniformInletHeatAdditionFvPatchField_H
72 
74 #include "fvPatchFields.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class outletMappedUniformInletHeatAdditionFvPatchField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class outletMappedUniformInletHeatAdditionFvPatchField
86 :
87  public fixedValueFvPatchScalarField
88 {
89  // Private data
90 
91  //- Name of the outlet patch to be mapped
92  word outletPatchName_;
93 
94  //- Name of the flux transporting the field
95  word phiName_;
96 
97  //- Input energy
98  scalar Q_;
99 
100  //- Minimum Temperature Limit
101  scalar TMin_;
102 
103  //- Maximum Temperature Limit
104  scalar TMax_;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("outletMappedUniformInletHeatAddition");
111 
112 
113  // Constructors
114 
115  //- Construct from patch and internal field
117  (
118  const fvPatch&,
120  );
121 
122  //- Construct from patch, internal field and dictionary
124  (
125  const fvPatch&,
127  const dictionary&
128  );
129 
130  //- Construct by mapping onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Return a clone
153  virtual tmp<fvPatchField<scalar>> clone() const
154  {
155  return fvPatchField<scalar>::Clone(*this);
156  }
157 
158  //- Clone with an internal field reference
160  (
162  ) const
163  {
164  return fvPatchField<scalar>::Clone(*this, iF);
165  }
166 
167 
168  // Member functions
169 
170  // Access
171 
172  //- Name of the outlet patch to be mapped
173  const word& outletPatchName() const
174  {
175  return outletPatchName_;
176  }
177 
178 
179  // Evaluation functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184 
185  //- Write
186  virtual void write(Ostream&) const;
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
This temperature boundary condition averages the temperature over the "outlet" patch specified by nam...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
const word & outletPatchName() const
Name of the outlet patch to be mapped.
TypeName("outletMappedUniformInletHeatAddition")
Runtime type information.
outletMappedUniformInletHeatAdditionFvPatchField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.