mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: faceOnlySet sampling does not stop at 'end' (closes #745)
This commit is contained in:
@ -54,6 +54,8 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
DynamicList<scalar>& samplingCurveDist
|
DynamicList<scalar>& samplingCurveDist
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const vector offset = (end_ - start_);
|
||||||
|
|
||||||
particle::trackingData td(particleCloud);
|
particle::trackingData td(particleCloud);
|
||||||
|
|
||||||
point trackPt = singleParticle.position();
|
point trackPt = singleParticle.position();
|
||||||
@ -75,9 +77,10 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
samplingCurveDist.append(mag(trackPt - start_));
|
samplingCurveDist.append(mag(trackPt - start_));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mag(trackPt - end_) < smallDist)
|
if (-smallDist < ((trackPt - end_) & offset))
|
||||||
{
|
{
|
||||||
// End reached
|
// Projected onto sampling vector
|
||||||
|
// - done when we are near or past the end of the sampling vector
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (singleParticle.onBoundaryFace())
|
else if (singleParticle.onBoundaryFace())
|
||||||
|
|||||||
@ -52,5 +52,6 @@ maxAlphaCo 1;
|
|||||||
|
|
||||||
maxDeltaT 1;
|
maxDeltaT 1;
|
||||||
|
|
||||||
|
#includeIfPresent "sampling"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object sampling;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
sampleSets
|
||||||
|
{
|
||||||
|
type sets;
|
||||||
|
libs ("libsampling.so");
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
writeInterval 1;
|
||||||
|
|
||||||
|
setFormat vtk;
|
||||||
|
interpolationScheme cellPointFace;
|
||||||
|
fields ( alpha.water );
|
||||||
|
|
||||||
|
sets
|
||||||
|
(
|
||||||
|
gauge_1
|
||||||
|
{
|
||||||
|
type face;
|
||||||
|
axis y;
|
||||||
|
start (0.02 0.20 0.005);
|
||||||
|
end (0.02 0.25 0.005);
|
||||||
|
nPoints 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
gauge_2
|
||||||
|
{
|
||||||
|
type face;
|
||||||
|
axis y;
|
||||||
|
start (0.2 0.03 0.005);
|
||||||
|
end (0.2 0.55 0.005);
|
||||||
|
nPoints 100;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user