R8-a harness: save/load of the coupled state (continue on the same grid, or extrude the slab onto the full duct)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-25 18:14:16 -05:00
co-authored by Claude Opus 5.5
parent 12a27c6fca
commit 9867a8b831
3 changed files with 263 additions and 14 deletions
@@ -155,7 +155,19 @@ impl E3Fluid {
/// thin slab periodic in z (the flag as a 2D problem), 0 the full 0.41 m
/// duct with slip side walls; the 2D inflow (parabolic in y, Ū 1) in
/// both. `speed` bounds the flag's surface speed (the narrow band).
pub fn build(ny: usize, nz_slab: usize, speed: f64, rest: Line) -> Self {
/// `start`: a saved state (its time, its line, its fields — extruded
/// onto every plane when the saved nz differs); the rest flow otherwise.
pub fn build(
ny: usize,
nz_slab: usize,
speed: f64,
rest: Line,
start: Option<&super::state::Saved>,
) -> Self {
let rest = match start {
Some(s) => s.line.clone(),
None => rest,
};
let h = H / ny as f64;
let nx = (L / h).round() as usize;
let nz = if nz_slab > 0 {
@@ -249,6 +261,10 @@ impl E3Fluid {
}
}
}
if let Some(s) = start {
s.fill(&mut field);
solver.set_time(s.t);
}
solver.initialize(&mut field);
let mut device = DeviceStep::new(solver, g);
device.upload(&field);