Post ProcessingΒΆ

After running a simulation, multiple artifacts are generated from it. These include macroscopics fields exported during simulation, .stl files representing the geometries in the domain, log messages, runtime information, among many other files. This section explains the output folder structure and files, and how to interact with them.

Output structureΒΆ

Each simulation is saved in the folder <save_path>/<simulation_name>/<sim_id>/. This folder is structured as

πŸ“ save_path/simulation_name/sim_id
  βš™οΈ config.yaml  # Full configuration for the simulation (not the original file that generated the simulations)
  βš™οΈ info.yaml  # Runtime information for the simulation
  πŸ“œ simulation.log  # Log file
  πŸ“ fields  # Macroscopic fields exported (open these in ParaView)
    πŸ“‘ inst.{export name}.xdmf  # Instantaneous export XDMF index, accumulates all time steps
    πŸ’Ύ inst.{export name}.{chunk}.hdf  # Rolling HDF5 data backing the instantaneous index
    πŸ“‘ stats.{export name}.xdmf  # Statistics export XDMF index, accumulates all time steps
    πŸ’Ύ stats.{export name}.{chunk}.hdf  # Rolling HDF5 data backing the statistics index
  πŸ“ probes  # Probes exported, flat with a {series}.{type}.{probe} prefix
    πŸ“‘ {series name}.line.{line name}.xdmf  # Historic line series, one entry per type (line, bodies, csvs, points, planes)
    πŸ’Ύ {series name}.line.{line name}.h5  # Time series data for the line series
    πŸ“Š {series name}.line.{line name}.points.csv  # Series points, positions after all transformations
    πŸ“‘ {series name}.bodies.{body name}.xdmf  # Body probe series
    πŸ“‘ {series name}.points.{point name}.xdmf  # Point probe series
    πŸ“‘ {series name}.csvs.{csv name}.xdmf  # CSV probe series
  πŸ“ monitors  # Field monitors exported
    πŸ“Š {monitor name}.{macr_name}.csv  # Monitor time series
    πŸ–ΌοΈ {monitor name}.{macr_name}.plot.png  # Monitor plot
  πŸ“ geometry  # Geometry: IBM bodies and point clouds
    πŸ“ {system}  # Output system folder (domain.default_system, lbm by default)
      🧊 {body name}.stl  # Body STL written in this output system
    πŸ“‘ body.{body name}.nodes.xdmf  # IBM node positions and exported values (point cloud per body)
    πŸ’Ύ body.{body name}.nodes.{chunk}.hdf  # Rolling HDF5 data backing the IBM node point cloud
    πŸ“Š pcloud.{cloud name}.pos.csv  # Point cloud positions
    πŸ“‘ pcloud.{cloud name}.nodes.xdmf  # Point cloud node values
    πŸ’Ύ pcloud.{cloud name}.nodes.{chunk}.hdf  # Rolling HDF5 data backing the point cloud
  πŸ“ mesh  # Computational grid artifacts (user-inspectable)
    🧱 blocks.lbm.obj  # Domain refinement blocks in the base lattice frame, for visualization
    🧱 blocks.{system}.obj  # Refinement blocks rescaled into each declared output coordinate system
    πŸ“‘ wall_normals.xdmf  # Continuous wall-normal map (when a predicate BC region wrote it)
  πŸ“ checkpoint  # Checkpoints saved during simulation, can be used to restart at a given step
    πŸ“ {time_step}
      πŸ“‘ macrs.xdmf  # Macroscopics required to restart (rho, u, S, omega_LES)
      πŸ’Ύ macrs.000.h5  # HDF5 data backing the checkpoint macroscopics
      πŸ—’οΈ state.json  # Probes plus solver state to restart
      πŸ“œ simulation.log  # Copy of the log to restart
      βš™οΈ config.yaml  # Copy of the config to restart
  πŸ“ _setup  # Solver machinery, never opened interactively
    πŸ“ code_generated  # Each program generated for runtime and its compile log
      πŸ”§ {program name}.cu  # Generated CUDA source
      πŸ“œ {program name}.cu.compile.log  # Compile log for the generated source
    πŸ“ SEM  # Synthetic eddy method state
    πŸ“Š profile.{name}.stats  # Profiling data

Note

The output layout is flat, which makes results easy to open and manage in ParaView.

Series indexingΒΆ

There are some specific rules to the historic series indexing that it’s very important to understand to operate with it.

The points are generated using the specification of the generator, then the points outside the domain are filtered out. The idx field of the points are generated using as reference the initial points (the ones not filtered out). So, for example, if the first two points of a line are out of the domain, the first index of the points.csv will be 2.

This is important for when you’re combining the idx of this with other sources of information, such as the LNAS vertices or triangles.

Domain overviewΒΆ

To have an overview of the domain setup, we recommend using ParaView. It supports all our file extensions and have extensive funcionalities for visualization, process and many other resources.

Below is an example of domain visualization using the mesh/blocks.obj and the geometry files of the bodies.

Bodies geometry

Visualization of domain refinement and positioned bodiesΒΆ

It’s also possible to view the points of series in the domain, converting the csv table to points in space

Points historic series

Visualization of points position from historic seriesΒΆ

Macroscopics FieldsΒΆ

Check the state of the macroscopics fields, such as density or velocity, is a must step to check the quality of a simulation. We also recommend ParaView for this. The macroscopic field can be either exported for instantaneous and statistical values of the macroscopic variables rho, u, S, omega_LES.

The resulting .xdmf can be further post processed with Paraview using the calculator tool, as demonstrated below for a statistics field:

Macroscopics field

Post processing of macroscopic fields with ParaviewΒΆ

In the example above, the calculator filter from ParaView is used for the calculation of turbulent intensity \(I_{u}\) from averaged fields of velocity and squared velocity sqrt(ux_2nd-(ux^2))/ux. Another frequently performed calculation is to transform the velocity components into a vector, which can be done with iHat*ux + jHat*uy + kHat*uz.

Being Python-based software, ParaView allows the user to apply any of its filters through scripts. This allows the user to write post processing routines that can be performed in any .xdmf files that contain the same variable names.

API interactionΒΆ

All these files and paths can be accessed through an internal API as well. In this way a program can access the full path of files such as the historic series data or points, macroscopics instataneous path, the .obj file with blocks visualization, and other information.

Below is a code snippet demonstrating how to use it.

import pathlib
from nassu.cfg.model import ConfigScheme
from nassu.cfg.schemes.simul import SimulationConfigs, SimulationOutput

filename = "validation/wind_engineering/02_flow_over_wall_mounted_cube/02_flow_over_mounted_cube.nassu.yaml"

sim_cfgs = ConfigScheme.from_file(pathlib.Path(filename)).load_sim_cfgs()
sim_cfg = sim_cfgs[0]
sim_output: SimulationOutput = sim_cfg.output

cube_stl_path = sim_output.bodies["cube"].stl # Path for stl output file of cube
full_info = sim_output.read_info() # reads info.yaml

To know more about this interface and how to interact with it, check the class nassu.cfg.schemes.simul.SimulationOutput.