mappedMixedFieldFvPatchField.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) 2019-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::mappedMixedFieldFvPatchField
28
29Group
30 grpGenericBoundaryConditions grpCoupledBoundaryConditions
31
32Description
33 This boundary condition provides a self-contained version of e.g. mapped
34 boundary conditions
35 - it expects two-way coupling (so the sampled field needs to run the
36 same bc)
37 - it does not use information on the patch; instead it holds the coupling
38 data locally.
39
40Usage
41 \table
42 Property | Description | Required | Default
43 field | Name of field to be mapped | no | this field name
44 weightField | Name of field to use as weight | no |
45 setAverage | Use average value | no | false |
46 average | Average value to use if \c setAverage = yes | partly |
47 \endtable
48
49 Example of the boundary condition specification:
50 \verbatim
51 <patchName>
52 {
53 type mappedMixedField;
54 field T; // optional field name
55 setAverage no; // apply an average value
56 average 0; // average to apply if setAverage
57 value uniform 0; // place holder
58 }
59 \endverbatim
60
61Note
62 Supports multi-world operation:
63
64 +----+ +----+
65 | | | |
66 | | | |
67 +----+ +----+
68 worldA worldB
69 regionA regionB
70 patchA patchB
71
72
73See also
74 Foam::mappedPatchBase
75 Foam::mappedPolyPatch
76 Foam::mappedFvPatch
77 Foam::mappedFieldFvPatchField
78 Foam::mixedFvPatchField
79
80SourceFiles
81 mappedMixedFieldFvPatchField.C
82
83\*---------------------------------------------------------------------------*/
84
85#ifndef mappedMixedFieldFvPatchField_H
86#define mappedMixedFieldFvPatchField_H
87
88#include "mappedPatchBase.H"
90#include "mixedFvPatchFields.H"
91#include "interpolation.H"
92#include "volFieldsFwd.H"
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96namespace Foam
97{
98
99/*---------------------------------------------------------------------------*\
100 Class mappedMixedFieldFvPatchField Declaration
101\*---------------------------------------------------------------------------*/
102
103template<class Type>
104class mappedMixedFieldFvPatchField
105:
106 public mixedFvPatchField<Type>,
107 public mappedPatchBase,
108 public mappedPatchFieldBase<Type>
109{
110
111 //- Name of weight field to sample
112 word weightFieldName_;
113
114
115public:
116
117 //- Runtime type information
118 TypeName("mappedMixedField");
119
120
121 // Constructors
122
123 //- Construct from patch and internal field
125 (
126 const fvPatch&,
127 const DimensionedField<Type, volMesh>&
128 );
130 //- Construct from patch, internal field and dictionary
132 (
133 const fvPatch&,
135 const dictionary&
136 );
137
138 //- Construct by mapping given
139 // mappedMixedFieldFvPatchField
140 // onto a new patch
142 (
144 const fvPatch&,
146 const fvPatchFieldMapper&
147 );
148
149 //- Construct as copy
151 (
153 );
154
155 //- Construct and return a clone
156 virtual tmp<fvPatchField<Type>> clone() const
157 {
159 (
161 (
162 *this
163 )
164 );
165 }
166
167 //- Construct as copy setting internal field reference
169 (
172 );
173
174 //- Construct and return a clone setting internal field reference
176 (
178 ) const
179 {
183 (
184 *this,
185 iF
186 )
187 );
188 }
189
190
191 // Member functions
192
193 // Mapping functions
194
195 //- Map (and resize as needed) from self given a mapping object
196 virtual void autoMap
197 (
198 const fvPatchFieldMapper&
199 );
201 //- Reverse map the given fvPatchField onto this fvPatchField
202 virtual void rmap
203 (
204 const fvPatchField<Type>&,
205 const labelList&
206 );
207
208
209 // Evaluation functions
210
211 //- Update the coefficients associated with the patch field
212 virtual void updateCoeffs();
213
214
215 //- Write
216 virtual void write(Ostream&) const;
217};
218
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222} // End namespace Foam
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#ifdef NoRepository
228#endif
229
230// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231
232#endif
233
234// ************************************************************************* //
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
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 e.g. mapped boundary conditions.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("mappedMixedField")
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.
mappedMixedFieldFvPatchField(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 ...
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
This boundary condition provides a base class for 'mixed' type boundary conditions,...
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.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73