1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 Foam::surfaceSlipDisplacementPointPatchVectorField
29 Displacement follows a triSurface. Use in a displacement fvMotionSolver
30 as a bc on the pointDisplacement field.
31 Following is done by calculating the projection onto the surface according
34 - POINTNORMAL : intersection with point normal
35 - FIXEDNORMAL : intersection with fixed vector
37 Optionally (intersection only) removes a component ("wedgePlane") to
41 - geometry : dictionary with searchableSurfaces. (usually
42 triSurfaceMeshes in constant/triSurface)
43 - projectMode : see above
44 - projectDirection : if projectMode = fixedNormal
45 - wedgePlane : -1 or component to knock out of intersection normal
46 - frozenPointsZone : empty or name of pointZone containing points
50 surfaceSlipDisplacementPointPatchVectorField.C
52 \*---------------------------------------------------------------------------*/
54 #ifndef surfaceSlipDisplacementPointPatchVectorField_H
55 #define surfaceSlipDisplacementPointPatchVectorField_H
57 #include "pointPatchFields.H"
58 #include "searchableSurfaces.H"
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 /*---------------------------------------------------------------------------*\
66 Class surfaceSlipDisplacementPointPatchVectorField Declaration
67 \*---------------------------------------------------------------------------*/
69 class surfaceSlipDisplacementPointPatchVectorField
71 public pointPatchVectorField
89 //- project mode names
90 static const NamedEnum<projectMode, 3> projectModeNames_;
93 const dictionary surfacesDict_;
95 //- How to project/project onto surface
96 const projectMode projectMode_;
98 //- direction to project
99 const vector projectDir_;
101 //- plane for 2D wedge case or -1.
102 const label wedgePlane_;
104 //- pointZone with frozen points
105 const word frozenPointsZone_;
107 //- Demand driven: surface to project
108 mutable autoPtr<searchableSurfaces> surfacesPtr_;
111 // Private Member Functions
113 //- Calculate displacement (w.r.t. points0()) to project onto surface
114 void calcProjection(vectorField& displacement) const;
116 //- Disallow default bitwise assignment
117 void operator=(const surfaceSlipDisplacementPointPatchVectorField&);
122 //- Runtime type information
123 TypeName("surfaceSlipDisplacement");
128 //- Construct from patch and internal field
129 surfaceSlipDisplacementPointPatchVectorField
132 const DimensionedField<vector, pointMesh>&
135 //- Construct from patch, internal field and dictionary
136 surfaceSlipDisplacementPointPatchVectorField
139 const DimensionedField<vector, pointMesh>&,
143 //- Construct by mapping given patchField<vector> onto a new patch
144 surfaceSlipDisplacementPointPatchVectorField
146 const surfaceSlipDisplacementPointPatchVectorField&,
148 const DimensionedField<vector, pointMesh>&,
149 const pointPatchFieldMapper&
152 //- Construct as copy
153 surfaceSlipDisplacementPointPatchVectorField
155 const surfaceSlipDisplacementPointPatchVectorField&
158 //- Construct and return a clone
159 virtual autoPtr<pointPatchVectorField> clone() const
161 return autoPtr<pointPatchVectorField>
163 new surfaceSlipDisplacementPointPatchVectorField
170 //- Construct as copy setting internal field reference
171 surfaceSlipDisplacementPointPatchVectorField
173 const surfaceSlipDisplacementPointPatchVectorField&,
174 const DimensionedField<vector, pointMesh>&
177 //- Construct and return a clone setting internal field reference
178 virtual autoPtr<pointPatchVectorField> clone
180 const DimensionedField<vector, pointMesh>& iF
183 return autoPtr<pointPatchVectorField>
185 new surfaceSlipDisplacementPointPatchVectorField
195 //- Surface to follow. Demand loads surfaceNames.
196 const searchableSurfaces& surfaces() const;
198 //- Update the patch field
199 virtual void evaluate
201 const Pstream::commsTypes commsType=Pstream::blocking
205 virtual void write(Ostream&) const;
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 } // End namespace Foam
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 // ************************************************************************* //