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.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef mappedMixedFieldFvPatchField_H
86 #define 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 
111  //- Name of weight field to sample
112  word weightFieldName_;
113 
114 
115 public:
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  );
129 
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  {
158  return tmp<fvPatchField<Type>>
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  {
180  return tmp<fvPatchField<Type>>
181  (
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  );
200 
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 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::mappedMixedFieldFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: mappedMixedFieldFvPatchField.C:114
volFieldsFwd.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::mappedMixedFieldFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedMixedFieldFvPatchField.C:192
Foam::mappedMixedFieldFvPatchField::mappedMixedFieldFvPatchField
mappedMixedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedMixedFieldFvPatchField.C:36
mappedMixedFieldFvPatchField.C
mappedPatchFieldBase.H
interpolation.H
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:112
Foam::mappedMixedFieldFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: mappedMixedFieldFvPatchField.C:125
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::mappedMixedFieldFvPatchField::TypeName
TypeName("mappedMixedField")
Runtime type information.
Foam::mappedPatchFieldBase
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Definition: mappedPatchFieldBase.H:105
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mixedFvPatchField
This boundary condition provides a base class for 'mixed' type boundary conditions,...
Definition: mixedFvPatchField.H:123
mixedFvPatchFields.H
Foam::mappedMixedFieldFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedMixedFieldFvPatchField.C:136
Foam::mappedMixedFieldFvPatchField
This boundary condition provides a self-contained version of e.g. mapped boundary conditions.
Definition: mappedMixedFieldFvPatchField.H:129
Foam::mappedMixedFieldFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: mappedMixedFieldFvPatchField.H:181
Foam::List< label >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
mappedPatchBase.H