Lagrangian: Rewrite of the particle tracking algorithm to function in
terms of the local barycentric coordinates of the current tetrahedron, rather than the global coordinate system. Barycentric tracking works on any mesh, irrespective of mesh quality. Particles do not get "lost", and tracking does not require ad-hoc "corrections" or "rescues" to function robustly, because the calculation of particle-face intersections is unambiguous and reproducible, even at small angles of incidence. Each particle position is defined by topology (i.e. the decomposed tet cell it is in) and geometry (i.e. where it is in the cell). No search operations are needed on restart or reconstruct, unlike when particle positions are stored in the global coordinate system. The particle positions file now contains particles' local coordinates and topology, rather than the global coordinates and cell. This change to the output format is not backwards compatible. Existing cases with Lagrangian data will not restart, but they will still run from time zero without any modification. This change was necessary in order to guarantee that the loaded particle is valid, and therefore fundamentally prevent "loss" and "search-failure" type bugs (e.g., 2517, 2442, 2286, 1836, 1461, 1341, 1097). The tracking functions have also been converted to function in terms of displacement, rather than end position. This helps remove floating point error issues, particularly towards the end of a tracking step. Wall bounded streamlines have been removed. The implementation proved incompatible with the new tracking algorithm. ParaView has a surface LIC plugin which provides equivalent, or better, functionality. Additionally, bug report <https://bugs.openfoam.org/view.php?id=2517> is resolved by this change.
This commit is contained in:
@ -47,7 +47,6 @@ runTimeModifiable true;
|
||||
functions
|
||||
{
|
||||
#include "streamLines"
|
||||
#include "wallBoundedStreamLines"
|
||||
#include "cuttingPlane"
|
||||
#include "forceCoeffs"
|
||||
}
|
||||
|
||||
@ -1,100 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// Interpolate U to create near-wall UNear
|
||||
near
|
||||
{
|
||||
// Where to load it from
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
type nearWallFields;
|
||||
|
||||
// Output every
|
||||
writeControl writeTime;
|
||||
|
||||
// Calculate every
|
||||
executeControl writeTime;
|
||||
|
||||
// Fields to be sampled. Per field original name and mapped field to
|
||||
// create.
|
||||
// Note: fields only get updated when writing!
|
||||
fields
|
||||
(
|
||||
(U UNear)
|
||||
);
|
||||
|
||||
// Patches/groups to sample (regular expressions)
|
||||
patches (motorBikeGroup);
|
||||
|
||||
// Distance to sample
|
||||
distance 0.001;
|
||||
}
|
||||
|
||||
// Use UNear to track along wall
|
||||
wallBoundedStreamLines
|
||||
{
|
||||
// Where to load it from (if not already in solver)
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
type wallBoundedStreamLine;
|
||||
|
||||
// Output every
|
||||
writeControl writeTime;
|
||||
|
||||
setFormat vtk; //gnuplot; //xmgr; //raw; //jplot;
|
||||
|
||||
// Velocity field to use for tracking.
|
||||
U UNear;
|
||||
|
||||
// Interpolation method. Default is cellPoint.
|
||||
// interpolationScheme pointMVC;
|
||||
|
||||
// Tracked forwards (+U) or backwards (-U)
|
||||
trackForward true;
|
||||
|
||||
interpolationScheme cellPoint;
|
||||
|
||||
// Names of fields to sample. Should contain above velocity field!
|
||||
fields (p U k UNear);
|
||||
|
||||
// Steps particles can travel before being removed
|
||||
lifeTime 100;
|
||||
|
||||
// Cloud name to use
|
||||
cloudName wallBoundedParticleTracks;
|
||||
|
||||
// Seeding method.
|
||||
seedSampleSet
|
||||
{
|
||||
type patchSeed;
|
||||
|
||||
uniformCoeffs
|
||||
{
|
||||
axis x; //distance;
|
||||
|
||||
start (0.0035 0.0999 0.0001);
|
||||
end (0.0035 0.0999 0.0099);
|
||||
nPoints 20;
|
||||
}
|
||||
|
||||
cloudCoeffs
|
||||
{
|
||||
axis x; //distance;
|
||||
points ((0.351516548679288 -0.0116085375585099 1.24));
|
||||
}
|
||||
|
||||
patchSeedCoeffs
|
||||
{
|
||||
patches (motorBikeGroup);
|
||||
axis x; //distance;
|
||||
maxPoints 20000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user