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 #include "Function1.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class outletMappedUniformInletHeatAdditionFvPatchField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class outletMappedUniformInletHeatAdditionFvPatchField
87 :
88  public fixedValueFvPatchScalarField
89 {
91  typedef fixedValueFvPatchScalarField parent_bctype;
92 
93  // Private Data
94 
95  //- Input energy
96  autoPtr<Function1<scalar>> Qptr_;
97 
98  //- Name of the outlet patch to be mapped
99  word outletPatchName_;
100 
101  //- Name of the flux transporting the field
102  word phiName_;
103 
104  //- Minimum Temperature Limit
105  scalar TMin_;
106 
107  //- Maximum Temperature Limit
108  scalar TMax_;
109 
111 public:
112 
113  //- Runtime type information
114  TypeName("outletMappedUniformInletHeatAddition");
115 
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
122  const fvPatch&,
124  );
125 
126  //- Construct from patch, internal field and dictionary
128  (
129  const fvPatch&,
131  const dictionary&
132  );
133 
134  //- Construct by mapping onto a new patch
136  (
137  const this_bctype&,
138  const fvPatch&,
140  const fvPatchFieldMapper&
141  );
142 
143  //- Construct as copy setting internal field reference
145  (
146  const this_bctype&,
148  );
149 
150  //- No copy without an internal field
152  (
153  const this_bctype&
154  ) = delete;
155 
156  //- Clone with an internal field reference
158  (
160  ) const
161  {
162  return fvPatchField<scalar>::Clone(*this, iF);
163  }
164 
165 
166  // Member functions
167 
168  // Access
169 
170  //- Name of the outlet patch to be mapped
171  const word& outletPatchName() const
172  {
173  return outletPatchName_;
174  }
175 
176 
177  // Evaluation functions
178 
179  //- Update the coefficients associated with the patch field
180  virtual void updateCoeffs();
181 
182 
183  //- Write
184  virtual void write(Ostream&) const;
185 
186 
187  // Member Operators
188 
189  //- Inherit assignment
190  using parent_bctype::operator=;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
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:635
A class for handling words, derived from Foam::string.
Definition: word.H:63
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.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.