embedded3 S2-4: quadratic wall gradient behind Parameters::wall_order (host predictor, operator route, e3_cut.cu; RTX_E3_WALL_ORDER); density pin holds at order 2
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 / 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 / Build (macos-latest) (push) Waiting to run
CI / Clippy Check (push) Failing after 3s
CI / Build (ubuntu-latest) (push) Failing after 4s
CI / Build CPU-Only (Explicit) (push) Failing after 4s
CI / Format Check (push) Failing after 5s
Documentation / Build API Documentation (push) Failing after 4s
Documentation / Build User Guide (push) Successful in 4s
Performance Benchmarks / Run Benchmarks (push) Successful in 2m40s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-18 07:21:57 -05:00
co-authored by Claude Fable 5.1
parent 53b1babb91
commit cda973df26
7 changed files with 87 additions and 9 deletions
@@ -226,7 +226,10 @@ impl Solver {
});
let a_w =
(cv.wall[0] * cv.wall[0] + cv.wall[1] * cv.wall[1] + cv.wall[2] * cv.wall[2]).sqrt();
let shear = mu * a_w / cv.distance;
let (c1, c2, nb) = mask.wall_gradient(c, p, &cv);
let shear = mu * a_w * c1;
// The explicit part of the quadratic wall gradient (order 2).
let shear_explicit = nb.map_or(0.0, |f| mu * a_w * c2 * (old[c][f] - ub));
let fraction = if self.params.momentum_volume_cell_mean {
let vol = |q: [i64; 3]| lat.cell(q).map_or(cv.alpha, |ci| mask.vol(ci));
0.5 * (vol(cell_minus) + vol(cell_plus))
@@ -235,8 +238,8 @@ impl Solver {
};
let v_eff = fraction.max(INERTIA_FLOOR) * h[c] * area[c];
let inertia = rho * v_eff / dt;
let u_star =
(inertia * u0 - conv + diff + pressure + source + shear * ub) / (inertia + shear);
let u_star = (inertia * u0 - conv + diff + pressure + source + shear * ub - shear_explicit)
/ (inertia + shear);
let v_alpha = fraction * h[c] * area[c];
(u_star, rho * (v_eff - v_alpha) * (u_star - u0) / dt)
}
@@ -78,7 +78,7 @@ struct E3Params {
bz0: i32,
bz1: i32,
scheme: i32,
pad: i32,
wall_order: i32,
dx: f64,
dy: f64,
dz: f64,
@@ -284,7 +284,7 @@ impl DeviceStep {
bz0: side_code(b.z0),
bz1: side_code(b.z1),
scheme: scheme_code(self.solver.params.convection_scheme),
pad: 0,
wall_order: i32::from(self.solver.params.wall_order),
dx: g.dx,
dy: g.dy,
dz: g.dz,
@@ -91,6 +91,11 @@ pub struct Parameters {
/// inertia of the fluid half of its volume instead of a tenth of a
/// cell against O(1) fluxes).
pub momentum_volume_cell_mean: bool,
/// The cut wall's shear closure: 1 = one-point `μ A_w (u_f U_b)/d_f`
/// (the recorded form), 2 = the quadratic wall gradient through the
/// next open face along the wall normal's dominant axis (S2-4).
/// `Parameters::default()` reads `RTX_E3_WALL_ORDER` (default 1).
pub wall_order: u8,
}
impl Default for Parameters {
@@ -107,6 +112,10 @@ impl Default for Parameters {
max_surface_speed: None,
aperture_substeps: 0,
momentum_volume_cell_mean: false,
wall_order: std::env::var("RTX_E3_WALL_ORDER")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(1),
}
}
}
@@ -231,6 +240,7 @@ impl Solver {
.map(|mut m| {
m.scheme = self.params.convection_scheme;
m.density = self.fluid.density;
m.wall_order = self.params.wall_order;
m
})
.expect("embedded mask")