From f016f0f96f410abd99339978e907ecb6ad9c91fd Mon Sep 17 00:00:00 2001 From: Omar Sobh Date: Tue, 22 Sep 2026 13:45:48 -0500 Subject: [PATCH] =?UTF-8?q?embedded3=20flag=20wake:=20RTX=5FE3=5FFLAG=5FDE?= =?UTF-8?q?PTH=20=E2=80=94=20the=20duct's=20z=20extent=20as=20a=20knob=20(?= =?UTF-8?q?default=20H);=20the=20inflow=20paraboloid,=20the=20flag's=20cen?= =?UTF-8?q?tring=20and=20the=20full/free=20tag=20follow=20it=20(the=20wide?= =?UTF-8?q?-duct=20exploration:=20the=20benchmark-span=20flag=20with=20fre?= =?UTF-8?q?e=20ends=20in=20a=200.82=20m=20duct)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 --- .../rtx-cfd/tests/embedded3_flag_wake.rs | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs b/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs index a958c55..187c888 100644 --- a/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs +++ b/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs @@ -212,21 +212,29 @@ fn flag_2d_analytic(x: f64, y: f64, t: f64) -> (f64, f64) { (best - FLAG_HALF, v_best) } -/// The flag's span: `RTX_E3_FLAG_SPAN` (default 0.2); at the channel's -/// full width the flag is the 2D geometry extruded (S2-3b). +/// The flag's span: `RTX_E3_FLAG_SPAN` (default 0.2); at the duct's +/// full depth the flag is the 2D geometry extruded (S2-3b). fn flag_span() -> f64 { env_f("RTX_E3_FLAG_SPAN", FLAG_SPAN) } +/// The duct's depth (the z extent): `RTX_E3_FLAG_DEPTH` (default H, the +/// square duct). A wider duct than the flag's span (2026-09-22, the +/// "wide span" exploration) puts a finite-span plate in free flow between +/// the side walls — not the benchmark's geometry. +fn duct_depth() -> f64 { + env_f("RTX_E3_FLAG_DEPTH", H) +} + /// The flag in 3D: the extruded capsule cut to the span with edges /// rounded to radius `r` (no cut at the full width). fn flag_3d(x: f64, y: f64, z: f64, t: f64, r: f64) -> (f64, (f64, f64)) { let (d2, v) = flag_2d(x, y, t); let span = flag_span(); - if span >= H { + if span >= duct_depth() { return (d2, v); } - let zc = 0.5 * H; + let zc = 0.5 * duct_depth(); let q1 = d2 + r; let q2 = (z - zc).abs() - 0.5 * span + r; let outside = (q1.max(0.0).powi(2) + q2.max(0.0).powi(2)).sqrt(); @@ -234,7 +242,8 @@ fn flag_3d(x: f64, y: f64, z: f64, t: f64, r: f64) -> (f64, (f64, f64)) { } fn inflow(y: f64, z: f64) -> f64 { - 16.0 * U_M * y * z * (H - y) * (H - z) / (H * H * H * H) + let d = duct_depth(); + 16.0 * U_M * y * z * (H - y) * (d - z) / (H * H * d * d) } #[test] @@ -247,7 +256,11 @@ fn flag_wake_on_the_device() { // `RTX_E3_FLAG_NZ=4`: a thin slab periodic in z with the 2D inflow (Ū = 1) — the // flag as a 2D problem, minutes per rung: the instrument for the load routes' parts. let slab_nz = env_f("RTX_E3_FLAG_NZ", 0.0) as usize; - let nz = if slab_nz > 0 { slab_nz } else { ny }; + let nz = if slab_nz > 0 { + slab_nz + } else { + (duct_depth() / h).round() as usize + }; // S2-9b: the 3D run with the slab's 2D inflow (uniform in z) and/or slip // side walls — the decomposition of the 3D-over-slab drag. let inflow_2d = std::env::var("RTX_E3_FLAG_INFLOW").is_ok_and(|v| v == "2d"); @@ -491,7 +504,7 @@ fn flag_wake_on_the_device() { } } if phase_due { - let tag = if flag_span() >= H { "full" } else { "free" }; + let tag = if flag_span() >= duct_depth() { "full" } else { "free" }; let path = std::path::Path::new(vtk_dir.as_ref().unwrap()) .join(format!("flag_{tag}_ny{ny}_phase{next_phase:02}.vtk")); write_vtk(&path, &field, Some(mask)).expect("vtk");