plots.render_flow

plots.render_flow(
    result,
    direction=None,
    n_streamlines=200,
    solid_opacity=0.15,
    solid_color='dimgray',
    tube_radius=0.4,
    cmap='Blues',
    save=None,
    show=True,
    off_screen=False,
    window_size=(800, 600),
)

Render a ParaView-style 3D visualisation of the solid structure and flow streamlines.

Requires pyvista (pip install pyvista).

Parameters

Name Type Description Default
result FlowResult Converged flow result returned by solve_flow() or read_flow_vtr(). required
n_streamlines int Number of seed points arranged as a grid on the inlet face. Default 200. 200
solid_opacity float Opacity of the solid surface mesh (0 = invisible, 1 = fully opaque). Default 0.15. 0.15
solid_color str Colour of the solid surface. Default "dimgray". 'dimgray'
tube_radius float Radius of the streamline tubes in voxel units. Default 0.4. 0.4
cmap str Matplotlib colormap used to colour streamlines by flow speed. Default "Blues". 'Blues'
save str or None Path at which to save a PNG screenshot. None (default) skips saving. None
show bool Open an interactive window after rendering. Default True. True
off_screen bool Render without opening a display window (useful on headless servers when save is set). Default False. False
window_size tuple of int Render-window width × height in pixels. Default (800, 600). (800, 600)

Returns

Name Type Description
plotter pyvista.Plotter The configured plotter (already shown/saved if requested).