1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 surfaceDisplacementPointPatchVectorField
28 Displacement fixed by projection onto triSurface.
29 Use in a displacement fvMotionSolver
30 as a bc on the pointDisplacement field.
32 Calculates the projection onto the surface according
35 - POINTNORMAL : intersection with point normal
36 - FIXEDNORMAL : intersection with fixed vector
38 This displacement is then clipped with the specified velocity * deltaT.
40 Optionally (intersection only) removes a component ("wedgePlane") to
44 - geometry : dictionary with searchableSurfaces. (usually
45 triSurfaceMeshes in constant/triSurface)
46 - projectMode : see above
47 - projectDirection : if projectMode = fixedNormal
48 - wedgePlane : -1 or component to knock out of intersection normal
49 - frozenPointsZone : empty or name of pointZone containing points
53 surfaceDisplacementPointPatchVectorField.C
55 \*---------------------------------------------------------------------------*/
57 #ifndef surfaceDisplacementPointPatchVectorField_H
58 #define surfaceDisplacementPointPatchVectorField_H
60 #include "pointPatchFields.H"
61 #include "fixedValuePointPatchFields.H"
62 #include "searchableSurfaces.H"
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 /*---------------------------------------------------------------------------*\
71 Class surfaceDisplacementPointPatchVectorField Declaration
72 \*---------------------------------------------------------------------------*/
74 class surfaceDisplacementPointPatchVectorField
76 public FixedValuePointPatchField
101 //- project mode names
102 static const NamedEnum<projectMode, 3> projectModeNames_;
105 const vector velocity_;
107 //- names of surfaces
108 const dictionary surfacesDict_;
110 //- How to project/project onto surface
111 const projectMode projectMode_;
113 //- direction to project
114 const vector projectDir_;
116 //- plane for 2D wedge case or -1.
117 const label wedgePlane_;
119 //- pointZone with frozen points
120 const word frozenPointsZone_;
122 //- Demand driven: surface to project
123 mutable autoPtr<searchableSurfaces> surfacesPtr_;
126 // Private Member Functions
128 //- Calculate displacement (w.r.t. points0()) to project onto surface
129 void calcProjection(vectorField& displacement) const;
132 //- Disallow default bitwise assignment
133 void operator=(const surfaceDisplacementPointPatchVectorField&);
137 //- Runtime type information
138 TypeName("surfaceDisplacement");
143 //- Construct from patch and internal field
144 surfaceDisplacementPointPatchVectorField
147 const DimensionedField<vector, pointMesh>&
150 //- Construct from patch, internal field and dictionary
151 surfaceDisplacementPointPatchVectorField
154 const DimensionedField<vector, pointMesh>&,
158 //- Construct by mapping given patchField<vector> onto a new patch
159 surfaceDisplacementPointPatchVectorField
161 const surfaceDisplacementPointPatchVectorField&,
163 const DimensionedField<vector, pointMesh>&,
164 const PointPatchFieldMapper&
167 //- Construct as copy
168 surfaceDisplacementPointPatchVectorField
170 const surfaceDisplacementPointPatchVectorField&
173 //- Construct and return a clone
174 virtual autoPtr<pointPatchVectorField> clone() const
176 return autoPtr<pointPatchVectorField>
178 new surfaceDisplacementPointPatchVectorField
185 //- Construct as copy setting internal field reference
186 surfaceDisplacementPointPatchVectorField
188 const surfaceDisplacementPointPatchVectorField&,
189 const DimensionedField<vector, pointMesh>&
192 //- Construct and return a clone setting internal field reference
193 virtual autoPtr<pointPatchVectorField> clone
195 const DimensionedField<vector, pointMesh>& iF
198 return autoPtr<pointPatchVectorField>
200 new surfaceDisplacementPointPatchVectorField
210 //- Surface to follow. Demand loads surfaceNames.
211 const searchableSurfaces& surfaces() const;
213 //- Update the coefficients associated with the patch field
214 virtual void updateCoeffs();
217 virtual void write(Ostream&) const;
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 // ************************************************************************* //