mappedFieldFvPatchField.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-2016 OpenFOAM Foundation
9 Copyright (C) 2018 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::mappedFieldFvPatchField
29
30Group
31 grpGenericBoundaryConditions grpCoupledBoundaryConditions
32
33Description
34 This boundary condition provides a self-contained version of the \c mapped
35 condition. It does not use information on the patch; instead it holds
36 the data locally.
37
38Usage
39 \table
40 Property | Description | Required | Default
41 field | Name of field to be mapped | no | this field name
42 setAverage | Use average value | no | false |
43 average | Average value to use if \c setAverage = yes | partly |
44 \endtable
45
46 Example of the boundary condition specification:
47 \verbatim
48 <patchName>
49 {
50 type mappedField;
51 field T; // optional field name
52 setAverage no; // apply an average value
53 average 0; // average to apply if setAverage
54 value uniform 0; // place holder
55 }
56 \endverbatim
57
58Note
59 Since this condition can be applied on a per-field and per-patch basis,
60 it is possible to duplicate the mapping information. If possible, employ
61 the \c mapped condition in preference to avoid this situation, and only
62 employ this condition if it is not possible to change the underlying
63 geometric (poly) patch type to \c mapped.
64
65See also
66 Foam::mappedPatchBase
67 Foam::mappedPolyPatch
68 Foam::mappedFvPatch
69 Foam::fixedValueFvPatchField
70
71SourceFiles
72 mappedFieldFvPatchField.C
73
74\*---------------------------------------------------------------------------*/
75
76#ifndef mappedFieldFvPatchField_H
77#define mappedFieldFvPatchField_H
78
79#include "mappedPatchBase.H"
82#include "interpolation.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88
89/*---------------------------------------------------------------------------*\
90 Class mappedFieldFvPatchField Declaration
91\*---------------------------------------------------------------------------*/
92
93template<class Type>
94class mappedFieldFvPatchField
95:
96 public fixedValueFvPatchField<Type>,
97 public mappedPatchBase,
98 public mappedPatchFieldBase<Type>
99{
100
101public:
102
103 //- Runtime type information
104 TypeName("mappedField");
105
106
107 // Constructors
108
109 //- Construct from patch and internal field
111 (
112 const fvPatch&,
113 const DimensionedField<Type, volMesh>&
114 );
115
116 //- Construct from patch, internal field and dictionary
118 (
119 const fvPatch&,
121 const dictionary&
122 );
123
124 //- Construct from patch, internal field and distance for normal type
125 // sampling
127 (
128 const fvPatch&,
130
131 // mappedPatchBase
132 const word& sampleRegion,
134 const word& samplePatch,
135 const scalar distance,
136
137 // My settings
138 const word& fieldName,
139 const bool setAverage,
140 const Type average,
141 const word& interpolationScheme
142 );
143
144 //- Construct by mapping given
145 // mappedFieldFvPatchField
146 // onto a new patch
148 (
150 const fvPatch&,
152 const fvPatchFieldMapper&
153 );
154
155 //- Construct as copy
157 (
159 );
160
161 //- Construct and return a clone
162 virtual tmp<fvPatchField<Type>> clone() const
163 {
165 (
167 (
168 *this
169 )
170 );
171 }
172
173 //- Construct as copy setting internal field reference
175 (
178 );
179
180 //- Construct and return a clone setting internal field reference
184 ) const
185 {
187 (
189 (
190 *this,
191 iF
192 )
193 );
194 }
195
196
197 // Member functions
198
199 // Mapping functions
200
201 //- Map (and resize as needed) from self given a mapping object
202 virtual void autoMap
203 (
204 const fvPatchFieldMapper&
205 );
206
207 //- Reverse map the given fvPatchField onto this fvPatchField
208 virtual void rmap
209 (
210 const fvPatchField<Type>&,
211 const labelList&
212 );
213
214
215 // Evaluation functions
216
217 //- Update the coefficients associated with the patch field
218 virtual void updateCoeffs();
219
220
221 //- Write
222 virtual void write(Ostream&) const;
223};
224
225
226// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227
228} // End namespace Foam
229
230// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231
232#ifdef NoRepository
234#endif
235
236// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237
238#endif
239
240// ************************************************************************* //
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 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
This boundary condition provides a self-contained version of the mapped condition....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("mappedField")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
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.
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
sampleMode
Mesh items to sample.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
const word & sampleRegion() const
Region to sample.
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
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.
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73