CFD Tutorial On The Drivaer Model
CFD Tutorial On The Drivaer Model
Note:
The geometry corresponds
to the fastback and smooth
underbody model
$PTOFC/drivaer
• $PTOFC is pointing to the directory where you extracted the training material.
• In the case directory, you will find the README.FIRST file. In this file, you will find the general instructions of
how to run the case. In this file, you might also find some additional comments.
• You will also find a few additional files (or scripts) with the extension .sh, namely, run_all.sh,
run_mesh.sh, run_sampling.sh, run_solver.sh, and so on. These files can be used to run the case
automatically by typing in the terminal, for example, sh run_solver.
• We highly recommend you to open the README.FIRST file and type the commands in the terminal, in this
way, you will get used with the command line interface and OpenFOAM® commands.
• If you are already comfortable with OpenFOAM®, use the automatic scripts to run the cases.
Drivaer validation case
What are we going to do?
• We will use this case to learn how to setup an automotive simulation, including setting
the moving ground and rotating wheels.
• We will compare the numerical solution with the experimental values.
• We will run the case with a robust numerics, but you are invited to try different setups
and compare the different outcomes.
• You are also invited to try different setups, that is, rotating wheels against fixed
wheels, moving ground against fixed ground, and so on.
• To find the numerical solution we will use the solver simpleFoam.
• simpleFoam is a steady-state solver for incompressible, turbulent flow, using the
SIMPLE algorithm.
• To speed up the convergence rate, we will use potentialFoam to initialize the flow
(pressure and velocity fields).
• To avoid velocity spikes during the beginning of the simulation, we will add a source
term to limit the maximum velocity.
• This source term will be enabled during the first 200 iterations.
Drivaer validation case
Running the case
• Let us first generate the mesh.
• To automatically generate the mesh using snappyHexMesh, type in the terminal,
1. $> sh run_mesh_shm.sh
• This script will automatically generate the mesh using the predefined parameters.
• The final mesh will contain approximately 3.8 million cells, with three inflation layers.
• While the mesh is not optimal, it is good enough to obtain an accurate and stable
solution.
• The user is invited to try with a better mesh, for this, you will need to change surface
refinement and inflation layers the parameters in the dictionary
snappyHexMeshDict.
• If you do not want to generate the mesh form scratch, you can use the pre-generated
mesh. In the terminal type
1. $> sh run_mesh_fluent.sh
Drivaer validation case
Running the case
• The run_mesh_shm.sh script, will execute the following steps (not all of them are
listed):
1. $> foamCleanTutorials
3. $> surfaceFeatureExtract
4. $> blockMesh
5. $> decomposePar
• The moving wall boundary conditions are illustrated in the figure above.
• A moving wall translational boundary condition is imposed at the ground.
• At the wheels, a moving wall rotational boundary condition is used.
Drivaer validation case
Selecting turbulence model
simulationType RAS;
RAS
{
RASModel kOmegaSST;
turbulence on;
printCoeffs on;
}
transportModel Newtonian;
nu [0 2 -1 0 0 0 0 ] 1.58E-5;
ddtSchemes
{
default steadyState; • Steady state discretization
}
gradSchemes
{ • Discretization of the gradient terms
default cellLimited Gauss linear 0.333; • Notice that aggressive limiters are only used for
grad(U) cellLimited Gauss linear 1;
grad(k) cellLimited Gauss linear 1;
the velocity and turbulent quantities.
grad(omega) cellLimited Gauss linear 1;
}
interpolationSchemes
{
• Interpolation scheme.
default linear; • Most of the times (if not all the times) linear
} interpolation is fine.
Drivaer validation case
Selecting the discretization schemes
laplacianSchemes
{
default Gauss linear limited 0.5; • Discretization of the diffusive terms.
}
• The choice of the method and blending factor is related
to the mesh quality.
• For industrial meshes or meshes with non-
snGradSchemes
{ orthogonality more than 70, using limited 0.5 is
default limited 0.5; recommended
}
wallDist
{ • Method to compute the distance-to-wall.
method meshWave;
}
• This is only used in turbulence models that requires
this information (e.g., k-Omega SST)
• For meshes with good quality at the walls, the
meshWave method is the recommended one.
• If the quality at the walls is low, is better to use the
Poisson method.
Drivaer validation case
Selecting the solution method and linear solvers
solvers
{
p
{ • Pressure (p) linear solver.
solver GAMG;
tolerance 1e-6;
• Most of times GAMG method is fine for pressure.
relTol 0.01; • If at any point you see this method taking more that 100
smoother GaussSeidel; iterations to convergence, switch to a Newton-Krylov
nPreSweeps 0;
nPostSweeps 2; method (e.g., PCG).
cacheAgglomeration on; • It is also recommended to set the minimum number of
agglomerator faceAreaPair;
nCellsInCoarsestLevel 100;
iterations to 3.
mergeLevels 1; • The tolerances used in this case are recommended for
minIter 3; most of the cases.
}
U
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08; • Velocity (U) and turbulence quantities (k and omega)
relTol 0.001;
minIter 2; linear solvers.
} • The PBiCGStab is recommended for most of the
"(k|omega)"
applications.
{ • It is also recommended to set the minimum number of
solver PBiCGStab; iterations to 2-3.
preconditioner DILU;
tolerance 1e-08; • The tolerances used in this case are recommended for
relTol 0.001; most of the cases.
minIter 2;
}
...
...
...
}
Drivaer validation case
Selecting the solution method and linear solvers
solvers
{
...
...
...
• This is the linear solver used with the potential solver
Phi (potentialFoam).
{ • potentialFoam solves for the velocity potential to
solver GAMG;
agglomerator faceAreaPair; provide velocity and incompressible flux fields,
mergeLevels 1; typically used to initialize viscous calculations.
cacheAgglomeration true;
nCellsInCoarsestLevel 200;
• Using the method GAMG is recommended.
tolerance 1e-8; • It is also recommended to set the minimum number of
relTol 0.001; iterations to 3.
smoother GaussSeidel;
nPreSweeps 0; • The tolerances used in this case are recommended for
nPostSweeps 2; most of the cases.
nFinestSweeps 2;
minIter 3;
}
SIMPLE
{ Non-orthogonal corrections.
nNonOrthogonalCorrectors 2; It is recommended to o at least one correction (even in good
pRefCell 0;
quality meshes).
pRefValue 0;
relaxationFactors
{
fields
{
p 0.9;
} Under-relaxation factors (URF).
equations
Remember, URF are problem dependent.
{ Most of the times, the values used in this case are the
p 0.9; recommended ones with the SIMPLE consistent method.
U 0.7;
k 0.7;
omega 0.7;
}
}
Drivaer validation case
fvOptions – Limiting the maximum velocity magnitude value
• To avoid velocity spikes during the beginning of the simulation, we can add a source term to limit the maximum
velocity magnitude value.
• This limiting of the maximum value is not compulsory. However, it is recommended to follow this practice to
avoid reaching unrealistic values and eventually divergence.
• This can be done by adding a limit in the form of a source term in the fvOptions dictionary (located in the
directory system).
• Also, it is recommended to use this form of limiter during the initial iterations and until the solution has
stabilized.
1. $> sh run_all_shm.sh
• This script will automatically generate the mesh using snappyHexMesh and then it
will run the solver.
• If you do not want to generate the mesh from scratch, you can use the pre-generated
mesh (in Fluent format).
• In the terminal type,
1. $> sh run_all_fluent.sh
• The non-uniform initialization is done by typing the following command in the terminal,
• This will initialize the velocity and pressure fields (using the inlet velocity).
• If you are working with external aerodynamics, it is strongly recommended to use this
kind of initialization as it speeds the computations and gives more stability (specially
during the initial iterations).
• Remember, this kind of initialization does not work in closed domains.
Drivaer validation case
Quantitative and qualitative post-processing
Note:
All the results reported correspond to the fastback and smooth underbody model
Drivaer validation case
Quantitative and qualitative post-processing
Note: All the results reported correspond to the fastback and smooth underbody model
Drivaer validation case
Quantitative and qualitative post-processing
Drag coefficient
Iteration
Setup 1 0.2660
Setup 2 0.2426
Setup 3 0.2569
Note:
All the results reported correspond to the
fastback and smooth underbody model
[1] R. Yazdani. Steady and Unsteady Numerical Analysis of the DrivAer Model. Chalmers University of Technology, Master Thesis, 2015.
[2] Experimental Comparison of the Aerodynamic Behavior of Fastback and Notchback DrivAer Models. SAE 2014-01-0613.
Drivaer validation case
Acknowledgements