Loading...
Searching...
No Matches
timeVaryingMappedFixedValuePointPatchField.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 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::timeVaryingMappedFixedValuePointPatchField
29
30Description
31 A time-varying form of a mapped fixed value boundary condition.
32
33Usage
34 \table
35 Property | Description | Required | Default
36 setAverage | Use average value | no | false
37 perturb | Perturb points for regular geometries | no | 1e-5
38 points | Name of points file | no | points
39 fieldTable | Alternative field name to sample | no | this field name
40 mapMethod | Type of mapping | no | planar
41 offset | Offset to mapped values | no | Zero
42 \endtable
43
44See also
45 Foam::timeVaryingMappedFixedValueFvPatchField
46
47SourceFiles
48 timeVaryingMappedFixedValuePointPatchField.C
49
50\*---------------------------------------------------------------------------*/
51
52#ifndef Foam_timeVaryingMappedFixedValuePointPatchField_H
53#define Foam_timeVaryingMappedFixedValuePointPatchField_H
54
56#include "Function1.H"
57#include "Pair.H"
58#include "instantList.H"
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65
66/*---------------------------------------------------------------------------*\
67 Class timeVaryingMappedFixedValuePointPatchField Declaration
68\*---------------------------------------------------------------------------*/
69
70template<class Type>
72:
73 public fixedValuePointPatchField<Type>
74{
75 // Private Data
76
77 //- If true adjust the mapped field to maintain average value
78 bool setAverage_;
79
80 //- Fraction of perturbation (fraction of bounding box) to add
81 scalar perturb_;
82
83 //- Name of the field data table, defaults to the name of the field
84 word fieldTableName_;
85
86 //- Name of points file (default: "points")
87 word pointsName_;
88
89 //- Interpolation scheme to use (default is empty == "planar")
90 word mapMethod_;
91
92 //- 2D interpolation (for 'planar' mapMethod)
93 autoPtr<pointToPointPlanarInterpolation> mapperPtr_;
94
95 //- List of boundaryData time directories
96 instantList sampleTimes_;
97
98 //- The first/second sample indices in sampleTimes
99 labelPair sampleIndex_;
100
101 //- The average values at first/second sampleIndex_ (if setAverage)
102 Pair<Type> sampleAverage_;
103
104 //- The interpolated values at first/second sampleIndex_
105 Pair<Field<Type>> sampleValues_;
106
107 //- Time varying offset values to interpolated data
109
110
111 // Private Member Functions
112
113 //- Find boundary data between time 't' and interpolate
114 void checkTable(const scalar t);
115
116 //- Update field and average value using interpolation at
117 //- given instant index
118 void updateSampledValues
119 (
120 const label sampleIndex,
122 Type& avg
123 ) const;
124
125
126public:
127
128 //- Runtime type information
129 TypeName("timeVaryingMappedFixedValue");
130
131
132 // Constructors
133
134 //- Construct from patch and internal field
136 (
137 const pointPatch&,
139 );
140
141 //- Construct from patch, internal field and dictionary
143 (
144 const pointPatch&,
146 const dictionary&
147 );
148
149 //- Construct by mapping given patch field onto a new patch
151 (
153 const pointPatch&,
156 );
157
158 //- Construct as copy
160 (
162 );
163
164 //- Construct as copy setting internal field reference
166 (
169 );
170
171 //- Return a clone
172 virtual autoPtr<pointPatchField<Type>> clone() const
173 {
174 return pointPatchField<Type>::Clone(*this);
175 }
176
177 //- Construct and return a clone setting internal field reference
179 (
181 ) const
182 {
183 return pointPatchField<Type>::Clone(*this, iF);
184 }
185
186
187 // Member Functions
188
189 // Mapping functions
190
191 //- Map (and resize as needed) from self given a mapping object
192 virtual void autoMap
193 (
195 );
196
197 //- Reverse map the given PointPatchField onto
198 // this PointPatchField
199 virtual void rmap
200 (
202 const labelList&
203 );
204
205
206 // Evaluation functions
207
208 //- Update the coefficients associated with the patch field
209 virtual void updateCoeffs();
210
211
212 //- Write
213 virtual void write(Ostream&) const;
214};
215
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219} // End namespace Foam
220
221// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222
223#ifdef NoRepository
225#endif
226
227// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228
229#endif
230
231// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
An ordered pair of two objects of type <T> with first() and second() elements.
Definition Pair.H:66
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
A FixedValue boundary condition for pointField.
fixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Basic pointPatch represents a set of points from the mesh.
Definition pointPatch.H:67
A time-varying form of a mapped fixed value boundary condition.
timeVaryingMappedFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
virtual autoPtr< pointPatchField< Type > > clone(const DimensionedField< Type, pointMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual autoPtr< pointPatchField< Type > > clone() const
Return a clone.
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given PointPatchField onto.
A class for handling words, derived from Foam::string.
Definition word.H:66
rDeltaTY field()
Namespace for OpenFOAM.
Pair< label > labelPair
A pair of labels.
Definition Pair.H:54
List< label > labelList
A List of labels.
Definition List.H:62
List< instant > instantList
List of instants.
Definition instantList.H:41
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68