mappedFixedValueFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::mappedFixedValueFvPatchField
26 
27 Description
28  This boundary condition maps the value at a set of cells or patch faces
29  back to *this.
30 
31  The sample mode is set by the underlying mapping engine, provided by the
32  mappedPatchBase class.
33 
34 Usage
35  \table
36  Property | Description | Required | Default value
37  fieldName | name of field to be mapped | no | this field name
38  setAverage | flag to activate setting of average value | yes |
39  average | average value to apply if \c setAverage = yes | yes |
40  interpolationScheme | type of interpolation scheme | no |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type mapped;
48  fieldName T;
49  setAverage no;
50  average 0;
51  interpolationScheme cell;
52  value uniform 0;
53  }
54  \endverbatim
55 
56  When employing the \c nearestCell sample mode, the user must also specify
57  the interpolation scheme using the \c interpolationScheme entry.
58 
59  In case of interpolation (where scheme != cell) the limitation is that
60  there is only one value per cell. For example, if you have a cell with two
61  boundary faces and both faces sample into the cell, both faces will get the
62  same value.
63 
64 Note
65  It is not possible to sample internal faces since volume fields are not
66  defined on faces.
67 
68 See also
69  Foam::mappedPatchBase
70  Foam::interpolation
71  Foam::fixedValueFvPatchField
72 
73 SourceFiles
74  mappedFixedValueFvPatchField.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef mappedFixedValueFvPatchField_H
79 #define mappedFixedValueFvPatchField_H
80 
82 //#include "interpolation.H"
83 #include "mappedPatchFieldBase.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class mappedFixedValueFvPatchField Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 template<class Type>
95 class mappedFixedValueFvPatchField
96 :
97  public fixedValueFvPatchField<Type>,
98  public mappedPatchFieldBase<Type>
99 {
100 
101 protected:
102 
103  // Protected Member Functions
104 
105  const mappedPatchBase& mapper
106  (
107  const fvPatch& p,
108  const DimensionedField<Type, volMesh>& iF
109  );
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("mapped");
116 
117 
118  // Constructors
120  //- Construct from patch and internal field
122  (
123  const fvPatch&,
125  );
126 
127  //- Construct from patch, internal field and dictionary
129  (
130  const fvPatch&,
132  const dictionary&
133  );
134 
135  //- Construct by mapping given mappedFixedValueFvPatchField
136  // onto a new patch
138  (
140  const fvPatch&,
142  const fvPatchFieldMapper&
143  );
144 
145  //- Construct as copy
147  (
149  );
150 
151  //- Construct and return a clone
152  virtual tmp<fvPatchField<Type>> clone() const
153  {
154  return tmp<fvPatchField<Type>>
155  (
157  );
158  }
159 
160  //- Construct as copy setting internal field reference
162  (
165  );
166 
167  //- Construct and return a clone setting internal field reference
169  (
171  ) const
172  {
173  return tmp<fvPatchField<Type>>
174  (
176  );
177  }
178 
179 
180  // Member functions
181 
182  // Evaluation functions
183 
184  //- Update the coefficients associated with the patch field
185  virtual void updateCoeffs();
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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:61
This boundary condition maps the value at a set of cells or patch faces back to *this.
Foam::fvPatchFieldMapper.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
TypeName("mapped")
Runtime type information.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Namespace for OpenFOAM.