Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
fvMotionSolver
pointPatchFields
derived
surfaceDisplacement
surfaceDisplacementPointPatchVectorField.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 | Copyright (C) 1991-2007 OpenCFD Ltd.
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
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.
15
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
19
for more details.
20
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/>.
23
24
Class
25
surfaceDisplacementPointPatchVectorField
26
27
Description
28
Displacement fixed by projection onto triSurface.
29
Use in a displacement fvMotionSolver
30
as a bc on the pointDisplacement field.
31
32
Calculates the projection onto the surface according
33
to the projectMode
34
- NEAREST : nearest
35
- POINTNORMAL : intersection with point normal
36
- FIXEDNORMAL : intersection with fixed vector
37
38
This displacement is then clipped with the specified velocity * deltaT.
39
40
Optionally (intersection only) removes a component ("wedgePlane") to
41
stay in 2D.
42
43
Needs:
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
50
that do not move
51
52
SourceFiles
53
surfaceDisplacementPointPatchVectorField.C
54
55
\*---------------------------------------------------------------------------*/
56
57
#ifndef surfaceDisplacementPointPatchVectorField_H
58
#define surfaceDisplacementPointPatchVectorField_H
59
60
#include <
OpenFOAM/pointPatchFields.H
>
61
#include <
OpenFOAM/fixedValuePointPatchFields.H
>
62
#include <
meshTools/searchableSurfaces.H
>
63
#include <
OpenFOAM/Switch.H
>
64
65
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66
67
namespace
Foam
68
{
69
70
/*---------------------------------------------------------------------------*\
71
Class surfaceDisplacementPointPatchVectorField Declaration
72
\*---------------------------------------------------------------------------*/
73
74
class
surfaceDisplacementPointPatchVectorField
75
:
76
public
fixedValuePointPatchVectorField
77
{
78
79
public
:
80
81
// Public data types
82
83
enum
projectMode
84
{
85
NEAREST
,
86
POINTNORMAL
,
87
FIXEDNORMAL
88
};
89
90
private
:
91
92
// Private data
93
94
//- project mode names
95
static
const
NamedEnum<projectMode, 3>
projectModeNames_;
96
97
//- Maximum velocity
98
const
vector
velocity_;
99
100
//- names of surfaces
101
const
dictionary
surfacesDict_;
102
103
//- How to project/project onto surface
104
const
projectMode
projectMode_;
105
106
//- direction to project
107
const
vector
projectDir_;
108
109
//- plane for 2D wedge case or -1.
110
const
label wedgePlane_;
111
112
//- pointZone with frozen points
113
const
word
frozenPointsZone_;
114
115
//- Demand driven: surface to project
116
mutable
autoPtr<searchableSurfaces>
surfacesPtr_;
117
118
119
// Private Member Functions
120
121
//- Calculate displacement (w.r.t. points0()) to project onto surface
122
void
calcProjection(
vectorField
& displacement)
const
;
123
124
125
//- Disallow default bitwise assignment
126
void
operator=(
const
surfaceDisplacementPointPatchVectorField
&);
127
128
public
:
129
130
//- Runtime type information
131
TypeName
(
"surfaceDisplacement"
);
132
133
134
// Constructors
135
136
//- Construct from patch and internal field
137
surfaceDisplacementPointPatchVectorField
138
(
139
const
pointPatch
&,
140
const
DimensionedField<vector, pointMesh>
&
141
);
142
143
//- Construct from patch, internal field and dictionary
144
surfaceDisplacementPointPatchVectorField
145
(
146
const
pointPatch
&,
147
const
DimensionedField<vector, pointMesh>
&,
148
const
dictionary
&
149
);
150
151
//- Construct by mapping given patchField<vector> onto a new patch
152
surfaceDisplacementPointPatchVectorField
153
(
154
const
surfaceDisplacementPointPatchVectorField
&,
155
const
pointPatch
&,
156
const
DimensionedField<vector, pointMesh>
&,
157
const
pointPatchFieldMapper
&
158
);
159
160
//- Construct as copy
161
surfaceDisplacementPointPatchVectorField
162
(
163
const
surfaceDisplacementPointPatchVectorField
&
164
);
165
166
//- Construct and return a clone
167
virtual
autoPtr<pointPatchVectorField>
clone
()
const
168
{
169
return
autoPtr<pointPatchVectorField>
170
(
171
new
surfaceDisplacementPointPatchVectorField
172
(
173
*
this
174
)
175
);
176
}
177
178
//- Construct as copy setting internal field reference
179
surfaceDisplacementPointPatchVectorField
180
(
181
const
surfaceDisplacementPointPatchVectorField
&,
182
const
DimensionedField<vector, pointMesh>
&
183
);
184
185
//- Construct and return a clone setting internal field reference
186
virtual
autoPtr<pointPatchVectorField>
clone
187
(
188
const
DimensionedField<vector, pointMesh>
& iF
189
)
const
190
{
191
return
autoPtr<pointPatchVectorField>
192
(
193
new
surfaceDisplacementPointPatchVectorField
194
(
195
*
this
,
196
iF
197
)
198
);
199
}
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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216
}
// End namespace Foam
217
218
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220
#endif
221
222
// ************************ vim: set sw=4 sts=4 et: ************************ //