ReFRESCO is a community based open-source CFD code for the maritime world. It solves multi-phase (unsteady) incompressible viscous flows using the Navier-Stokes equations, complemented with turbulence models, cavitation models and volume fraction transport equations for different phases. The code is developed by MARIN together with several other non-profit organizations around the world. ReFRESCO runs on several HPC supercomputer facilities to simulate all sorts of maritime problems, from ship resistance and propulsion, propeller performance, wave-, current- and wind loads, fluid-structure interaction problems to detailed studies on turbulent flows. When running these complex and long calculations, on thousands of processors in parallel, and especially when the time-resolution of the solution is of crucial importance, the amount of data generated becomes a bottleneck. Not only the time taken to write to the storage but also having the storage capacity for the data generated, seriously limit the work of the CFD practitioners.
To tackle this problem, ReFRESCO has been coupled to ParaView Catalyst, an existing open source solution for in-situ analysis. That means that, rather than storing all the data and filtering out the useful information later on, the analysis of the data is done while the simulation is running. This has several major advantages: first of all, no time is lost in writing to and reading from storage: because the data is already in memory, the analysis can be performed very quickly. Next, the storage needed for the analysis results is usually much smaller than for storing the complete state of the simulation. For example: storing the computational grid and data of a ship at speed for analysis of its wave pattern can easily take a few gigabytes at each time step. Analysis of the wave pattern and storing that result takes only a few megabytes at each time step! This means that the interesting data can be stored more often, and still use less storage overall, compared to storing the full state of the simulation at only, let’s say, every tenth time step. The nature of co-processing also allows the users to quickly see the results visually, leading to a better understanding of the physics simulated, and time saved when performing e.g. exploratory calculations. Finally, the analysis in ParaView Catalyst is done using Python. This makes it much easier for users of ReFRESCO to start using the co-processing.


Free surface of a dam-break free surface simulation

To create the coupling between ReFRESCO and ParaView, a so-called adapter was created that sits between the simulation and the analysis code. The adapter takes the ReFRESCO data, and presents it to Catalyst in a form that it understands, the Visualization Toolkit (VTK) data format. The development of the adapter required a careful approach, where all the details of both data models needed to fall into place for it to work. Using the open source ParaView Catalyst enabled the developers to quickly get up to speed with the VTK data model and develop the adapter between the two codes. Extensive testing shows that the performance of the ReFRESCO code is not affected: the analysis can be performed without significant slowdown with moderate memory overhead. Initial reactions of the first users included and ‘this is very easy to use’ and ‘this is a game changer’.