Commit e2b6e323 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Limit tracking distance for steady calcs

parent 574c23ad
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -340,9 +340,13 @@ bool Foam::KinematicParcel<ParcelType>::move
// will change if a face is hit
label cellI = p.cell();
if (p.active())
const scalar magU = mag(U_);
if (p.active() && magU > ROOTVSMALL)
{
dt *= p.trackToFace(p.position() + dt*U_, td);
const scalar d = mag(dt*U_) + ROOTVSMALL;
const vector n = U_/magU;
const scalar dCorr = min(d, mag(n & mesh.bounds().span()));
dt *= dCorr/d*p.trackToFace(p.position() + dCorr*n, td);
}
tEnd -= dt;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment