rtx-cfd: PatchConvection::TvdVanAlbada — van Albada deferred correction on the curvilinear predictor (downwind-side linear weight, gradient-ratio r over the face d lengths, far-upwind across the opposite face, boundary faces upwind); annulus MMS orders 2.10/1.69 at 0.24× upwind; cylinder-flag MMS orders 1.98/1.97 (1.06× upwind — diffusion-dominated, recorded); knobs RTX_OVERSET_CFD1_TVD, RTX_OVERSET_MAX_ROUNDS, RTX_CF_SCHEME
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Build CPU-Only (Explicit) (push) Canceled after 0s
Documentation / Build User Guide (push) Canceled after 0s
CI / Format Check (push) Canceled after 0s
CI / Clippy Check (push) Canceled after 0s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Build (ubuntu-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
Performance Benchmarks / Run Benchmarks (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Documentation / Build API Documentation (push) Canceled after 0s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X2GmJXeQ2njUecEKiJZ1G2
This commit is contained in:
Omar Sobh
2026-09-06 00:21:48 -07:00
co-authored by Claude Fable 5.1
parent 02c855b9c4
commit 5f780447de
7 changed files with 155 additions and 8 deletions
@@ -81,7 +81,7 @@ async fn march(
normal_diffusion: diffusion,
..CurvilinearParameters::default()
};
let convecting = convection == PatchConvection::Upwind;
let convecting = convection != PatchConvection::None;
let mut solver = CurvilinearPisoSolver::new(config, params, mesh)?;
solver.set_boundary_velocity(|x, y, _t| (u_exact(x, y), v_exact(x, y)));
solver.set_momentum_source(move |x, y, _t| source(x, y, convecting));
@@ -242,6 +242,45 @@ async fn skewed_annulus_with_upwind_is_first_order() -> CfdResult<()> {
Ok(())
}
/// P4 step 2 gate (ii): the van Albada deferred correction on the skewed
/// annulus beats upwind at every rung (upwind: 1.151502e-1 / 5.445770e-2 /
/// 3.119486e-2) with orders >= 1.4.
#[tokio::test]
async fn skewed_annulus_with_tvd_beats_upwind() -> CfdResult<()> {
let upwind = [1.151502e-1, 5.445770e-2, 3.119486e-2];
let mut errs = Vec::new();
for (&ns, &u) in [32usize, 64, 128].iter().zip(&upwind) {
let m = march(
annulus_skewed([0.0, 0.0], 0.5, 1.5, ns, ns / 4, 0.3, 3.0)?,
PatchConvection::TvdVanAlbada,
NormalDiffusion::Explicit,
1e-6,
)
.await?;
println!(
"annulus tvd ns={ns}: L2 {:.6e} (upwind {u:.6e}, ratio {:.2}), max div {:.2e}, {} steps",
m.l2_velocity,
m.l2_velocity / u,
m.max_div_rel,
m.steps
);
assert!(m.max_div_rel < 1e-9, "divergence {:.3e}", m.max_div_rel);
assert!(
m.l2_velocity < u,
"TVD {:.4e} not below upwind {u:.4e}",
m.l2_velocity
);
errs.push(m.l2_velocity);
}
let o = orders(&errs);
println!("annulus tvd orders {o:?}");
assert!(
o.iter().all(|&x| x >= 1.4),
"tvd orders {o:?} (gate >= 1.4)"
);
Ok(())
}
#[tokio::test]
async fn snapshot_restore_rerun_is_bit_identical() -> CfdResult<()> {
let mesh = annulus_skewed([0.0, 0.0], 0.5, 1.5, 24, 6, 0.3, 2.0)?;