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 | Copyright (C) 2011-2016 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 Group
28  grpGenericBoundaryConditions grpCoupledBoundaryConditions
29 
30 Description
31  This boundary condition maps the value at a set of cells or patch faces
32  back to *this.
33 
34  The sample mode is set by the underlying mapping engine, provided by the
35  mappedPatchBase class.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  fieldName | name of field to be mapped | no | this field name
41  setAverage | flag to activate setting of average value | yes |
42  average | average value to apply if \c setAverage = yes | yes |
43  interpolationScheme | type of interpolation scheme | no |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type mapped;
51  fieldName T;
52  setAverage no;
53  average 0;
54  interpolationScheme cell;
55  value uniform 0;
56  }
57  \endverbatim
58 
59  When employing the \c nearestCell sample mode, the user must also specify
60  the interpolation scheme using the \c interpolationScheme entry.
61 
62  In case of interpolation (where scheme != cell) the limitation is that
63  there is only one value per cell. For example, if you have a cell with two
64  boundary faces and both faces sample into the cell, both faces will get the
65  same value.
66 
67 Note
68  It is not possible to sample internal faces since volume fields are not
69  defined on faces.
70 
71 See also
72  Foam::mappedPatchBase
73  Foam::interpolation
74  Foam::fixedValueFvPatchField
75 
76 SourceFiles
77  mappedFixedValueFvPatchField.C
78 
79 \*---------------------------------------------------------------------------*/
80 
81 #ifndef mappedFixedValueFvPatchField_H
82 #define mappedFixedValueFvPatchField_H
83 
85 //#include "interpolation.H"
86 #include "mappedPatchFieldBase.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 
93 /*---------------------------------------------------------------------------*\
94  Class mappedFixedValueFvPatchField Declaration
95 \*---------------------------------------------------------------------------*/
96 
97 template<class Type>
98 class mappedFixedValueFvPatchField
99 :
100  public fixedValueFvPatchField<Type>,
101  public mappedPatchFieldBase<Type>
102 {
103 
104 protected:
105 
106  // Protected Member Functions
107 
108  const mappedPatchBase& mapper
109  (
110  const fvPatch& p,
111  const DimensionedField<Type, volMesh>& iF
112  );
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("mapped");
119 
120 
121  // Constructors
123  //- Construct from patch and internal field
125  (
126  const fvPatch&,
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const fvPatch&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given mappedFixedValueFvPatchField
139  // onto a new patch
141  (
143  const fvPatch&,
145  const fvPatchFieldMapper&
146  );
147 
148  //- Construct as copy
150  (
152  );
153 
154  //- Construct and return a clone
155  virtual tmp<fvPatchField<Type>> clone() const
156  {
157  return tmp<fvPatchField<Type>>
158  (
160  );
161  }
162 
163  //- Construct as copy setting internal field reference
165  (
168  );
169 
170  //- Construct and return a clone setting internal field reference
172  (
174  ) const
175  {
176  return tmp<fvPatchField<Type>>
177  (
179  );
180  }
181 
182 
183  // Member functions
184 
185  // Evaluation functions
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #ifdef NoRepository
203 #endif
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
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.
virtual void write(Ostream &) const
Write.
Foam::fvPatchFieldMapper.
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:54
TypeName("mapped")
Runtime type information.
Namespace for OpenFOAM.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.