1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 surfaceDisplacementPointPatchVectorField
29 Displacement fixed by projection onto triSurface.
30 Use in a displacement fvMotionSolver
31 as a bc on the pointDisplacement field.
33 Calculates the projection onto the surface according
36 - POINTNORMAL : intersection with point normal
37 - FIXEDNORMAL : intersection with fixed vector
39 This displacement is then clipped with the specified velocity * deltaT.
41 Optionally (intersection only) removes a component ("wedgePlane") to
45 - geometry : dictionary with searchableSurfaces. (usually
46 triSurfaceMeshes in constant/triSurface)
47 - projectMode : see above
48 - projectDirection : if projectMode = fixedNormal
49 - wedgePlane : -1 or component to knock out of intersection normal
50 - frozenPointsZone : empty or name of pointZone containing points
54 surfaceDisplacementPointPatchVectorField.C
56 \*---------------------------------------------------------------------------*/
58 #ifndef surfaceDisplacementPointPatchVectorField_H
59 #define surfaceDisplacementPointPatchVectorField_H
61 #include "pointPatchFields.H"
62 #include "fixedValuePointPatchFields.H"
63 #include "searchableSurfaces.H"
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 /*---------------------------------------------------------------------------*\
72 Class surfaceDisplacementPointPatchVectorField Declaration
73 \*---------------------------------------------------------------------------*/
75 class surfaceDisplacementPointPatchVectorField
77 public FixedValuePointPatchField
102 //- project mode names
103 static const NamedEnum<projectMode, 3> projectModeNames_;
106 const vector velocity_;
108 //- names of surfaces
109 const dictionary surfacesDict_;
111 //- How to project/project onto surface
112 const projectMode projectMode_;
114 //- direction to project
115 const vector projectDir_;
117 //- plane for 2D wedge case or -1.
118 const label wedgePlane_;
120 //- pointZone with frozen points
121 const word frozenPointsZone_;
123 //- Demand driven: surface to project
124 mutable autoPtr<searchableSurfaces> surfacesPtr_;
127 // Private Member Functions
129 //- Calculate displacement (w.r.t. points0()) to project onto surface
130 void calcProjection(vectorField& displacement) const;
133 //- Disallow default bitwise assignment
134 void operator=(const surfaceDisplacementPointPatchVectorField&);
138 //- Runtime type information
139 TypeName("surfaceDisplacement");
144 //- Construct from patch and internal field
145 surfaceDisplacementPointPatchVectorField
148 const DimensionedField<vector, pointMesh>&
151 //- Construct from patch, internal field and dictionary
152 surfaceDisplacementPointPatchVectorField
155 const DimensionedField<vector, pointMesh>&,
159 //- Construct by mapping given patchField<vector> onto a new patch
160 surfaceDisplacementPointPatchVectorField
162 const surfaceDisplacementPointPatchVectorField&,
164 const DimensionedField<vector, pointMesh>&,
165 const PointPatchFieldMapper&
168 //- Construct as copy
169 surfaceDisplacementPointPatchVectorField
171 const surfaceDisplacementPointPatchVectorField&
174 //- Construct and return a clone
175 virtual autoPtr<pointPatchVectorField> clone() const
177 return autoPtr<pointPatchVectorField>
179 new surfaceDisplacementPointPatchVectorField
186 //- Construct as copy setting internal field reference
187 surfaceDisplacementPointPatchVectorField
189 const surfaceDisplacementPointPatchVectorField&,
190 const DimensionedField<vector, pointMesh>&
193 //- Construct and return a clone setting internal field reference
194 virtual autoPtr<pointPatchVectorField> clone
196 const DimensionedField<vector, pointMesh>& iF
199 return autoPtr<pointPatchVectorField>
201 new surfaceDisplacementPointPatchVectorField
211 //- Surface to follow. Demand loads surfaceNames.
212 const searchableSurfaces& surfaces() const;
214 //- Update the coefficients associated with the patch field
215 virtual void updateCoeffs();
218 virtual void write(Ostream&) const;
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 } // End namespace Foam
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 // ************************************************************************* //