You are on page 1of 11

Proceedings of HYDRO 2013 INTERNATIONAL,

Proceedings of
4-6HYDRO 2013IIT
Dec 2013, INTERNATIONAL
Madras, INDIA
A SPH Model to Simulate Free Surface Flows

A SPH MODEL TO SIMULATE FREE SURFACE FLOWS


Manoj K. Diwakar1, Pranab K. Mohapatra2 and Shivam Tripathi3

A computational model to simulate free surface flows is presented in this work. Smoothed
Particle Hydrodynamics (SPH) method is used to solve the strong form of fluid dynamics
differential equations. SPH is a mesh-free method that relies on the particle view of the field
problem and approximates the continuity and momentum equations on a set of particles. A cubic
function is used as the kernel function to smoothen the flow properties around a particle. Two
different problems, the dam break flow and the shear driven cavity flows, are simulated to
demonstrate the capabilities of the method. The method is validated against the simplified
analytical solution of one-dimensional dam break flow and is extended to two-dimensional flow.
The water surface profile, the bore front and the velocity profile computed by the present SPH
method are in good agreement with existing results in literature. Simulated flow field for the
shear driven cavity flow is also satisfactory.

1 Research scholar, Department of Civil Engineering, Indian Institute of Technology Kanpur, Kanpur 208 016,
India, Email: manojd@iitk.ac.in
2 Associate Professor, Department of Civil Engineering, Indian Institute of Technology Kanpur, Kanpur 208
016, India, Email: pranab@iitk.ac.in
3 Assistant Professor, Department of Civil Engineering, Indian Institute of Technology Kanpur, Kanpur 208
016, India, Email: shiva@iitk.ac.in

1
Proceedings of HYDRO 2013 INTERNATIONAL,
Proceedings of
4-6HYDRO 2013IIT
Dec 2013, INTERNATIONAL
Madras, INDIA
A SPH Model to Simulate Free Surface Flows

A SPH MODEL TO SIMULATE FREE SURFACE FLOWS


Manoj K. Diwakar1, Pranab K. Mohapatra2 and Shivam Tripathi3

Abstract: A computational model to simulate free surface flows is presented in


this work. Smoothed Particle Hydrodynamics (SPH) method is used to solve the
strong form of fluid dynamics differential equations. SPH is a mesh-free method
that relies on the particle view of the field problem and approximates the
continuity and momentum equations on a set of particles. A cubic function is
used as the kernel function to smoothen the flow properties around a particle.
Two different problems, the dam break flow and the shear driven cavity flows,
are simulated to demonstrate the capabilities of the method. The method is
validated against the simplified analytical solution of one-dimensional dam break
flow and is extended to two-dimensional flow. The water surface profile, the
bore front and the velocity profile computed by the present SPH method are in
good agreement with existing results in literature. Simulated flow field for the
shear driven cavity flow is also satisfactory.

Keywords: SPH; hydraulics; free surface flow; dam break.

INTRODUCTION

Smoothed particle hydrodynamics (SPH) is a numerical method that solves the equations of fluid
dynamics by replacing the fluid continuum with a set of particles. It relies on a particle view of
the field problem without using any mesh. The particles represent interpolation points from
which properties of the fluid can be approximated. SPH was developed for compressible flows
(Gingold and Monaghan, 1977); but has been successfully applied to many fluid dynamics
problems, including, problems of incompressible flows (Monaghan, 1994).

SPH solves the strong form of partial differential equations. It imposes no constraints on either
the geometry of the system or its evolution from the initial conditions. The basis of the method is
interpolation theory. The conservation laws of continuum fluid dynamics are transformed into
their particle forms by integral equations through the use of an interpolation function. Particle
properties are known only at discrete points and the integrals are evaluated as sums over
neighboring points. SPH formulation uses smoothing kernel functions that guarantees the conser-

1 Research scholar, Department of Civil Engineering, Indian Institute of Technology Kanpur, Kanpur 208 016,
India, Email: manojd@iitk.ac.in
2 Associate Professor, Department of Civil Engineering, Indian Institute of Technology Kanpur, Kanpur 208
016, India, Email: pranab@iitk.ac.in
3 Assistant Professor, Department of Civil Engineering, Indian Institute of Technology Kanpur, Kanpur 208 016,
India, Email: shiva@iitk.ac.in

2
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

vation of momentum and energy, and also ensures that the particle system retains geometric
structure of the continuum system (Monaghan, 2005). Readers are referred to the paper for the
details of SPH method.

In this paper, two representative incompressible fluid flow problems, namely, dam break and
shear cavity are solved using SPH. The solution of SPH are compared with the theoretical
solution and the sensitivity of SPH parameters are studied.

EQUATIONS

Governing Equations

SPH method solves continuity and momentum equations derived from the continuum physics in
Lagrangian framework. The equations are
D
Continuity equation:   u (1)
Dt
Dv 1
Momentum equation:   P 2v  g (2)
Dt 
In the equations, ρ, v, P, t and g represent density, velocity, pressure, time and acceleration due
to gravity respectively.

SPH Equations

SPH equations are obtained from the continuum equations of fluid dynamics by interpolating
from a set of points. The interpolation is done using smoothing kernels, which approximate a
delta function. These kernels are analytic functions that can be differentiated without the use of
grids.

The momentum equation for any particle a can be written as

dva P P  Wab  W  ra  rb , h 
  mb  a2  b2   ab  aWab  Fa where, (3)
dt b  a b 

where, va denotes the velocity of the particle and m is the mass of the particle. The symbol P
represents the pressure, and ρa is the density of the particle. The term Πab induces viscosity and
Fa is the body force. Wab is the interpolating kernel and  a , denotes the gradient of the kernel
taken with respect to the coordinates of particle a. The symbol b represents the neighbor particles
of a that are within domain h of the kernel function. Summation is over all the neighboring
particles other than particle a. The particle position is represented by r. The equation is written in
symmetric form to conserve linear and angular momentum.

The density is estimated as


   mbWab (4)
b

3
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

However, if Eq. (4) is used for water, where the density discontinuously falls to zero at the
surface, the estimated density will be smoothed over the length 2h and surface particles will have
a low density. The equation of state then produces incorrect pressures (Monaghan, 1994). Hence
the density is approximated by the rate of change of density.

Writing the continuity equation in the form


D
   v   v  (5)
Dt
and using SPH particle approximation, the rate of change of the density of particle can be
approximated by:
d a
  mb  va  vb  aWab (6)
dt b

and, the thermal energy per unit mass change can be approximated as:
(7)
dua 1 P P 
  mb  a2  b2   ab  vab aWab
dt 2 b  a b 
The rate of change of particle position is given by:
dra
 va (8)
dt
However, for free surface flow problems, the change in particle position is approximated by
XSPH (Monaghan, 1994)
dra  v v 
 va    mb  b a Wab (9)
dt b   ab 
The equation provides a correction to the velocity of the particles that keeps them more ordered
and prevents the penetration of one particle to another. The coefficient ε is generally taken to be
0.5.

METHODOLOGY

In SPH methodology, the fluid is divided into a set of discrete particles. These particles
constitutes flow and fluid properties. The properties of any particle is obtained by summing the
relevant properties of all the particles within a neighborhood using a kernel function. The
contributions of each particle to a property are weighted according to their distance from the
particle of interest and their density, as determined by the kernel function.

Pressure is calculated by using an appropriate equation of state. The viscous term in the
momentum equation is calculated by using an artificial viscosity equation. Boundary conditions
are enforced by boundary particles that exert central forces to the particles coming closure to the
boundary.

Kernel Function

4
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

Commonly used kernel functions in SPH method are the Gaussian and the cubic spline functions.
In this study, cubic spline function is used. The selected kernel function is exactly zero for
particles further away than two times the smoothing length and maximum at the center. The
smoothing length ( ) determines the resolution. The size of the smoothing length can be varying
or fixed in both space and time. By assigning each particle its own smoothing length and
allowing it to vary with time, the resolution of a simulation can be made auto-adaptive itself.
Typically h is greater than the initial particle separation. A kernel function should satisfy certain
properties that are needed for stable and accurate solution and are detailed in Liu and Liu (2003).

The Cubic Spline Kernel used in this study is given below (Lattanzio and Monaghan, 1985):

1  1.5q 2  0.75q3 0  q  1

Wab   d  0.25  2  q  1 q  2
3
(10)
 0 q2

where,  d is a scaling factor which makes the smoothing function unity. For 1, 2 and 3
2 10 1
dimensional problems d is 3h , 7 h2 and  h3 respectively. Wab is not dimensionless, it has the
rab
dimension (length)−2 for 2D problems. The variable q  , where, rab is the absolute distance
h
between particles a and b.

Artificial Viscosity

The viscous term  ab in the momentum equation (Eq. 3) can be approximated as (Monaghan,
1994):
  cab ab  ab2
 vab  rab  0 hvab  rab
 ab   ab where, ab 
 vab  rab  0 rab2   2 (11)
 0

where ab  12  a  b  , cab  12  ca  cb  and  2  0.01h2 . In the above expressions, Aab  Aa  Ab ,


where A denotes variable v and r and c is the speed of sound. The term involving  introduces
shear and bulk viscosity into incompressible flow. The parameter  is a free parameter that
changes from problem to problem. For the simulations reported in the paper,  and  were
chosen to be 0.01 and 0, respectively.

Equation of State

For incompressible fluid such as water, incompressibility can be enforced by two ways. The first
approach is to directly impose the constraint of constant density. The second approach is to
approximate fluid as an artificial fluid that is more compressible than the real fluid. The artificial
fluid will have speed of sound much larger than the speed of bulk flow; hence the density
fluctuations will be very small (Monaghan, 1994). In this work, the second approach is used.

5
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

Equation of state for water which describes sound waves accurately, is used in this study for the
calculation of pressure field. The equation of state, modified to give a smaller speed of sound,
has the form (Monaghan, 1994)
   
p  B    1 (12)
 0  

where, p represents the pressure and γ = 7. B is a constant that determines the speed of sound and
is equal to the atmospheric pressure.

Boundary Conditions

In SPH method, boundaries of the problem domain can be included by using boundary particles
which impose forces on the fluid particles. The simulations described in this paper are made with
boundary particles which exert central forces on fluid particles. For a boundary and fluid particle
separated by a distance r the force per unit mass is assumed to have the Leonard-Jones form and
purely repulsive in nature. For such formulation, the boundary force can be approximated by
(Monaghan, 1994):

   r P1  r  P 2  x

 D        2
0 0 ab
rab  r0
f  rab      rab   ab   ab
r r (13)



 0 rab  r0
The force is directed along the line through the centers of the particles. The indices P1 and P2
are taken as 12 and 6 respectively.

The length scale r0 is taken to be the initial spacing between the particles, and the coefficient D is
chosen by considering the physical configuration. In general, D=5gH, where H is the initial
depth of the water. Boundary particles are placed on the boundary at half the initial spacing to
provide a strong barrier to the fluid.

IMPLEMENTATION

The particles are initially set up on a Cartesian lattice. Each particles are then assigned flow and
fluid properties depending upon the type of fluid and flow. The mass of particle b can be
calculated by , where is the volume of the particle. The particles are assigned an
initial density 103 kg/m3 which need to be adjusted to get correct hydrostatic pressure when the
pressure is calculated using the relation (Monaghan, 1994)
1/ 
  g  H  y 
  0 1  0  (14)
 B 
where is the initial depth and is height. The system is then activated by initiating the motion
to be studied.

6
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

Simulation time stepping can be carried out using a leap-frog scheme. The time-step is largely
controlled by the Courant condition, but we use the general SPH time-step control (Lattanzio et
al., 1985) which includes the stability restrictions due to the viscous and body forces.

MODEL APPLICATIONS

The simplified dam break problem in one and two dimensions is simulated using SPH method
and the results are compared with theoretical and experimental results. The results obtained for
one dimensional dam break problem is compared with the Stokes solution, and the results for two
dimensional problem is compared with the experimental results of Martin and Noyce (1952). The
SPH simulations of shear cavity problem is compared with simulation of finite difference model
available in the literature (Liu and Liu, 2003).

RESULTS
One dimensional Dam Break
The geometry considered for one dimensional dam break problem is shown in Fig. 1. Total
number of particles considered is 2000 and the parameter α is taken to be 0.01. The obtained
water surface and the velocity profiles for the simulation of 30, 60 and 90 seconds after the dam
break are shown in Fig. 2 with comparison with analytical solution.

Fig. 1. Problem domain of 1D dam break problem.

Fig. 2. Surface and velocity profiles for 1D dam break.

Two dimensional Dam Break

7
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

The problem domain is shown in Fig. 3. The initial dam height (H0) taken is 25m and the
downstream bed is assumed to be dry. A total of 2500 particles are considered as fluid particles
and boundary particles are placed along the left and bottom boundaries. The parameter α is again
taken equal to 0.01. The surface profiles and the velocity contours along with velocity vectors at
representative times (i.e. 1.13 and 2.22 seconds) are shown in Fig. 4, 5 and 6 respectively.
Pressure distribution is given in Fig. 7.

Fig. 3. Problem domain of 2D dam break problem.

Fig. 5. Horizontal velocity distribution in 2D dam break flow.

Fig. 6. Vertical velocity distribution in 2D dam break flow.

8
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

Fig. 7. Pressure distribution in 2D dam break flow.

Table 1 compare SPH results to the experimental results obtained by Martin and Noyce (1952).
The maximum water surface depth (H) and the surge front Z are compared at dimensionless time
step t *   t / H0 / g  .

Table 1. Depth and surge front values of the SPH model and experiment
Time HEXP/H0 HSPH/H0 ZEXP/H0 ZSPH/H0
0.71 0.90 0.92 1.33 1.56
1.31 0.76 0.74 2.25 2.45

Shear Cavity
The problem domain is shown in Fig. 8. A total of 1600 fluid particles are considered during
simulation and boundary particles are considered at all the three sides except at the top. At the
top, there is a lid which is moving continuously at a constant speed. The initial and final particle
positions at steady state, horizontal and vertical velocity contours and centerline velocities are
shown in Fig. 9, 10 and 11 respectively. Vortices are formed inside the cavity. The centerline
velocity profile obtained are in good agreement with the finite difference model solution
available in literature.

9
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

Fig. 8. Problem domain and geometry of the shear cavity.

Fig. 10. Horizontal and vertical velocity distribution in shear cavity.

Fig. 11. Comparison of centerline velocities with FDM solution.

CONCLUSIONS

10
Proceedings of HYDRO 2013 INTERNATIONAL
A SPH Model to Simulate Free Surface Flows

The SPH simulation of one and two dimensional dam break problems, and shear cavity shows
the potential of the methodology to solve incompressible fluid dynamics problem. Though the
SPH simulation are computationally expensive compared to traditional numerical methods like
finite difference, it is much simpler to implement and can solve complex problems, where the
traditional approach may fail.

The SPH simulation requires selection of parameters, and artificial equation of state. Research is
underway to study their sensitivity to simulate results.

REFERENCES

Gingold, R.A. and Monaghan, J.J. 1977. Smoothed particle hydrodynamics - Theory and
application to non-spherical stars. Monthly Notices of the Royal Astronomical Society, 181,
375-389.
Lattanzio, J.C., Monaghan, J.J., Pongracic, H. and Schwarz, M.P. 1985. Interstellar Cloud
Collisions. Monthly Notices of the Royal Astronomical Society, 215, 125-147.
Liu, G.R. and Liu, M.B. 2003. Smoothed Particle Hydrodynamics – A Meshfree Particle
Method. World Scientific Publication.
Martin, J.C. and Noyce, W.J. 1952. Part IV. An Experimental Study of the Collapse of Liquid
Columns on a Rigid Horizontal Plane. Philosophical Transactions of the Royal Society A,
244, 312-324.
Monaghan, J.J. 1994. Simulating Free Surface Flows with SPH. J. Computational Physics, 110,
399-406.
Monaghan, J.J. 2005. Smoothed Particle Hydrodynamics. Reports on Progress in Physics, 68,
1703-1759.

11

You might also like