Sluonics GmbH

Supporting you with software development.

OpenFOAM in a race car simulation

Situation

A racing car simulation has to predict lap times for many settings, including weather conditions. A partial problem is including velocity into the equation.

The simulation requires drag and lift coefficients depending on vehicle speed and wind velocities.

Solution

OpenFOAM setup

SimpleFOAM is used for a steady state simulation of an incompressible airflow. Discretization is done by a Gauss linear. The solver is the GAMG.

One simulation with a vehicle speed of 40m/s and no wind, showing an ahmed body,

The Magnitude of the velocity U is also in m/s.

A python code generator was used to create blockMeshDict and patch the initial constant file U. The files patched the position and flow speed of the inlet and outlet boundaries,

The angle Θ is the result of the vehicle air flow added to the wind air flow.

Storing

The problem offers an embarrassingly parallel solution. The data can be generated in LSF Jobs, each utilizing the cores of a single CPU. They write their results to a common sqlite database. Since this happens infrequently, there is no congestion.

Interpolation

The Delaunay triangulation is applied on the set of points given by vehicle speed, wind speed and wind angle. For interpolation to a point, the simplex containing this point is searched. Afterwards, linear interpolation is applied using the values of the vertices of the simplex.

This approach permits working with datasets of varying density. This makes usage with yet incomplete databases and successive optimization easy.

Below a cut for a vehicle at 40m/s is shown,

The angles are the wind attack angles while the radius is the wind speed.

Benefits

  • Extend car simulation by detailed forces due to wind
  • Support arbitrary wind attack angles
  • Interpolation
  • Continous update

Costs

  • 2 months development time
  • Cluster with at least 32 cores

Tools

  • OpenFOAM
  • Python 3 & SciPy
  • MPI
  • SQLite 3
  • Platform LSF

Impressum and privacy statement