mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Limit tracking distance for steady calcs
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user