mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: searchableCylinder: handling of normal outside cylinder
This commit is contained in:
@ -672,41 +672,41 @@ void Foam::searchableCylinder::getNormal
|
|||||||
{
|
{
|
||||||
if ((magV-radius_) < mag(parallel))
|
if ((magV-radius_) < mag(parallel))
|
||||||
{
|
{
|
||||||
// above endcap
|
// either above endcap (magV<radius) or outside but closer
|
||||||
normal[i] = -unitDir_;
|
normal[i] = -unitDir_;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
normal[i] = v/mag(v);
|
normal[i] = v/magV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (parallel <= 0.5*magDir_)
|
else if (parallel <= 0.5*magDir_)
|
||||||
{
|
{
|
||||||
// See if endcap closer or sidewall
|
// See if endcap closer or sidewall
|
||||||
if (parallel <= mag(magV-radius_))
|
if (magV >= radius_ || (radius_-magV) < parallel)
|
||||||
{
|
{
|
||||||
// above endcap
|
normal[i] = v/magV;
|
||||||
normal[i] = -unitDir_;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
normal[i] = v/mag(v);
|
// closer to endcap
|
||||||
|
normal[i] = -unitDir_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (parallel <= magDir_)
|
else if (parallel <= magDir_)
|
||||||
{
|
{
|
||||||
// See if endcap closer or sidewall
|
// See if endcap closer or sidewall
|
||||||
if ((magDir_-parallel) <= mag(magV-radius_))
|
if (magV >= radius_ || (radius_-magV) < (magDir_-parallel))
|
||||||
{
|
{
|
||||||
// above endcap
|
normal[i] = v/magV;
|
||||||
normal[i] = unitDir_;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
normal[i] = v/mag(v);
|
// closer to endcap
|
||||||
|
normal[i] = unitDir_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // beyong cylinder
|
else // beyond cylinder
|
||||||
{
|
{
|
||||||
if ((magV-radius_) < (parallel-magDir_))
|
if ((magV-radius_) < (parallel-magDir_))
|
||||||
{
|
{
|
||||||
@ -715,7 +715,7 @@ void Foam::searchableCylinder::getNormal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
normal[i] = v/mag(v);
|
normal[i] = v/magV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user