Loading...
Searching...
No Matches
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 Copyright (C) 2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::surfaceSlipDisplacementPointPatchVectorField
29
30Description
31 Displacement follows a triSurface. Use in a displacementMotionSolver
32 as a bc on the pointDisplacement field.
33 Following is done by calculating the projection onto the surface according
34 to the projectMode
35 - NEAREST : nearest
36 - POINTNORMAL : intersection with point normal
37 - FIXEDNORMAL : intersection with fixed vector
38
39 Optionally (intersection only) removes a component ("wedgePlane") to
40 stay in 2D.
41
42 Needs:
43 - geometry : dictionary with searchableSurfaces. (usually
44 triSurfaceMeshes in constant/triSurface)
45 - projectMode : see above
46 - projectDirection : if projectMode = fixedNormal
47 - wedgePlane : -1 or component to knock out of intersection normal
48 - frozenPointsZone : empty or name of pointZone containing points
49 that do not move
50 - scale : optional scaling factor as PatchFunction1. Note that this
51 is only supported for polyPatch-derived pointPatches
52 ('facePointPatch') and not for stand-alone pointPatches.
53
54
55SourceFiles
56 surfaceSlipDisplacementPointPatchVectorField.C
57
58\*---------------------------------------------------------------------------*/
59
60#ifndef Foam_surfaceSlipDisplacementPointPatchVectorField_H
61#define Foam_surfaceSlipDisplacementPointPatchVectorField_H
62
63#include "pointPatchFields.H"
64#include "searchableSurfaces.H"
65#include "PatchFunction1.H"
66
67// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68
69namespace Foam
70{
72/*---------------------------------------------------------------------------*\
73 Class surfaceSlipDisplacementPointPatchVectorField Declaration
74\*---------------------------------------------------------------------------*/
75
77:
80public:
82 // Public Data Types
84 enum projectMode
85 {
86 NEAREST,
89 };
90
91private:
92
93 // Private data
94
95 //- Project mode names
96 static const Enum<projectMode> projectModeNames_;
97
98 //- Names of surfaces
99 const dictionary surfacesDict_;
100
101 //- How to project/project onto surface
102 const projectMode projectMode_;
103
104 //- Direction to project
105 const vector projectDir_;
106
107 //- Plane for 2D wedge case or -1.
108 const label wedgePlane_;
109
110 //- pointZone with frozen points
111 const word frozenPointsZone_;
112
113 //- Scalar scale factor
115
116 //- Demand driven: surface to project
117 mutable autoPtr<searchableSurfaces> surfacesPtr_;
118
119
120 // Private Member Functions
121
122 //- Calculate displacement (w.r.t. points0()) to project onto surface
123 void calcProjection(vectorField& displacement) const;
124
125 //- No copy assignment
126 void operator=
127 (
129 ) = delete;
130
131
132public:
133
134 //- Runtime type information
135 TypeName("surfaceSlipDisplacement");
136
137
138 // Constructors
139
140 //- Construct from patch and internal field
142 (
143 const pointPatch&,
145 );
146
147 //- Construct from patch, internal field and dictionary
149 (
150 const pointPatch&,
153 );
154
155 //- Construct by mapping given patch field onto a new patch
157 (
159 const pointPatch&,
162 );
163
164 //- Copy construct with internal field reference
166 (
169 );
170
171 //- Copy construct
173 (
175 )
176 :
178 (
179 pfld,
180 pfld.internalField()
181 )
182 {}
183
184
185 //- Return a clone
187 {
188 return pointPatchField<vector>::Clone(*this);
189 }
190
191 //- Construct and return a clone setting internal field reference
192 virtual autoPtr<pointPatchField<vector>> clone
193 (
194 const DimensionedField<vector, pointMesh>& iF
195 ) const
196 {
197 return pointPatchField<vector>::Clone(*this, iF);
198 }
200
201 // Member Functions
202
203 //- Surface to follow. Demand loads surfaceNames.
204 const searchableSurfaces& surfaces() const;
205
206 //- Update the coefficients associated with the patch field
207 virtual void updateCoeffs();
208
209 //- Write
210 virtual void write(Ostream&) const;
211};
212
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216} // End namespace Foam
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#endif
221
222// ************************************************************************* //
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:57
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Foam::pointPatchFieldMapper.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
const DimensionedField< vector, pointMesh > & internalField() const noexcept
Basic pointPatch represents a set of points from the mesh.
Definition pointPatch.H:67
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...
TypeName("surfaceSlipDisplacement")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
surfaceSlipDisplacementPointPatchVectorField(const surfaceSlipDisplacementPointPatchVectorField &pfld)
Copy construct.
virtual autoPtr< pointPatchField< vector > > clone() const
Return a clone.
surfaceSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
virtual autoPtr< pointPatchField< vector > > clone(const DimensionedField< vector, pointMesh > &iF) const
Construct and return a clone setting internal field reference.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
Field< vector > vectorField
Specialisation of Field<T> for vector.
pointPatchField< vector > pointPatchVectorField
Vector< scalar > vector
Definition vector.H:57
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68