Repository navigation
Fix issues #233-#239 - #265
Merged
WeiqunZhang merged 7 commits intoSep 21, 2026
Merged
Conversation
AMReX-Fluids#233 compute_MAC_projected_velocities: the direction_dependent inflow tests read a zeroed scratch MultiFab, whose ghost cells hold the interior copy (0) on the outflow part of an in/out face. The non-strict >= / <= tests therefore treated that as zero inflow and overwrote the extrapolated outflow face velocity with 0, after which Hydro aborts with "no outflow from the direction dependent boundaries". Make the tests strict. AMReX-Fluids#234 IncfloVelFill: the Burggraf (probtype 16) lid profile 16 x^2 (1-x)^2 is the tangential velocity u on the high-y wall, not the normal velocity v. The PR AMReX-Fluids#122 refactor assigned it to norm_vel, so benchmark.burggraf ran a uniform-speed lid with a spurious normal velocity through it. Restore the pre-AMReX-Fluids#122 behaviour. AMReX-Fluids#235 init_plane_poiseuille: probtype 43 shared probtype 42's zero initial velocity, so the outflow part of its direction_dependent x faces started at 0 and InitialProjection's in/out solvability check saw no outflux. Give probtype 43 the zero-net-flux profile u = 6y(1-y)-1 that IncfloVelFill imposes on those faces. AMReX-Fluids#236 ComputeDt: the explicit-diffusion limit used the constant m_mu, ignoring the strain-rate dependent viscosity and the tracer/temperature diffusivities, which are advanced explicitly by the same m_diff_type switch. Build the effective diffusivity per cell from compute_viscosity_at_level, max_n mu_s[n] and mu_T/cp, divide by rho, and take its max. AMReX-Fluids#237 particleData.Redistribute() inside RemakeLevel / MakeNewLevelFromCoarse runs before AmrCore::regrid installs the new BoxArrays, DistributionMappings and finest_level, so it redistributes against the old layout and the first step after a regrid indexes u_mac with stale grid indices. Redistribute once after regrid() returns instead. AMReX-Fluids#238 ApplyPredictor advected the tracer particles during InitialIterations. The fields are restored after each initial iteration but the particle positions are not, so the particles started the run m_initial_iterations*dt ahead of the fluid. Skip the advection when incremental_projection is set. AMReX-Fluids#239 IncfloDenFill / IncfloTracFill / IncfloTempFill never wrote the outflow part of a direction_dependent face (filcc has no case for that BC type and the functors were inflow-only), and decided inflow/outflow from the raw input velocity rather than the probtype profile that IncfloVelFill uses. Factor the prescribed normal velocity into incflo_bc_normal_velocity(), use it in all four functors, and give the scalar functors the same "outflow: copy the first interior cell" branch IncfloVelFill has. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
WeiqunZhang
approved these changes
Sep 21, 2026
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #233, #234, #235, #236, #237, #238, #239.
What's in here
src/convection/incflo_compute_MAC_projected_velocities.cppdirection_dependentinflow tests read a zeroed scratch MultiFab, whose ghost cells hold the interior copy (0) on the outflow part of an in/out face. The non-strict>=/<=tests treated that as zero inflow and overwrote the extrapolated outflow face velocity with 0, after which Hydro aborts with "no outflow from the direction dependent boundaries". Tests made strict.src/prob/prob_bc.H16x²(1-x)²is the tangential velocityuon the high-y wall, not the normal velocityv. The PR #122 refactor assigned it tonorm_vel, sobenchmark.burggrafran a uniform-speed lid with a spurious normal velocity through it. Pre-#122 behaviour restored.src/prob/prob_init_fluid.cppdirection_dependentx faces started at 0 andInitialProjection's in/out solvability check saw no outflux. probtype 43 now starts from the zero-net-flux profileu = 6y(1-y)-1thatIncfloVelFillimposes on those faces.src/incflo_compute_dt.cppm_mu, ignoring the strain-rate dependent viscosity and the tracer/temperature diffusivities, which are advanced explicitly by the samem_diff_typeswitch. The effective diffusivity is now built per cell fromcompute_viscosity_at_level,max_n mu_s[n]andmu_T/cp, divided by rho, with covered cells zeroed.src/incflo_regrid.cpp,src/incflo.cppparticleData.Redistribute()insideRemakeLevel/MakeNewLevelFromCoarseruns beforeAmrCore::regridinstalls the new BoxArrays, DistributionMappings andfinest_level, so it redistributed against the old layout and the first step after a regrid indexedu_macwith stale grid indices. Now redistributes once afterregrid()returns.src/incflo_apply_predictor.cppApplyPredictoradvected the tracer particles duringInitialIterations. The fields are restored after each initial iteration but the particle positions are not, so particles started the runm_initial_iterations*dtahead of the fluid. Skipped whenincremental_projectionis set.src/prob/prob_bc.HIncfloDenFill/IncfloTracFill/IncfloTempFillnever wrote the outflow part of adirection_dependentface (filcc has no case for that BC type and the functors were inflow-only), and decided inflow/outflow from the raw input velocity rather than the probtype profileIncfloVelFilluses. The prescribed normal velocity is factored intoincflo_bc_normal_velocity(), used by all four functors, and the scalar functors gained the same "outflow: copy the first interior cell" branchIncfloVelFillhas.Verification
Baseline below is pristine
ab031bed; both built DOUBLE/optimized. All five build configurations (2D/3D × EB/no-EB, plusUSE_PARTICLES=TRUE) compile with no new diagnostics.#233 + #235 —
benchmark.inout: baseline aborts"Cannot enforce solvability, no outflow from the direction dependent boundaries"; with these fixes it runs all 10 steps in both 2D and 3D.#234 — Burggraf
uerror at steady state (stop_time=20):Second order (Norm2 orders 1.91, 1.98) where the baseline error was O(1) and non-convergent. 3D at N=16 agrees: 0.428 → 0.0102.
#236 — Bingham (
mu=1, tau_0=1, papa_reg=1e-3) withdiffusion_type=0: baseline dt = 4.883e-5, fixed dt = 4.878e-8 — a factor of 1001, exactlyeta(sr→0)/mu.#237 —
rayleigh_taylorwithamr.max_level=2 amr.regrid_int=2and tracer particles: baseline segfaults (exit 11) on the step after the first regrid; fixed runs 12 steps through 5 regrids.#238 —
plt00000particle data withinitial_iterations0 vs 3 (Godunov): baseline differs, fixed is identical.No regressions —
pltfiles bit-identical to baseline (fcompare) on 24 benchmarks: 5 intest_no_eb_2d, 5 intest_2d, 9 intest_no_eb_3d, 10 intest_3d— including every 3D-only probtype routed through the new helper (311, 32, 322, 33, 333, 1102, 41, 42).Pre-existing issues noticed while testing (not addressed here)
init_burggraf(prob_init_fluid.cpp) usesx = (i+0.5)*dx - 0.5, i.e. a domain shifted to [-0.5, 0.5], whileDiffFromExactand the probtype-16 forcing usex = (i+0.5)*dx. The IC is not the exact solution it is meant to be.benchmark.burggrafsetsstop_time = 5, which does not reach steady state — the 32² error is 0.040 at t=5 versus 0.0033 at t≥15.test_convergence_burggraftherefore measures a transient and needsstop_time ≈ 15-20to show the convergence above.benchmark.inout'sfixed_dt = 0.01exceeds the CFL limit by ~7× with the corrected IC (the warning is printed; the run is stable since the problem is inviscid).test_no_eb_3d/benchmark.burggrafsets a 2-componentamr.n_cell, so it aborts in 3D before doing anything; at 32×32×8 the nodal MLMG then fails identically in baseline and with these fixes.PRECISION = FLOAT) MLMG cannot reach its defaultrtol, so most benchmarks abort with "Failed to converge" regardless of this branch — e.g. untouchedbenchmark.double_shear_layerstalls atresid/bnorm = 1.65e-6.🤖 Generated with Claude Code