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 -------------------------------------------------------------------------------
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::mappedMixedFieldFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions grpCoupledBoundaryConditions
31 
32 Description
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 
40 Usage
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 
61 Note
62  Supports multi-world operation:
63 
64  +----+ +----+
65  | | | |
66  | | | |
67  +----+ +----+
68  worldA worldB
69  regionA regionB
70  patchA patchB
71 
72 
73 See also
74  Foam::mappedPatchBase
75  Foam::mappedPolyPatch
76  Foam::mappedFvPatch
77  Foam::mappedFieldFvPatchField
78  Foam::mixedFvPatchField
79 
80 SourceFiles
81  mappedMixedFieldFvPatchField.txx
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef Foam_mappedMixedFieldFvPatchField_H
86 #define Foam_mappedMixedFieldFvPatchField_H
87 
88 #include "mappedPatchBase.H"
89 #include "mappedPatchFieldBase.H"
90 #include "mixedFvPatchFields.H"
91 #include "interpolation.H"
92 #include "volFieldsFwd.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 
99 /*---------------------------------------------------------------------------*\
100  Class mappedMixedFieldFvPatchField Declaration
101 \*---------------------------------------------------------------------------*/
102 
103 template<class Type>
104 class mappedMixedFieldFvPatchField
105 :
106  public mixedFvPatchField<Type>,
107  public mappedPatchBase,
108  public mappedPatchFieldBase<Type>
109 {
110  typedef mappedMixedFieldFvPatchField<Type> this_bctype;
111  typedef mixedFvPatchField<Type> parent_bctype;
112 
113  // Private Data
114 
115  //- Name of weight field to sample
116  word weightFieldName_;
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("mappedMixedField");
123 
124 
125  // Constructors
126 
127  //- Construct from patch and internal field
129  (
130  const fvPatch&,
132  );
133 
134  //- Construct from patch, internal field and dictionary
136  (
137  const fvPatch&,
139  const dictionary&
140  );
141 
142  //- Construct by mapping onto a new patch
144  (
145  const this_bctype&,
146  const fvPatch&,
148  const fvPatchFieldMapper&
149  );
150 
151  //- Construct as copy setting internal field reference
153  (
154  const this_bctype&,
156  );
157 
158  //- No copy without an internal field
159  mappedMixedFieldFvPatchField(const this_bctype&) = delete;
160 
161  //- Clone with an internal field reference
163  (
165  ) const
166  {
167  return fvPatchField<Type>::Clone(*this, iF);
168  }
169 
170 
171  // Member functions
172 
173  // Mapping functions
174 
175  //- Map (and resize as needed) from self given a mapping object
176  virtual void autoMap
177  (
178  const fvPatchFieldMapper&
179  );
180 
181  //- Reverse map the given fvPatchField onto this fvPatchField
182  virtual void rmap
183  (
184  const fvPatchField<Type>&,
185  const labelList&
186  );
187 
188 
189  // Evaluation functions
190 
191  //- Update the coefficients associated with the patch field
192  virtual void updateCoeffs();
193 
194 
195  //- Write
196  virtual void write(Ostream&) const;
197 
198 
199  // Member Operators
201  //- Inherit assignment
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #ifdef NoRepository
213  #include "mappedMixedFieldFvPatchField.txx"
214 #endif
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Forwards and collection of common volume field types.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void write(Ostream &) const
Write.
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition provides a base class for &#39;mixed&#39; type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
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:635
A FieldMapper for finite-volume patch fields.
mappedMixedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
TypeName("mappedMixedField")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
virtual tmp< fvPatchField< Type > > clone() const
No clone without an internal field reference.
Definition: fvPatchField.H:610