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&,
125  const DimensionedField<Type, volMesh>&
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 and return a clone
154  virtual tmp<fvPatchField<Type>> clone() const
155  {
156  return tmp<fvPatchField<Type>>
157  (
159  (
160  *this
161  )
162  );
163  }
164 
165  //- Construct as copy setting internal field reference
167  (
170  );
171 
172  //- Construct and return a clone setting internal field reference
174  (
176  ) const
177  {
178  return tmp<fvPatchField<Type>>
179  (
181  (
182  *this,
183  iF
184  )
185  );
186  }
187 
188 
189  // Member functions
190 
191  // Mapping functions
192 
193  //- Map (and resize as needed) from self given a mapping object
194  virtual void autoMap
195  (
196  const fvPatchFieldMapper&
197  );
198 
199  //- Reverse map the given fvPatchField onto this fvPatchField
200  virtual void rmap
201  (
202  const fvPatchField<Type>&,
203  const labelList&
204  );
205 
206 
207  // Evaluation functions
208 
209  //- Update the coefficients associated with the patch field
210  virtual void updateCoeffs();
211 
212 
213  //- Write
214  virtual void write(Ostream&) const;
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #ifdef NoRepository
225  #include "mappedMixedFvPatchField.C"
226 #endif
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
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::mappedMixedFvPatchField::mappedMixedFvPatchField
mappedMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedMixedFvPatchField.C:37
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
mappedPatchFieldBase.H
Foam::mappedMixedFvPatchField::TypeName
TypeName("mappedMixed")
Runtime type information.
Foam::mappedMixedFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedMixedFvPatchField.C:236
mappedMixedFvPatchField.C
Foam::mappedMixedFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedMixedFvPatchField.C:180
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::mappedMixedFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: mappedMixedFvPatchField.C:170
Foam::mappedMixedFvPatchField
This boundary condition maps the value at a set of cells or patch faces back to *this.
Definition: mappedMixedFvPatchField.H:128
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::mappedMixedFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: mappedMixedFvPatchField.C:162
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::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::mappedMixedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: mappedMixedFvPatchField.H:179
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54