engine: draw fluid results as slices, coloured obstacles and streamlines

After solve.fluid the results view had nothing to draw: a fluid step's
fields are per cell, the view only knew nodal fields, and the deformed
display it built dropped the geometry surfaces, so even the part
vanished.

A fluid step now has its own display (`engine::flow`, on render's
flow display data), shared by the headless pictures and the window:
the part drawn as it is, its faces coloured by the field in the fluid
beside them, the field on a slice through the domain and streamlines
seeded on the inlet face upstream of the obstacles, coloured by speed
when the legend shows velocity. It is first shown with velocity
magnitude on a slice through the middle, normal to the horizontal axis
across the flow.

New commands: results.slice {step, field: velocity|pressure, axis:
x|y|z|none, position, frame}, results.surface {step, show} and
results.streamlines {step, show, count, max_steps, seeds | line,
frame}, which replies with what it traced. results.contour takes
velocity and pressure for fluid steps (a new `pressure` field) with
the usual bands and legend clamp, and results.frame walks a fluid
step's frames. Streamlines leave the coming-soon list. Hostile
parameters are refused, and the counts are capped.

Part of #193.
This commit is contained in:
Christian Svensson authored and Irakli Kourtis committed 2026-10-17 07:25:04 -04:00
1 parent 0d30ddb747
commit f7dcd46b2f
11 files changed
+1086 -32

No files matched your search

+4
View File
@@ -17,6 +17,7 @@ pub mod bug_report;
pub mod catalogue;
pub mod cmd;
pub mod crash;
pub mod flow;
pub mod logfile;
pub use cmd::analytic_surfaces;
@@ -298,6 +299,9 @@ pub struct Session {
/// What the last `geometry.check` found, drawn as markers while the design it checked is
/// open ([`view::geometry_marks`]). Not an edit: neither journalled, saved nor undone.
pub geometry_marks: Option<Arc<view::GeometryMarks>>,
/// The streamlines last traced for a fluid step's display ([`flow::TraceCache`]): the
/// `results.streamlines` reply and the plot share them. Not an edit either.
pub traced: flow::TraceCache,
}
impl Session {