outletMappedUniformInletFvPatchField.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) 2011-2018 OpenFOAM Foundation
9  Copyright (C) 2020 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::outletMappedUniformInletFvPatchField
29 
30 Group
31  grpInletBoundaryConditions
32 
33 Description
34  The \c outletMappedUniformInlet is an inlet boundary condition that
35  - averages the patch field of <Type> over a specified "outlet" patch
36  and uniformly applies the averaged value over a specified inlet patch.
37  - optionally, the averaged value can be scaled
38  and/or offset by a pair of specified values.
39 
40  The governing equation of the boundary condition is:
41 
42  \f[
43  \phi_{inlet} = f \phi_{outlet} + \phi_{offset}
44  \f]
45 
46  where
47  \vartable
48  \phi_{inlet} | Spatially-uniform patch-field value at an inlet patch
49  \phi_{outlet} | Averaged patch-field value at an outlet patch
50  f | User-defined fraction value
51  \phi_{offset} | User-defined offset value
52  \endvartable
53 
54 Usage
55  Example of the boundary condition specification:
56  \verbatim
57  <patchName>
58  {
59  // Mandatory entries (unmodifiable)
60  type outletMappedFilterInlet;
61  outletPatch <outletPatchName>;
62 
63  // Optional entries (unmodifiable)
64  fraction 0.1;
65  offset 10; // (1 0 0);
66  phi phi;
67 
68  // Optional (inherited) entries
69  ...
70  }
71  \endverbatim
72 
73  where the entries mean:
74  \table
75  Property | Description | Type | Reqd | Dflt
76  type | Type name: outletMappedUniformInlet | word | yes | -
77  outletPatch | Name of patch to be mapped | word | yes | -
78  fraction | Fraction value | scalar | no | 1
79  offset | Offset value | Type | no | Zero
80  phi | Name of operand flux field | word | no | phi
81  \endtable
82 
83  The inherited entries are elaborated in:
84  - \link fixedValueFvPatchFields.H \endlink
85 
86 See also
87  - Foam::fixedValueFvPatchField
88  - Foam::outletMappedUniformInletHeatAdditionFvPatchField
89  - Foam::outletMappedUniformInletTemperatureFvPatchField
90 
91 SourceFiles
92  outletMappedUniformInletFvPatchField.C
93  outletMappedUniformInletFvPatchFields.C
94 
95 \*---------------------------------------------------------------------------*/
96 
97 #ifndef outletMappedUniformInletFvPatchField_H
98 #define outletMappedUniformInletFvPatchField_H
99 
100 #include "fixedValueFvPatchFields.H"
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 namespace Foam
105 {
106 
107 /*---------------------------------------------------------------------------*\
108  Class outletMappedUniformInletFvPatchField Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 template<class Type>
112 class outletMappedUniformInletFvPatchField
113 :
114  public fixedValueFvPatchField<Type>
115 {
116  // Private Data
117 
118  //- Name of the outlet patch to be mapped
119  word outletPatchName_;
120 
121  //- Name of operand flux field
122  word phiName_;
123 
124  //- Fraction value
125  scalar fraction_;
126 
127  //- Offset value
128  Type offset_;
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("outletMappedUniformInlet");
135 
136 
137  // Constructors
138 
139  //- Construct from patch and internal field
141  (
142  const fvPatch&,
143  const DimensionedField<Type, volMesh>&
144  );
145 
146  //- Construct from patch, internal field and dictionary
148  (
149  const fvPatch&,
150  const DimensionedField<Type, volMesh>&,
151  const dictionary&
152  );
153 
154  //- Construct by mapping given outletMappedUniformInletFvPatchField
155  //- onto a new patch
157  (
158  const outletMappedUniformInletFvPatchField<Type>&,
159  const fvPatch&,
160  const DimensionedField<Type, volMesh>&,
161  const fvPatchFieldMapper&
162  );
163 
164  //- Construct as copy
166  (
168  );
169 
170  //- Construct and return a clone
171  virtual tmp<fvPatchField<Type>> clone() const
172  {
173  return tmp<fvPatchField<Type>>
174  (
176  );
177  }
178 
179  //- Construct as copy setting internal field reference
181  (
184  );
185 
186  //- Construct and return a clone setting internal field reference
188  (
190  ) const
191  {
192  return tmp<fvPatchField<Type>>
193  (
195  );
196  }
197 
198 
199  // Member Functions
200 
201  // Access
202 
203  //- Name of the outlet patch to be mapped
204  const word& outletPatchName() const
205  {
206  return outletPatchName_;
207  }
208 
209 
210  // Evaluation
211 
212  //- Update the coefficients associated with the patch field
213  virtual void updateCoeffs();
214 
215 
216  //- Write
217  virtual void write(Ostream&) const;
218 };
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #ifdef NoRepository
229 #endif
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::outletMappedUniformInletFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: outletMappedUniformInletFvPatchField.C:180
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::outletMappedUniformInletFvPatchField::TypeName
TypeName("outletMappedUniformInlet")
Runtime type information.
outletMappedUniformInletFvPatchField.C
Foam::outletMappedUniformInletFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: outletMappedUniformInletFvPatchField.C:120
Foam::outletMappedUniformInletFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: outletMappedUniformInletFvPatchField.H:222
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::outletMappedUniformInletFvPatchField::outletPatchName
const word & outletPatchName() const
Name of the outlet patch to be mapped.
Definition: outletMappedUniformInletFvPatchField.H:255
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::outletMappedUniformInletFvPatchField
The outletMappedUniformInlet is an inlet boundary condition that.
Definition: outletMappedUniformInletFvPatchField.H:163
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::outletMappedUniformInletFvPatchField::outletMappedUniformInletFvPatchField
outletMappedUniformInletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: outletMappedUniformInletFvPatchField.C:38
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54