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-2015 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  \heading Patch usage
38 
39  \table
40  Property | Description | Required | Default value
41  fieldName | name of field to be mapped | no | this field name
42  setAverage | flag to activate setting of average value | yes |
43  average | average value to apply if \c setAverage = yes | yes |
44  interpolationScheme | type of interpolation scheme | no |
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  myPatch
50  {
51  type mapped;
52  fieldName T;
53  setAverage no;
54  average 0;
55  interpolationScheme cell;
56  value uniform 0;
57  }
58  \endverbatim
59 
60  When employing the \c nearestCell sample mode, the user must also specify
61  the interpolation scheme using the \c interpolationScheme entry.
62 
63  In case of interpolation (where scheme != cell) the limitation is that
64  there is only one value per cell. For example, if you have a cell with two
65  boundary faces and both faces sample into the cell, both faces will get the
66  same value.
67 
68 Note
69  It is not possible to sample internal faces since volume fields are not
70  defined on faces.
71 
72 SeeAlso
73  Foam::mappedPatchBase
74  Foam::interpolation
75  Foam::fixedValueFvPatchField
76 
77 SourceFiles
78  mappedFixedValueFvPatchField.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef mappedFixedValueFvPatchField_H
83 #define mappedFixedValueFvPatchField_H
84 
86 //#include "interpolation.H"
87 #include "mappedPatchFieldBase.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 
94 /*---------------------------------------------------------------------------*\
95  Class mappedFixedValueFvPatchField Declaration
96 \*---------------------------------------------------------------------------*/
97 
98 template<class Type>
99 class mappedFixedValueFvPatchField
100 :
101  public fixedValueFvPatchField<Type>,
102  public mappedPatchFieldBase<Type>
103 {
104 
105 protected:
106 
107  // Protected Member Functions
108 
109  const mappedPatchBase& mapper
110  (
111  const fvPatch& p,
112  const DimensionedField<Type, volMesh>& iF
113  );
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("mapped");
120 
121 
122  // Constructors
123 
124  //- Construct from patch and internal field
126  (
127  const fvPatch&,
129  );
130 
131  //- Construct from patch, internal field and dictionary
133  (
134  const fvPatch&,
136  const dictionary&
137  );
138 
139  //- Construct by mapping given mappedFixedValueFvPatchField
140  // onto a new patch
142  (
144  const fvPatch&,
146  const fvPatchFieldMapper&
147  );
148 
149  //- Construct as copy
151  (
153  );
154 
155  //- Construct and return a clone
156  virtual tmp<fvPatchField<Type> > clone() const
157  {
158  return tmp<fvPatchField<Type> >
159  (
161  );
162  }
163 
164  //- Construct as copy setting internal field reference
166  (
169  );
170 
171  //- Construct and return a clone setting internal field reference
172  virtual tmp<fvPatchField<Type> > clone
173  (
175  ) const
176  {
177  return tmp<fvPatchField<Type> >
178  (
180  );
181  }
182 
183 
184  // Member functions
185 
186  // Evaluation functions
187 
188  //- Update the coefficients associated with the patch field
189  virtual void updateCoeffs();
190 
191  //- Write
192  virtual void write(Ostream&) const;
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
p
p
Definition: pEqn.H:62
Foam::mappedFixedValueFvPatchField
This boundary condition maps the value at a set of cells or patch faces back to *this.
Definition: mappedFixedValueFvPatchField.H:123
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
mappedFixedValueFvPatchField.C
mappedPatchFieldBase.H
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:101
Foam::mappedFixedValueFvPatchField::mappedFixedValueFvPatchField
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedFixedValueFvPatchField.C:39
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
Foam::mappedFixedValueFvPatchField::TypeName
TypeName("mapped")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::mappedFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedFixedValueFvPatchField.C:122
Foam::mappedPatchFieldBase
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Definition: mappedPatchFieldBase.H:64
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::mappedFixedValueFvPatchField::mapper
const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Definition: mappedFixedValueFvPatchField.C:103
Foam::mappedFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: mappedFixedValueFvPatchField.H:180
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::mappedFixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedFixedValueFvPatchField.C:147