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
f09d9852
Commit
f09d9852
authored
Jul 12, 2018
by
mattijs
Browse files
BUG: particle: locate can get stuck on cell centre. Fixes
#935
.
parent
d82deea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/basic/particle/particle.C
View file @
f09d9852
...
...
@@ -424,14 +424,18 @@ void Foam::particle::locate
<<
exit
(
FatalError
);
}
// Put the particle at the cell centre and in a random tet
coordinates_
=
barycentric
(
1
,
0
,
0
,
0
);
// Put the particle at (almost) the cell centre and in a random tet.
// Note perturbing the cell centre to make sure we find at least one
// tet containing it. With start point exactly at the cell centre very
// occasionally it would not get found in any of the tets
coordinates_
=
barycentric
(
1
-
3
*
SMALL
,
SMALL
,
SMALL
,
SMALL
);
tetFacei_
=
mesh_
.
cells
()[
celli_
][
0
];
tetPti_
=
1
;
facei_
=
-
1
;
// Track to the injection point
track
(
position
-
mesh_
.
cellCentres
()[
celli_
],
0
);
track
(
position
-
this
->
position
(),
0
);
if
(
!
onFace
())
{
return
;
...
...
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