patchTransformedInterpolation.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) 2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::patchTransformedInterpolation
28 
29 Description
30  Interpolation of cell-based displacements to the points with additional
31  correction of patch-adjacent cells.
32 
33  Snappy meshes often have moderately non-orthogonal faces next to patches.
34  If these partches are moved, these already quite distorted faces quickly
35  violate the quality criteria.
36 
37  This method corrects patch-adjacent cells are by calculating the average
38  translation, rotation and expansion of points connected to the patch. This
39  transformation is then applied to all the points in the cell that are not
40  on the patch. This does a better job of preserving the cell shape on the
41  patch than pure interpolation, though it can simply move the problem into
42  the next layer of cells.
43 
44  The user needs only to specify the patches on which this correction is
45  performed:
46 
47  \verbatim
48  interpolation patchTransformed (movingPatch1 movingPatch2);
49  \endverbatim
50 
51  Note that this method is not defined for scalar displacement fields.
52 
53 SourceFiles
54  patchTransformedInterpolation.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef patchTransformedInterpolation_H
59 #define patchTransformedInterpolation_H
60 
61 #include "motionInterpolation.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class patchTransformedInterpolation Declaration
70 \*---------------------------------------------------------------------------*/
71 
73 :
74  public motionInterpolation
75 {
76  // Private data
77 
78  //- Patches on which to enforce transformation on adjacent cells
79  const labelList patches_;
80 
81 
82  // Private member functions
83 
84  //- Get patches from the input stream
85  labelList getPatches(Istream& entry) const;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("patchTransformed");
92 
93 
94  // Constructors
95 
96  //- Construct from an fvMesh and an Istream
98  (
99  const fvMesh& mesh,
100  Istream& entry
101  );
102 
103 
104  //- Destructor
106 
107 
108  // Member Functions
109 
110  //- Interpolate the given scalar cell displacement
111  virtual void interpolate
112  (
113  const volScalarField&,
115  ) const;
116 
117  //- Interpolate the given vector cell displacement
118  virtual void interpolate
119  (
120  const volVectorField&,
122  ) const;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:67
Foam::patchTransformedInterpolation::patchTransformedInterpolation
patchTransformedInterpolation(const fvMesh &mesh, Istream &entry)
Construct from an fvMesh and an Istream.
Definition: patchTransformedInterpolation.C:84
Foam::patchTransformedInterpolation::TypeName
TypeName("patchTransformed")
Runtime type information.
Foam::patchTransformedInterpolation::~patchTransformedInterpolation
virtual ~patchTransformedInterpolation()
Destructor.
Definition: patchTransformedInterpolation.C:96
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchTransformedInterpolation::interpolate
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Definition: patchTransformedInterpolation.C:103
Foam::motionInterpolation
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers,...
Definition: motionInterpolation.H:52
Foam::motionInterpolation::mesh
const fvMesh & mesh() const
Return const-reference to the mesh.
Definition: motionInterpolation.H:119
Foam::List< label >
Foam::patchTransformedInterpolation
Interpolation of cell-based displacements to the points with additional correction of patch-adjacent ...
Definition: patchTransformedInterpolation.H:71
Foam::GeometricField< scalar, fvPatchField, volMesh >
motionInterpolation.H