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-2023 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, internal field and dictionary
125  (
126  const pointPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given patchField<vector> onto a new patch
133  (
135  const pointPatch&,
137  const pointPatchFieldMapper&
138  );
139 
140  //- Disallow copy without setting internal field reference
142  (
144  ) = delete;
145 
146  //- Copy constructor setting internal field reference
148  (
151  );
152 
153  //- Construct and return a clone setting internal field reference
155  (
157  ) const
158  {
160  (
162  (
163  *this,
164  iF
165  )
166  );
167  }
168 
169  // Member Functions
170 
171  //- Surface to follow. Demand loads surfaceNames.
172  const searchableSurfaces& surfaces() const;
173 
174  //- Update the patch field
175  virtual void evaluate
176  (
178  );
179 
180  //- Write
181  virtual void write(Ostream&) const;
182 
183 
184  // Member Operators
185 
186  //- Disallow default bitwise assignment
187  void operator=
188  (
190  ) = delete;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
commsTypes
Types of communications.
Definition: UPstream.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
autoPtr< pointPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:57
Container for searchableSurfaces.
Displacement follows a triSurface. Use in a displacementMotionSolver as a bc on the pointDisplacement...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Update the patch field.
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
surfaceSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("surfaceSlipDisplacement")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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