You are on page 1of 62

KTH Formula Student

Hassan Hussein
Marlene Vivien Euchenhofer
Piyush Kalyankumar Deshpande
Sahil Kanchan

SD2229 Vehicle Dynamics Project Course


KTH Royal Institute of Technology
Stockholm, Sweden
October 28, 2022
Contents
1 AERODYNAMICS 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Tools used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3.1 Star CCM+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3.2 Supercomputer . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4.1 Modeling Geometry . . . . . . . . . . . . . . . . . . . . . . . 3
1.4.2 Surface Repair . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.3 Defining Region . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4.4 Meshing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.1 Physics Continua and Numerical Solvers . . . . . . . . . . . . 12
1.5.2 Boundary Layer Modeling . . . . . . . . . . . . . . . . . . . . 13
1.5.3 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . 16
1.6 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.6.1 Simulation Monitoring . . . . . . . . . . . . . . . . . . . . . . 18
1.7 Results and Validation . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.7.1 Mesh Convergence Study . . . . . . . . . . . . . . . . . . . . 19
1.7.2 Aerodynamic Sensitivity Study . . . . . . . . . . . . . . . . . 23
1.8 Convergence Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

2 LAP-TIME SIMULATION 31
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.2 Design Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.3 Lap-time Simulator - MATLAB . . . . . . . . . . . . . . . . . . . . . 33
2.3.1 CARbuilder . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.2 TRACKbuilder . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.3.3 TESTAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.3.4 LAPSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.4 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.4.1 Acceleration and Braking . . . . . . . . . . . . . . . . . . . . 47
2.4.2 Skidpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

References 52
1 AERODYNAMICS
Hassan Hussein 1 AERODYNAMICS

1.1 Introduction
Since the late 1960’s aerodynamics have had an ever-increasing role in racing cars
especially Formula 1. The main purpose of aerodynamics is to increase the normal
load on the tires for increased grip without the corresponding addition of mass. The
aerodynamic forces play a significant role in enhancing the performance of the cars.
To achieve the fastest lap time possible in a F1 car, drag force have to be minimized
and downforce need to be maximized. Downforce can be generated in F1 cars by
front wings, diffuser, rear wings, and the ground effect caused by the shape of the
undertray.
Formula Student is the largest educational Engineering competition in the world
where students design, manufacture and test a racing car in the style of F1. Stu-
dent teams from many universities around the world annually compete against each
other to build the best formula student car possible in terms of, among others,
performance, cost and reliability. KTH has its own team with over 80 members
called KTH Formula Student (KTH FS). This year, KTH FS is building a driver-
less electrical vehicle (DeV17) to participate with it in the 2022 Formula student
competition.

1.2 Purpose
The purpose of our project is to create Computational Fluid Dynamics (CFD) sim-
ulations of DeV17 with primary focus on mesh convergence and numerical error
analysis.

1.3 Tools used


1.3.1 Star CCM+
Star CCM+ is a computational fluid dynamics (CFD) simulation software developed
by Siemens Digital Industries Software that is used for modeling and analysis of
many engineering problems, mainly fluid flow. The software provides solutions for
multi physics simulations and helps the user to predict how products and designs
will behave in real-world environments [1].
It was recommended to use Star CCM+ as simulation software and Siemens license
was granted to us by KTH FS. Moreover, the provided CAD model of DeV17 was
already designed using Siemens NX, which made the use of Star CCM+ an intu-
itive decision since both NX and Star CCM+ are software developed by the same
company.

2
Hassan Hussein 1 AERODYNAMICS

1.3.2 Supercomputer
This project is based on running many CFD simulations with different mesh set-
tings from coarser to finer meshes to study mesh convergence, which made the
computational time immensely high, and our personal computers couldn’t handle
it. Therefore, a supercomputer needed to be used to run the simulation on.
With the assistance of our supervisor Mikael Nybacka, our project was granted the
use of a supercomputer called Dardel from the Swedish National Infrastructure for
Computing (SNIC). Dardel is a high-performance computing (HPC) system with a
theoretical peak performance of 13.5 Petaflops according to SNIC [2]. However, the
process of using Dardel was quite complicated and took us some time to familiarize
ourselves with it. This was achieved with the help of Professor Mihai Mihaescu and
Marco Laudato from Fluid Mechanics department at KTH.
In order to log in to Dardel, a SSH key pairs and a Kerberos ticket need to be gener-
ated. To start with, Dardel uses SSH (Secure Shell) key pairs as an authentication
method. Briefly speaking, the user needs to generate a key pair that contains a
private and a public key. The public key should be uploaded to the SSH server on
SNIC login portal to be able to encrypt data. The private key as the name tells
should be kept private and can decrypt data on the user side when connecting to
the corresponding public key [3]. A valid Kerberos ticket need to be created and
stored on the user computer to be forwarded to the remote system when the used
try to login. The software Putty was used to generate SHH key pairs and Kerberos
v5 software (from Heimdal) to generate Kerberos tickets.
There are two ways to use Dardel, the first one is to submit jobs to the queue system
to be ran. The user can submit the simulation and close the terminal where Dardel
will run it and save the solution when the turn comes. However, the simulation
needs to be ready for running before submitting and the mesh needed to be cre-
ated already on our personal computers. The second way is to run the simulation
interactively, this means that the user can run Star CCM+ and control it directly
through terminal. The first way was used to run simulations with coarser meshes
that could be generated on our personal computer and the second way was used to
generate finer meshes as well as running the simulations directly on Dardel.

1.4 Pre-processing
1.4.1 Modeling Geometry
As mentioned before, CAD model of DeV17 was provided to us by KTH FS to use
it in our simulations. The first step was importing the 3D-CAD model into Star
CCM+ environment and making some modifications to it. Due to the fact that
the car is axially symmetrical, it was enough to study and build simulations of half
the car. This helped to reduce the computational time of the simulation by half.

3
Hassan Hussein 1 AERODYNAMICS

For this reason, all components on the right side of the car were removed and only
components on the left side were preserved.
Other modifications were made on the vehicle’s CAD model directly inside Star
CCM+ such as closing small holes on the surface, imprint intersecting surfaces and
simplifying the electrical machines into simple filled cylinders of the same size. This
was also done to reduce the computational time of the simulation. Once the design
modifications have been completed, all parts were renamed and reorganised under
body groups to make it easier to deal with later. The last thing that was done
within the 3D-CAD model in Star CCM+ is creating and exporting two coordinate
systems, one coordinate system in the center of each wheel. This was done to help
define the rotation direction of the wheels later when setting up the boundaries.
Afterwards, a new geometry part was created from the modified 3D-CAD model of
the car. Additionally, a driver head part was also created to represent the driver of
the car.
The next step was creating a new part in the shape of a block to represent the
computational domain. A computational domain is the part of space where the
solution of the CFD simulation is calculated. It plays the part of a wind tunnel
in wind tunnel testing. The domain’s surfaces were split by patch to sex different
surfaces to be able to assign specific properties to each surface. Surfaces were named
as: inlet, outlet, top, ground, side plane and symmetry plane as shown in figure
1.

Figure 1: Half car CFD computational domain with initial size.

4
Hassan Hussein 1 AERODYNAMICS

The upstream distance should be long enough to allow the flow to adjust before
reaching the car and the downstream distance should be even longer to allow space
to the boundary condition imposed at the domain outlet. However, both distances
can’t be long to unlimited degree because this will cause a great increase in the com-
putational time which should be avoided. Taking that into consideration along with
the recommendations given by KTH FS, the upstream distance initially decided to
be one car length, and the downstream distance to be two cars length. Accordingly,
the initial size chosen of the domain was 12X2.25X3 meters, where the length is four
times the length of the car along the flow direction, the width is about two times
the width of the car and the height is a little more than two times the height of the
car.
However, it turns out later on that the initial lengths chosen of the upstream
and downstream distances were not long enough and caused simulation failure.
Therefore, domain size needed to be changed, but this will be addressed in sec-
tion 1.8.

1.4.2 Surface Repair


Since CAD models sometimes have discrepancies in the definition of their surfaces
and contains unclean geometries that can cause problems in the mesh process [4], it
was important to search for surface problems and repair them before start meshing.
This can be done using the Surface Repair tool in Star CCM+ that helps to diagnoses
surface errors and allows the user to manually repair them. The validity of the
surfaces on DeV17 geometry was checked and over 300 errors were found which
makes the manual repair process inconvenient and time consuming. Therefore, the
Surface Wrapper tool was used instead.
A Surface wrapper is a tool in Star CCM+ that can be used to provide a closed,
manifold, non-intersecting surface when working on a poor-quality CAD model that
contains many errors that can’t be fixed easily using manual repair [5, 6]. The
process is like wrapping the car with plastic wrap. The level of detail in the Surface
Wrapper is corresponding to how carefully the procedure is performed. However,
the result of the Surface Wrapper is not optimal and should be used together with
the Surface Remesher tool to provide a high-quality surface that can be used in the
mesh processing [5]. Default and custom controls of the Surface Wrapper used are
presented in table 1 and table 2 respectively and the resulting Surface Wrapper is
shown in figure 2 and figure 3.

5
Hassan Hussein 1 AERODYNAMICS

Table 1: Default controls of Surface Wrapper.

Control Value Unit


Base size 10 mm
Target surface size 10 mm
Minimum surface size 5 mm
Surface curvature 36 Pts/circle

Figure 2: Surface Wrapper in xz-plane.

Figure 3: Surface Wrapper.

6
Hassan Hussein 1 AERODYNAMICS

Table 2: Custom controls of Surface Wrapper.

Part Control Value Unit


Target surface size 2 mm
Chassis
Minimum surface size 1 mm
Target surface size 0.5 m
Domain
Minimum surface size 0.5 m
Target surface size 2 mm
Driver Minimum surface size 1 mm
Surface curvature 180 Pts/circle
Target surface size 3 mm
End-plates
Minimum surface size 1 mm
Target surface size 1 mm
Rods Minimum surface size 0.5 mm
Surface curvature 36 Pts/circle
Target surface size 3 mm
Side pod Minimum surface size 0.6 mm
Surface curvature 360 Pts/circle
Target surface size 3 mm
Under-tray
Minimum surface size 1 mm
Target surface size 2.5 mm
Wheels Minimum surface size 0.7 mm
Surface curvature 360 Pts/circle
Target surface size 5 mm
Wing large Minimum surface size 1 mm
Surface curvature 360 Pts/circle
Target surface size 5 mm
Wing Medium Minimum surface size 0.7 mm
Surface curvature 360 Pts/circle
Target surface size 1 mm
Wing small Minimum surface size 0.1 mm
Surface curvature 360 Pts/circle

7
Hassan Hussein 1 AERODYNAMICS

1.4.3 Defining Region


CFD simulations in Star CCM+ are defined by regions where a mesh can be gen-
erated, and the simulation’s physics can be solved [5]. Regions are different from
geometries, where geometry parts are used to define, curves, edges, faces and sur-
faces that describe the shape of our model and represent its geometry. On the other
hand, a region is a volume in space that is surrounded by boundaries to describe
the setup of the simulation. Therefore, a region needed to be created and relation-
ships between the geometry parts and the region needed to be set up by boundary
conditions.
A velocity inlet condition was imposed at the domain’s inlet with a velocity mag-
nitude of 40 km/h, and a pressure outlet condition was imposed at the domain’s
outlet. The ground was set to no-slip wall condition moving with a velocity of 40
km/h in the positive x-direction with rotating wheels at 50.28 rad/s. Symmetry
plane condition was imposed on the rest of the domain’s surfaces which are top,
side plane and symmetry plane. Lastly, no-slip wall condition is also used on the
surface of the vehicle.

1.4.4 Meshing
A mesh (also called grid) is a discretized representation of a continuous geometric
shape by dividing it into many finite elements called cells for the purpose of easier
calculations [5]. Generating the mesh for only the half car reduced the number of
cells by half, which consequently reduced the computational time significantly. The
operation Automated Mesh in Star CCM+ was used to generate the mesh of DeV17.
Automated mesh generates surface and volume meshes automatically after selecting
mesh settings by the user [5].
The mesh settings used are Trimmed Cell Remesher, Surface Remesher, Automatic
Surface Repair and Prism Layer Mesher. Trimmed cells are polyhedral cells but can
usually be recognized as hexahedral cells with one or more corners and/or edges that
are cut off [7]. The topology used is trimmed because it is recommended for modeling
external aerodynamic flows which is the case in this project. It provides high-quality
mesh for both simple and complex geometries and also allows cell refinements in the
wake region behind the car. Surface Remesher and Automatic Surface Repair were
used to improve the overall quality of the surface accomplished through Surface
Wrapper. Lastly, Prism Layer Mesher was used to build thin layers of cells normal
to the surface to help determine the flow solution close to the wall. Prism layers are
important and required to enhance the accuracy of the solution. [5, 6, 8] The prism
layers around the rear wing are displayed in figure 4.
After selecting mesh settings, default controls such as cell base size, minimum sur-
face size, surface curvature and other controls were specified together with custom
controls for each part of the car. Custom controls were used to control the level

8
Hassan Hussein 1 AERODYNAMICS

Figure 4: Prism layers around the leading edge of rear wing.

of detail on each part separately e.g., wings have smaller cell size to resolve the
flow with higher resolution and improve the accuracy of the solution. On the other
hand, the domain can have bigger cell size due to its simple geometry. Default and
custom controls of the automated mesh used are presented in table 3 and table 4
respectively and the resulting mesh is shown in figure 5 and 6. Darker areas in figure
5 and 6 represents smaller cells with higher resolution.

Table 3: Mesh default controls.

Control Value Unit


Target surface size 100 % of base size
Minimum surface size 50 % of base size
Surface curvature 36 Pts/circle

9
Hassan Hussein 1 AERODYNAMICS

Table 4: Mesh custom controls.

Part Control Value Unit


Target surface size 20 % of base size
Chassis
Minimum surface size 10 % of base size
Target surface size 5000 % of base size
Domain
Minimum surface size 5000 % of base size
Target surface size 20 % of base size
Driver Minimum surface size 10 % of base size
Surface curvature 180 Pts/circle
Target surface size 30 % of base size
End-plates
Minimum surface size 10 % of base size
Target surface size 10 % of base size
Rods Minimum surface size 5 % of base size
Surface curvature 36 Pts/circle
Target surface size 30 % of base size
Side pod Minimum surface size 6 % of base size
Surface curvature 360 Pts/circle
Target surface size 30 % of base size
Under-tray
Minimum surface size 10 % of base size
Target surface size 25 % of base size
Wheels Minimum surface size 7 % of base size
Surface curvature 360 Pts/circle
Target surface size 50 % of base size
Wing large Minimum surface size 10 % of base size
Surface curvature 360 Pts/circle
Target surface size 50 % of base size
Wing Medium Minimum surface size 7 % of base size
Surface curvature 360 Pts/circle
Target surface size 10 % of base size
Wing small Minimum surface size 1 % of base size
Surface curvature 360 Pts/circle

10
Hassan Hussein 1 AERODYNAMICS

Figure 5: Mesh with 6 cm base size.

Figure 6: Mesh with 6 cm base size in xz-plane.

11
Marlene Euchenhofer 1 AERODYNAMICS

1.5 Modelling
1.5.1 Physics Continua and Numerical Solvers
When preparing our simulation environment in a computational fluid dynamics
(CFD) software, we must not forget the importance of the physics and numerical
solvers we use to model the behavior of the flow in the flow domain, as they influence
the course and outcome of the simulation. For all of our simulations, we simulated
a gas (air) in a three-dimensional field with constant density, due to the relatively
low velocities for which we mimicked the aerodynamic performance of the car. A
choice that needs to be made about how the simulation is meant to be solved by the
software also concerns whether a steady or an unsteady solver should be applied. An
unsteady solver is to be used when the flow is not expected to significantly change
over time. If oscillation occurs behind the body or separation is identified while
monitoring the simulation, one can switch to an unsteady solver [9]. Although we
expected separation at the back of the car around the rear wing, we decided to use
a steady solver in order to save computational time, and as the separation at the
back of the car was not expected to massively influence the flow around the other
components of the car which all are located upstream of the separation area. As
long as the aerodynamic coefficients and forces that were monitored did not show
the typical periodic fluctuations of unsteady flow behavior, we decided that this
simplifying compromise could be taken. In STAR-CCM+, just like it is the case
with most other common CFD software, there are two different numerical solvers
that can be used for simulating the flow field: a coupled flow solver and a segregated
flow solver. The coupled flow solver is a density-based one, that is advised to use
for Mach numbers above 0.2 [5] and when shock waves occur. As we model a car
that performs at much lower speeds, we can assume incompressible flow. Therefore
the coupled flow solver becomes inefficient and the choice should be made to use the
segregated flow solver, which is a pressure-based one that solves the flow equations
separately, which leads to a significant reduction in computational time and memory
consumption [9].
A flow that is experiencing spacial and time-wise irregularities and fluctuations on
a small scale is defined as turbulent. This is the case for most flow problems in
engineering [5]. The most common way to handle these fluctuations in turbulent
flow is by using the Reynolds-Averaged Navier-Stokes (RANS) equations, where the
instantaneous flow variables, here, generalizing, referred to as ϕ, gets decomposed
in an averaged component ϕ, and a fluctuating one ϕ′ . The simple relation can be
seen in equation 1 [5].

ϕ = ϕ + ϕ′ (1)

One then has to decide which RANS turbulence model to use. The models that were

12
Marlene Euchenhofer 1 AERODYNAMICS

considered for our project are the k-epsilon model and the k-omega mode, both of
which solve two transport equations. The k-epsilon model solves an equation for the
turbulent kinetic energy k and one for the eddy dissipation rate ε, while the k-omega
model solves its second equation for the specific eddy dissipation rate ω ∝ kε [9].
While the strengths of the k-epsilon model lie in its robustness concerning freestream
fluctuations, it is rather insensitive to adverse pressure gradients and shows a weaker
performance when it comes to modeling boundary layer behavior. Therefore it is
less often used in aerodynamics applications than the k-omega model. Still, in order
to compare the computation outcomes of the two models, the k-epsilon model was
also applied to some of the simulations run during this project. The k-omega model
does much better performing when it comes to modeling viscous sublayer, which
will be discussed in section 1.5.2, and the boundary layer in general [10]. As it is
relatively sensitive though to variations in the freestream conditions and therefore
to the conditions at the inlet boundary, an extension of the model, called the SST
(shear-stress transport) k-omega model, is the one that is most commonly used and
advised to be used in aerodynamic simulations. It combines the two previously
discussed models and thereby allows for accurate modeling of the boundary layer
region while implementing the advantages of the k-epsilon model in the far field [5].
The boundary layer, the paramount region of the flow around a body, that has been
referred to several times now will be addressed in the next section.

1.5.2 Boundary Layer Modeling


Near a solid wall, the flow behaves differently than in the outer flow field, and
viscous effects need to be taken into account, as the tangential velocity approaches
zero when we move closer towards a solid wall, or in our case, the surface of the
model in the flow domain. Therefore, when setting up a mesh, we need to pay
special attention to these regions, where the so-called boundary layer forms. The
typical velocity profile of such a boundary layer can be seen in figure 7.

Figure 7: A typical boundary layer profile over a flat surface [11].

The function u(y) describes the velocity parallel to the surface with the wall distance

13
Marlene Euchenhofer 1 AERODYNAMICS

y. The thickness δ of the boundary layer is usually described as the distance of the
wall where the velocity reaches 99% of the value of the far field velocity u0 [12] and
therefore often referred to as δ99 . In order to adequately cover the flow’s behavior
in the boundary layer region, as mentioned in section 1.4.4, so-called prism layers
are created in the mesh close to the model’s surface. Those cells typically are of
much smaller dimensions in the direction normal to the wall, compared to the cells
located farther from the body, in order to cover the velocity gradient in this region.
The special attention towards this region is often referred to as Wall Treatment
in CFD. In order to discuss the fluid’s behavior independently from the individual
problem, dimensionless quantities are often used. The ones of interest to us are the
dimensionless tangential velocity u+ and the dimensionless normal wall distance y+.
The latter especially is of great importance when it comes to the inner region of the
boundary layer. In the viscous sublayer, where viscous effects dominate the flow
behavior, u+ only depends on y+, which is the case for y+ < 5. For 5 < y+ < 30,
viscous effects and turbulent stresses equally dominate. This is the buffer layer,
which is followed by the log layer for values of y+ between 30 and 500, where
solely turbulent stresses are present and the two dimensionless quantities are in a
logarithmic relation to each other. Figure 8 shows u+ plotted against y+ for this
inner region of the boundary layer.

Figure 8: The dimensionless velocity u+ over the dimensionless wall distance y+ in


the inner region of a boundary layer [13].

Concerning the prism layers in the mesh, two input parameters should be attuned
to the boundary layer: the height of the first prism layer cells and the total thickness
of the prism layers. The height of the prism layer closest to the surface should be
chosen in a way that the value of y+ in this cell reaches unity so that the first cell

14
Marlene Euchenhofer 1 AERODYNAMICS

covers the viscous sublayer. This is often referred to as the low y+ approach [9].
Through the following series of calculations, one can come up with a first estimation
of these values. We decided to follow the algorithm provided by Wimshurst [14], and
as adviced by Wimshurst himself, all equations were cross-checked with Schlichting
[15]:
First, the Reynolds number Re needs to be calculated, using the fluid density ρ, the
free stream velocity u0 , a characteristic length of the surface L, for example, the
chord length of the wing, and the fluid’s dynamic viscosity µ:

ρu0 L
ReL = (2)
µ

Based on that, one must then choose an empirical correlation for the skin friction
coefficient cf . Although for the front wing, for example, we can expect laminar flow,
based on the Reynolds number due to its smaller chord length, for simplification we
only use one correlation for cf , which is for turbulent flow over a flat plate at
Re < 109 :

cf = [2 log10 (ReL ) − 0.65]−2.3 (3)

We then use the skin friction coefficient to first calculate the wall shear stress coef-
ficient τω and after that the friction velocity uτ :

τω = 1/2ρu20 cf (4)

r
τω
uτ = (5)
ρ

The relation between y+ and uτ can be seen in equation 6:

ρyuτ
y+ = (6)
µ

We aim for a value of y+ of one in the center of the first cell, therefore, when
y
calculating the height yh0 of the first cell, we set y = h20 and y+ = 1.
The height of adjacent prism layers increases with the growth rate r. The identity
that can be used to calculate the total height of all n prism layers combined can be
seen in equation 7.

15
Marlene Euchenhofer 1 AERODYNAMICS

1 − rn
 
yhtotal = yh0 (7)
1−r

Based on the Reynolds number calculated through equation 2, we can make an


estimation for the thickness of the boundary in case of laminar flow for ReL <
5 · 105 :

4.91L
δ99 = √ (8)
ReL

and in case of turbulent flow for ReL > 5 · 105 :

0.38L
δ99 = 1/5
(9)
ReL

The outcome of the respective calculation for δ99 gives a first estimate for the re-
quired combined thickness of the prism layers. One then needs to either set a value
for the growth rate r or for the number of prism layers n. The other value is then
set through the relation shown in equation 7. Table 5 show exemplary results for
the calculations for selected characteristic lengths of the model1 :

Table 5: Boundary Layer calculations for selected car components

specified object char. length [m] yh0 [m] δ99 [m]


Front Wing 0.423 5.8e-5 0.0126
Rear Wing (large) 0.443 5.9e-5 0.0130
Rear Wing Endplate 0.621 6.0e-5 0.0171
Full Car 3.936 7.1e-5 0.0116

Figure 9 shows the distribution of y+ for three different prism layer setups with a
decreasing thickness for the first layer cells from figure 9a, with the default settings
for the prism layers to figure 9c, where the value for y+ becomes a little to low
on a large majority of the surface area. The effect of these modifications will be
addressed in section 1.7.1.

1.5.3 Boundary Conditions


As mentioned in section 1.4.3 we assign all surfaces in our flow field to a region in
which our fluid flows. All these surfaces then need to be assigned a certain type
of boundary by which we set the conditions or values that need to be met there.
1
Based on the Reynolds number, either equation 8 or correlation 9 is used for the boundary
layer thickness.

16
Marlene Euchenhofer 1 AERODYNAMICS

(a) yh0 = 8e-3 m, 12 prism layers

(b) yh0 = 6e-5 m, 20 prism layers

(c) yh0 = 5e-5 m, 20 prism layers

Figure 9: The near wall distribution of 0 ≤ y+ ≤ 2, where y+ = 1 is the desired


optimum.
17
Marlene Euchenhofer 1 AERODYNAMICS

By default, all surfaces are walls. This means that no fluid can pass through them
and that the no-slip condition holds. We stuck with the default setting for all the
surfaces of the car model. The wheels of the car were, additionally to being set
as walls, assigned the attribute to rotate around their center axis with a relative
rotation velocity that matches the virtual speed of the car. The rotation rate ωrot
with respect to the free stream velocity u0 and the wheel radius R was calculated
using the following relation:

u0
ωrot = (10)
R
The ground of the domain was also set as a wall, but instead of a static one, as
one that moves in the same direction as the flow. That way, the no-slip condition
holds without forming a velocity gradient, as the ground does not move relative
to the flow. In order to avoid the formation of a boundary layer at the top of
the domain, we assigned it the type of a symmetry plane, just like the two side
faces of the domain, where one actually is a symmetry plane concerning the half-car
model. The inlet of the domain was set as a velocity inlet with the flow entering
normal to the surface with a constant velocity magnitude that is equal to the speed
of the car that is to be simulated. As explained in this paragraph, there was no
velocity profile that needed to be defined, as the no-slip condition was avoided on
all four neighboring surfaces of the inlet. The outlet of the domain was assigned
to be a pressure outlet, meaning that the pressure was the value that was set as
a boundary condition for this plane. The pressure was set to be the same as the
ambient pressure, therefore the flow would exit the domain without producing any
pressure force over this surface [5].

1.6 Simulation
1.6.1 Simulation Monitoring
Once we run a simulation, we can monitor the behavior of some quantities to judge
the validity of the simulation and the reliability of its results. Usually, the first
sources of information in order to judge whether a simulation converges as desired,
are the residuals. The residuals represent the average global error of a flow variable
of the different transport equations that are solved in the flow field. By default,
the residuals are normalized by their maximum value of the first five iterations so
that they become more comparable. For steady simulations, as it was the case in
our project, the goal is that the residuals converge with an increasing number of
iterations over the course of the whole simulation [5]. A general rule of thumb is that
the normalized residuals should drop by three orders of magnitude in order for the
simulation to properly converge. Still, there are limitations when it comes to judging
the convergence and validity of a simulation only by monitoring the residuals. While
a simulation that starts off with an initial bad guess for the numerical solution

18
Marlene Euchenhofer 1 AERODYNAMICS

progresses by dropping three orders of magnitude without properly converging, a


simulation that has a very low error from the beginning on might not drop much in its
residuals and still provide good and reliable results. Therefore, it is advised to also
monitor other quantities and examine their behavior [10]. As different quantities
might not approach an asymptotic limit after the same number of iterations [5],
we chose to monitor more than one quantity, making sure, that all of them have
converged by the time the simulation is stopped. In our case, we chose to monitor the
aerodynamic forces drag and downforce, as well as the aerodynamic moment around
the most forward point of the car, the nose of the chassis. The moment monitor, was
usually the one that took the most iterations to converge. This behavior exemplarily
can be seen in figure 10, where different monitors for a simulation of a mesh with
5225253 cells at a velocity of 40 km/h are plotted. The residuals in 10a show an
acceptable convergence behavior by dropping in several orders of magnitude and
ultimately reaching an asymptotic minimum. While one might be tempted to stop
the simulation after 400 iterations when only monitoring the drag force which can be
seen in 10b, the same plot shows, that the downforce, as well as the y-Moment seen
in 10c, take approximately 200 further iterations in order to reach an acceptable
convergence.
In the end, we decided to go with the default settings of always running the sim-
ulation for 1000 iterations if no errors came up. Therefore we only monitored the
solutions to decide whether a simulation was credible, as we always wanted to make
sure that no errors occur after the results seemed to have already converged. Had
we relied on the convergence of the residuals and different quantities as an indicator
of when to stop simulating, we could have saved up to 45% of computation time
for some simulations as can be seen in the figures 10. For the simulations we ran
on the supercomputer, this did not highly influence our progress in the project.
For the simulations we ran on our personal machines or in the lab, on the other
hand, we could have saved crucial time in order to set up and run more simula-
tions for different mesh settings and therefore possibly could have gathered more
results.
When monitoring the residuals while the simulation is still running, one can often
guess the upcoming termination of a faulty simulation by a sudden increase in the
residuals. Facing such issues is a common obstacle in CFD. The ways we used to
troubleshoot these complications will be discussed in the upcoming section.

1.7 Results and Validation


1.7.1 Mesh Convergence Study
The main study that was conducted was a mesh convergence study, often also re-
ferred to as mesh sensitivity or mesh independence study. The aim of such a study
is to start with creating a coarse mesh and further increase the level of detail, by

19
Marlene Euchenhofer 1 AERODYNAMICS

(a) Residuals monitor plot

(b) Force monitor plot

(c) y-Moment monitor plot

Figure 10: Monitor plots for a mesh with a base size of 8 cm and 5225253 cells.
20
Marlene Euchenhofer 1 AERODYNAMICS

approaching a finer level of discretization and thereby increasing the total number
of volumetric mesh cells. One then needs to monitor and compare the results for
one or several parameters of the simulations in order to evaluate the refinement
process of the mesh. The goal of such an iterative process is to determine a valid
balance between the level of discretization of the flow field, which directly influences
the computational time for each simulation, and the accuracy of the solution [9]. In
the case of this specific study, the parameter that was directly altered in a range of
7-12 cm was the base size of the cells. As this parameter is a reference size for the
target and minimum surface size, as well as the prism layer total thickness, these
quantities were also affected by the change in the base size. For comparing the
simulation results, the two aerodynamic quantities that were investigated for differ-
ent mesh settings were the lift coefficient CL and the drag coefficient CD , both for
the full package of the car2 . The values for the two coefficients plotted against the
number of cells in million can be seen in figure 11, which additionally includes some
wind tunnel test results obtained by the KTH Formula Student team [16]. Both the
simulations and the tests were performed at a flow speed of u0 = 40 km/h. The
underlying simulations were conducted using the favored SST k-omega turbulence
model that was already addressed in section 1.5.1.

Figure 11: Mesh independence study on CL and CD , using the k-omega turbulence
model at u0 = 40 km/h.
2
The lift coefficient CL will only be considered in magnitude in this study. Both coefficients CL
and CD are based on a reference area of 1 m2 as advised by the KTH Formula Student team.

21
Marlene Euchenhofer 1 AERODYNAMICS

Despite some fluctuations, a downward trend for both CL and CD with increasing
cell count can be seen. It can therefore be implied, that the error due to a lower
level of discretization leads to producing higher aerodynamic coefficients in this
case. What can also be observed is that both coefficients approach the respective
lower values from the comparable wind tunnel test with a finer discretization of
the simulated region. Yet, the coefficients do not decrease monotonically with an
increase in the cell count of the mesh, and especially CL shows great discrepancy
from the chosen reference test result.
The non-monotonic behavior can most probably be explained by the thickness of
the prism layers which was not kept at a constant level but was usually linked to the
base size. As however explained in section 1.5.2, the prism layer thickness should
aim to match the boundary layer thickness. Determining proper, fixed thicknesses
for the prism layers and keeping them constant could have canceled out one factor
of uncertainty to make the results more comparable and possibly result in a clearer
trend, as demonstrated by the two simulations run with the largest number of cells.
For the second largest mesh, the thickness of the near-wall prism layer was created
to match a value of y+ close to unity within the first layer of cells. While the
simulation run on this mesh with 10.9 million cells was the one that produced the
lowest values for the force coefficients, the simulation on the mesh with 11.1 million
cells, which had an even smaller thickness for the first layer of prism cells, resulted
in values that were a little higher again. Investigation into the near-wall values for
y+ showed that, in this case, on large areas of the body, y+ was lower than the
target value of one. The distributions of y+ for those two simulations can be seen
in figures 9b and 9c respectively. This shows, that making the estimations for the
boundary layer that were suggested in section 1.5.2 should be taken into preliminary
consideration and always need to be kept in mind before setting up a mesh.
The large overall discrepancy between the simulation results for CL and the re-
spective results from the tests can be explained by the limited comparability of the
setups. While the flow around the car was simulated for a ride height of 25 mm and
with rotating wheels, in the adduced wind tunnel test series, the car was lifted to
a ground clearance of 57 mm, in order to make the non-rotating wheels not touch
the ground. The main reason for the discrepancy in the values of CL is therefore
most likely the more than doubled ground clearance, which is expected to have sig-
nificantly lowered the suction under the car, leading to much lower values for the
downforce, compared to a setup with a ride height comparably to the one that was
used in the simulations. Moreover, it has to be mentioned that the side pods in the
car model were empty, as no radiator was included in the CAD model, also leading
to a different flow field around the car. The flow around such a complex model as a
formula student car is highly sensitive to all kinds of small adjustments in the setup,
leading to large influences on the whole flow field, and therefore also on the com-
puted results. One could either assume, that adding a radiator would increase the
drag due to the air being pushed through narrower slots and an overall smaller area

22
Marlene Euchenhofer 1 AERODYNAMICS

in the sidepod or to more air, therefore, being redirected around the sidepod and
away from the car, resulting in less drag, due to a lower level of turbulence created
around the car. As no further investigation was undertaken on this aspect of the
car design, it is hard to make a proper assumption about the effect of the radiator
on the force coefficients. Therefore, some uncertainty needs to be considered.

Figure 12: Mesh independence study on CL and CD , using the k-epsilon turbulence
model at u0 = 40 km/h.

As a formality, figure 12 shows the aerodynamic force coefficients CL and CD plot-


ted against the number of cells in millions for simulations ran, using the k-epsilon
turbulence model, again at a flow speed of u0 = 40 km/h, and including the same
abovementioned values obtained from the wind tunnel tests. Here, the trend is less
clear than for the SST k-omega turbulence model as seen in figure 11, and also the
assumed error is higher. This is in line with the recommendations from [5], [10], and
[9] to use the SST k-omega turbulence model over the k-epsilon turbulence model
for external aerodynamic flow investigations.

1.7.2 Aerodynamic Sensitivity Study


To find a way to connect the two subprojects Aerodynamics and Lap-Time Simula-
tions, a sensitivity study on the center of pressure for a variation of the flow speed
u0 was conducted. In order to determine the location of the center of pressure along
the x-axis, the forces and moments in the xz-plane, shown in figure 13, need to be

23
Marlene Euchenhofer 1 AERODYNAMICS

considered.

Figure 13: The aerodynamic forces and moment in the xz-plane of a formula student
car [17].

My is here defined as the y-Moment about the most forward point of the car, the
nose of the chassis. The following connectedness arises with the downforce FL and
the drag FD , along with their respective lever arms lL and lD :

My = −FL · lL − FD · lD (11)

Equation 11 includes two unknowns, lL , and lD . In order to find an approximate


x-location of the center of pressure, it was assumed that lD << lL and FD < FL , so
that equation 11 was simplified to:

My = −FL · lL (12)

Both FL and My can be directly obtained from the simulation. The center of
pressure/center of lift is from now on defined as the dimensionless quantity 0 ≤
CoL ≤ 1 obtained by dividing lL by the length of the full car l = 2.941 m. This
results in the following final relation:

My
CoL = − (13)
FL · lL

Simulations were run and the above mentioned calculation was executed for every 10
km/h from u0 = 10 km/h to u0 = 120 km/h. In figure 14a, the resulting values for
CoL are plotted against the respective velocities. Unlike expected, no trend for CoL

24
Marlene Euchenhofer 1 AERODYNAMICS

(a) Center of lift for varying velocity

(b) Downforce, drag and y-Moment for vary- (c) Aerodynamic coefficients for varying ve-
ing velocity locity

Figure 14: Sensitivity study for the center of lift on a mesh with 3195343 cells.

moving rearwards with an increase in the velocity due to an increasing contribution


of the rear wing to the overall downforce can be observed. Instead, the behavior of
CoL with a variation in the velocity seems rather erratic.
Figure 14b shows FL , FD , and My over the velocity for the same simulations. All
three quantities seem to show the expected quadratic behavior with an increasing
velocity. Taking a closer look at the dimensionless coefficients3 CL , CD , and CMy ,
as shown in figure 14c, though, one can clearly see, that CL and especially CMy vary
significantly with the velocity. The inaccurate results for the forces and the moment
can be attributed to mostly the same factors that were already explained in section
1.7.1. The one that needs further ellaboration here though is the effect of the total
thickness of the prism layers. In order to compare the result for different velocities,
3
All three coefficients are based on a reference area of 1 m2 as advised by the KTH Formula
Student team. For the moment coefficient, an exemplary lever arm of 1 m is used.

25
Marlene Euchenhofer 1 AERODYNAMICS

the same mesh, with the same specifications for the prism layers, was used for all
simulations within this study. As explained in section 1.5.2, the boundary layer
thickness and the wall distance at which y+ reaches unity rely on the velocity u0 .
As those two are the main parameters determining the setup of the prism layers in
a mesh, those cells should have been specified differently for each velocity in order
to properly simulate the flow in the critical boundary layer region. In order to
properly compare credible results, however, a mesh convergence for each simulated
velocity must have been conducted, which would have gone beyond the scope of this
project. Instead, the results were not implemented in the Lap-Time Simulations
and the lessons learned from this study, especially about the significant influence
of the treatment of the boundary layer region, were used towards the end of the
parallel performed mesh convergence study.

26
Hassan Hussein 1 AERODYNAMICS

1.8 Convergence Problems


Once the pre-processing phase was completed, simulations with different mesh set-
tings were ready for running. Some simulations worked and convergence achieved
but many others failed with error message: Floating point exception. This error
message usually appears due to several reasons such as division by zero and in-
valid operation [18]. This made the residuals increase significantly which caused the
divergence of the solution.
To find the cause of this problem and solve it, the following checking list was fol-
lowed:
• Checking geometry.
• Checking boundary conditions.
• Checking physics.
• Check mesh quality.
• Try different solvers.
• Apply under-relaxation factor.
To start with, dimensions of the geometry and all units were checked. Afterwards,
the tool Surface Repair was used to search and manually fix remaining surface
problems such as small holes, intersecting surfaces and other surface faults. All
boundary conditions were checked if they had been assigned correctly. Magnitude
and direction of inlet velocity, outlet pressure and wheels’ rotational speed and
direction were also verified. It was checked that the rotational speed of the wheels
matches the virtual speed of the car. Moreover, it had been checked that the physics
used in the simulation do indeed describe the real-world situation physics.
After checking all of the geometry, boundary conditions and physics, it was time
to check the mesh quality. A valid mesh cell is the one where a solution can be
calculated, and convergence can be achieved after running the simulation. Therefore,
it is important to check the validity and quality of the generated mesh cells to
diagnose problem areas. There are many methods to measure cell quality such as
checking face validity and Skewness angle of the cells [5]. Face validity measure the
correctness of face normals relative to the cell centroid that they are connected to. In
a good cell, all face normals are pointing outwards with respect to the cell centroid.
While in a bad cell, one or more normals are pointing toward the cell centroid.
Figure 15 shows a good and bad cell with respect to face validity. According to Star
CCM+ user guide cells with a face validity less than 1.0e-5 are considered bad cells
and should be avoided [5].

27
Hassan Hussein 1 AERODYNAMICS

Figure 15: Comparison between a good and a bad cell with respect to face validity.

Cell Skewness angle is another indicator of the mesh quality and suitability [5].
To understand Skewness angle, consider the two-dimensional representations of two
cells in figure Figure 16. The two cells are separated by a common face and the
Skewness angel θ is the angel between the face normal vector ⃗a and the vector
⃗ Therefore, it can be easily concluded that a
connecting the two cell centroids ds.
Skewness angel equal to zero is the ideal Skewness angel and the mesh is perfectly
orthogonal. According to Star CCM+ user guide cells with a Skewness angle greater
than 85◦ are considered bad cells and should be avoided [5].

Figure 16: Skewness angle between two-dimensional representations of two cells.

28
Hassan Hussein 1 AERODYNAMICS

After locating bad cells, custom controls around the bad areas were used to generate
a finer mesh with better quality. Moreover, a different solver than the previously
used one was tested. This time, k-epsilon was used instead of k-omega to solve
the same simulations. Eventually, it was realised that the domain size was small,
and the downstream distance wasn’t long enough to allow space to the boundary
condition imposed at the domain outlet which caused problems. Therefore, the size
of the domain was changed to 18X3X6 meters, where the length is now six times
the length of the car along the flow direction as shown in figure 17.

Figure 17: Half car CFD computational domain with correct size.

29
Marlene Euchenhofer 1 AERODYNAMICS

1.9 Conclusion
Although the initial goal of coming up with a completely new and entirely indepen-
dent mesh for the KTH Formula Student team to use has not been met to the full
extent, the project still provided us with some valuable insight and many lessons
learned. Taking a step back and starting from an easier mesh without having a
vast number of custom controls from the beginning saved us from getting lost in
errors and from not being able to run any simulations. The Mesh Sensitivity Study,
despite not fully converging, already shows a rather clear trend for the force coef-
ficients with an increasing number of cells. Further refinement needs to be made
to the crucial areas close to the body and in its wake. It was shown, that paying
special attention to the boundary layer/prism layer region, as pointed out in the
Aerodynamic Sensitivity Study, as well as a large enough size for the domain is
of uttermost importance and needs to be taken into account from the very begin-
ning. The latter mistake might have been avoided if we had organized more regular
and detailed consultations with the KTH Formula Student Aerodynamics team. A
larger domain might have also reduced the number of occurrences of the recurring
floating point error. The sprint approach we chose enabled us to tackle new specific
obstacles we faced each week and urged us to solve them until the next management
meeting. This step-by-step method was necessary and effective for us to proceed
with the new software and virtual environment we were working in and allowed us
to take some time in between and set up and run some trial and error simulations.
During the process of the course, we not only gained some valuable hard skills but
also important soft skills like how to plan, distribute and communicate workload
and progress in an engineering team. We further hope that the documentation we
provide of our work can help others gain a headstart when approaching CFD for
the first time and thereby benefit from our experiences.

30
2 LAP-TIME SIMULATION
Piyush Kalayankumar Deshpande Sahil Kanchan

2.1 Introduction
The advent of the Information Age has led to the transformation of Mechanical En-
gineering. The development of various software packages to simulate aerodynamics,
vehicle motion, stress analysis etc. has remoulded the way engineers solve problems.
As a result of the amendment, various mathematical tools help in analysing complex
problems with the click of a button.
Lap-time simulation is one of the best examples of application of computers to design
vehicles in order to optimise the available resources. It helps the designer evaluate
the vehicle performance based on various parameters and helps in determining the
best set of parameters for near perfect results[19].
In this part of the project, the design and development of a lap-time simulation
model, developed for KTH Formula Student team, is described and analysed in
detail.

2.2 Design Methodology


Time management and design methodology are crucial parameters for the success
of any project. The optimised use of allocated time and resources plays a vital role
in the timely completion of projects. Based on the time plan and the intensity of
the project, the sprint design methodology seemed to be the ideal fit.
Sprint methodology is defined as 5 day process to answer critical questions [20]. In
the sub-group, the design goals for SD2229 were discussed and envisioned in the
initial stages of the project. Once the project goals were set, weekly goals were
defined to distribute the work load equally in the defined timeline. With the goals
of the week defined, the modified sprint methodology was implemented with strict
weekly deadlines. The general workflow for the week is described in figure 18.
The sprint methodology followed is very effective as it breaks down the project goals
in smaller sub-sections making them easier to achieve. It helps in working effectively
on smaller parts of the project rather than the entire project at once, thus, enabling
to tackle every problem with an optimised solution.

32
Piyush Kalayankumar Deshpande Sahil Kanchan

Define Goals
Great process concepts begin
with a challenge that has to
be overcome. Begin by
identifying the challenges and
defining the goals for the
week. Brainstorm ideas
Think beyond the box to find
innovative solutions to the
problems you've recognized.
Don't limit yourself. All ideas
are good at this stage.
Narrow down ideas
Finalise on the process to be
followed minding the time and
resource constraints. Make
sure that the defined goal is
achieved.
Build a prototype
Work on the development of the
solution to the problem,
MTALAB script,, CarMaker
simulation, etc.
Test your prototype
Test the product developed and
make sure the results are
acceptable. Assess the
performance and test the
prototype to its limits.
Document
Once you are confident in your
solution, documnet the
process and product for future
reference and reports.

Figure 18: Sprint Methodology

2.3 Lap-time Simulator - MATLAB


The focus of the project is to develop a simulation package to help the KTH FS
team to design and develop existing and future vehicles. However, the simulations
require tremendous calculation, thus 4 different MATLAB codes are developed in
order to reduce the computational time and optimise resources[21]. The 4 different
MATLAB scripts are,
• CARbuilder - To initialise the vehicle.
• TRACKbuilder - To initialise the track.
• TESTAB - To simulate the acceleration and braking events.

33
Piyush Kalayankumar Deshpande Sahil Kanchan

• LAPSIM - To simulate vehicle performance on built tracks.

2.3.1 CARbuilder
Excel File
The parametric data is stored in an excel file to ease the change of their values. In
order to convert the vehicle into a model, data from many subsystems is required.
These subsystems are mainly classified into broader categories namely: Inertia,
Dimensions, Steering, Aerodynamics, Brakes, Tyres, Battery Management System
and Transmission. There are many sub-categories in these broader classifications
which have been assigned values based on how ”KTHFS-171” has been designed.
The motor torque curve has also been included in order to get a good understanding
of the torque generation by the motor at a given speed.
MATLAB File: CARbuilder
The data which is stored in the excel file is called into MATLAB via CARbuilder.
A general convention of direction has been followed to assign proper signs to the
forces being generated. The positive sign convention has been allotted to: In the
longitudinal direction (x-axis), forward motion; In the lateral direction (y-axis),
the left side, when sitting inside the vehicle; In vertical direction (z-axis), upward
motion; To consider the forces generated by any kind of banking on a road, a right
turn; The lateral movement of a vehicle, when seen from z-axis, resulting in yaw
motion, is turning left.
Subsystem Models
As mentioned earlier, the vehicle is divided into many subsystems. These subsys-
tems are converted into models to ease our own understanding of the functioning
of the vehicle. The vehicle is divided into subsystem models namely: Brake Model,
Steering Model, Powertrain Model, Tyre Model, External Force Model and Driver
Throttle and Brake Map Model.
• Brake Model: To replicate the braking capacity of the vehicle. The vehicle
uses the same brake cylinders in the front and the rear, thus giving an even
brake force distribution. The parameters calculated in this model are: Master
Cylinder Area, Piston Area and required Brake Pedal Force [22].

1. Master Cylinder Area (Amast ):


2
πDmast
Amast = (14)
4

2. Piston Area (Apist ):


2
πNpist Dpist
Apist = (15)
4

34
Piyush Kalayankumar Deshpande Sahil Kanchan

3. Required Brake Pedal Force (Fpedal ):


Amast 1 Rtyre 1 1 long
Fpedal = 2 × × Ddisc Hpad
× × × Ftyre (16)
Rpedal 4 − µpad Apist
2 2

• Steering Model: To recreate the steering subsystem of the vehicle, steering


model was created which uses the steering gear ratio between the tyres’ slip
angle and steering wheel [23]. The model can be made complex after including
the bicycle model and considering small slip angles only. Tyre forces must then
be considered to be linear and should be calculated along with yaw moments.
These equations are given by:
Fy tyre = Fy f ront + Fy rear = 2CF (δ + β) + 2CR β (17)

Mz tyre = λL × Fy f ront + (1 − λ)L × Fy rear = 2λL × CF (δ + β) + 2CR (1 − λ)L × β


(18)
This can be written in matrix form as the target values to be achieved by
the Lateral tyre forces being generated is Fytyre = M (v 2 r + gsin(ϕtrack
bank )) and
the moment should be 0. From equation 17 and equation 18, the following
equation can be written, giving the body slip and tyre slip values:
M (v 2 r + gsin(ϕtrack
    
CF CF + CR δ bank ))
2 =
λL × CF λL × CF + (1 − λ)L × CR β 0
(19)
After obtaining the slip angle value from equation 19, the steering wheel angle
required is given by: δswa = is δ
• Powertrain Model: This model is the heart of the vehicle model, as it is
from this model, maximum tractive force as being produced by the motors is
calculated [22]. The motor has a certain torque v/s speed characteristic curve,
which is used to calculate torque being produced at a certain speed of the
motor. There is inclusion of a final drive to increase the torque output at the
wheels of the vehicle. This final drive has also been included in this model.
Speed of the motor is defined in RPM in the torque-speed curve in the excel
file. There is no gearbox in the current vehicle, but if need be, the model has
provision for the inclusion of a gearbox. The equations used to simulate the
powertrain model are:
r = rf inal (20)
ωmotor = r × ωwheel (21)
τwheel = r × τmotor (22)
2πωwheel Rtyre
v= (23)
60

35
Piyush Kalayankumar Deshpande Sahil Kanchan

Using equation 20 to equation 23, the maximum tractive force which is given
to the wheels by the motor is:
max τwheel
Fxmotor = (24)
Rtyre

• Tyre Model: In this model, complexity of implementing a tyre model is being


reduced to Normal Load sensitivity [23]. No slip angles, camber, pressure or
temperature variations are being considered. The generalized equation is given
by:
δµ
Ftyre = µ(Fz ) × Fz = (µ + (N0 − Fz )) × Fz (25)
δFz
1. Longitudinal Direction (X-axis): The vehicle has 4 motors, thus, it is an
All-Wheel Drive (AWD) car. All the 4 wheels are used in acceleration
and braking events. Using equation 25, the force being generated in the
longitudinal direction can be written as:
δµx 0
Fxacc max = 4(µ0x + (N − Fzdrivingtyres )) × Fzdrivingtyres (26)
δFz x
max δµx 0 Fztotal
Fxdec = (µ0x + (N − )) × Fztotal (27)
δFz x 4

2. Lateral Direction (Y-axis): Similarly, using equation 25, the force being
generated in the lateral direction can be written as:

δµy 0 Fztotal
Fymax = (µ0y + (N − )) × Fztotal (28)
δFz y 4

Depending on whether the car is accelerating or decelerating, equation 26 or


equation 27 shall be used respectively. This results in the usage of friction
ellipse, which has a combination of the both lateral and longitudinal forces
being produced by the tyres. The equation for friction ellipse is given by:
Fx 2 Fy
( max
) + ( max )2 = 1 (29)
Fx Fy

• External Force Model: This model consists of the forces which act on the
vehicle, as it is in motion [22] [23]. Forces are generated in all the three
directions and are given by:
1. Vertical Direction (Z-axis):
1
Fzaero = ρACl v 2 (30)
2

36
Piyush Kalayankumar Deshpande Sahil Kanchan

Fzmass = −M g × cos(θincl
track
)cos(ϕtrack
bank ) (31)

Fztotal = Fzmass + Fzaero (32)

2. Longitudinal Direction (X-axis):

Fxmass = M g × sin(θincl
track
) (33)

1
Fxaero = ρACd v 2 (34)
2

Fxroll = Cr |Fztotal | (35)

Fxtotal = Fxroll + Fxmass + Fxaero (36)

3. Lateral Direction (Y-axis):

Fymass = −M g × sin(ϕtrack
bank ) (37)

Using equation 30 to equation 37, the final equations of motion, in all three
directions, which can then be utilized for creating the vehicle model are given
by:
1. In longitudinal direction:

Fxmass + Fxtyre + Fxaero + Fxroll = M ax (38)

2. In lateral direction:

Fymass + Fytyre = M ay (39)

3. In vertical direction:

Fzmass + Fzaero = 0 (40)

• Driver Throttle and Brake Map Model: The model constitutes of the
driver behaviour when trying to accelerate and brake the vehicle. In order to
prevent slipping of tyres and utilize the maximum available friction on each
tyre, the driver must be able to understand what throttle position will help in
maximizing traction during acceleration and what brake position will minimize
the braking distance. The model works under the assumption of Linear Torque
v/s Throttle pedal sensor. The values for Throttle Position Sensor (tps) and
Brake Position Sensor (bps) always lie between 0 and 1 (both inclusive).

37
Piyush Kalayankumar Deshpande Sahil Kanchan

1. For acceleration, the value of throttle position sensor is given by:


max
min(atyres
x , amotor
x )
tps = motor
(41)
ax

and bps = 0
2. For deceleration, the value of brake position sensor is given by:
1 Rtyre 1 1
bps = Ddisc Hpad
× × × Ftyre (42)
4 − µpad Apist
2 2

and tps = 0
CARbuilder provides a ”.mat” file as an output along with Traction Model, Motor
characteristics and GGV Map of the car. The figure 19 shows the output of the
CARbuilder file. This ”.mat” file is then used in LAPSIM MATLAB file and the
required variables are called into it to replicate the vehicle.

Figure 19: Output File CARbuilder: KTHFS-171

Figure 19 produces the GGV Map of the car. This map demonstrates the capabilities
of the vehicle during acceleration, deceleration and cornering at a certain velocity.
The shape of the curve in the positive longitudinal direction is dictated by the
Final Tractive Force curve. This is because, the final tractive force curve represents
the maximum tractive force which can be translated into movement of the vehicle
restricted by the capabilities of the tyres. The negative longitudinal acceleration

38
Piyush Kalayankumar Deshpande Sahil Kanchan

(longitudinal deceleration), is aided by the aerodynamic drag which is acting on the


vehicle. Since, this force is quadratic in nature and depends on the velocity of the
vehicle, the longitudinal deceleration curve also adorns the parabolic shape.

2.3.2 TRACKbuilder
The script developed is very similar to the one used to initialise the vehicle param-
eters. It uses an excel file to gather input information from the designer and build
the track.
The excel file has various input parameters, such as track shape, elevation, banking,
grip factors and sectors. These options allow the user to design the desired track
for lap-time simulations.
Shape Data
In this section, three input parameters are used to design the track, namely, the
type of turn, the length of the turn and the radius at the centre of the turn. It has
to be noted that for straight portions in the track, the radius is set to zero and while
turning, the length of the track is the circular turn segment length.
Elevation, Banking and Grip Factor
The elevation, banking and grip factor along the length of the track is mentioned
along with its values. The different locations and the corresponding values which
are mentioned in the input file are stored in the MATLAB script. These values are
used to calculate the forces acting on the vehicle at that specific point on the track
which running the LAPSIM model. As a result, accuracy in maintained and results
can be assumed to be precise

(a) Shaping the track


(b) FSAE Skidpad Event [24]

Figure 20: Shape data for building the track.

The shape data for the skidpad event is shown in the figure 20b, and it can be
calculated and stored in the excel file as shown in table 6.

39
Piyush Kalayankumar Deshpande Sahil Kanchan

Table 6: Skidpad Shape data

Turn Sector Length Radius


Right 1 9.125
Right 55 9.125
Right 1 9.125
Left 1 9.125
Left 55 9.125
Left 1 9.125

The data entered in the excel file is rough and thus needs to be smoothed in order to
create smoother turns. The MATLAB script calculates intermittent points based on
the input provided. The distance between immediate points can be set by varying
the ’mesh size’ factor in the code. It is important to note that the code does not
alter the straights and leaves them untouched. While computing curves, the code
developed takes into account the centre point of each turn and passes the track
to be followed through these points. Thus, defining smaller segment length results
in smoother tracks and more accurate results. While dealing while long constant
radius turns, the code runs in a loop to inject multiple points on the segment, thus
improving the accuracy of the track.
The data is stored in the excel file are used to plot the overall track data as shown
in figure 21. The data is also stored in a ’.mat’ file which is called while running the
LAPSIM model to calculate lap-time on specific tracks.

40
Piyush Kalayankumar Deshpande Sahil Kanchan

TRACKbuilder
Track Name: FSAE Skidpad
Date & Time: 2022/10/03 08:16:30
3D Map
Curvature

curvature [m-1]
0.1
curvature
0 apex
15
-0.1
0 20 40 60 80 100
position [m]
Elevation
10 1

elevation [m]
0

-1
5 0 20 40 60 80 100
position [m]
Inclination

inclination [deg]
1
y [m]

0 0

-1
0 20 40 60 80 100
position [m]
-5 Banking
1
banking [deg]

-10 -1
0 20 40 60 80 100
position [m]
Grip Factor
2
grip factor [-]

-15 1

0
0 20 40 60 80 100
-5 0 5 position [m]
x [m]

Figure 21: Output File for FSAE Skidpad- TRACKbuilder

2.3.3 TESTAB
The acceleration and braking events at FS events are simulated in the TESTAB
script. Kinematic equations of motion are considered to keep the model simple and
easy to understand. The TESTAB script simply imports data from the ’.mat’ file
created by the CARbuilder script. As a result, the code becomes shorter and the
computational time decreases. The recalled data is stored in variables and the mesh
size is defined. The mesh size used while simulating the acceleration and braking
events is 0.00001.
The assumption which is made here is that the vehicle accelerated with constant

41
Piyush Kalayankumar Deshpande Sahil Kanchan

acceleration between nodes on the track. Thus, the equations used are[25];

dt = 0.00001 (43)

v = v0 + ax × dt (44)

1
x = x0 + v0 × dt + ax × dt (45)
2

t = t + dt (46)

The acceleration of the vehicle(ax ) is calculated from the motor torque and RPM
curves at every instance. The limit on acceleration is set between the maximum
acceleration that can be applied by the tyres and the maximum available acceleration
from the motors. The effect of rolling resistance, drag resistance and normal load are
all considered while calculating the time to cover 75m. The simulation is initiated
with an infinite while loop, running equations 44,45 and 46, which ends once the car
has crossed the 75m mark(x >= 75). At this instance, the braking maneuver begins
to calculate the stopping distance and time. The braking distance is also calculated
in an infinite while loop which breaks when the velocity of the vehicle becomes zero.
The following results were obtained by calculating for the acceleration and braking
events for the KTHFS-171:

Table 7: TESTAB Results

Average acceleration 0.894 [G]


Peak acceleration 1.607 [G]
Acceleration time for 75m 3.618 [s]
Velocity at 75m 114.196 [km/hr]
Average deceleration 0.628 [G]
Peak deceleration 2.214 [G]
Distance to decelerate 24.034 [m]
Time to decelerate 1.534 [s]

Based on the results obtained in table 7, the results are plotted as shown in figure
22.

42
Piyush Kalayankumar Deshpande Sahil Kanchan

ABbuilder
Vehicle: KTHFS-171
Date & Time: 2022/10/13 18:16:54
100
Distance [m]

50

0
0 1 2 3 4 5 6
Speed Time [s] Speed
Acceleration [m/s2] Speed [km/h]

Acceleration [m/s2] Speed [km/h]


100 100
50 50
0 0
0 1 2 3 4 5 6 0 20 40 60 80 100
Time [s] Distance [m]
Acceleration Acceleration
10 10
0 0
-10 -10
-20 -20
0 1 2 3 4 5 6 0 20 40 60 80 100
Motor Speed [rpm]

Motor Speed [rpm]


Time [s] Distance [m]
Motor Speed Motor Speed
20000 20000

10000 10000

0 0
0 1 2 3 4 5 6 0 20 40 60 80 100
Time [s] Distance [m]
Throttle Position Throttle Position
100 100
tps [%]

tps [%]

50 50

0 0
0 1 2 3 4 5 6 0 20 40 60 80 100
Time [s] Distance [m]
Brake Pressure Brake Pressure
bps [bar]

bps [bar]

50 50

0 0
0 1 2 3 4 5 6 0 20 40 60 80 100
Time [s] Distance [m]

Figure 22: Acceleration and Braking events - TESTAB

The plots in figure 22 show the variation of different parameters with respect to
time and distance. It is interesting to note the throttle position curve, where it is
noted that initially the throttle of the vehicle is not engaged 100% as there is a limit
to the acceleration the tyres can support, i.e., to avoid wheel spin.

2.3.4 LAPSIM
The LAPSIM model is developed to simulate a vehicle running on tracks. The vehicle
data and the track data are imported from the respective ’.mat’ files to initialise the
simulation model. The required parameters are stored locally before the simulation
starts. The process followed in the LAPSIM script van be best understood from the
flowchart in figure 23.

43
Piyush Kalayankumar Deshpande Sahil Kanchan

Read Calculate max


input and velocity in pure
settings lateral condition

Create
Apexes

Sort the
Apexes
Accelerates Decelerates
the vehicle the vehicle
from all from all
apexes apexes
Post
process

Export
results

Figure 23: LAPSIM script process chart

The computed apex is described as a place when a vehicle has stopped accelerating,
is in a pure lateral situation, and the vehicle will begin accelerating immediately
after passing that point[26]. The maximum velocity of the vehicle is calculated at
each defined node on the track individually. While simulating on straight roads, the
maximum velocity of the vehicle is calculated by the maximum speed capability of
the motor. However, while cornering, The maximum lateral force that the tyres may
apply is determined and adjusted in relation to the pure lateral situation [23]. The
following equations are used to calculate the pure lateral condition case[27],
Fzmass = −M g × cos(θincl
track
)cos(ϕtrack
bank ) (47)

1
Fzaero = ρACl v 2 (48)
2

Fztotal = Fzmass + Fzaero (49)

44
Piyush Kalayankumar Deshpande Sahil Kanchan

Fymass = −M g × sin(ϕtrack
bank ) (50)

dµy 0 Fztotal
Fytyre = [µ0y + (Ny − )]Fztotal (51)
dF 4
The lateral force equilibrium can be written as,

M v2
Fytyre − Fymass = (52)
R
(53)

It is important to note that all the forces are computed on the LHS of equation 52,
while the desired pure lateral condition is on the RHS. By substituting the equations
47,48,49,50 and 51 in equation 52, we get a 4th degree equation in velocity as,
1 dµy 2 dµy 1 dµy mass M
(− D ) × v 4 + (µ0y D + DNy0 − Fz D− ) × v2
4 dF dF 2 dF r
dµy 0 mass 1 dµy mass 2
+(µ0y Fzmass + N F − (F ) + Fymass ) = 0
dF y z 4 dF z
where,

D = − 21 ρCL A

On simplification, the 4th order equation can be transformed to a 2nd order quadratic
equation of the form,

A(v 2 )2 + B(v 2 ) + C = 0 (54)

where,
dµy 2
A = − 41 dF D

dµy 1 dµy mass M


B = µ0y D + 0
dF DNy − 2 dF Fz D − R

dµy 0 mass 1 dµy


C = µ0y Fzmass + dF Ny Fz − mass )2
4 dF (Fz + Fymass

Solving equation 54 and taking only positive solutions, the velocity required to com-
plete is the turn is calculated. However, due to drag force acting on the vehicle, this
speed cannot be maintained as we have exhausted the tyre in the lateral direction
and thus, no longitudinal acceleration is possible. Thus, in order to compensate for
the loss in longitudinal acceleration, a loop is setup as shown in figure 24.

45
Piyush Kalayankumar Deshpande Sahil Kanchan

Calculate
Calculate Calculate
Obtain v needed
Fexternal max Ftyre
ay

F tyrex = -(F aerox + F rollx+ F massx )

Pass v, ay

Calculate
remaining ay Calculate
Remaining ay <= Needed ay
from friction new v
ellipse

Figure 24: Longitudinal force compensation workflow

The GGV plot is used to calculate the available lateral acceleration at a specific
longitudinal acceleration value. If the remaining lateral acceleration value is less
than the needed lateral acceleration value, the new velocity is calculated as shown
by the equation 55,
s
arem track )
− g × sin(θbank
y
v= (55)
r

The skidpad event at Formula student event is simulated in the LAPSIM model and
the following results were obtained, as shown in figure 25.

46
Piyush Kalayankumar Deshpande Sahil Kanchan

Figure 25: Simulation results for Skidpad

It can be noted from the figure 25 that the solver runs the vehicle on its limits and at
maximum lateral acceleration, as shown in the GGV curve. The maximum velocity
for the entire events is 42.795 [km/hr] and is constant throughout. The time taken
to complete the skidpad event is calculated as 9.632 [s].

2.4 Validation
The simulations run on MATLAB were verified by performing similar analysis in
CarMaker [28]. The acceleration and braking events, skidpad event were simulated
with similar track conditions and vehicle parameters.

2.4.1 Acceleration and Braking


The acceleration events for 75m followed by the brake test were simulated in Car-
Maker to verify the results obtained by the MATLAB script TESTAB.

47
Piyush Kalayankumar Deshpande Sahil Kanchan

AB: Longitudinal Velocity v/s Time AB: Longitudinal Acceleration v/s Time
35 20
CarMaker Vx CarMaker Ax
LapSIM Vx LapSIM Ax
15
30

10
25

5
20

15

-5

10
-10

5
-15

0 -20

-5 -25
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Time[s] Time[s]

(a) Longitudinal Velocity (b) Longitudinal acceleration

Figure 26: Results comparison between MATLAB and CarMaker

It can be noted from figure 26a, both the curves have similar trends, however, there
is a delay of 1.2 [s] between both the curves. In the figure 26b, it can be noted that
the maximum longitudinal acceleration is close to 15 [m/s2 ] for the MATLAB script
while it is 8 [m/s2 ] for the CarMaker simulation. Similar trends can be noticed in
the distance v/s time curve for both the simulations, as shown in figure 27.

AB: Distance v/s Time


120
CarMaker Distance
LapSIM Distance

100

80
Distance [m]

60

40

20

-20
0 1 2 3 4 5 6 7
Time[s]

Figure 27: Distance v/s Time for Acceleration and Braking

48
Piyush Kalayankumar Deshpande Sahil Kanchan

2.4.2 Skidpad
The results from the skidpad event were also verified by creating the track in Car-
Maker and comparing the results from the LAPSIM MATLAB script.
Skidpad: Lateral Acceleration v/s Time
Skidpad: Longitudinal Velocity v/s Time 20
12.2
CarMaker Ay
CarMaker Vx LapSIM Ay
LapSIM Vx
15

12

10

11.8
5

11.6 0

-5
11.4

-10

11.2
-15

11
0 1 2 3 4 5 6 7 8 9 10 -20
0 1 2 3 4 5 6 7 8 9 10
Time[s] Time [s]

(a) Longitudinal Velocity (b) Lateral acceleration

Figure 28: Results comparison between MATLAB and CarMaker

Skidpad: Distance v/s Time


120
Skidpad Distance [114.7]

100

80
Distance[m]

60 Required Time [9.632 s]

40

20
CarMaker Distance
LapSIM Distance
Distance
Time
0
0 1 2 3 4 5 6 7 8 9 10
Time[s]

Figure 29: Distance v/s Time - Skidpad

49
Piyush Kalayankumar Deshpande Sahil Kanchan

From figure 28a, it can be noted that the value for CarMaker oscillates, while it is
constant for the LAPSIM script. However, the mean value of longitudinal velocity
remains the same as the LAPSIM solver. In figure 28b, the lateral acceleration in
both the simulation software packages focalize. The change in direction is very steep
in the LAPSIM script as it is a mathematical solver while the transition is smoother
in CarMaker.
The time taken and distance travelled to complete the skidpad event in both the
software packages, namely CarMaker and MATLAB is similar and coincide perfectly,
as shown in the figure 29. The variation in results for the acceleration and braking
events can be accounted for weight transfer, which has not been accounted for in the
MATLAB TESTAB script. Increasing the complexity of the MATLAB model should
account for the delta time of 1.2 [s] and provide similar results as CarMaker.

2.5 Conclusion
The project focuses on simulating an already existing vehicle of KTH Formula Stu-
dent and validating the simulation using IPG CarMaker and MATLAB software,
along with application of analytical and theoretical knowledge. Understanding the
concepts involved in the functioning of subsystems in the actual vehicle is crucial in
modelling and integrating individual subsystems on the software to create a complete
a car model. Building models in different software brings out the trade-offs between
the simplified model on MATLAB and a high-fidelity model in IPG CarMaker in
terms of computational time, accuracy of results and understanding of the system
being used. Overall, much has been accomplished, but new sets of objectives are
yet to be proposed and achieved. Through this half of the project, we experienced
an expedited development process to build a software from ground up.

50
Marlene Euchenhofer Lap-Time Simulation

Acknowledgements
From the Aerodynamics subproject, we would like to extend our sincere gratitude
to the KTH Fluid Mechanics department, professor Mihai Mihaescu, and especially
Marco Laudato for his invaluable support of the project. Many thanks also to our
supervisor Mikael Nybacka who arranged for us to work on the SNIC supercomput-
ers, which sped up our progress immensely and allowed us to prepare and run a much
larger number of simulations. Further, we would like to thank Gabriel Ågren and
Nikhil Srikkanth from the KTH Formula Student team for their help and guidance
with CFD and the deployment of the necessary software licenses.
From the Lap-Time Simulation sub-project, we would like to express our heartfelt
gratitude to Mikael Nybacka for providing us with the required support and software
licenses. Further, we also would like to give credit to Priyatharrshan Selambagoun-
danpalayam Karuppanan for his continuous inputs and help in this project.

51
References
[1] PLM Siemens. “Simcenter STAR-CCM”. In: Academic Research, Release 12
(2017).
[2] About Dardel. https : / / www . pdc . kth . se / hpc - services / computing -
systems/about-dardel-1.1053338. KTH PDC Center for High Performance
Computing 2022, Accessed October 11, 2022.
[3] What is SSH Public Key Authentication? https://www.ssh.com/academy/
ssh/public- key- authentication. SSH Academy 2022, Accessed October
26, 2022.
[4] Jianjun Chen et al. “Automatic surface repairing, defeaturing and meshing
algorithms based on an extended B-rep”. In: Advances in Engineering Software
86 (2015), pp. 55–69.
[5] Simcenter STAR-CCM+ Documentation. Version 2020.1. Siemens Digital In-
dustries Software, 2020.
[6] “CFD Basics”. In: Americas Agency Training Document (2008).
[7] Haidong Yuan, Zhigang Yang, and Qiliang Li. “Effects of installation envi-
ronment on flow around rear view mirror”. In: SAE International Journal of
Passenger Cars-Mechanical Systems 10.2017-01-1517 (2017), pp. 580–590.
[8] Andre Bakker. Lectures on Applied Computational Fluid Dynamics, 2008. Ac-
cessed October 24, 2022.
[9] F Götten et al. “A review of guidelines and best practices for subsonic aero-
dynamic simulations using RANS CFD”. In: (2019). Asia Pacific Sympo-
sium on Aerospace Technology. 4-6 December, 2019. url: https : / / www .
researchgate.net/publication/337756101_A_review_of_guidelines_
and_best_practices_for_subsonic_aerodynamic_simulations_using_
RANS_CFD.
[10] ANSYS Fluent User’s Guide. Version 15.0. ANSYS Inc., 2013.
[11] On Boundary Layers: Laminar, Turbulent and Skin Friction. 2016. url: https:
//aerospaceengineeringblog.com/boundary-layers/. Accessed: 17 Octo-
ber 2022.
[12] J H Spurk and N Aksel. Fluid Mechanics. 3rd ed. Springer, 2020.
[13] Turbulence Part 3 - Selection of wall functions and Y+ to best capture the Tur-
bulent Boundary Layer. 2013. url: https://www.computationalfluiddynamics.
com.au/turbulence-part-3-selection-of-wall-functions-and-y-to-
best - capture - the - turbulent - boundary - layer/. Accessed: 17 October
2022.
[14] Dr. A Wimshurst. Fluid Mechanics 101 Calculators Tools. url: https://
www . fluidmechanics101 . com / pages / tools . html. Accessed: 17 October
2022.
[15] H Schlichting (Deceased) and K Gersten. Bounndary-Layer Theory. 9th ed.
Springer, 2016.
[16] KTH Formula student. Formulas tudent2 2917. 2022. Accessed: 20 October
2022.
[17] Scuderia Mensa - HS Rheinmain Racing. Current race car // The SPR21e.
2021. url: https://www.scuderia-mensa.de/en/home-english/. Accessed:
23 October 2022.
[18] Floating Point Exception (Core Dumped): The Expert Solution To Fix It.
https://www.positioniseverything.net/floating- point- exception-
core-dumped/. Position is Everything 2022, Accessed October 24, 2022.
[19] Jahee Campbell-Brennan. Vehicle Dynamics: Lap Time Simulation. https:
//www.waveydynamics.com/post/lap-time-simulation.
[20] GOOGLE VENTURES. The Design Sprint. http://www.gv.com/sprint/#:
~ : text = The % 20sprint % 20is % 20a % 20five , that % 20any % 20team % 20can %
20use..
[21] TUMFTM. laptime-simulation. https : / / github . com / TUMFTM / laptime -
simulation.
[22] MSc Vehicle Engineering. SD2222: Vehicle Components.
[23] MSc Vehicle Engineering. SD2225: Ground Vehicle Dynamics.
[24] Formula Student Germany. Formula Student Rules 2022. https : / / www .
formulastudent . de / fileadmin / user _ upload / all / 2022 / rules / FS -
Rules_2022_v1.0.pdf.
[25] the Physics Classroom. 1-D Kinematics - Lesson 6 - Describing Motion with
Equations. https://www.physicsclassroom.com/class/1DKin/Lesson-
6/Kinematic-Equations.
[26] drivingfast.net. Racing line. https://drivingfast.net/racing-line/.
[27] Emilio Frazzoli Efstathios Velenis and Panagiotis Tsiotras. “Steady-State Cor-
nering Equilibria and Stabilization for a Vehicle During Extreme Operating
Conditions.” In: ().
[28] IPG. User Guide - CarMaker. Version 10.2.1. IPG Automotive GmbH, 2021.
[29] Owen Patterson. Star CCM+ Tutorial 2022. 2022. url: https://youtu.be/
NpWgfA1xtWk.
Marlene Euchenhofer APPENDIX

Appendix
Appendix A - STAR-CCM+ Step-by-Step Guide
This appendix is meant to serve as an example of how to set up and run a simulation
in STAR-CCM+ from start to finish. It is mostly a transcript of Owen Patterson’s
Star CCM+ Tutorial 2022 [29] with some adjustments and comments. The author
does not guarantee the accuracy of the information but merely provides this doc-
ument to enable a smoother access to the workflow of STAR-CCM+ for following
newcomers.

I Create a New File/Model


(a) New File
(b) Parallel on local host → choose number of cores
II Prepare Half Car Geometry
(a) New 3D-CAD model
(b) Import new CAD model
(c) Features → ImportCad → Repair CAD → Execute( → click pink hammer)
(d) Delete all parts that are not going to be in the domain (partially → that
are only on the right side of the car)
(e) Unite (Boolean) all parts that will not be referred to separately
(f) Rename parts
(g) Create local coordinate system(s)
optional; example: wheel center for rotating wheel
(i) Right click on concentric part of wheel
(ii) Reference Geometry → Point from Entity Center → Centerpid
(iii) Right click on concentric part of wheel
(iv) Reference Geometry → Coordinate System from Point and Plane →
choose point (ii)
(v) Rename coordinate system
(vi) Right click on system in Features → Export Coordinate System
(vii) Repeat for second wheel
(h) Update 3D-CAD

54
Marlene Euchenhofer APPENDIX

(i) Close 3D-CAD


(j) Create parts form 3D-CAD Model → New Geometry Part → Ok
(k) optional Check: create new geometry scene
(l) optional Combine surfaces for each wheel (set rotation for only one surface
each later)
III Create Domain
(a) Parts → New Shape Part → Block
(b) Choose coordinates
(c) Create (patience! )
(d) Close
(e) Rename domain
(f) Split [surfaces] by Patch
(g) Assign names
IV Create Surface Wrapper
(a) New Operations → Surface Wrapper from all parts (incl. Domain)
(b) Adjust Default Controls
(c) Add and adjust Custom Controls
(d) Execute (patience! )
V Create and Prepare Region
(a) Create Region for Surface Wrapper Part
(i) Right click on Surface Wrapper Part
(ii) Assign Parts to Region
(iii) Create a Region for Each Part
(iv) Create a Boundary for Each Part Surface
(v) Apply
(vi) Close
(b) Assign Types to Boundaries (examples)
(i) Inlet: Velocity Inlet
(ii) Outlet: Pressure Outlet

55
Marlene Euchenhofer APPENDIX

(iii) Ground : Wall


(iv) Rest: Symmetry Plane
VI Create (Automated) Mesh
(a) Operations → New Mesh → Automated Mesh
(i) Surface Wrapper
(ii) Surface Remesher
(iii) Automatic Surface Repair
(iv) Trimmed Cell Mesher
(v) Prism Layer Mesher
(b) Adjust Default Controls
(c) Add and adjust Custom Controls
(d) optional:
(i) Prism Layer Mesher: total wall thickness instead of growth rate
(ii) Turn on Maximum Core/Prism Transition Ratio
(iii) Turn on Post Mesh Optimization
(e) Execute (patience! )
(f) Save!
(g) optional : Check: create new Mesh Scene
VII Set Physics Continuum
automatically created by creating an automated mesh
(a) Select Models (example)
(i) Three Dimensional
(ii) Steady
(iii) Gas
(iv) Segregated Flow
(v) Constant Density
(vi) Turbulent
(vii) k-omega Turbulence

56
Marlene Euchenhofer APPENDIX

(b) Set velocity value in Initial Conditions for velocity (with respect to labora-
tory coordinate system)
(c) Set velocity values in Physics Values and Conditions under Boundaries
under Regions
(i) Inlet: set value for Velocity Magnitude (positive)
(ii) optional (if ground is moving): Ground
1) Set Method for Tangential Velocity Specification on Vector
2) Set Relative Velocity to negative velocity
(iii) optional (if wheels are rotating): Wheels
1) Set Method for Tangential Velocity Specification under Physics
Conditions on Local Rotation Rate
2) Set Axis under Physics Values (choose respective coordinate sys-
tem)
3) Set Wall Relative Rotation to calculated value with respect to ve-
locity
VIII Prepare Visualization and Recording of Results (examples)
(a) Create Plane (to visualize a vector field )
(i) Derived Part → New Part → Section → Plane
(ii) Chose orientation
(iii) Chose origin
(iv) New Vector Displayer
(v) Create
(vi) Close
(vii) Scene → Section Vector → Display Mode: Line Integral Convolution
(viii) Hide Surface and Scalar in scene
(b) Create Reports (example: Force report)
for force coefficients, one either needs to insert a reference area or run a
frontal area report parallel and link it to the force coefficient
(i) New Report → Force
(ii) Set Units
(iii) Set Direction (with respect to laboratory coordinate system)

57
Marlene Euchenhofer APPENDIX

(iv) Parts: Boundaries: add all desired car parts under Surface Wrapper
Region
(v) Rename
(vi) Put (several) reports in one graph
(i) Select report(s in desired order))
(ii) Create Monitor and Plot from Report
(iii) Single Plot
IX Run Simulation
(a) Initialize Solution (green flag)
applies starting conditions, points out potential issues
(b) Save!
(c) Run (Ctrl +R)
residuals plot appears, other plots and monitors can be observed while run-
ning a simulation but that might slow down the process
X Analyze Outcome (examples)
(a) Study residuals and other plots (graphs should converge)
(b) Run reports (double click)
(c) Study surface pressure distribution (example for scalar scene)
(i) New scalar scene
(ii) Parts: Surface Wrapper
(iii) Scalar: Pressure
(iv) Contour Style: Smooth Blended
(v) Set range
(vi) Right click in scene → Apply Representation → Latest Surface/Vol-
ume

58
Piyush Kalyankumar Deshpande Sahil Kanchan

Appendix B - Variable Nomenclature for Lap-Time Simulation

Symbol Variable Description


Dmast Master cylinder diameter [m]
Dpist Piston diameter [m]
Npist Number of pistons
Rpedal Brake pedal ratio
Rtyre Tyre radius [m]
Ddisc Brake disc diameter [m]
Hpad Brake pad height [m]
µpad Coefficient of friction between the pad and the disc
long
Ftyre Longitudinal tyre force [N ]
Fytyre Lateral tyre force [N ]
CF Front cornering stiffness [N/deg]
CR Rear cornering stiffness [N/deg]
δ Lateral tyre slip angle [deg]
β Body slip angle [deg]
Mztyre Lateral tyre moment [N − m]
λ Weight distribution
L Wheelbase [m]
M Mass of the vehicle [kg]
v Velocity of the vehicle [m/s]
r Radius of curvature [1/m]
g Acceleration due to gravity [m/s2 ]
ϕtrack
bank Track banking angle [deg]
ϕtrack
incl Track inclination angle [deg]
δswa Steering wheel angle [deg]
is Steering gear ratio
rf inal Final drive gear ratio
ωmotor Motor rotational speed [RP M ]
ωwheel Wheel rotational speed [RP M ]
τmotor Motor torque [N − m]
τwheel Wheel torque [N − m]
Fztyre Vertical tyre load [N ]
N0 Normal load when µ = µ0 [N ]
µ0x Nominal coefficient of friction in longitudinal direction
Nx0 Longitudinal load when µx = µ0x [N ]
µ0y Nominal coefficient of friction in lateral direction
Ny0 Lateral load when µy = µ0y [N ]
Fzaero Aerodynamic downforce [N]
Fzmass Normal load due to mass of the vehicle [N ]

59
Piyush Kalyankumar Deshpande Sahil Kanchan

Symbol Variable Description


A Frontal area [m2 ]
Cl Coefficient of lift
ρ Density of air [kg/m3 ]
Fx mass Induced mass due to track inclination [N ]
Cd Coefficient of drag [N ]
Fxaero Aerodynamic drag [N ]
Cr Coefficient of rolling resistance
Fxroll Rolling resistance [N ]
Fymass Induced mass due to track banking [N ]
ax Longitudinal acceleration [m/s2 ]
ay Lateral acceleration [m/s2 ]
tyres max
ax Maximum longitudinal acceleration provided by tyres[m/s2 ]
amotor
x Longitudinal acceleration provided by motor [m/s2 ]
v0 Initial velocity [m/s]
x0 Initial distance [m]
R Turning radius [m]
rem
ay Available lateral acceleration [m/s2 ]

60

You might also like