patchCorrectedInterpolation.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) 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::patchCorrectedInterpolation
26 
27 Description
28  Interpolation of cell-based displacements to the points with additional
29  correction for interpolation inconsistency on patches.
30 
31  The default interpolation method interpolates from the cells to all points
32  except those on boundaries with value boundary conditions. The discrepancy
33  across the boundary cell can cause shearing and inversion if the cells are
34  of very high aspect ratio.
35 
36  This method applies the default interpolation to *all* points, including
37  those on value boundaries. The difference between the interpolated value on
38  the boundary and the desired boundary condition is then propagated into the
39  mesh with a wave. Contributions from different patches are inverse-distance
40  weighted, and the result is added to the default interpolation. The result
41  of this is that thin boundary cells are maintained much more accurately for
42  non-uniform patch displacements.
43 
44  The user must specify the patch groups from which to propagate the motion.
45  Ideally, these groups will be opposing; i.e. one group with the aerofoil,
46  and one with the far field:
47 
48  \verbatim
49  interpolation patchCorrected
50  (
51  (aerofoilUpper aerofoilLower)
52  (farField)
53  );
54  \endverbatim
55 
56 SourceFiles
57  patchCorrectedInterpolation.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef patchCorrectedInterpolation_H
62 #define patchCorrectedInterpolation_H
63 
64 #include "motionInterpolation.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class patchCorrectedInterpolation Declaration
73 \*---------------------------------------------------------------------------*/
74 
76 :
77  public motionInterpolation
78 {
79  // Private data
80 
81  //- Patch groups from which to propagate the displacement
83 
84 
85  // Private member functions
86 
87  //- Get patch groups from the input stream
89 
90  //- Interpolate the given cell displacement
91  template <class Type>
92  void interpolateType
93  (
96  ) const;
97 
98  //- Interpolate patch data by inverse distance weighting
99  template <class Type>
101  (
103  ) const;
104 
105  //- Propagate data from a number of patches into the field
106  template <class Type>
108  (
109  const label,
112  ) const;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("patchCorrected");
119 
120 
121  // Constructors
122 
123  //- Construct from an fvMesh and an Istream
125  (
126  const fvMesh& mesh,
127  Istream& entry
128  );
129 
130 
131  //- Destructor
133 
134 
135  // Member Functions
136 
137  //- Interpolate the given scalar cell displacement
138  virtual void interpolate
139  (
140  const volScalarField&,
142  ) const;
143 
144  //- Interpolate the given vector cell displacement
145  virtual void interpolate
146  (
147  const volVectorField&,
149  ) const;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:65
Foam::patchCorrectedInterpolation::~patchCorrectedInterpolation
virtual ~patchCorrectedInterpolation()
Destructor.
Definition: patchCorrectedInterpolation.C:95
Foam::patchCorrectedInterpolation::getPatchGroups
labelListList getPatchGroups(Istream &entry) const
Get patch groups from the input stream.
Definition: patchCorrectedInterpolation.C:47
Foam::patchCorrectedInterpolation::interpolate
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Definition: patchCorrectedInterpolation.C:102
Foam::patchCorrectedInterpolation::interpolateDataFromPatchGroups
void interpolateDataFromPatchGroups(GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate patch data by inverse distance weighting.
Definition: patchCorrectedInterpolationTemplates.C:92
Foam::patchCorrectedInterpolation::interpolateType
void interpolateType(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate the given cell displacement.
Definition: patchCorrectedInterpolationTemplates.C:36
Foam::patchCorrectedInterpolation::patchCorrectedInterpolation
patchCorrectedInterpolation(const fvMesh &mesh, Istream &entry)
Construct from an fvMesh and an Istream.
Definition: patchCorrectedInterpolation.C:83
Foam::patchCorrectedInterpolation::patchGroups_
const labelListList patchGroups_
Patch groups from which to propagate the displacement.
Definition: patchCorrectedInterpolation.H:81
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::patchCorrectedInterpolation
Interpolation of cell-based displacements to the points with additional correction for interpolation ...
Definition: patchCorrectedInterpolation.H:74
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::motionInterpolation
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers,...
Definition: motionInterpolation.H:50
Foam::motionInterpolation::mesh
const fvMesh & mesh() const
Return const-refernce to the mesh.
Definition: motionInterpolation.H:117
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::patchCorrectedInterpolation::propagateDataFromPatchGroup
void propagateDataFromPatchGroup(const label, pointScalarField &, GeometricField< Type, pointPatchField, pointMesh > &) const
Propagate data from a number of patches into the field.
Definition: patchCorrectedInterpolationTemplates.C:152
patchCorrectedInterpolationTemplates.C
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
motionInterpolation.H
Foam::patchCorrectedInterpolation::TypeName
TypeName("patchCorrected")
Runtime type information.