SPH 2017
SPH 2017
Presented By
Ahmed Nasreldeen
Long Fan
Keru Liu
Presentation
Outlines
Ø Introduction
Ø Historical Perspective
Ø General Principles.
Ø Governing Equations
Ø Hand-Calculation Example
Ø Numerical Example
Ø Example Applications
Smoothed Particle Hydrodynamics
(SPH)
It is a computational method used for simulating the dynamics of continuum
media, such as solid mechanics and fluid flows. It has been used in many fields of research,
including astrophysics, ballistics, volcanology, and oceanography. It is a mesh-free
Lagrangian method (where the coordinates move with the fluid)
Smoothed Particle
Hydrodynamics
Some particle properties are The fluid is Fluid dynamics
determined by taking an average represented by a
over neighboring particles particle system
Particle Based
Methods
Ø Smoothed Particle Hydrodynamics
Ø Dissipative Particle Dynamics
Ø Brownian Dynamics
Eulerian vs Lagrangian
descriptions
Eulerian method Lagrangian
Concerned with fluid properties method
Concerned with a particular
(velocity, density, pressure, particle of fluid as it moves
temperature) at a specific space- through space to reflect the
time point (x,y,z,t). behavior of the rest particles.
Ø When the nodes assumes a physical meaning, i.e. they represent material particles
carrying physical properties, the method is said to be meshfree particle and
follows, in general, a Lagrangian approach.
Ø Accurate and stable numerical solutions for integral equations or PDEs with all
kind of boundary conditions
Limitations of Grid Based
Methods
Not Suitable for problems involving:
Ø Large displacements.
Ø Large inhomogeinities.
Ø Deformable boundaries.
Ø Free surfaces.
Historical
Perspective
Computer
(Monaghan, 2005) graphics
Cosmological
(Springel, 2005) simulations
Ø The free surfaces, material interfaces, and moving boundaries can all be traced
naturally in the process of simulation regardless the complicity of the movement of
the particles, which have been very challenging to many Eulerian methods.
Therefore, SPH is an ideal choice for modeling free surface and interfacial flow
problems.
Ø SPH is suitable for problems where the object under consideration is not a
continuum. This is especially true in bio- and nano- engineering at micro and nano
scale, and astrophysics at astronomic scale
Ø SPH is comparatively easier in numerical implementation, and it is more natural to
develop three-dimensional numerical models than grid based methods.
Ø Pure advection is treated exactly. For example, if the particles are given a colour,
and the velocity is specified, the transport of colour by the particle system is exact
Ø With more than one material, each described by its own set of particles, interface
problems are often trivial for SPH but difficult for finite difference schemes.
Ø Particle methods bridge the gap between the continuum and fragmentation in a
natural way.
Ø The resolution can be made to depend on position and time, which makes the
method very attractive for most astrophysical and many geophysical problems.
Ø Another generic problem is that the artificial viscosity is operating at some level
also outside of shocks, giving the numerical model a relatively high numerical
viscosity, which limits the Reynolds numbers that can be easily reached with SPH.
Industrial applications of SPH
Method
Ø Aerospace industries
Ø Car industries
Ø Industrial processing
Ø Fluid-structure interaction
Ø Other applications
(Astrophysics, Bioengineering, Hydrodynamics)
The basic step of the method
(domain discretization, field function approximation and numerical solution):
Ø The continuum:
A set of arbitrarily distributed particles with no connectivity (meshfree);
15
Integral representation of a function:
16
Integral representation of a function:
Ø The interpolation is based on the theory of integral interpolants using kernels
that approximate a delta function
Ø The width, or core radius, is a scaling factor that controls the smoothness or
roughness of the kernel.
17
Integral representation into finite summation
Ø Numerical equivalent
𝐴↓𝐼 (𝑟)=∫Ω↑▒𝐴(𝑟 )𝑊(𝑟−𝑟 ,ℎ)𝑑𝑟
𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑉↓𝑗 𝑊(𝑟−𝑟↓𝑗 ,ℎ)
𝑉=𝑚/𝜌
Ø The basis formulation of the SPH
18
Ø Up to now, various kernel functions have been developed and used in
the SPH method, among which the most widely used are the cubic
spline kernel function and the Wendland kernel.
−𝑊(𝑟↓𝑖𝑗 ,ℎ)=𝐶↓ℎ █ {█(2−𝑞)↑3 −4(1−𝑞)↑3 𝑓𝑜𝑟 0≤𝑞≤1
(2−𝑞)↑3 𝑓𝑜𝑟 1≤𝑞≤2 0
𝑓𝑜𝑟 𝑞>2 𝐶↓ℎ =15/(4𝜋ℎ↑2 )
𝑊(𝑟↓𝑖𝑗 ,ℎ)=𝐶↓ℎ █ {█(2−𝑞)↑4 (1+2𝑞)−4(1−𝑞)↑3 𝑓𝑜𝑟
0≤𝑞≤2 0 𝑓𝑜𝑟 𝑞>2 𝐶↓ℎ =7/(64𝜋
ℎ↑2 )
q=𝑟↓𝑖𝑗 /ℎ
19
Governing
Equations
Each particle is specified by a state list:
mass,
velocity,
position,
force,
density,
pressure
Particle i (mi , v i , ri , Fi , ρ i , pi )
Governing Equations
The acceleration of a particle is
m=
( Density of fluid )⋅ (Total volume)
Total number of particles
Let us now go back to the weighted
averages…
ρi = ∑ m jW (rij )
j
rij
Surface tracking
2
pi = cs (ρi − ρ 0 )
where Cs is the speed of sound and ρ0 is the fluid reference density
(mi , v i , ri , Fi , ρ i , pi )
Ø Velocities and positions are calculated from the forces in a way similar to an
ordinary particle system
Ø But before we go into that we need to learn more about taking averages…
In SPH, the average is formally defined as follows:
mj
A i ≈∑ A jW (rij ) mj
j ρj ρ i ≈∑ ρ jW (rij )
j ρj
mj
∇A i ≈ ∑ A j ∇W (rij ) ≈ ∑ m jW ( rij )
j ρj
j
2
mj
∇ A ≈∑ A j ∇ 2W (rij ) Meshless method!!
i ρj
j
Velocities and
Forces
Motion equation in elasticity:
dv 1 1
= ∇ ⋅ σ + Fext
dt ρ ρ
where:
σ = Cε
σ = − pΙ + µε!
All this together produces the following fluid equation called
Navier-Stokes equation
dv 1 µ 1
= − ∇p + ∇ ⋅ ∇v + Fext + g
dt ρ ρ ρ
Convert each term on the RHS in Navier-Stokes to SPH-
averages
1
− ∇p ≈ ∑ Pij∇W (rij )
ρ i j
where
m j ⎛ pi pj ⎞
Pij = − ⎜ + ⎟
ρ j ⎜⎝ ρ i 2 ρ j 2 ⎟⎠
1
− ∇p ≈ ∑ Pij∇W (rij )
ρ i j
30
The second term (viscosity):
µ
− ∇ ⋅ ∇v ≈ ∑ Vij ∇ 2W (rij )
ρ i j
where
m j ⎛ vi vj ⎞
Vij = − µ ⎜ + ⎟
ρ j ⎜⎝ ρ i 2 ρ j 2 ⎟⎠
Summary
Ø The acceleration of a particle can now be written:
external 1 external
ai ≈ Fi
ρi
gravity
ai ≈ (0,0,− g )
Hand-Calculation
Example
33
Problem
Description
Mass Density Pressure Viscosity Velocity Location
h ∆t
/m /ρ /P /μ /v /(x,y)
Particle i 1 1 1 1 (1,1) (2,1) 2.5 1
Particle j 1 1 1 1 (0.5,1) (1,2) 2.5 1
4
𝑋↓𝑗 =(4,3)
3 𝑉↓𝑗 =(0.5,1)
2 𝑟↓𝑖,𝑗
𝑋↓𝑖 =(2,2) ℎ
1
0 𝑉↓𝑖 =(1,1)
-1 0 1 2 3 4 5 6 7
-1
34
Calculation of 𝛻
W↓𝑖𝑗
Using the numerical method to solve 𝛻W↓𝑖,𝑗
𝜕𝑊↓𝑖𝑗 /𝜕𝑥 =(−45∗((2−0.001)↑2 +1↑2 )↑3/2 /4π∗ℎ↑5 +45∗((2−0.001)↑2 +1↑2 )/2π∗ℎ↑4 −15/π∗ℎ↑2 )−(−45∗5↑3/2 /4π∗ℎ↑5 +45∗5/2π∗ℎ↑4 −15/π∗ℎ↑2 )/0.001 =−2.43∗10↑−1
𝜕𝑊↓𝑖𝑗 /𝜕𝑦 =(−45∗(2↑2 +(1−0.001)↑2 )↑3/2 /4π∗ℎ↑5 +45∗(2↑2 +(1−0.001)↑2 )/2π∗ℎ↑4 −15/π∗ℎ↑2 )−(−45∗5↑3/2 /4π∗ℎ↑5 +45∗5/2π∗ℎ↑4 −15/π∗ℎ↑2 )/0.001 =−1.21∗10↑−1
Particle j
𝑊↓𝑖𝑗 =45𝑟↓𝑖𝑗↑3 /4𝜋ℎ↑5 −45𝑟↓𝑖𝑗↑2 /2𝜋ℎ↑4 +15/𝜋ℎ↑2
Particle i
𝛻W↓i,j =𝜕W
↓ij /𝜕x ,𝜕W
↓ij /𝜕y =(−2.43∗10↑−1 ,−1.21∗
10↑−1 );
35
Calculation of 𝛁
𝑾↓𝐣𝐢
Using the numerical method to solve 𝛻W↓𝑗𝑖
𝜕𝑊↓𝑗𝑖 /𝜕𝑥 =(−45∗((−2−0.001)↑2 +1↑2 )↑3/2 /4π∗ℎ↑5 +45∗((−2−0.001)↑2 +1↑2 )/2π∗ℎ↑4 −15/π∗ℎ↑2 )−(−45∗5↑3/2 /4π∗ℎ↑5 +45∗5/2π∗ℎ↑4 −15/π∗ℎ↑2 )/0.001 =−2.43∗10↑−1
𝜕𝑊↓𝑗𝑖 /𝜕𝑦 =(−45∗(2↑2 +(−1−0.001)↑2 )↑3/2 /4π∗ℎ↑5 +45∗(2↑2 +(−1−0.001)↑2 )/2π∗ℎ↑4 −15/π∗ℎ↑2 )−(−45∗5↑3/2 /4π∗ℎ↑5 +45∗5/2π∗ℎ↑4 −15/π∗ℎ↑2 )/0.001 =−1.21∗10↑−1
Particle j
𝛻W↓𝑗𝑖 =𝜕W
↓𝑗𝑖 /𝜕x ,𝜕W
↓𝑗𝑖 /𝜕y =(−2.43∗10↑−1 ,−1.21∗
10↑−1 );
36
Calculation of 𝛁
2𝑾↓i,j
Using the numerical method to solve 𝛻2W↓𝑖,𝑗
37
Calculation of 𝛁
𝟐𝑾↓𝐣,𝐢
Using the numerical method to solve 𝛻2W↓𝑗,𝑖
38
Calculation of Acceleration, Velocity and
Location
39
Calculation of Acceleration, Velocity and
Location
40
Calculation
Results
Mass Density Pressure Viscosity Velocity Location
h ∆t
/m /ρ /P /μ /v /(x,y)
Particle i 1 1 1 1 (2.5,1.7) (2,1) 2.5 1
Particle j 1 1 1 1 (-1.0,0.3) (1,2) 2.5 1
4 𝑉↓𝑗𝑛𝑒𝑤 𝑉↓𝑖𝑛𝑒𝑤
3
𝑉↓𝑗𝑝𝑟𝑒
2
𝑉↓𝑖𝑝𝑟𝑒 ℎ
1
0
-1 0 1 2 3 4 5 6 7
-1
For each time step:
Ø Discrete from integration to summation
Ø Numerical approximation for Kernel Function
Ø Calculate density for each particle
Ø Calculate pressure for each particle
Ø Calculate all type of accelerations for each particle, and sum it up
Ø Find new velocities and positions by using the same summation method as
before…
Numerical Example
43
Simulation Example
Ø Software Introduction
Ø Software preparation
Ø Numerical Computation
Ø Parameter Setup
Ø Coding
Ø Visualization of result
Software
Introduction
Ø Numerically computation.
Kernel Function:
Ø Gaussian
Ø Quadratic
Ø Cubic
Ø Wendland
Parameter Setup
Time-stepping algorithm:
Ø Predictor-Corrector
Ø Verlet
Ø Symplectic
Ø Beeman
Parameter Setup
Viscosity treatment:
Ø Artificial viscosity
Ø Laminar
Density Filter:
Ø Execute SPHysics_2D.
Ø Visualize by ParaView.
Coding-bug and
solution
Bug:
‘Xilink’ Command in SPHYSICS.mak file cannot be recognize
by new version of Cygwin.
Solution:
Remodify the PHYSICS.mak file as follows:
Visualization of result
Visualization of result (t=0, 15,30,45)
Visualization of result (t=60,
75,90,105)
Visualization of result (t=120,
135,149)
Example
Applications
62
Uses in astrophysics
Smoothed-particle hydrodynamics's adaptive resolution, numerical conservation of
physically conserved quantities, and ability to simulate phenomena covering many
orders of magnitude make it ideal for computations in theoretical astrophysics.
Uses in fluid simulation
First, SPH guarantees conservation of mass without extra
computation. Second, SPH computes pressure from weighted
contributions of neighboring particles. Finally, SPH creates a free
surface for two-phase interacting fluids directly.For these reasons it is
possible to simulate fluid motion using SPH in real time.
Uses in solid mechanics
This feature has been exploited in many applications in Solid
Mechanics: metal forming, impact, crack growth, fracture,
fragmentation, etc.
Questions
66