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>
139class outletMappedUniformInletFvPatchField
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 (
200 const outletMappedUniformInletFvPatchField<Type>&,
201 const fvPatch&,
202 const DimensionedField<Type, volMesh>&,
203 const fvPatchFieldMapper&
204 );
205
206 //- Construct as copy
208 (
210 );
211
212 //- Construct and return a clone
213 virtual tmp<fvPatchField<Type>> clone() const
214 {
216 (
218 );
219 }
220
221 //- Construct as copy setting internal field reference
223 (
226 );
227
228 //- Construct and return a clone setting internal field reference
230 (
232 ) const
233 {
235 (
237 );
238 }
239
240
241 // Member Functions
242
243 // Mapping
244
245 //- Map (and resize as needed) from self given a mapping object
246 virtual void autoMap
247 (
248 const fvPatchFieldMapper&
249 );
250
251 //- Reverse map the given fvPatchField onto this fvPatchField
252 virtual void rmap
253 (
254 const fvPatchField<Type>&,
255 const labelList&
256 );
257
258
259 // Evaluation
260
261 //- Update the coefficients associated with the patch field
262 virtual void updateCoeffs();
263
264
265 //- Write
266 virtual void write(Ostream&) const;
267};
268
269
270// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271
272} // End namespace Foam
273
274// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275
276#ifdef NoRepository
278#endif
279
280// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281
282#endif
283
284// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
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...
Definition: fvPatchField.H:82
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
Construct and return a clone.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:63
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73