surfaceSlipDisplacementPointPatchVectorField.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) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::surfaceSlipDisplacementPointPatchVectorField
28
29Description
30 Displacement follows a triSurface. Use in a displacementMotionSolver
31 as a bc on the pointDisplacement field.
32 Following is done by calculating the projection onto the surface according
33 to the projectMode
34 - NEAREST : nearest
35 - POINTNORMAL : intersection with point normal
36 - FIXEDNORMAL : intersection with fixed vector
37
38 Optionally (intersection only) removes a component ("wedgePlane") to
39 stay in 2D.
40
41 Needs:
42 - geometry : dictionary with searchableSurfaces. (usually
43 triSurfaceMeshes in constant/triSurface)
44 - projectMode : see above
45 - projectDirection : if projectMode = fixedNormal
46 - wedgePlane : -1 or component to knock out of intersection normal
47 - frozenPointsZone : empty or name of pointZone containing points
48 that do not move
49
50SourceFiles
51 surfaceSlipDisplacementPointPatchVectorField.C
52
53\*---------------------------------------------------------------------------*/
54
55#ifndef surfaceSlipDisplacementPointPatchVectorField_H
56#define surfaceSlipDisplacementPointPatchVectorField_H
57
58#include "pointPatchFields.H"
59#include "searchableSurfaces.H"
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65
66/*---------------------------------------------------------------------------*\
67 Class surfaceSlipDisplacementPointPatchVectorField Declaration
68\*---------------------------------------------------------------------------*/
71:
73{
74
75public:
76
77 // Public data types
79 enum projectMode
80 {
84 };
85
86private:
87
88 // Private data
89
90 //- Project mode names
91 static const Enum<projectMode> projectModeNames_;
92
93 //- Names of surfaces
94 const dictionary surfacesDict_;
95
96 //- How to project/project onto surface
97 const projectMode projectMode_;
98
99 //- Direction to project
100 const vector projectDir_;
101
102 //- Plane for 2D wedge case or -1.
103 const label wedgePlane_;
104
105 //- pointZone with frozen points
106 const word frozenPointsZone_;
107
108 //- Demand driven: surface to project
109 mutable autoPtr<searchableSurfaces> surfacesPtr_;
110
111
112 // Private Member Functions
113
114 //- Calculate displacement (w.r.t. points0()) to project onto surface
115 void calcProjection(vectorField& displacement) const;
116
117 //- No copy assignment
118 void operator=
119 (
121 ) = delete;
122
123
124public:
125
126 //- Runtime type information
127 TypeName("surfaceSlipDisplacement");
128
129
130 // Constructors
131
132 //- Construct from patch and internal field
134 (
135 const pointPatch&,
137 );
138
139 //- Construct from patch, internal field and dictionary
141 (
142 const pointPatch&,
144 const dictionary&
145 );
146
147 //- Construct by mapping given patchField<vector> onto a new patch
149 (
151 const pointPatch&,
154 );
155
156 //- Construct as copy
158 (
160 );
161
162 //- Construct and return a clone
164 {
166 (
168 (
169 *this
170 )
171 );
172 }
173
174 //- Construct as copy setting internal field reference
176 (
179 );
180
181 //- Construct and return a clone setting internal field reference
183 (
185 ) const
186 {
188 (
190 (
191 *this,
192 iF
193 )
194 );
195 }
196
197 // Member Functions
198
199 //- Surface to follow. Demand loads surfaceNames.
200 const searchableSurfaces& surfaces() const;
201
202 //- Update the patch field
203 virtual void evaluate
204 (
206 );
207
208 //- Write
209 virtual void write(Ostream&) const;
210};
211
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215} // End namespace Foam
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219#endif
220
221// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
commsTypes
Types of communications.
Definition: UPstream.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Foam::pointPatchFieldMapper.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
Displacement follows a triSurface. Use in a displacementMotionSolver as a bc on the pointDisplacement...
virtual autoPtr< pointPatchVectorField > clone(const DimensionedField< vector, pointMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Update the patch field.
TypeName("surfaceSlipDisplacement")
Runtime type information.
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
virtual autoPtr< pointPatchVectorField > clone() const
Construct and return a clone.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73