Loading...
Searching...
No Matches
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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::outletMappedUniformInletFvPatchField
29
30Group
31 grpInletBoundaryConditions
32
33Description
34 The \c outletMappedUniformInlet is an inlet boundary condition that
35 - averages patch fields of specified "outlet" patches
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 specified value,
39 and/or mapped by a specified time delay.
40
41 The governing equation of the boundary condition is:
42
43 \f[
44 \phi_{inlet} =
45 \sum_i \left( f_i \phi_{{outlet}_i} + \phi_{{offset}_i} \right)
46 \f]
47
48 where
49 \vartable
50 \phi_{inlet} | Spatially-uniform patch-field value at an inlet patch
51 \phi_{outlet} | Averaged patch-field value at an outlet patch
52 f | User-defined fraction value
53 \phi_{offset} | User-defined offset value
54 i | Outlet-patch index
55 \endvartable
56
57Usage
58 Example of the boundary condition specification:
59 \verbatim
60 <patchName>
61 {
62 // Mandatory entries
63 type outletMappedUniformInlet;
64
65 outlets
66 {
67 <outletName.1>
68 {
69 fraction <Function1<scalar>>;
70 offset <Function1<Type>>;
71 timeDelay <Function1<scalar>>;
72 }
73 <outletName.2>
74 {
75 fraction <Function1<scalar>>;
76 offset <Function1<Type>>;
77 timeDelay <Function1<scalar>>;
78 }
79 ...
80 }
81
82 // Optional entries
83 uniformValue <PatchFunction1<Type>>;
84 phi phi;
85
86 // Inherited entries
87 ...
88 }
89 \endverbatim
90
91 where the entries mean:
92 \table
93 Property | Description | Type | Reqd | Deflt
94 type | Type name: outletMappedUniformInlet | word | yes | -
95 outlets | Dictionary name: outlets | dict | yes | -
96 fraction | Fraction value | Function1<scalar> | no | 1
97 offset | Offset value | Function1<Type> | no | Zero
98 timeDelay | Time delay | Function1<scalar> | no | 0
99 uniformValue | Base inlet patch field | PatchFunction1<Type> | no | Zero
100 phi | Name of operand flux field | word | no | phi
101 \endtable
102
103 The inherited entries are elaborated in:
104 - \link fixedValueFvPatchFields.H \endlink
105 - \link PatchFunction1.H \endlink
106 - \link Function1.H \endlink
107
108Note
109 - Any negative input of \c timeDelay entry
110 is forced to be zero without emitting any warnings.
111
112See also
113 - Foam::fixedValueFvPatchField
114 - Foam::outletMappedUniformInletHeatAdditionFvPatchField
115 - Foam::outletMappedUniformInletTemperatureFvPatchField
116
117SourceFiles
118 outletMappedUniformInletFvPatchField.C
119 outletMappedUniformInletFvPatchFields.C
120
121\*---------------------------------------------------------------------------*/
122
123#ifndef outletMappedUniformInletFvPatchField_H
124#define outletMappedUniformInletFvPatchField_H
125
127#include "PatchFunction1.H"
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131namespace Foam
132{
133
134/*---------------------------------------------------------------------------*\
135 Class outletMappedUniformInletFvPatchField Declaration
136\*---------------------------------------------------------------------------*/
137
138template<class Type>
140:
141 public fixedValueFvPatchField<Type>
142{
143 // Private Data
144
145 //- Base inlet patch field
146 autoPtr<PatchFunction1<Type>> uniformValuePtr_;
147
148 //- List of outlet-patch names
149 wordList outletNames_;
150
151 //- List of outlet-patch field offsets
152 PtrList<Function1<Type>> offsets_;
153
154 //- List of outlet-patch field fractions
155 PtrList<Function1<scalar>> fractions_;
156
157 //- List of outlet-patch field time delays
158 PtrList<Function1<scalar>> timeDelays_;
159
160 //- List of outlet-patch mapping fields
161 List<DynamicList<Type>> mapFields_;
162
163 //- List of outlet-patch mapping times
164 List<DynamicList<scalar>> mapTimes_;
165
166 //- Name of operand flux field
167 word phiName_;
168
169 //- Current time index
170 label curTimeIndex_;
171
172
173public:
174
175 //- Runtime type information
176 TypeName("outletMappedUniformInlet");
177
178
179 // Constructors
180
181 //- Construct from patch and internal field
183 (
184 const fvPatch&,
185 const DimensionedField<Type, volMesh>&
186 );
187
188 //- Construct from patch, internal field and dictionary
190 (
191 const fvPatch&,
192 const DimensionedField<Type, volMesh>&,
193 const dictionary&
194 );
195
196 //- Construct by mapping given outletMappedUniformInletFvPatchField
197 //- onto a new patch
199 (
201 const fvPatch&,
203 const fvPatchFieldMapper&
204 );
205
206 //- Construct as copy
208 (
210 );
211
212 //- Construct as copy setting internal field reference
214 (
217 );
218
219 //- Return a clone
220 virtual tmp<fvPatchField<Type>> clone() const
221 {
222 return fvPatchField<Type>::Clone(*this);
223 }
224
225 //- Clone with an internal field reference
227 (
229 ) const
230 {
231 return fvPatchField<Type>::Clone(*this, iF);
232 }
233
234
235 // Member Functions
236
237 // Mapping
238
239 //- Map (and resize as needed) from self given a mapping object
240 virtual void autoMap
241 (
242 const fvPatchFieldMapper&
243 );
244
245 //- Reverse map the given fvPatchField onto this fvPatchField
246 virtual void rmap
247 (
248 const fvPatchField<Type>&,
249 const labelList&
250 );
251
252
253 // Evaluation
254
255 //- Update the coefficients associated with the patch field
256 virtual void updateCoeffs();
257
258
259 //- Write
260 virtual void write(Ostream&) const;
261};
262
263
264// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265
266} // End namespace Foam
267
268// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269
270#ifdef NoRepository
272#endif
273
274// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275
276#endif
277
278// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
The outletMappedUniformInlet is an inlet boundary condition that.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
outletMappedUniformInletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("outletMappedUniformInlet")
Runtime type information.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
List< label > labelList
A List of labels.
Definition List.H:62
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68