mappedMixedFvPatchField.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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::mappedMixedFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions grpCoupledBoundaryConditions
31 
32 Description
33  This boundary condition maps the value at a set of cells or patch faces
34  back to *this.
35 
36  The sample mode is set by the underlying mapping engine, provided by the
37  mappedPatchBase class.
38 
39 Usage
40  \table
41  Property | Description | Required | Default
42  field | Name of field to be mapped | no | this field name
43  weightField | Name of field to use as weight | no |
44  setAverage | Use average value | no | false |
45  average | Average value to use if \c setAverage = yes | partly |
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  <patchName>
51  {
52  type mappedMixed;
53  field T; // optional field name
54 
55  value uniform 273.0;
56 
57  refValue $value;
58  refGradient uniform 0.0;
59  valueFraction uniform 1.0;
60  }
61  \endverbatim
62 
63 Note
64  Supports multi-world operation:
65 
66  +----+ +----+
67  | | | |
68  | | | |
69  +----+ +----+
70  worldA worldB
71  regionA regionB
72  patchA patchB
73 
74 
75 See also
76  Foam::mappedPatchBase
77  Foam::mappedPolyPatch
78  Foam::mappedFvPatch
79  Foam::mappedFieldFvPatchField
80  Foam::mixedFvPatchField
81 
82 SourceFiles
83  mappedMixedFvPatchField.C
84 
85 \*---------------------------------------------------------------------------*/
86 
87 #ifndef mappedMixedFvPatchField_H
88 #define mappedMixedFvPatchField_H
89 
90 #include "mappedPatchFieldBase.H"
91 #include "mixedFvPatchFields.H"
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 namespace Foam
96 {
97 
98 /*---------------------------------------------------------------------------*\
99  Class mappedMixedFvPatchField Declaration
100 \*---------------------------------------------------------------------------*/
101 
102 template<class Type>
103 class mappedMixedFvPatchField
104 :
105  public mixedFvPatchField<Type>,
106  public mappedPatchFieldBase<Type>
107 {
108 
109  //- Name of weight field to sample
110  word weightFieldName_;
111 
112 
113 public:
114 
115  //- Runtime type information
116  TypeName("mappedMixed");
117 
118 
119  // Constructors
120 
121  //- Construct from patch and internal field
123  (
124  const fvPatch&,
126  );
127 
128  //- Construct from patch, internal field and dictionary
130  (
131  const fvPatch&,
133  const dictionary&
134  );
135 
136  //- Construct by mapping given
137  // mappedMixedFvPatchField
138  // onto a new patch
140  (
142  const fvPatch&,
144  const fvPatchFieldMapper&
145  );
146 
147  //- Construct as copy
149  (
151  );
152 
153  //- Construct as copy setting internal field reference
155  (
158  );
159 
160  //- Return a clone
161  virtual tmp<fvPatchField<Type>> clone() const
162  {
163  return fvPatchField<Type>::Clone(*this);
164  }
165 
166  //- Clone with an internal field reference
168  (
170  ) const
171  {
172  return fvPatchField<Type>::Clone(*this, iF);
173  }
174 
175 
176  // Member functions
177 
178  // Mapping functions
179 
180  //- Map (and resize as needed) from self given a mapping object
181  virtual void autoMap
182  (
183  const fvPatchFieldMapper&
184  );
185 
186  //- Reverse map the given fvPatchField onto this fvPatchField
187  virtual void rmap
188  (
189  const fvPatchField<Type>&,
190  const labelList&
191  );
192 
193 
194  // Evaluation functions
195 
196  //- Update the coefficients associated with the patch field
197  virtual void updateCoeffs();
198 
200  //- Write
201  virtual void write(Ostream&) const;
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #ifdef NoRepository
212  #include "mappedMixedFvPatchField.C"
213 #endif
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
mappedMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
TypeName("mappedMixed")
Runtime type information.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
This boundary condition maps the value at a set of cells or patch faces back to *this.
Namespace for OpenFOAM.
virtual void write(Ostream &) const
Write.