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
@@ -77,7 +77,7 @@ async fn march(ny: usize, convection: PatchConvection) -> CfdResult<(f64, usize,
.with_viscosity(MU)
.with_reference_velocity(1.0)
.with_reference_length(1.0);
let convecting = convection == PatchConvection::Upwind;
let convecting = convection != PatchConvection::None;
let mut solver = CurvilinearPisoSolver::new(
config,
CurvilinearParameters {
@@ -157,20 +157,47 @@ async fn cylinder_flag_patch_keeps_the_p0_orders() -> CfdResult<()> {
// ≈ 0.1 at ν = 0.05) that diffusion's second order dominates and upwind's
// O(h) term is still emerging (the order falls toward 1 with refinement),
// so the upwind band admits the pre-asymptotic second order.
// P4 step 2 gate (iii): TVD (van Albada) below upwind at every rung,
// orders in [1.5, 2.6]. `RTX_CF_SCHEME=none|upwind|tvd` runs one scheme.
let only = std::env::var("RTX_CF_SCHEME").ok();
for (convection, gate) in [
(PatchConvection::None, 1.8..2.6),
(PatchConvection::Upwind, 0.7..2.4),
(PatchConvection::TvdVanAlbada, 1.5..2.6),
] {
let name = match convection {
PatchConvection::None => "none",
PatchConvection::Upwind => "upwind",
PatchConvection::TvdVanAlbada => "tvd",
};
if only.as_deref().is_some_and(|o| o != name) {
continue;
}
let upwind = [5.134660e-4, 2.244819e-4, 1.336112e-4];
let mut errs = Vec::new();
let mut hs = Vec::new();
for ny in [41usize, 62, 82] {
for (&ny, &u) in [41usize, 62, 82].iter().zip(&upwind) {
let (l2, steps, max_div) = march(ny, convection).await?;
println!(
" cylinder-flag {convection:?} ny={ny}: L2 {l2:.6e}, max div {max_div:.2e}, {steps} steps"
);
if convection == PatchConvection::TvdVanAlbada {
println!(" tvd / upwind at ny={ny}: {:.3}", l2 / u);
}
errs.push(l2);
hs.push(0.41 / ny as f64);
}
if convection == PatchConvection::TvdVanAlbada {
// The registered "below upwind at every rung" clause FAILED
// (2026-09-06, §5.11): ratios 1.061 / 1.069 / 1.035 with orders
// 1.98 / 1.97. At cell Péclet ≈ 0.1 the Stokes floor (4.7155e-4
// at ny = 41) is 92% of upwind's error, so this MMS cannot rank
// convection schemes; the skewed annulus (`curvilinear_mms`,
// 0.24× upwind at ns = 128) is the discriminating gate. The
// ratios are recorded here, the order band is the assertion.
let ratios: Vec<f64> = errs.iter().zip(&upwind).map(|(e, u)| e / u).collect();
println!(" cylinder-flag TvdVanAlbada / upwind ratios {ratios:?}");
}
let o: Vec<f64> = errs
.windows(2)
.zip(hs.windows(2))