embedded3 S2-5: centroid diffusion default ON (RTX_E3_DIFFUSION_CENTROID=0 restores the records); flat_wall_position_is_second_order gate; closure.rs split (cutwall.rs under 700)
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / CI Success (push) Blocked by required conditions
CI / Build (macos-latest) (push) Waiting to run
CI / Format Check (push) Failing after 4s
CI / Clippy Check (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
CI / Build (ubuntu-latest) (push) Failing after 4s
Documentation / Build User Guide (push) Successful in 7s
CI / Build CPU-Only (Explicit) (push) Failing after 54s
Documentation / Build API Documentation (push) Failing after 1m0s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-18 12:37:56 -05:00
co-authored by Claude Fable 5.1
parent 37086300ba
commit 99e4a7214b
6 changed files with 178 additions and 136 deletions
@@ -108,7 +108,7 @@ fn dfg_2d1_on_the_host() {
let fcv = mask.control_volume_force_with_walls(&field, dt, RHO, mu, None, bx, false);
let cd = |f: [f64; 3]| coef * f[0];
println!(
" t {t:7.3}: c_D operator {:.4} (p {:.4} + s {:.4} + exchange {:.4}) | reconstructed {:.4} (p {:.4} + s {:.4}) | box {:.4} c_L {:.5} Δp {:.5}; residual {:.1e} [{:.0} s]",
" t {t:7.3}: c_D operator {:.4} (p {:.4} + s {:.4} + exchange {:.4}) | reconstructed {:.4} (p {:.4} + s {:.4}) | box {:.4} c_L {:.5} Δp {:.5} (quadratic probes {:.5}); residual {:.1e} [{:.0} s]",
cd(po) + cd(so) + cd(ex),
cd(po),
cd(so),
@@ -123,6 +123,18 @@ fn dfg_2d1_on_the_host() {
- mask
.pressure_at(&field.p, CX + 0.5 * D, CY, 0.5 * lz)
.unwrap_or(f64::NAN),
{
// Δp by quadratic extrapolation along the normal from probes
// at 1.5 h, 2.5 h, 3.5 h (whole-fluid stencils only).
let wall_p = |sign: f64| {
let at = |d: f64| {
mask.pressure_at(&field.p, CX + sign * (0.5 * D + d * h), CY, 0.5 * lz)
.unwrap_or(f64::NAN)
};
4.375 * at(1.5) - 5.25 * at(2.5) + 1.875 * at(3.5)
};
wall_p(-1.0) - wall_p(1.0)
},
r.final_residual,
start.elapsed().as_secs_f64()
);
@@ -53,10 +53,8 @@ fn offset(ny: usize, theta: f64) -> (f64, Vec<(f64, f64, f64)>) {
for k in 0..=nz {
for j in 0..ny {
for i in 0..nx {
if k < nz || true {
let idx = g.wface(k.min(nz), j, i);
field.w[idx] = exact((j as f64 + 0.5) * h);
}
let idx = g.wface(k, j, i);
field.w[idx] = exact((j as f64 + 0.5) * h);
}
}
}
@@ -100,3 +98,24 @@ fn flat_wall_effective_position() {
}
}
}
/// The gate: with the centroid diffusion (the default) the effective wall
/// position is second order — within 0.08 h at ny 16, halving in units of
/// h at ny 32, the same at every cut fraction (before S2-5: −½θ h at
/// every resolution).
#[test]
fn flat_wall_position_is_second_order() {
if std::env::var("RTX_E3_DIFFUSION_CENTROID").is_ok_and(|v| v == "0") {
return;
}
for theta in [0.25, 0.75] {
let (coarse, _) = offset(16, theta);
let (fine, _) = offset(32, theta);
println!(" θ {theta}: offset {coarse:+.4} h at ny 16, {fine:+.4} h at ny 32");
assert!(coarse.abs() < 0.08, "ny 16 offset {coarse}");
assert!(
fine.abs() < 0.6 * coarse.abs(),
"the offset does not halve: {coarse} → {fine}"
);
}
}