Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
3f2d5983
Commit
3f2d5983
authored
Oct 28, 2015
by
mattijs
Browse files
ENH: snappyHexMesh: shoot gap-detection rays perpendicular to the surface
parent
afa6bd50
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementGapRefine.C
View file @
3f2d5983
...
...
@@ -881,7 +881,7 @@ Foam::label Foam::meshRefinement::generateRays
||
(
mode
==
volumeType
::
INSIDE
&&
s
<
-
SMALL
)
)
{
//// Use vector through cell centre
//// Use
single
vector through cell centre
//vector n(v/(magV+ROOTVSMALL));
//
//start.append(cc);
...
...
@@ -893,32 +893,83 @@ Foam::label Foam::meshRefinement::generateRays
//gapSize2.append(nearGap);
// Shoot some rays through the cell centre
// X-direction:
//// Shoot some rays through the cell centre
//// X-direction:
//start.append(cc);
//end.append(cc+nearGap*vector(1, 0, 0));
//gapSize.append(nearGap);
//
//start2.append(cc);
//end2.append(cc-nearGap*vector(1, 0, 0));
//gapSize2.append(nearGap);
//
//// Y-direction:
//start.append(cc);
//end.append(cc+nearGap*vector(0, 1, 0));
//gapSize.append(nearGap);
//
//start2.append(cc);
//end2.append(cc-nearGap*vector(0, 1, 0));
//gapSize2.append(nearGap);
//
//// Z-direction:
//start.append(cc);
//end.append(cc+nearGap*vector(0, 0, 1));
//gapSize.append(nearGap);
//
//start2.append(cc);
//end2.append(cc-nearGap*vector(0, 0, 1));
//gapSize2.append(nearGap);
// 3 axes aligned with normal
// Use vector through cell centre
vector
n
(
v
/
(
magV
+
ROOTVSMALL
));
// Get second vector. Make sure it is sufficiently perpendicular
vector
e2
(
1
,
0
,
0
);
scalar
s
=
(
e2
&
n
);
if
(
mag
(
s
)
<
0
.
9
)
{
e2
-=
s
*
n
;
}
else
{
e2
=
vector
(
0
,
1
,
0
);
e2
-=
(
e2
&
n
)
*
n
;
}
e2
/=
mag
(
e2
);
// Third vector
vector
e3
=
n
^
e2
;
// Rays in first direction
start
.
append
(
cc
);
end
.
append
(
cc
+
nearGap
*
vector
(
1
,
0
,
0
)
);
end
.
append
(
cc
+
nearGap
*
n
);
gapSize
.
append
(
nearGap
);
start2
.
append
(
cc
);
end2
.
append
(
cc
-
nearGap
*
vector
(
1
,
0
,
0
)
);
end2
.
append
(
cc
-
nearGap
*
n
);
gapSize2
.
append
(
nearGap
);
//
Y-
direction
:
//
Rays in second
direction
start
.
append
(
cc
);
end
.
append
(
cc
+
nearGap
*
vector
(
0
,
1
,
0
)
);
end
.
append
(
cc
+
nearGap
*
e2
);
gapSize
.
append
(
nearGap
);
start2
.
append
(
cc
);
end2
.
append
(
cc
-
nearGap
*
vector
(
0
,
1
,
0
)
);
end2
.
append
(
cc
-
nearGap
*
e2
);
gapSize2
.
append
(
nearGap
);
//
Z-
direction
:
//
Rays in third
direction
start
.
append
(
cc
);
end
.
append
(
cc
+
nearGap
*
vector
(
0
,
0
,
1
)
);
end
.
append
(
cc
+
nearGap
*
e3
);
gapSize
.
append
(
nearGap
);
start2
.
append
(
cc
);
end2
.
append
(
cc
-
nearGap
*
vector
(
0
,
0
,
1
)
);
end2
.
append
(
cc
-
nearGap
*
e3
);
gapSize2
.
append
(
nearGap
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment