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 | 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::patchTransformedInterpolation
26 
27 Description
28  Interpolation of cell-based displacements to the points with additional
29  correction of patch-adjacent cells.
30 
31  Snappy meshes often have moderately non-orthogonal faces next to patches.
32  If these partches are moved, these already quite distorted faces quickly
33  violate the quality criteria.
34 
35  This method corrects patch-adjacent cells are by calculating the average
36  translation, rotation and expansion of points connected to the patch. This
37  transformation is then applied to all the points in the cell that are not
38  on the patch. This does a better job of preserving the cell shape on the
39  patch than pure interpolation, though it can simply move the problem into
40  the next layer of cells.
41 
42  The user needs only to specify the patches on which this correction is
43  performed:
44 
45  \verbatim
46  interpolation patchTransformed (movingPatch1 movingPatch2);
47  \endverbatim
48 
49  Note that this method is not defined for scalar displacement fields.
50 
51 SourceFiles
52  patchTransformedInterpolation.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef patchTransformedInterpolation_H
57 #define patchTransformedInterpolation_H
58 
59 #include "motionInterpolation.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class patchTransformedInterpolation Declaration
68 \*---------------------------------------------------------------------------*/
69 
71 :
72  public motionInterpolation
73 {
74  // Private data
75 
76  //- Patches on which to enforce transformation on adjacent cells
77  const labelList patches_;
78 
79 
80  // Private member functions
81 
82  //- Get patches from the input stream
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("patchTransformed");
90 
91 
92  // Constructors
93 
94  //- Construct from an fvMesh and an Istream
96  (
97  const fvMesh& mesh,
98  Istream& entry
99  );
100 
101 
102  //- Destructor
104 
105 
106  // Member Functions
107 
108  //- Interpolate the given scalar cell displacement
109  virtual void interpolate
110  (
111  const volScalarField&,
113  ) const;
114 
115  //- Interpolate the given vector cell displacement
116  virtual void interpolate
117  (
118  const volVectorField&,
120  ) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:65
Foam::patchTransformedInterpolation::patchTransformedInterpolation
patchTransformedInterpolation(const fvMesh &mesh, Istream &entry)
Construct from an fvMesh and an Istream.
Definition: patchTransformedInterpolation.C:81
Foam::patchTransformedInterpolation::TypeName
TypeName("patchTransformed")
Runtime type information.
Foam::patchTransformedInterpolation::~patchTransformedInterpolation
virtual ~patchTransformedInterpolation()
Destructor.
Definition: patchTransformedInterpolation.C:93
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::patchTransformedInterpolation::patches_
const labelList patches_
Patches on which to enforce transformation on adjacent cells.
Definition: patchTransformedInterpolation.H:76
Foam::patchTransformedInterpolation::interpolate
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Definition: patchTransformedInterpolation.C:100
Foam::patchTransformedInterpolation::getPatches
labelList getPatches(Istream &entry) const
Get patches from the input stream.
Definition: patchTransformedInterpolation.C:51
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::patchTransformedInterpolation
Interpolation of cell-based displacements to the points with additional correction of patch-adjacent ...
Definition: patchTransformedInterpolation.H:69
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
motionInterpolation.H