overset: the stamp-energy instrument (P5-3's energy-source measurement) — OversetResult gains stamp_energy (½ρ(u_stamped² − u_before²)·dx·dy summed over the fringe faces after the flux balance on a reclassification step) and reclass_energy (the faces touching a cell whose class changed); the replay CSV logs both plus the reclassified-cell count per step — the comparator showed the plate loads per unit motion agree with ours to ~10 %, so the discrepancy is our limit-cycle amplitude, an h-growing energy source, and the hole boundary's reclassification is the candidate
CI / CI Success (push) Failing after 0s
CI / Build (macos-latest) (push) Failing after 16s
CI / Test (macos-latest) (push) Skipped
CI / Test (ubuntu-latest) (push) Skipped
CI / Python Bindings (maturin) (macos-latest) (push) Skipped
CI / Python Bindings (maturin) (ubuntu-latest) (push) Skipped
CI / WASM Build + Size Check (push) Skipped
CI / Distributed Training Tests (push) Skipped
Documentation / Build User Guide (push) Successful in 13s
CI / Format Check (push) Failing after 19s
CI / Clippy Check (push) Failing after 5s
Performance Benchmarks / Run Benchmarks (push) Failing after 6s
Documentation / Build API Documentation (push) Failing after 7s
CI / Build CPU-Only (Explicit) (push) Failing after 1m24s
CI / Build (ubuntu-latest) (push) Failing after 2m2s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0116sg1Qz1gMv9hdcKP1XUam
This commit is contained in:
Omar Sobh
2026-09-12 17:32:05 -05:00
co-authored by Claude Fable 5.1
parent 796b8487ad
commit 914d369efe
2 changed files with 45 additions and 7 deletions
@@ -134,6 +134,14 @@ pub struct OversetResult {
pub reclassified_cells: usize,
/// Background cells that jumped hole → active (patch moved > 1 cell).
pub fresh_cells: usize,
/// Kinetic energy the exchange wrote into the background's fringe faces
/// on this step's reclassification (`½ ρ (u_stamped² u_before²)` per
/// face times `dx·dy`, summed over the stamped `u` and `v` faces after
/// the fringe flux balance) [J/m]; 0 when the patch did not move.
pub stamp_energy: f64,
/// The part of `stamp_energy` on faces that touch a cell whose class
/// changed in this rebuild — the reclassification's own share.
pub reclass_energy: f64,
}
/// Restorable state of the composite (the coupling re-runs a step).
@@ -510,6 +518,7 @@ impl OversetPisoSolver {
// path to the bit.
let mut reclassified = 0usize;
let mut fresh = 0usize;
let (mut stamp_energy, mut reclass_energy) = (0.0_f64, 0.0_f64);
// P3b locating trace (print-only, `RTX_OVERSET_TRACE_SP`): the class
// of every background cell before this step, kept only when a
// reclassification happens.
@@ -581,11 +590,10 @@ impl OversetPisoSolver {
// instead of taking the patch's interpolation when they turn
// prescribed.
let h1 = std::env::var("RTX_OVERSET_H1").is_ok();
let u_before = field.background.u.clone();
let v_before = field.background.v.clone();
let (u_keep, v_keep) = if h1 {
(
Some(field.background.u.clone()),
Some(field.background.v.clone()),
)
(Some(u_before.clone()), Some(v_before.clone()))
} else {
(None, None)
};
@@ -606,6 +614,31 @@ impl OversetPisoSolver {
}
}
self.balance_fringe(&mut field.background);
// The energy the stamp wrote (P5-3's energy-source instrument):
// every stamped face, and the faces touching a reclassified cell.
{
let rho = self.background.config().density;
let vol = dx * dy;
let changed = |jj: usize, ii: usize| {
jj < ny && ii < nx && old_map.class(jj, ii) != self.overlap.class(jj, ii)
};
for e in &self.overlap.fringe_u {
let (a, b) = (u_before[(e.j, e.i)], field.background.u[(e.j, e.i)]);
let de = 0.5 * rho * (b * b - a * a) * vol;
stamp_energy += de;
if changed(e.j, e.i) || (e.i > 0 && changed(e.j, e.i - 1)) {
reclass_energy += de;
}
}
for e in &self.overlap.fringe_v {
let (a, b) = (v_before[(e.j, e.i)], field.background.v[(e.j, e.i)]);
let de = 0.5 * rho * (b * b - a * a) * vol;
stamp_energy += de;
if changed(e.j, e.i) || (e.j > 0 && changed(e.j - 1, e.i)) {
reclass_energy += de;
}
}
}
// Knock-out H2 (`RTX_OVERSET_H2`): cells that turn active → fringe
// keep the background's own pressure this step instead of the
// patch's stamped value (their p' is still Dirichlet from the
@@ -805,6 +838,8 @@ impl OversetPisoSolver {
overlap_flux_scale: scale,
reclassified_cells: reclassified,
fresh_cells: fresh,
stamp_energy,
reclass_energy,
})
}
}