mappedFixedValueFvPatchField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::mappedFixedValueFvPatchField
29 
30 Group
31  grpGenericBoundaryConditions grpCoupledBoundaryConditions
32 
33 Description
34  This boundary condition maps the value at a set of cells or patch faces
35  back to *this.
36 
37  The sample mode is set by the underlying mapping engine, provided by the
38  mappedPatchBase class.
39 
40 Usage
41  \table
42  Property | Description | Required | Default
43  field | Field name to be mapped | no | this field name
44  setAverage | Use average value | no | false
45  average | Average value to use if \c setAverage = yes | partly |
46  interpolationScheme | type of interpolation scheme | partly |
47  \endtable
48 
49  Example of the boundary condition specification:
50  \verbatim
51  <patchName>
52  {
53  type mapped;
54  field T;
55  setAverage no;
56  average 0;
57  interpolationScheme cell;
58  value uniform 0;
59  }
60  \endverbatim
61 
62  When employing the \c nearestCell sample mode, the user must also specify
63  the interpolation scheme using the \c interpolationScheme entry.
64 
65  In case of interpolation (where scheme != cell) the limitation is that
66  there is only one value per cell. For example, if you have a cell with two
67  boundary faces and both faces sample into the cell, both faces will get the
68  same value.
69 
70 Note
71  It is not possible to sample internal faces since volume fields are not
72  defined on faces.
73 
74 See also
75  Foam::mappedPatchBase
76  Foam::interpolation
77  Foam::fixedValueFvPatchField
78 
79 SourceFiles
80  mappedFixedValueFvPatchField.C
81 
82 \*---------------------------------------------------------------------------*/
83 
84 #ifndef mappedFixedValueFvPatchField_H
85 #define mappedFixedValueFvPatchField_H
86 
88 //#include "interpolation.H"
89 #include "mappedPatchFieldBase.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class mappedFixedValueFvPatchField Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 template<class Type>
101 class mappedFixedValueFvPatchField
102 :
103  public fixedValueFvPatchField<Type>,
104  public mappedPatchFieldBase<Type>
105 {
106 public:
107 
108  //- Runtime type information
109  TypeName("mapped");
110 
111 
112  // Constructors
113 
114  //- Construct from patch and internal field
116  (
117  const fvPatch&,
118  const DimensionedField<Type, volMesh>&
119  );
120 
121  //- Construct from patch, internal field and dictionary
123  (
124  const fvPatch&,
126  const dictionary&
127  );
128 
129  //- Construct by mapping given mappedFixedValueFvPatchField
130  // onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Return a clone
153  virtual tmp<fvPatchField<Type>> clone() const
154  {
155  return fvPatchField<Type>::Clone(*this);
156  }
157 
158  //- Clone with an internal field reference
160  (
162  ) const
163  {
164  return fvPatchField<Type>::Clone(*this, iF);
165  }
166 
167 
168  // Member functions
169 
170  // Evaluation functions
171 
172  //- Update the coefficients associated with the patch field
173  virtual void updateCoeffs();
174 
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #ifdef NoRepository
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition maps the value at a set of cells or patch faces back to *this.
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.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
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
TypeName("mapped")
Runtime type information.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
Namespace for OpenFOAM.