Modelling Assignment: OpenFoam
Modelling Assignment: OpenFoam
Faculty of Engineering
Imperial College London
SW7 2AZ
1 Introduction
The equations governing the flows of fluids in the physical world are
difficult to solve in all but the most simple of problems. It is only
recently with the advent of computers that scientists and engineers
have been able to use numerical techniques to simulate fluid flows
in complex geometries, such as in the primary loop of a pressurised
water reactor (PWR). These algorithms and numerical techniques
encompass a growing field known as computational fluid dynamics
(CFD).
In this report, several simple CFD simulations were created by using
the openFoam package and the results were studied in order to gain
an understanding of the strengths and limitations of these types of
software. Three different exercises were completed in this lab:
2 Methodology
All exercises in this lab were completed by using openFoam on a
remote computer. This computer was connected to by using a
secure shell (via any terminal) while directories and files were
viewed using WinSCP.
2.2 - Meshing
Before performing any flow calculations, the volume that is to be
analysed must first be split into multiple discrete regions in a
process called meshing. An example of such a mesh with and
without cell grading can be seen in Figure 1. The cell size in the
mesh influences the accuracy of the results, with smaller cells
generally leading to more accurate solutions at the expense of
greater computational costs. In order to maintain numerical stability
in the simulation, a quantity known as the Courant number must be
less than or equal to 1. The Courant number is defined as:
Co=
Where
velocity, and
t
U
x
(2.1)
is the magnitude of the
Figure 1 - 25x25 mesh of cavity geometry. Left mesh is uniform while right is
graded.
2.4 ParaView
The final step is to process the results in ParaView to produce
relevant plots and make sense of the data. ParaView allows the user
to see a visualisation of the volume mesh and any mesh grading
which was applied in the first step. Scalar scenes are also produced
to analyse the evolution of flow behaviour over the length of the
simulation.
Figure 2 top left to bottom right: Pressure map, velocity arrows, stream tracer,
graded mesh.
DU
(3.1)
is
reduced the depth at which the effects of the moving lid were felt by
the flow. Higher Reynolds numbers mean that the inertial forces of
the flow become more pronounced than the viscous forces, and
therefore the boundary layer thickness (a phenomenon influenced
by viscosity) is reduced. Peak pressures always occurred at the top
left and top right corners, as shown in Figure 2. Peak velocities
always occurred at the moving wall due to the no-slip condition.
3.1.2 Peak Shear Stresses
The peak shear stresses occur at the wall. This is because the shear
stress is a function of the velocity gradient as follows [3]:
=
du
dy
(3.2)
this interface allows greater heat diffusion into the coolant via the
interaction of atoms.
3.1.3 Confidence in Results
Confidence
in
the
results
was
achieved
by
performing
6
4
2
0
0
500
1000
1500
2000
Number of Cells
Figure 4 - Plot of peak pressure against number of cells showing convergence.
5000
10000
15000
Number of Cells
Figure 8 - Plot of peak pressure against number of cells for backward-step case.
32
30
28
26
0
5000
10000
15000
Number of Cells
Figure 12 - Plot of peak pressure against number of cells for the turbulent duct
case.
4 Conclusion
Fluid flow in a lid-driven cavity and a duct with a backward-facing
step was modelled using the openFoam software package, with
turbulent flow also being modelled for the backward-facing step. It
was found that in the lid-driven cavity exercise, larger Reynolds
numbers would decrease the size of the boundary layer. Higher
resolution meshes were also found to provide better-converged
solutions, at the expense of longer computation times.
The laminar case for the duct exercise showed that at low speeds,
the flow will first feel a disturbance at the step which disconnects
the boundary layer, and then reach a steady state velocity
distribution in the larger duct with a new boundary layer formed. In
a small region around the step, the local pressure fell below gauge
and some backflow was observed. At higher speeds, the flow did not
have enough time to reach a new steady state velocity distribution
in the larger duct and a large region of low pressure was observed
after the step.
The turbulent case for the duct showed that low Reynolds numbers
produce results similar to those in the laminar case as would be
expected. At high Reynolds numbers however, the flow becomes
chaotic after the step and no longer resembles the laminar case
with a clear boundary layer.
Further studies should be done to optimise grading and mesh sizes
as these would significantly help reduce the computational costs of
the simulations, particularly the turbulent flow scenario where
pressure and velocity distributions are more complex. Other
improvements include using compressible models to analyse the
effect of choking and also studying the effect of a forward-facing
step.
5 References
[1]
Bluck. M, Modelling for Nuclear Engineers: Thermal
Hydraulics, 2014
[2]
[3]
[4]
[5]