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 and return a clone
146  virtual tmp<fvPatchField<Type>> clone() const
147  {
148  return tmp<fvPatchField<Type>>
149  (
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
167  return tmp<fvPatchField<Type>>
168  (
170  );
171  }
172 
173 
174  // Member functions
175 
176  // Evaluation functions
177 
178  //- Update the coefficients associated with the patch field
179  virtual void updateCoeffs();
180 
181 
182  //- Write
183  virtual void write(Ostream&) const;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #ifdef NoRepository
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Foam::mappedFixedValueFvPatchField
This boundary condition maps the value at a set of cells or patch faces back to *this.
Definition: mappedFixedValueFvPatchField.H:125
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
mappedFixedValueFvPatchField.C
mappedPatchFieldBase.H
Foam::mappedFixedValueFvPatchField::mappedFixedValueFvPatchField
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedFixedValueFvPatchField.C:35
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::mappedFixedValueFvPatchField::TypeName
TypeName("mapped")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::mappedFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedFixedValueFvPatchField.C:114
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
fixedValueFvPatchFields.H
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::mappedFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: mappedFixedValueFvPatchField.H:170
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::mappedFixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedFixedValueFvPatchField.C:139