Tutorial: Aerodynamics Simulation of Flow Around a Vehicle
This tutorial shows how an incompressible turbulent airflow around a moving vehicle can be simulated. Figure 1 shows an example of the resulting flow behavior:
Figure 1: Post-processing of the CFD simulation results with streamlines
This tutorial teaches how to:
Set up and run an incompressible simulation;
Assign topological entity sets;
Assign boundary conditions, material, and other properties to the simulation;
Mesh with the SimScale standard meshing algorithm.
We are following the typical SimScale workflow:
Prepare the CAD model for the simulation;
Set up the simulation;
Create the mesh;
Run the simulation and analyze the results.
1. Prepare the CAD Model and Select the Analysis Type
The first step is to click on the button below. It will copy the tutorial project containing the geometry into your workbench.
The following picture demonstrates what should be visible after importing the tutorial project:
Figure 2: The imported CAD model of the vehicle.
Note that the car geometry is not too detailed. Small and detailed features that don’t greatly affect the aerodynamics, such as bolts and windshield wipers, should be removed or simplified.
With this approach, we can reduce the computation effort necessary throughout the entire simulation process, while still obtaining meaningful results. Find more information about CAD preparation on this documentation page.
Did you know?
We can use the car’s symmetrical shape in our favor. As we expect the flow field to be mirrored along the symmetry plane of the car, we only need to use one half of the geometry.
Figure 3: Half of the car geometry, with the XZ symmetry plane highlighted in red
As a result, it’s possible to run the simulations faster.
1.1. Create an Enclosure
The first step for this simulation is the creation of an enclosure. This will create the flow domain that will be used for the external aerodynamics analysis.
Select ‘Add geometry operation’, then pick the ‘Enclosure‘ operation.
Figure 4: Creating a new enclosure
The enclosure dimensions are chosen according to the length (L) of the vehicle. As a rule of thumb, the following values can be used:
Downstream: 8-10 times the length of the vehicle;
Upstream: 3-5 times the length of the vehicle;
As much as necessary to the minimum z-direction, so that the ground can be tangent to the wheels;
Other directions: 3 times the length of the vehicle.
Figure 5: The recommended sizing of the domain for a car aerodynamics case.
For this simulation project, we are going to use only half of the car, due to symmetry. Please set up the enclosure dimensions as shown below:
Figure 6: The dimensions of the enclosure
Minimum (x) value: -15 m
Minimum (y) value: -15 m
Minimum (z) value: -0.01 m
Maximum (x) value: 40 m
Maximum (y) value: 0 m
Maximum (z) value: 15 m
After you are done, click ‘Start‘.
1.2 Create the Simulation
Figure 7 shows the resulting enclosure. Proceed by clicking on the ‘Create a Simulation’ button.
Figure 7: Resulting enclosure, which represents the fluid domain for this tutorial
Doing so opens the analysis type choice widget:
Figure 8: Analysis type choice widget
Choose ‘Incompressible’ as the analysis type. It can be used for cases where the Mach number remains lower than 0.3 in the entire domain, which will be the case for this tutorial. Proceed by clicking on the ‘Create Simulation’ button.
The simulation tree will be visible on the left-hand side of the interface. We have to set up all entries, to be able to run the simulation. The global settings of the simulation remain as default:
Figure 9: Incompressible analysis properties
In this tutorial, we want to calculate the steady-state solution, which is independent of time. SimScale also supports transient analysis, which allows the calculation of time-dependent results.
Did you know?
The k-omega SST turbulence model is recommended for external aerodynamics cases.
It works as a blend between the k-omega and k-epsilon models. The k-omega model is predominant in the near-wall, switching to the k-epsilon model in the free-stream.
Find more information about the k-omega SST model in this documentation page.
1.3 Create Topological Entity Sets
Topological entity sets are groups of faces. They’re particularly helpful when the same group of faces is used several times during the simulation setup. The user can quickly select a given group of topological entities at once whenever they need to be assigned to a condition.
Let’s create three topological entity sets for this tutorial. To begin with, you will have to hide the walls of the enclosure. In order to do this, select all six faces of the domain by rotating the model (they should turn to red). Then right-click in the viewer, and pick the ‘Hide selection‘ option, so they turn invisible.
Figure 10: To manually select the faces of the wheel, the walls of the enclosure must be hidden using the workbench.
After the walls of the domain are hidden, follow the steps below:
Pick the 5 faces of the front wheel;
Create a new set by clicking the ‘+ button’ next to the Topological Entity Sets;
Name the set appropriately (e.g., ‘Front Wheel’) and click on ‘Create New Set‘ after you are done.
Repeat the same process for the 5 faces of the rear wheel.
Figure 11: Adding a topological entity set for the front wheel faces
Now, let’s create one topological entity set for the remaining faces of the vehicle. Follow the steps below:
Figure 12: Creating a topological entity set for the vehicle’s body
Hide the front wheel and rear wheel topological entity sets by clicking on the eye icon next to them;
Right-click in the viewer and click on ‘Select all’;
Click on the ‘+ button’ next to Topological Entity Sets;
Name the newly created set appropriately (e.g., ‘Body’).
After creating the Body topological entity set, you can make the enclosure walls reappear by right-clicking in the viewer and selecting ‘Show all’. The enclosure walls will be necessary to assign boundary conditions later on in the tutorial.
2. Assigning the Material and Boundary Conditions
Now we are ready to set up the physics of the simulation.
2.1 Define a Material
In the simulation tree, click on the ‘+ button’ next to Materials. Choose ‘Air’ from the material library that pops up.
Figure 13: List of presaved fluid materials available in SimScale
The flow region that was created at the beginning of the simulation setup is automatically assigned to the material:
Figure 14: Air properties
Did you know?
For this tutorial, we will use the default values for the air properties. It’s possible, however, to edit each one of the values from Figure 13 by clicking on them.
2.2 Assign the Boundary Conditions
The physical situation simulated is a car moving with 20 \(m/s\) through a breezeless environment. Now it is rather difficult to directly model the car’s velocity in a CFD simulation. We get the same result if we turn the situation around: Instead of a moving car, breezeless air, and the still-standing street, we make the car stand still and let the air around the car and the street move with 20 \(m/s\).
An overview of the boundary conditions for the domain can be seen below:
Figure 15: Overview of the boundary conditions applied to the walls of the enclosure
Similarly, for the car walls, the following boundary conditions are applied:
Figure 16: An overview of the boundary conditions as applied on the topological entity sets of the car
To create a boundary condition, click on the ‘+ button’ next to Boundary conditions, and select the desired type from the drop-down menu.
Figure 17: Adding a new boundary condition
a. Velocity Inlet
Let’s define the air velocity at the inlet patch. To do so, create a new boundary condition, selecting ‘Velocity Inlet‘ from the drop-down menu, as seen in Figure 16.
With a Fixed value velocity inlet boundary condition, the velocity that we define is a vector. You can use the orientation cube in the bottom-right corner of the viewer for reference. In this tutorial, let’s set the velocity in the x-direction to 20 \(m/s\).
Figure 18: Velocity inlet for the airflow.
b. Pressure Outlet
Create a second boundary condition, this time a ‘Pressure Outlet’. In incompressible analysis, the user has to specify a gauge pressure. The gauge pressure is relative to a reference value (ambient pressure, for example).
Therefore, a pressure outlet condition with 0 \(Pa\) gauge pressure is applied to the outlet face of the domain:
Figure 19: Pressure outlet on the domain
c. Walls: Slip Condition
For the third boundary condition, select ‘Wall’ from the drop-down menu. Set (U) Velocity to ‘Slip’.
The slip condition allows flow tangent to the face, but won’t allow flow in a normal direction. This is a good approximation for the top and side faces of the enclosure, which are far away from the car.
Therefore, assign the slip wall condition to the top (xy-plane) and the right side (xz-plane) of the domain, as seen below:
As previously discussed, a ‘Symmetry’ boundary condition will be applied to the symmetry plane, since we expect mirrored aerodynamic flow patterns about this plane:
Figure 21: Symmetry face of the domain
e. Wall: Moving Wall
Now, we are going to assign a boundary condition to the road. Create yet another ‘Wall’ boundary condition. This time, set (U) Velocity to ‘Moving wall’. In this configuration, the user can specify the tangential component for the fluid velocity on the assigned faces.
Define a velocity of 20 \(m/s\) in the x-direction, which is the same vector that was defined for the velocity inlet boundary condition:
Figure 22: The moving road assignment on the bottom face
f. Wall: No-Slip
The next ‘Wall’ boundary condition will have a no-slip condition for (U) Velocity. This defines a velocity equal to zero on the assigned entities.
Furthermore, we will use ‘Wall functions’ to model the near-wall velocity profiles. Assign this boundary condition to the previously created ‘Body’ topological entity set.
Figure 23: No-slip wall boundary condition for the faces of the vehicle’s body
Find in this article relevant information about wall functions and other wall treatments.
g. Wall: Rotating Wall – Front Wheel
We can model the rotating car wheels with a ‘Wall’ boundary condition. This time, select ‘Rotating wall’ for (U) Velocity. The following information is necessary to set up a rotating wall condition:
Point on axis: the user should define a point on the axis of rotation. In our case, the center of the wheel should be used as a reference. In Figure 23, we are using Onshape to determine the coordinates of a point on the rotation axis for the front wheel.
Figure 24: Obtaining the coordinates for a point on the front wheel’s axis of rotation
Rotation axis: this is the axis about which the faces will rotate. The direction of the rotation is given by the right-hand rule. In the right-hand rule, the thumb represents the rotation axis and the movement of the other fingers represents the direction of rotation. See Figure 24:
Figure 25: Rotation axis in the negative y-direction (red) and the resulting direction of rotation (blue), due to the right-hand rule.
(ω) Rotational velocity: the last parameter to define is the rotational velocity ω (\(rad/s\) for the wheels. It can be calculated using the formula (1) below:
$$\omega = \frac {U} {r} \tag{1}$$
Where \(U \ (m/s)\) is the linear velocity of the car and \(r\ (m)\) is the radius of the wheel.
In our case, the car velocity is 20 \(m/s\) and the wheel radius is 0.3495 \(m\) (see Figure 23). Therefore, our rotational velocity \(\omega\) is 57.22 \(rad/s\).
Now we have the necessary information to set up the rotating wall condition for the front wheel, as seen in the figure below:
Figure 26: Setting the rotating wall properties for the front wheel
Define (U) Velocity as ‘Rotating wall’;
Input ‘(0.916, -0.97, 0.349)’ for the Point on axis coordinates;
Specify ‘-1’ in the y-direction for the Rotation axis. The Rotational velocity is ‘57.22’ \(rad/s\).
Lastly, assign this boundary condition to the previously defined ‘Front Wheel’ topological entity set.
h. Wall: Rotating Wall – Rear Wheel
Finally, the same procedure is also followed for the rear wheel. The only difference between the front wheel and the rear wheel boundary conditions will be the Point on axis coordinates.
Please set up the last ‘Wall’ boundary condition as shown below:
Figure 27: Setting the rotating wall properties for the rear wheel
Define (U) Velocity as ‘Rotating wall’;
Input ‘(3.584, -1, 0.349)’ for the Point on axis coordinates;
Specify ‘-1’ in the y-direction for the Rotation axis. The Rotational velocity is ‘57.22’ \(rad/s\).
Lastly, assign this boundary condition to the previously defined ‘Rear Wheel’ topological entity set.
2.3. Set the Numerics & Simulation Control
The Numerics settings can be left as default.
In the simulation tree, click on the ‘Simulation control’ tab, and configure it as shown:
Figure 28: Simulation control properties
Change the Maximum runtime for the simulation to ‘30000’ seconds;
EnablePotential foam initialization. This setting initializes the velocity field and enhances stability in the early iterations.
Did you know?
In a steady-state simulation, the End time and Delta t parameters control the number of iterations to be performed. With the default settings, a simulation consists of a total of 1000 iterations, which is enough for most simulations to converge.
Lift and drag coefficients are some of the most important parameters when evaluating the performance of the flow aerodynamics of a vehicle. Therefore, let’s create a ‘Force and moment coefficients’ result control, as shown below:
Figure 29: Adding a set of coefficients calculation
Please set up the result control as below:
Figure 30: Settings for the force and moment coefficients result control
The Center of rotation coordinates of our car are determined as follows:
x coordinate: halfway between the center of the front and rear wheel;
y coordinate: on the symmetry plane;
z coordinate: on the ground level;
Using Onshape to determine the exact coordinates, our Center of rotation is located on ‘(2.246, 0, 0)’.
Set the positive z-axis as the Lift direction by applying 1. The other axes receive a value of 0;
Set the positive x-axis as the Drag direction by applying 1. The other axes receive a value of 0;
Set the positive y-axis as the Pitch direction by applying 1. The other axes receive a value of 0;
Apply 20 (m/s) as (|U<∞>|) Freestream velocity magnitude, which is the same magnitude that was defined for the velocity inlet boundary condition;
The Reference length is the car’s length along the x-axis. Our car’s length is 4.65 \(m\);
The Reference area value is a projection of the frontal car area onto a plane. It’s important to note that, as we’re using half of the car geometry, the area projection must account only for half of the model.
Figure 31: Using Onshape to determine the projected frontal area of half of the car
Assign the result control to all of the car faces. The easiest way to do that is by assigning the three previously created topological entity sets.
Important
Be careful when setting up the result control parameters, as they are used by the algorithm to calculate the drag and lift coefficients.
For the drag and lift formulas, and more examples on how to set up the forces and moment coefficients result control, please refer to the following articles:
For the meshing operation, we recommend using the standard algorithm. The standard mesher is a good choice in general, as it is quite automated and delivers good results for most geometries, with the following default properties:
Figure 32: The settings for the standard mesher.
Did you know?
Often, large changes in the mesh’s cell sizes only occur in a few regions. Increasing the global mesh refinements rises the number of cells drastically.
When using the standard mesher, SimScale offers a physics-based meshing option, which automatically refines the regions around the inlets and outlets.
You can also do this manually, by using one of the local refinement options, foremost being local element size and region refinements.
If you want to learn more about the Standard meshing algorithm, please have a look at the relevant documentation page.
3.1 Adding Refinements
Why do we need mesh refinements?
In external aerodynamic simulations, as air flows around the body, two regions have important physical effects: the regions close to the car body and the wake region, which develops downstream from the object.
Figure 33: Velocity profile around the car. Notice sudden changes around the car body and also the wake region downstream.
Since the gradients in velocity and pressure are large in those areas, they require finer cells to be resolved accurately. Therefore, further refinements will be necessary.
To add a refinement to your mesh, click on the ‘+ button’ next to Refinements.
Figure 34: Adding a new mesh refinement
a. Region Refinements
First, let’s create region refinements downstream from the car to capture the wake of the aerodynamic flow. A region refinement is used to refine the volume mesh for one or more user-specified geometry primitives.
First, create two new cartesian boxes, which will be assigned to the region refinements later on. Click on the ‘+ button’ next to the Geometry primitives in the right-hand side panel.
Figure 35: Adding a new geometry primitive
Then choose a ‘Cartesian Box’ from the drop-down menu.
The dimensions of the first box are the following:
Figure 37: First cartesian box created for region refinements.
Minimum (x) value: -5 m
Minimum (y) value: -5 m
Minimum (z) value: -0.2 m
Maximum (x) value: 15 m
Maximum (y) value: 1 m
Maximum (z) value: 5 m
Notice how the box extends further downstream from the car. The objective is to capture the high gradients from the wake, which is pictured in Figure 32.
Repeat the process for a second Cartesian box, now with the given dimensions:
Figure 38: Small cartesian box created for a region refinement. The smaller box also extends further downstream.
Minimum (x) value: -1 m
Minimum (y) value: -2 m
Minimum (z) value: -0.2 m
Maximum (x) value: 7 m
Maximum (y) value: 1 m
Maximum (z) value: 2 m
We are now ready to create the region refinements. Using Figure 33 as a reference, create a ‘Region refinement’. Set the Maximum edge length to 0.1 \(m\) and toggle on the ‘Large Box‘ selection:
Figure 39: Setting the region refinement properties for the large Cartesian box
Repeat the process for the Small Box. As the smaller box is closer to the surface, a finer discretization will be enforced. Please set the Maximum edge length to 0.07 \(m\):
Figure 40: Setting the region refinement properties for the small Cartesian box.
b. Local Element Size
This refinement is applied to faces, and limits the cell edge lengths based on the input.
Create a ‘Local element size’ refinement and set the Maximum edge length to 0.005 \(m\). Assign it to both ‘Front Wheel’ and ‘Rear Wheel’ topological entity sets, to capture the region next to the rotating walls accurately.
Figure 41: Local element size settings for the wheels.
3.2 Meshing Results
Now you can go back to the main meshing settings and click on ‘Generate’, as in Figure 31. Note that this is not a mandatory step: You can also just start the aerodynamic flow simulation and the mesh will be created automatically. However, let’s have a look at the finished mesh in this simulation before starting the simulation.
This mesh will take around 25 minutes to complete and this is what it will look like:
Figure 42: Mesh result; take a look what each refinement is doing.
Be Aware
This tutorial presents how the simulation is set up for a successful CFD run. The setup for this tutorial is simplified. To ensure the reliability of the results, a series of studies have to be performed.
Further tests with finer meshes, improved layering control, extended enclosures, etc., should be performed.
Naturally, it’s important to make sure that each of the simulation runs are also converging. For bigger meshes, it might be necessary to prescribe more iterations.
For more insights on how to assess convergence in a CFD simulation, please refer to this documentation page.
4. Start the Simulation
The simulation setup is now ready. We can proceed to create a new simulation run. To do so, click on the ‘+ button’ next to Simulation Runs.
Figure 43: Creating a new simulation run
This way, the mesh will be generated, and, afterward, the simulation run will start automatically. While the simulation results are being calculated, you can already have a look at the intermediate aerodynamic flow results in the post-processor. They are being updated in real-time!
You will also find a link to the finished project at the end of the tutorial.
Note
A red warning message may appear, stating that the duration of the simulation exceeds the maximum runtime. The defined maximum runtime of 30000 seconds will be enough for this simulation, therefore, please proceed by clicking on ‘Start’:
Figure 44: Creating a new run. You can proceed by clicking on ‘Start’
The simulation run takes from 2 to 3 hours to finish. At this point, you can access the post-processing environment by clicking on ‘Solution Fields’ or ‘Post-process results’:
Figure 45: Accessing the post-processing environment for a finished simulation run.
5. Post-Processing
5.1 Force and Moment Coefficients
The drag and lift coefficients are available in the ‘Force and moment coefficients’ tab:
Figure 46: Forces and moments result control, showing how the coefficients are changing over the iterations.
The plot shows you how the coefficients are changing throughout the simulation process, as the iterations go on. In a converged simulation, the coefficients will stabilize around a value.
Therefore, in a steady-state simulation, the intermediate results are important to assess convergence. The final, converged solution is the one that should be analyzed to obtain the aerodynamic flow parameters.
5.2 Surface Visualization
After accessing the post-processor by clicking on ‘Solution Fields‘, you can use several post-processing filters to further analyze the results. If the pressure distribution is not yet visualized, go to Parts color and change the Coloring to ‘Pressure’.
Figure 47: Pressure distribution in the fluid domain is automatically displayed when entering the post-processor. Changing the Coloring in the Filters panel will change the quantities visualized.
To better visualize the aerodynamic flow around the car you can hide the enclosure by selecting it, right-clicking your mouse, and choosing ‘Hide selection’.
Figure 48: Hiding the enclosure of the car to better visualize pressure distribution on the vehicle.
In Figure 48, we have the pressure contours on the car body. As previously discussed, these are gauge pressures. In the areas where aerodynamic flow stagnation occurs (e.g., on the bumper), pressure exhibits larger values.
Figure 49: Visualization of pressure distribution on the vehicle. Visualize other quantities by changing the Coloring in the Filters panel.
5.3 Cutting Planes
If you want to observe the aerodynamic flow characteristics around the car click the ‘Add filters’ button and create a ‘Cutting Plane’:
Figure 50: Selecting ‘Cutting Plane’ from the Filters panel
Configure the cutting plane by following the steps below:
Change the Position by changing the coordinates to: 12.5, -0.5, 7.495.
Make sure the Orientation is on the ‘Y’ axis.
Change the Coloring to ‘k’.
For example, the figure below is a cutting plane that is placed around the vehicle showing the turbulent kinetic energy (k) around the car.
Figure 51: Cutting plane around the vehicle to visualize turbulent kinetic energy
From the figure above, we can see that the car creates a disturbance in the aerodynamic flow which produces high turbulent kinetic energy, especially behind the trunk closer to the ground.
5.4 Streamlines and Animation
Streamlines are useful to visualize where aerodynamic flow separation occurs. To do this, select ‘Particle Trace’ from the Filters panel and its settings will be shown.
Next, pick the start position of the particles by clicking the button beside Position. Place this at the inlet of the enclosure and the streamlines will be shown from the start point. You can also modify the number of particles under # Seeds horizontally and # Seeds vertically. We will use ’20’ points horizontally and ’30’ points vertically. Change the Spacing of the streamlines to ‘5e-2’ and the size to ‘1e-2’.
Figure 52: Setting particle traces around a vehicle with position at the inlet and 20 points horizontally and 30 points vertically.
Animations can be started by choosing ‘Animation’ from the Filters panel. Click the play button to start the animation.
Animation 1: Velocity streamlines around a vehicle with aerodynamic flow separation at the trailing edge of the car combined with pressure contours on the body.
When combining the pressure distribution on the surfaces of the car with the velocity streamlines around the car, we can see that high pressure is created at the front when the velocity at the lowest. Aerodynamic flow seems to be accelerating as it travels over the roof and beyond. A Suction region with very low velocities can be analyzed with blue streamlines.
You can analyze the aerodynamic flow results further with the SimScale post-processor. Have a look at our post-processing guide to learn how to use it.
Congratulations! You finished the aerodynamic flow behavior tutorial!
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary Cookies
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.