You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ApplyPredictor(true) advects tracer particles during InitialIterations: fields are reset after each initial iteration but particle positions are not, so particles start the run m_initial_iterations*dt ahead of the fluid #238
Severity: medium · Category: correctness Locations:src/incflo_apply_predictor.cpp:229-235, src/setup/init.cpp:484-494, src/particles/incflo_Tracers.cpp:69-87, src/utilities/io.cpp:361 Based on commit 46de3367 (line numbers refer to that tree).
The defect
InitialIterations (init.cpp:484-494) calls ApplyPredictor(true)m_initial_iterations times (default 3) and
after each call restores the state with copy_from_old_to_new_{velocity,density,tracer,temperature}(): the
iterations exist only to converge the initial pressure/gp, and the fluid state is meant to be unchanged
when Evolve starts. ApplyPredictor, however, ends with
unconditionally on incremental_projection. evolveTracerParticles -> incflo_PC::AdvectWithFlow moves the
particles by m_dt with the MAC velocities of that iteration, and nothing in InitialIterations moves them
back (there is no old/new copy of particle positions). With Godunov/BDS the particles are therefore advanced m_initial_iterations pseudo-steps of m_dt = init_shrink*dt_cfl before step 1, while the fluid is not.
With MOL the particles are advected in ApplyCorrector, which the initial iterations never call, so MOL is
unaffected -- another Godunov-vs-MOL asymmetry that changes answers.
Why it matters
Every particle trajectory is offset from the flow by m_initial_iterations*m_dt (default 3 x 0.1 x dt_cfl,
larger with incflo.init_shrink closer to 1). The plt00000 written by InitData right after InitialIterations (io.cpp:361 writes the particles into every plotfile) no longer shows the initial
particle positions, and chk00000 restarts from the displaced particles. For a tracer-particle validation
(e.g. comparing particle paths to streamlines of a Taylor-Green or Rayleigh-Taylor run) this is a systematic
phase error present from t = 0.
How to reach it
Any -DINCFLO_PARTICLES=ON build, any DIM, EB or not, with incflo.use_tracer_particles = 1, incflo.advection_type = Godunov (default) and incflo.initial_iterations > 0 (default 3). Example: test_no_eb_2d/benchmark.taylor_green_vortices plus incflo.use_tracer_particles = 1; compare the particle
positions in plt00000 with the seeding pattern of incflo_PCInit -- they have already moved. Setting incflo.initial_iterations = 0 makes the displacement disappear, confirming the source.
Suggested fix
Skip the particle advection in the initial-iteration calls (incremental_projection is true only from InitialIterations; Advance always calls ApplyPredictor() with the default false).
--- a/src/incflo_apply_predictor.cpp+++ b/src/incflo_apply_predictor.cpp@@ -229,7 +229,9 @@
// **************************************************************************************
// Update the particle positions
// **************************************************************************************
- if (m_advection_type != "MOL") {+ // Not during the initial pressure iterations: the fields are reset after+ // each of those, but particle positions would not be.+ if (m_advection_type != "MOL" && !incremental_projection) {
evolveTracerParticles(AMREX_D_DECL(GetVecOfConstPtrs(u_mac), GetVecOfConstPtrs(v_mac),
GetVecOfConstPtrs(w_mac)));
}
(audit/notes/T3-scratch/009.diff, checked with git apply --check.)
Activity
Fix issues #233-#239 (#265)
asalmgren commentedon Sep 21, 2026
closed by #265