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 
107 protected:
108 
109  // Protected Member Functions
110 
111  const mappedPatchBase& mapper
112  (
113  const fvPatch& p,
114  const DimensionedField<Type, volMesh>& iF
115  );
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("mapped");
122 
123 
124  // Constructors
125 
126  //- Construct from patch and internal field
128  (
129  const fvPatch&,
131  );
132 
133  //- Construct from patch, internal field and dictionary
135  (
136  const fvPatch&,
138  const dictionary&
139  );
140 
141  //- Construct by mapping given mappedFixedValueFvPatchField
142  // onto a new patch
144  (
146  const fvPatch&,
148  const fvPatchFieldMapper&
149  );
150 
151  //- Construct as copy
153  (
155  );
156 
157  //- Construct and return a clone
158  virtual tmp<fvPatchField<Type>> clone() const
159  {
160  return tmp<fvPatchField<Type>>
161  (
163  );
164  }
165 
166  //- Construct as copy setting internal field reference
168  (
171  );
172 
173  //- Construct and return a clone setting internal field reference
175  (
177  ) const
178  {
179  return tmp<fvPatchField<Type>>
180  (
182  );
183  }
184 
185 
186  // Member functions
187 
188  // Evaluation functions
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #ifdef NoRepository
206 #endif
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
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:59
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:105
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::mapper
const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Definition: mappedFixedValueFvPatchField.C:99
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:118
Foam::mappedPatchFieldBase
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Definition: mappedPatchFieldBase.H:102
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
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:182
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:143