surfaceSlipDisplacementPointPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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::surfaceSlipDisplacementPointPatchVectorField
26 
27 Description
28  Displacement follows a triSurface. Use in a displacementMotionSolver
29  as a bc on the pointDisplacement field.
30  Following is done by calculating the projection onto the surface according
31  to the projectMode
32  - NEAREST : nearest
33  - POINTNORMAL : intersection with point normal
34  - FIXEDNORMAL : intersection with fixed vector
35 
36  Optionally (intersection only) removes a component ("wedgePlane") to
37  stay in 2D.
38 
39  Needs:
40  - geometry : dictionary with searchableSurfaces. (usually
41  triSurfaceMeshes in constant/triSurface)
42  - projectMode : see above
43  - projectDirection : if projectMode = fixedNormal
44  - wedgePlane : -1 or component to knock out of intersection normal
45  - frozenPointsZone : empty or name of pointZone containing points
46  that do not move
47 
48 SourceFiles
49  surfaceSlipDisplacementPointPatchVectorField.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef surfaceSlipDisplacementPointPatchVectorField_H
54 #define surfaceSlipDisplacementPointPatchVectorField_H
55 
56 #include "pointPatchFields.H"
57 #include "searchableSurfaces.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class surfaceSlipDisplacementPointPatchVectorField Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
71 {
72 public:
73 
74  // Public data types
75 
76  enum projectMode
77  {
81  };
82 
83 private:
84 
85  // Private Data
86 
87  //- Project mode names
88  static const NamedEnum<projectMode, 3> projectModeNames_;
89 
90  //- Names of surfaces
91  const dictionary surfacesDict_;
92 
93  //- How to project/project onto surface
94  const projectMode projectMode_;
95 
96  //- Direction to project
97  const vector projectDir_;
98 
99  //- Plane for 2D wedge case or -1.
100  const label wedgePlane_;
101 
102  //- pointZone with frozen points
103  const word frozenPointsZone_;
104 
105  //- Demand driven: surface to project
106  mutable autoPtr<searchableSurfaces> surfacesPtr_;
107 
108 
109  // Private Member Functions
110 
111  //- Calculate displacement (w.r.t. points0()) to project onto surface
112  void calcProjection(vectorField& displacement) const;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("surfaceSlipDisplacement");
119 
120 
121  // Constructors
122 
123  //- Construct from patch and internal field
125  (
126  const pointPatch&,
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const pointPatch&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given patchField<vector> onto a new patch
140  (
142  const pointPatch&,
144  const pointPatchFieldMapper&
145  );
146 
147  //- Disallow copy without setting internal field reference
149  (
151  ) = delete;
152 
153  //- Copy constructor setting internal field reference
155  (
158  );
159 
160  //- Construct and return a clone setting internal field reference
162  (
164  ) const
165  {
167  (
169  (
170  *this,
171  iF
172  )
173  );
174  }
175 
176  // Member Functions
177 
178  //- Surface to follow. Demand loads surfaceNames.
179  const searchableSurfaces& surfaces() const;
180 
181  //- Update the patch field
182  virtual void evaluate
183  (
185  );
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 
190 
191  // Member Operators
192 
193  //- Disallow default bitwise assignment
194  void operator=
195  (
197  ) = delete;
198 };
199 
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
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
Displacement follows a triSurface. Use in a displacementMotionSolver as a bc on the pointDisplacement...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Update the patch field.
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::pointPatchFieldMapper.
TypeName("surfaceSlipDisplacement")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
Container for searchableSurfaces.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
autoPtr< pointPatchField< vector > > clone() const
Disallow clone without setting internal field reference.
surfaceSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.