1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::surfaceSlipDisplacementPointPatchVectorField
28 Displacement follows a triSurface. Use in a displacement fvMotionSolver
29 as a bc on the pointDisplacement field.
30 Following is done by calculating the projection onto the surface according
33 - POINTNORMAL : intersection with point normal
34 - FIXEDNORMAL : intersection with fixed vector
36 Optionally (intersection only) removes a component ("wedgePlane") to
40 - geometry : dictionary with searchableSurfaces. (usually
41 triSurfaceMeshes in constant/triSurface)
42 - projectMode : see above
43 - projectDirection : if projectMode = fixedNormal
44 - wedgePlane : -1 or component to knock out of intersection normal
45 - frozenPointsZone : empty or name of pointZone containing points
49 surfaceSlipDisplacementPointPatchVectorField.C
51 \*---------------------------------------------------------------------------*/
53 #ifndef surfaceSlipDisplacementPointPatchVectorField_H
54 #define surfaceSlipDisplacementPointPatchVectorField_H
56 #include "pointPatchFields.H"
57 #include "searchableSurfaces.H"
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 /*---------------------------------------------------------------------------*\
65 Class surfaceSlipDisplacementPointPatchVectorField Declaration
66 \*---------------------------------------------------------------------------*/
68 class surfaceSlipDisplacementPointPatchVectorField
70 public pointPatchVectorField
88 //- project mode names
89 static const NamedEnum<projectMode, 3> projectModeNames_;
92 const dictionary surfacesDict_;
94 //- How to project/project onto surface
95 const projectMode projectMode_;
97 //- direction to project
98 const vector projectDir_;
100 //- plane for 2D wedge case or -1.
101 const label wedgePlane_;
103 //- pointZone with frozen points
104 const word frozenPointsZone_;
106 //- Demand driven: surface to project
107 mutable autoPtr<searchableSurfaces> surfacesPtr_;
110 // Private Member Functions
112 //- Calculate displacement (w.r.t. points0()) to project onto surface
113 void calcProjection(vectorField& displacement) const;
115 //- Disallow default bitwise assignment
116 void operator=(const surfaceSlipDisplacementPointPatchVectorField&);
121 //- Runtime type information
122 TypeName("surfaceSlipDisplacement");
127 //- Construct from patch and internal field
128 surfaceSlipDisplacementPointPatchVectorField
131 const DimensionedField<vector, pointMesh>&
134 //- Construct from patch, internal field and dictionary
135 surfaceSlipDisplacementPointPatchVectorField
138 const DimensionedField<vector, pointMesh>&,
142 //- Construct by mapping given patchField<vector> onto a new patch
143 surfaceSlipDisplacementPointPatchVectorField
145 const surfaceSlipDisplacementPointPatchVectorField&,
147 const DimensionedField<vector, pointMesh>&,
148 const pointPatchFieldMapper&
151 //- Construct as copy
152 surfaceSlipDisplacementPointPatchVectorField
154 const surfaceSlipDisplacementPointPatchVectorField&
157 //- Construct and return a clone
158 virtual autoPtr<pointPatchVectorField> clone() const
160 return autoPtr<pointPatchVectorField>
162 new surfaceSlipDisplacementPointPatchVectorField
169 //- Construct as copy setting internal field reference
170 surfaceSlipDisplacementPointPatchVectorField
172 const surfaceSlipDisplacementPointPatchVectorField&,
173 const DimensionedField<vector, pointMesh>&
176 //- Construct and return a clone setting internal field reference
177 virtual autoPtr<pointPatchVectorField> clone
179 const DimensionedField<vector, pointMesh>& iF
182 return autoPtr<pointPatchVectorField>
184 new surfaceSlipDisplacementPointPatchVectorField
194 //- Surface to follow. Demand loads surfaceNames.
195 const searchableSurfaces& surfaces() const;
197 //- Update the patch field
198 virtual void evaluate
200 const Pstream::commsTypes commsType=Pstream::blocking
204 virtual void write(Ostream&) const;
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 } // End namespace Foam
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 // ************************************************************************* //