8
ARYA DASH 8074797 1 Summary This report aims at understanding some of the basic behaviours of an SPH code through simulating a flow following a dam break using SPHysics. Following a basic analysis of the flow physics, the behaviour of the following models were analysed: SPH Density Filtering, Solid Wall Boundary Condition using Repulsive Force, Varying Smoothing Length and Changing the Pressure Gradient Formulation. Albeit, the comparisons are mostly qualitative, effort has been made to draw some quantitative conclusions, such as in terms of ‘computation time’. Though validations with experimental results have not been performed, due to number of cases simulated it was inferred that the solution obtained by using a smoothing length of 1.3 with Repulsive Wall Boundary Condition is at least ‘numerically correct’, and can potentially provide accurate and meaningful solutions. This setup was also inferred to have the lowest solution run time, along with the one for the first Pressure Gradient Formulation. Introduction The report discusses the above mentioned five cases with suitable snapshots of the flow field. The discussion for each of the 5 cases includes a brief analysis of the SPH method, the flow physics, solution time and accuracy of the results. The first case considers a Solid Wall Boundary Condition where fluid particles do not move and remain still with no additional performance improvements. This case has been used to discuss the essential flow physics and the governing equations. Then, a Zeroth Order- Shepard Density Filter was used to improve accuracy. Following this, the Solid Wall Boundary Condition was changed to Repulsive Force, and results were compared based on solution time and qualitative accuracy. Then the Smoothing length or the size of the kernel was both increased and decreased from 1.3, and the effects on the solution were studied. Then, the pressure gradient formulation was finally altered to a supposedly more accurate and efficient method. Finally, suitable conclusions have been drawn at the end with a tabular summary and comparison between the computation times for each scenario. The SPH Method Smoother-Particle Hydrodynamics is a meshless computational method for simulating fluid flows. Initially developed for astrophysical problems, SPH has found its utility across many other industries, especially in coastal and naval engineering, where traditional mesh based methods can be extremely cost and resource intensive. It works by dividing the fluid into a set of discrete elements, referred to as particles. These particles have a spatial distance (known as the "smoothing length"), over which their properties are "smoothed" by a kernel function (Wikipedia, 2016). In the SPH method, the Dirac function is replaced by a “bell- shaped” kernel function (W) that ‘mimics’ the Dirac delta function, and the generic function f(x) is reproduced with the following convolution integral:

SPH Lab Report_Arya Dash

Embed Size (px)

Citation preview

Page 1: SPH Lab Report_Arya Dash

ARYA DASH 8074797 1

Summary This report aims at understanding some of the basic behaviours of an SPH code through

simulating a flow following a dam break using SPHysics. Following a basic analysis of the

flow physics, the behaviour of the following models were analysed: SPH Density Filtering,

Solid Wall Boundary Condition using Repulsive Force, Varying Smoothing Length and

Changing the Pressure Gradient Formulation. Albeit, the comparisons are mostly qualitative,

effort has been made to draw some quantitative conclusions, such as in terms of

‘computation time’. Though validations with experimental results have not been performed,

due to number of cases simulated it was inferred that the solution obtained by using a

smoothing length of 1.3 ∆𝑥 with Repulsive Wall Boundary Condition is at least ‘numerically

correct’, and can potentially provide accurate and meaningful solutions. This setup was also

inferred to have the lowest solution run time, along with the one for the first Pressure

Gradient Formulation.

Introduction The report discusses the above mentioned five cases with suitable snapshots of the flow

field. The discussion for each of the 5 cases includes a brief analysis of the SPH method, the

flow physics, solution time and accuracy of the results. The first case considers a Solid Wall

Boundary Condition where fluid particles do not move and remain still with no additional

performance improvements. This case has been used to discuss the essential flow physics

and the governing equations. Then, a Zeroth Order- Shepard Density Filter was used to

improve accuracy. Following this, the Solid Wall Boundary Condition was changed to

Repulsive Force, and results were compared based on solution time and qualitative

accuracy. Then the Smoothing length or the size of the kernel was both increased and

decreased from 1.3∆𝑥, and the effects on the solution were studied. Then, the pressure

gradient formulation was finally altered to a supposedly more accurate and efficient

method. Finally, suitable conclusions have been drawn at the end with a tabular summary

and comparison between the computation times for each scenario.

The SPH Method Smoother-Particle Hydrodynamics is a meshless computational method for simulating fluid

flows. Initially developed for astrophysical problems, SPH has found its utility across many

other industries, especially in coastal and naval engineering, where traditional mesh based

methods can be extremely cost and resource intensive. It works by dividing the fluid into a

set of discrete elements, referred to as particles. These particles have a spatial distance

(known as the "smoothing length"), over which their properties are "smoothed" by a kernel

function (Wikipedia, 2016). In the SPH method, the Dirac function is replaced by a “bell-

shaped” kernel function (W) that ‘mimics’ the Dirac delta function, and the generic function

f(x) is reproduced with the following convolution integral:

Page 2: SPH Lab Report_Arya Dash

ARYA DASH 8074797 2

Results and Discussions This section discusses the results obtained from the SPH simulation with concise insights

into the flow physics.

Case 1: The Basic Simulation The analytical solution for a rectangular channel is given by Saint-Venant Equations

(Chanson 2006):

and

Where d is the water depth, V is the flow velocity, t is the time, x is the horizontal co-

ordinate with x = 0 at the dam, DH is the hydraulic diameter, and S is the source term. These

are essentially the continuity and the momentum equations respectively. However in

SPHysics, the two-dimensional shallow water wave equation in general conservative form

was solved; this is given by:

Where is the vector of conserved variables, and are the flux vectors in the x- and y-

directions and represents a source vector (Zoppou and Roberts, 2000).

The flow was assumed to be laminar. This is a reasonable assumption to make as the flow

here is dominated by effects of gravity, and not ‘turbulence’. Figure 1 shows the 20th,

40th, 80th and the 100th frames (in order) for the Basic SPH Simulation.

Figure 1: The Basic SPH Simulation showing the 20th, 40th, 80th and the 100th frames (in order)

It can clearly be inferred from Figure 1 that the solution captures the kinematics of the flow

correctly but not the dynamics. Too high and too low values for pressures can be observed

at a single location making the solution ‘unphysical’. This is primarily caused due to the

inaccuracies of the density values as the kernel suffers from a lack of particles near the

Page 3: SPH Lab Report_Arya Dash

ARYA DASH 8074797 3

boundary layer and at the ‘free surface’. Additionally, the relation between pressure and

density is given by the Tait’s Equation of State (Minatti and Pasculli, 2010):

Clearly from the above equation, small changes in density can yield enormous changes in

pressure. So, this led to the next case where the values of density were improved using a

‘density filter’. The solution run time for this case was 196.5s.

Case 2: Density Filter In order to overcome the inaccuracies due to the deficiency of particles near the free

surface or the boundary, a Zeroth Order Shepard Density filter was used. It is given by

(Crespo, 2008):

Figure 2 shows the 20th, 40th, 80th and the 100th frames (in order) of the results obtained

from the simulation.

Figure 2: shows the 20th, 40th, 80th and the 100th frames (in order) with Density Filter

It can be noticed that the solution looks ‘physically acceptable’- both in terms of kinematics

and dynamics. As compared to the Basic Simulation, the pressure contours are much

smoother and uniform, and the ‘splashes’ much taller. The simulation run time was

190.83s i.e. faster than the previous. This has been discussed in more detail in the

‘Conclusion’.

Page 4: SPH Lab Report_Arya Dash

ARYA DASH 8074797 4

Case 3: Repulsive Force Solid Wall Boundary Condition Repulsive Force Solid Wall Boundary Condition was then examined to visualise the effects of

changes in the types of boundary conditions chosen to define the solid wall. Figure 3 shows

the 20th, 40th, 80th and the 100th frames (in order) of the results obtained from the

simulation.

Figure 3:20th, 40th, 80th and the 100th frames (in order)- Repulsive Force

From Figure 3, it can be observed that there have been significant improvements of the

quality of the contours obtained near the boundary layer. This is because the Repulsive

Force uses an empirical function with singularity so that the force increases as the particle

nears the boundary (Crespo, 2008). Comparing the 100th frame with the previous ones,

better stratified contours for pressure are also observed in the centre of the fluid domain.

The simulation run time was 184s.

Case 4: Changing the Smoothing Length Another widely accepted way of increasing the accuracy of the solution is by increasing the

size of the kernel. In theory, this would involve more neighbouring particles to fetch

information from, and hence a more accurate solution. The initial smoothing length ℎ =

1.3∆𝑥 was first increased to 1.5∆𝑥 and then reduced to 1∆𝑥 followed by 0.5∆𝑥. Figure 4

compares the 80th frame for the three smoothing lengths considered.

From Figure 4, it can clearly be noted that a smoothing length of 0.5∆𝑥 gave completely

unphysical solutions. This is due to lack of adequate number of points, and hence the

information. However as the size of the smoothing length was increased, ‘clearer’ contours

and physically acceptable solutions were obtained. On the contrary, if the smoothing length

was further increased to 1.5∆𝑥 and beyond, some inaccuracies in results were observed-

particularly near the free surface and the boundaries. This is because the size of the ‘kernel’

is so big that it extends out of the fluid domain into the boundary wall and the free surface,

where no information on the fluid flow is held. And also, these fluctuations now affect a

bigger range of particles.

Page 5: SPH Lab Report_Arya Dash

ARYA DASH 8074797 5

Figure 4: Pressures contours of the 80th frame

Nonetheless, a smoothing length of 1.5∆𝑥 may very well be accepted where high levels of

accuracy isn’t the focus. Hence, the trade-off is accuracy vs computation time. It only took

201.64s to run the simulations for 1.5∆𝑥 where as it took 215s and 234.76s to simulate for

1∆𝑥 and 0.5∆𝑥 respectively. This is because as the smoothing increases, the fluid domain

can be computed using lesser number of kernels. Moreover the smaller smoothing lengths

keep producing inaccurate solutions at every time step. So, they take longer to converge.

Hence, 𝒉 = 𝟏. 𝟑∆𝒙 can be recommended as a good trade-off between accuracy and

computation time in general case.

0.5∆𝑥

1.5∆𝑥

1.0∆𝑥

Page 6: SPH Lab Report_Arya Dash

ARYA DASH 8074797 6

Case 5: Changing Pressure Gradient Formulation The classical formulation of pressure gradient had been used thus far to solve for the Navier

Stokes Equation. This can be stated as (Rogers, 2016):

An investigation was performed on two other formulations:

Formulation 1: Figure 5 shows the pressure contours obtained from the

undermentioned formulation.

Figure 5: Pressure Contours for Formulation 1

Clearly, as compared to the previous solutions obtained, Formulation 1 provided the best

quality contours for pressure distributions. Notably, it was the fastest simulation with a run

time of 184s, sharing the first position with Case 3.

Formulation 2:

The analysis was further extended to observe the results from Formulation 2. It was

observed that the code ‘crashed’ giving no valuable results. Rogers (2016) states that the

above equation does not satisfy one of the basic principles of physics – ‘The Law of

Conservation of Momentum’. So, due to loss in mass, pressure and velocity values across

the fluid domain, the solver fails to address the vital flow physics involved and hence does

not provide any useful results.

Page 7: SPH Lab Report_Arya Dash

ARYA DASH 8074797 7

Conclusion

The Basic Simulation provided unphysical solutions for pressure distributions due to the

inaccuracies involved with the computation of the density values.

Addition of Density filter in Case 2 improved the solution by manifolds. Despite of higher

computational demands, using a Density Filter was faster than the Basic Simulation by

approximately 6s as larger time steps could be taken without violating the CFL

criterion.

Using a Repulsive Force Solid Wall Boundary Condition provided much better quality

plots than a Density Filter, and was the fastest simulation of all.

Increasing the smoothing length reduces the computation time, but also the accuracy at

the same time and vice versa. Whilst h=1.5∆𝑥 was the fastest, h=1.3∆𝑥 was deemed to

be a good trade-off between computation time and accuracy.

Formulation 1 provided a much faster convergence with convincing results whilst

Formulation 2 crashed the code as it did not satisfy the ‘The Law of Conservation of

Momentum’.

Though validations with experimental results have not been performed, due to number

of cases simulated it can inferred that the solution obtained by using a smoothing length

of 1.3 ∆𝑥 with Repulsive Wall Boundary Function is at least ‘numerically correct’, and

can potentially provide accurate and meaningful solutions.

Though SPH is being widely used at a research level to simulate fluid flows across a wide

range of industries, there is still a long way before it can be practically and conveniently

used in the industry. Liu and Liu (2003) blames this on the numerical stability of the SPH

method.

Table 1 summarises the times taken by all the cases run.

Number Name TIME TAKEN (s)

1 Basic Simulation 196.5

2 Density Filter 190.83

3 Repulsive Wall Boundary Condition 184

4 Changing Smoothing Length

1.5∆𝑥 201.64

1.0∆𝑥 215

0.5∆𝑥 234.76

5 Changing Pressure Gradient Formulation

Formulation 1 184

Formulation 2 N/A Table 1: Computation times for all Cases

Page 8: SPH Lab Report_Arya Dash

ARYA DASH 8074797 8

References

1. Chanson, H. (2006). Analytical Solutions of Laminar and Turbulent Dam Break Wave.

[online]. Available from

https://espace.library.uq.edu.au/view/UQ:8090/River06_1z.pdf (Accessed

26/03/2016)

2. Crespo, A.J.C. (2008). Application of Smoothed Particles Hydrodynamics Modelling.

Available at:

http://cfd.mace.manchester.ac.uk/sph/SPH_PhDs/2008/crespo_thesis.pdf (Accessed

26/03/2016)

3. Liu G.R. and Liu M.B. (2003). Smoothed Particle Hydrodynamics: A Mesh Free Particle

Method. [online]. Available at:

http://www.worldscientific.com/worldscibooks/10.1142/5340. (Accessed

26/03/2016)

4. Minatti L. and Pasculli A. (2010). Dam break Smoothed Particle Hydrodynamic

modeling based on Riemann solvers. Vol. 69. WIT Press Ltd. [online]. Available from

http://www.witpress.com/Secure/elibrary/papers/AFM10/AFM10013FU1.pdf

(Accessed 26/03/2016)

5. Rogers, B.D. (2016). Introduction to Smooth Particle Hydrodynamics Student Version

2. [Lecture]. Available at:

https://online.manchester.ac.uk/webapps/blackboard/execute/content/file?cmd=vi

ew&content_id=_3588119_1&course_id=_36322_1 (Accessed 26/03/2016)

6. Smoothed-particle hydrodynamics (2016). Wikipedia. Available at:

https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics (Accessed

26/03/2016)

7. Zoppou C. and Roberts, S. (2000). Numerical Solution of Two Dimensional Unsteady

Dam Break. Elsevier Ltd. [online]. Available from

http://www.sciencedirect.com/science/article/pii/S0307904X99000566 (Accessed

26/03/2016)