Post-Processing

Data processing will usually be used to either visualize how a parameter behaves throughout the domain or to calculate a value of interest from the results. An example of the former would be to create a cross-section of the domain that displays the pressure field around the car, while an example of the latter would be to calculate the drag of the car.

Many simulation programs, including SimScale, provide tools for processing the simulation data. However, there are also dedicated post-processing programs such as ParaView. SimScale’s post-processing environment is fairly intuitive and I use it for quick visualizations. ParaView has more options, and has generally proven itself to be more reliable in my opinion. I’ll talk about both programs here, so you can choose which post-processor you like using. Furthermore, SimScale is introducing a new post-processor as of the time of writing so I’ll talk about that as well.

 

SimScale


Forces

Force data is accessed separately from SimScale’s main post-processing environment. During and after a simulation run, you can check the simulation forces by going to the left navigation panel and selecting the Force plot under the run you want to analyze. This should bring up a plot of all forces at each simulation iteration. To find drag, add the forces acting in the z direction at the most recent iteration. The only significant contributions should be from pressure and viscous forces. And remember to double the result because only half of the car was simulated. To find lift or down force, repeat in the y direction.

 

Figure 4.1: SimScale’s force plot. In this simulation, the Pressure force z was -6.7637 N and the Viscous force z was -11.0686 N. This means the full car would have a pressure drag of 13.5274 N and a viscous drag of 22.1372 N, for a total drag of 35.6646 N.

 

Legacy Interface

To visualize the results, go to the navigation panel, go to the simulation run, and select Solution field. You might be asked if you would like to use the Legacy Interface or the new Beta Interface. In the Legacy interface, there will be a list of tools in the upper left and a geometry viewer on the right. These tools are called filters in ParaView and SimScale’s beta version is switching to that terminology so I’ll call them filters. There are also some other settings at the top of the geometry viewer, most notably the time frame settings (Black rewind, play, and fast-forward symbols). Most of the time, make sure you are analyzing the most recent time point in the simulation as this is likely the most accurate data available. Add a filter by finding the desired filter in the list and clicking the plus symbol on the right side of the label. This will bring up a panel, with settings specific to that filter. The 3 that I use most often are Cutting Planes, Isovolumes, and Particle Traces. After adding a filter, it can be found as a sub-item under the label. A filter’s visibility can be toggled by clicking the eye symbol to the left of it and can be removed by clicking the minus symbol to the right of it.

 

Figure 4.2: SimScale’s legacy interface.

If you add a filter that uses a scalar, say pressure, you will notice that a scale bar is automatically generated. The scale bar is automatically scaled relative to the maximum and minimum values in the domain. I always preferred to change the range to round numbers and kept the range consistent between simulations to make comparisons easier. This is done by going to the panel with the post-processing tools and clicking the drop-down arrow to the left of Results. Then select the parameter you’re using, which for this example is SCL: Pressure. In the panel that opens, you can change the colour scheme, the number of divisions in the scale, the range of the scale, toggle logarithmic mapping, and toggle node averaging.

SimScale can also display the mesh over a cross-section when post-processing simulation data. I’ve never run into mesh size limitations with this method so even if the Mesh Clip tool wasn’t working on a mesh, this method might. Obviously this method requires the simulation to be solved first and so it shouldn’t be used to develop the mesh initially, but could be useful later on. This is particularly useful for checking if any unexpected results are actually artifacts from mesh defects.

 

Beta Interface

Selecting New Beta Interface will bring you to the new interface. Maybe by the time you’re reading this, SimScale will have made this the default interface. Either way, it’s pretty similar to the old one. The geometry viewer is mostly the same, but the panel in the upper left is different. There’s a section called Parts Color, which allows the colour and opacity of the geometry to be controlled or allows the geometry to be coloured according to a simulation variable. There’s also a button that says Add Filter. This is where you can add all the visualizations that were available in the legacy interface. After adding the filter, many of the same options from the legacy interface now will show up in a new section of the left panel. You can toggle the visibility of the filter by clicking the slider to the right of its name and you can delete a filter by clicking the garbage icon to the right of that slider. One other big difference is that the range of a scale bar is changed by directly interacting with it. Simply click the minimum or maximum value and type in the desired value.

 

ParaView


ParaView can be downloaded here: https://www.paraview.org/download/

To use a program other than SimScale, the results need to be downloaded. In the left navigation panel, click on the run you want to analyze. In the panel that opens find the download button and click that. The result files can get quite large, especially if you’ve saved the results at more than one time point.

When the download finishes, navigate to the zip file and extract it. Now open ParaView. Select open file in the upper left, and navigate into the extracted folder. There should be a bunch of other folders and a file with a .foam extension. Select that file and click OK.

 

Figure 4.3: This is ParaView’s interface, the Open button is highlighted in red.

Figure 4.4: After navigating to the extracted folder, you should see this case.foam file.

 

Now the Pipeline Browser will have the .foam file added to it and the bottom left Properties panel will have some more options. Scroll to the Mesh Regions section, select all regions except the 6 bounding boxes and the internal mesh, and click Apply. This can take a few minutes.

 

Figure 4.5: After opening the file, setup the Properties settings, and click Apply.

Figure 4.6: After clicking Apply, the selected mesh regions should be displayed in the geometry viewer.

Figure 4.7: These are the tools to select the time point in the simulation, found near the top toolbar.

Figure 4.8: These are the tools to change how the geometry is coloured. The left icons control the colour map and range, while the left and middle drop-down menus (middle one is greyed out in this image, since it only applies to vector quantities) change which variable is being displayed.

 

After it loads, I would change to the most recent time point that was simulated as this should be the most accurate point of the simulation. Now, we can start processing the data. ParaView works by adding filters to the data file. Every filter you add will show up in the Pipeline Browser, below the .foam file. To see a list of all the filters ParaView has, go to the top menu bar, hover over Filters, and then hover over Alphabetical.

 

Figure 4.9: ParaView’s filters. Each filter with a symbol to the left of it has a shortcut in the upper tool bars, simply look for the matching symbol.

 

Learning all of these filters is beyond the scope of this guide and unnecessary for our team, so I will explain how to find the drag value and leave you to research or experiment with whatever else interests you. Since we only simulated half of the car, let’s add a Reflect filter. In the Properties panel, select X Min as the plane and click Apply. In the geometry viewer, you should see the full car now, not just half.

Next, add an Extract Surface filter, click Apply.

Add a Generate Surface Normals Filter, click Apply.

Now add a Calculator filter. In the Properties panel, you should see Result Array Name, a text bar with “Result” written by default, another text bar below that, and then a bunch of buttons with mathematical operations. You can change the Result Array Name to whatever you want to call your calculated quantity, I usually leave it as the default unless I’m using multiple calculations. In the empty text bar, this is where you enter the formula that you want calculated. Type “-p * Normals_Z” and click Apply. This multiplies the pressure value at each point on the car’s surface with the z component the normal vector at each point along the surface.

Now add an Integrate Variables filter and click Apply. This should bring up a panel with a table in it. Scroll until you find Result (or whatever you called the calculated value), record the value beneath it, keep scrolling until you find wallShearStress, and record the third value beneath that (the z component). The values in this table are values that have been integrated across the surface that was extracted earlier. Integrating the calculated result gives the pressure drag of the car, while integrating the wall shear stress gives the viscous drag. Add the magnitude of each drag component to get the total drag.

 

 

Once again, the same process could be used in the y direction to calculate the lift or downforce. I’ll end here and let you experiment with other visualizations, ParaView has filters for everything that SimScale has and more. Some of them require the internalMesh mesh region though.


 

 

If you’ve been following along, you’ve now completed a CFD simulation in SimScale. I tried to make this guide brief, if you’d like to learn more about fluids, aerodynamics, or CFD simulations I’ll add some more resources below.

 

Additional Resources:

  • Midnight Sun PDF Library: Always a useful place to go. There are resources for many different aspects of vehicle engineering, with some that are specific to solar cars.

  • The Leading Edge: There’s a paper copy in the bay. Very helpful for understanding solar car aerodynamics, although it is focused on challenger class vehicles.

  • The Efficient Engineer: A YouTube channel focusing on explaining general engineering concepts with excellent animations. This is a good place to learn some fundamental fluid concepts.

  • braintruffle: An odd name but this is a newer YouTube channel that is creating a series of videos on the continuum approximation for fluids. They conceptually explain the assumptions and statistics used to simplify fluids from quantum mechanical entities to a continuum of field values. Future videos will look at discretizing the continuum for simulations.

  • Fluid Mechanics 101: A YouTube channel with detailed videos on specific topics in computational fluid dynamics. This is a great resource if you want to learn more about a specific topic, like a certain algorithm or turbulence model.

  • SimScale: There’s also several resources provided by SimScale. They have a wiki section and webinars for simulation theory, forums where people discuss issues they encountered during simulations, pretty good documentation to explain how to use their product, and you can also look at example projects to learn how other people handled certain simulation problems directly in SimScale.

  • LEAP Australia: A blog that has some useful articles. I mostly looked at their boundary layer articles.

  • CFD-Online: I haven’t looked through this site very thoroughly, but I did use it to learn about estimating initial conditions.