Skip to content

ParaView

write_paraview

Description

Writes the current state on the whole domain to ParaView files in <output_directory>/ParaviewOutput/: one .pvtr master file per output and one .vtr piece per MPI process (rectilinear grid, coordinates in m, including the domain origin). The point fields are:

Field Description
P pressure difference relative to the reference state (Pa): \(p = \frac{c^2}{3}\,\rho_{ref}\,(\rho_{LBM} - 1)\), 0 in the solid nodes
U velocity (m/s)
OBST obstacle field: -1 fluid node, -2 solid node

With distributions: true, the 19 distribution functions \(f_i\) are also written.

YAML syntax

write_paraview is called by the dump_paraview batch, every simulation_paraview_freq steps:

dump_paraview:
  - update_ghost
  - macro_variables
  - write_paraview:
     distributions: false

global:
  simulation_paraview_freq: 500
  display_paraview_first_timestep: true   # also write the initial state
  output_directory: "MySimDir"
Slot Type Default Description
filename string "hippoLBM_%010d" base filename, formatted with the current timestep
output_directory string "hippoLBMOutputDir" base output directory
distributions bool false also write the \(f_i\)
display_filename bool true print the filename in the log

write_paraview_subbox

Description

Writes a physical-space sub-region of the domain, with the same fields as write_paraview (one .pvtr master file and one .vtr piece per overlapping MPI rank). Ranks whose subdomain does not overlap bounds write nothing. Useful to focus on a region of interest in large simulations.

Note

The bounds box is clipped to the domain. If it falls entirely outside the domain, an informational message is printed and nothing is written. The distributions flag is not supported.

YAML syntax

dump_paraview:
  - update_ghost
  - macro_variables
  - write_paraview_subbox:
     filename: "hippoLBM_subbox_%010d"
     bounds: [[0.4, 0.0, 0.0], [0.6, 2.0, 2.0]]

global:
  simulation_paraview_freq: 500
  output_directory: "MySimDir"
Slot Type Default Description
bounds AABB required physical-space box [[xmin,ymin,zmin],[xmax,ymax,zmax]] to write
filename string "hippoLBM_subbox_%010d" base filename, formatted with the current timestep
output_directory string "hippoLBMOutputDir" base output directory
display_filename bool true print the filename in the log

Visualization

Open the .pvtr files of ParaviewOutput/ in ParaView (the series is loaded as a time sequence). A vorticity post-processing script is provided in script/vorticity/ of the hippoLBM repository.

Cost of the outputs

Writing ParaView files is expensive on large domains (on GPU runs of the Eiffel Tower example, it dominates the run time). Increase simulation_paraview_freq, or write a sub-box, for production runs.