SimWorks postprocessing with ParaView

ParaView is a free and open-source software devoted to data analysis and visualisation, it can be used to analyse CFD results carried out with OpenFOAM. You can download it from the official website, it is a very powerful software to carry out custom data visualisation and analysis. It can be used to create iso-surfaces, streamlines or any custom plot starting from CFD results. ParaView is fully compatible with SimWorks and SimWorks Manager CFD analysis results.

Why use ParaView in combination with SimWorks

SimWorks and SimWorks Manager offer an integrated post-processor that is very useful to perform a quick analysis (SimWorks) as well as for comparisons across different simulations (SimWorks Manager).

Since CFD results of SimWorks and SimWorks Manager are saved in OpenFOAM format, we encourage the use of ParaView to do more in-depth and advanced analyses of the results of CFD simulations. We encourage our users to learn and use ParaView as it allows to create custom in-depth analysis of CFD results completing very nicely the SimWorks ecosystem.

This way, SimWorks users can expand their experience with post-processing OpenFOAM results and SimWorks Manager users can create more advance post-processing filters and analysis of the results. 

Opening SimWorks results in ParaView

Once a SimWorks or SimWorks Manager simulation in completed a full folder structure is created. If you navigate into the case folder you will find a .foam file named after your simulation, for example once we completed the sphere drag tutorial the following structure was created :

To load the SimWorks simulation results in ParaView, open the software and complete the following steps:

1) Click on the Open command

2) The .foam file will appear in the Pipeline Browser, from here you can show / hide the part

3) If the simulation was carried out in parallel please select Decomposed case in the Case Type entry, otherwise leave the entry as Reconstructed case

4) Once you select the Case type click on Apply

Once the file is opened you need to complete the following to visualise the Cp field on the sphere surface:

1) Make sure that the main file is set to visible

2) Select only the part you are interested in the Properties menu, in our case was the part_7

3) Click on Apply and you should see the main object of the simulation

4) Click on the parameter you want to visualise, in our case we chose the Cp

How to customise the plots

If you scroll down in the Properties tab you can find the Coloring section, here you can select the parameter you want to visualise (1) which is equivalent to selecting the parameter as seen in the previous section. From this menu you can actually select the parameter range (2) so you can change the scale of the visualised date. Similarly, you can change the opacity (3) of the visualised object:

You can use the same operations on any visualised data. It is possible to load a second copy of the sphere.foam file to apply any other filter. Once applied, any visualised data can be modified using the same principles as the ones in this section. For example, the next section shows how to create iso-surfaces of a field.

How to define an iso-surface

We will reload the .foam file not to affect what has been done so far. Follow the steps below:

1) Reload the .foam file even if it was already loaded, make sure that internalMesh is ticked so that the volume data is loaded

2) Click on the Contour icon to create a filter

3) Select for instance mag(U) to highlight a portion of the space with a given velocity

4) In our tutorial, the sphere simulation was carried out with a freestream velocity of 5 m/s, so we will highlight the area around the sphere where the flow speed is accelerated to 6 m/s. To do so, we type 6 in the Value Range field and click Apply and the iso-surface will be displayed

You can still scroll down to the Coloring section and select which parameter to use to colour the iso-surface. It is also possible to select Solid color and, in Edit, it is possible to select the colour we want to apply to it or it can be coloured against any given parameter.

How to plot streamlines

We will now add streamlines to the previous entry:

1) Select the .foam file loaded in the previous step

2) Select the Stream Tracer filter and select it

3) Make sure that High Resolution Line Source is selected as Seed Type

4) Define 2 points spaced in Z just upstream of the object, we selected two points at x=-0.25, y=0.0 and z=-0.1 and 0.1

5) Set a Resolution of 100 streamlines, and click Apply

Once completed you can change the streamlines color in the Coloring section still in the Properties tab, you can also define a single color. From the same tab you can also change the overall background color of ParaView and obtain a picture similar to the one below:

Conclusions

This tutorial offers a quick overview of ParaView capabilities and how to use it to analyse SimWorks results. What has been shown here is only a fraction of the ParaView capabilities. Since ParaView is a very powerful software, we suggest to complete the following tutorials to get a more in-depth knowledge. All the filters and functionalities in ParaView can be applied to all the SimWorks results. 

Save a scene in ParaView

Once you are happy with your postprocessing results, you may want to save the current view to re-open at a later stage. To do so, go to the File menu and click on Save State… you can load it up later with the command Load State... Please bear in mind the State contains references to the location of the original data therefore you cannot delete or move the data if you want to reopen them in ParaView at a later stage:

How to create and export a video

If you want to analyse the results of an unsteady simulation, it is often useful to create a video animation of a field of interest.

In the example below, we use the results of a transient simulation of a delta wing carried out with DES. First, we create a scene visualising the Cp field on the delta wing surface and iso-surfaces of Cp to see the time evolution of the tip vortices. Once we are happy with the visualised data, we can export the animation by selecting Save Animation… from the File menu. We suggest to export using the .png format, meaning that the scene will be automatically recreated for each time step and saved as an independent image:

Once the images have been exported, you can create a video using a software that combines the series of images. Here, we used the free and open-source software ImageJ. We trimmed the first 0.5 sec of a 1 sec video by deleting the first 100 images and then in ImageJ

1) File –> Import –> Image sequence…

2) Leave the images open and File –> Save as AVI …

ImageJ main menu, from here you can import the images and export the completed AVI file

You can leave the export settings as default, or you can experiment with different fps. If you need to export the video to .mp4 format instead of .AVI you can use another software or a video conversion services.

Representation of surface Cp and vortices structure detaching from a delta wing at 40deg of incidence – Simulation carried out with SimWorks Manager

Conclusions

This tutorial offers a quick overview of ParaView capabilities and how to use it to analyse SimWorks results. What has been shown here is only a fraction of the ParaView capabilities. Since ParaView is a very powerful software, we suggest to complete the following tutorials to get a more in-depth knowledge. All the filters and functionalities in ParaView can be applied to all the SimWorks results. 

Try our free CFD software SimWorks, no registration required or contact us to find out more

Share on whatsapp
Share on email
Share on linkedin
Share on facebook
Share on twitter