16.08.2013 Views

Truncation error in SPH

Truncation error in SPH

Truncation error in SPH

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Truncation</strong> <strong>error</strong> <strong>in</strong> <strong>SPH</strong><br />

Nathan Qu<strong>in</strong>lan, Mihai Basa, Ruairi Nestor, Marty Lastiwka<br />

First <strong>SPH</strong>ERIC Workshop<br />

10-12 May 2006, University of Rome La Sapienza


Statement of the problem<br />

What is the <strong>error</strong> <strong>in</strong> the approximation<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

a<br />

( )<br />

∂A<br />

∂W x − x<br />

≅ −∑ A( x )<br />

Δx<br />

∂x ∂x<br />

b a<br />

b b<br />

x = x b<br />

b<br />

a<br />

b<br />

( x )<br />

∇A ≅ − A ∇ W V<br />

x= x<br />

∑<br />

b b a b<br />

(nD)<br />

(1D)


Methods<br />

Analysis<br />

Taylor series expansions → truncation <strong>error</strong> <strong>in</strong> 1D<br />

Numerical Experiments<br />

Evaluation of an analytical test function<br />

for:<br />

• uniform and non-uniform particle distribution<br />

• 1D and 3D<br />

• standard <strong>SPH</strong> and consistency-corrected kernels<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006


The <strong>SPH</strong> evaluation of a gradient<br />

( )<br />

a<br />

∂A<br />

x<br />

∂x<br />

Eulerian<br />

∂ u<br />

1<br />

+ ( u ⋅ ∇ ) u + ∇ p = 0<br />

∂t<br />

ρ<br />

≅ −<br />

x −2h<br />

( )<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

a<br />

( )<br />

∂W x − x<br />

xa + 2h<br />

A x<br />

a<br />

dx<br />

∫<br />

∂x<br />

smooth<strong>in</strong>g discretisation<br />

( )<br />

( )<br />

∂W x − x<br />

≅ − A x Δx<br />

∑<br />

Lagrangian<br />

Du<br />

1<br />

+ ∇ p = 0<br />

Dt ρ<br />

b a<br />

b<br />

b<br />

∂xb<br />

b


The dimensionless kernel<br />

Wˆ ( s)<br />

= hW ( x − x )<br />

a<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

0<br />

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2<br />

s<br />

=<br />

x − x<br />

h<br />

a


Smooth<strong>in</strong>g <strong>error</strong><br />

x + 2h<br />

a<br />

∂A ∂W<br />

≅ − A dx<br />

∂x ∫ ∂x<br />

x = x x −2h<br />

a a<br />

Expand A(x) as a Taylor series and <strong>in</strong>tegrate by parts:<br />

xa + 2h xi + 2h 3 xa + 2h<br />

∂A dW ⎛ ⎞ 1 ∂ A 3 ∂W<br />

= − A dx + A′ a ⎜1− Wdx ⎟ + 3 ( x − xa ) dx +<br />

∂x x x dx ⎜ ⎟<br />

= 6<br />

x<br />

a xa −2h ⎝ xa −2h ⎠<br />

∂x<br />

∂<br />

a xa −2h<br />

<strong>in</strong> dimensionless form:<br />

∫ ∫ ∫ …<br />

xa + 2h 2<br />

( )<br />

2 3<br />

a 1<br />

a a<br />

x = x 2 6<br />

x −2h<br />

∂A ∂W<br />

ˆ h ˆ h<br />

= − A dx + A′ − Wds + A′′ s W ′ ds + A′′′ s Wˆ ′ ds +<br />

∂x ∂x<br />

a a<br />

∫ ∫ ∫ ∫ …<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006


Discretisation <strong>error</strong> – uniform particle spac<strong>in</strong>g<br />

The 1D <strong>SPH</strong> discretisation is a<br />

numerical <strong>in</strong>tegration of the form<br />

xn +Δx<br />

2<br />

n<br />

x −Δx<br />

1<br />

∫<br />

2<br />

b=<br />

1<br />

( )<br />

f ( x) dx ≅ Δx∑ f x<br />

The Second Euler-MacLaur<strong>in</strong><br />

Formula:<br />

1<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

b<br />

A(x)<br />

W(x)<br />

xn +Δx 2 n<br />

∞<br />

2k<br />

B2k Δx<br />

∫<br />

( ) ∑ ( b ) ∑ 1 2<br />

n<br />

2<br />

b 1 k 1 ( 2 k ) !<br />

x −Δx<br />

= =<br />

− 2k + 1 ( )<br />

( ) ( + )<br />

x b<br />

x a<br />

Δx b<br />

( 2k −1 2k −1<br />

)<br />

1 2 1 2<br />

f x dx = Δx f x − − f − f<br />

( )<br />

( )<br />

x


Kernel boundary smoothness<br />

Boundary smoothness of the kernel<br />

is the highest <strong>in</strong>teger β for which<br />

the β th derivative and all lower<br />

derivatives are zero at the<br />

boundaries of the compact support.<br />

cubic B-spl<strong>in</strong>e kernel: β=2<br />

Gaussian kernel: β→∞ <strong>in</strong> <strong>in</strong>f<strong>in</strong>ite doma<strong>in</strong><br />

polynomial kernel: arbitrary β<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

ˆ<br />

W<br />

ˆ<br />

W ′<br />

ˆ<br />

W ′′<br />

ˆ<br />

W ′′′<br />

1<br />

0.5<br />

0<br />

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2<br />

1<br />

0<br />

-1<br />

-2<br />

2<br />

-1.5 -1 -0.5 0 0.5 1 1.5 2<br />

0<br />

-2<br />

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2<br />

5<br />

0<br />

-5<br />

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2<br />

s = ( (x-x x − )/h<br />

i x ) h<br />

a


Overall <strong>error</strong> – uniform particle spac<strong>in</strong>g<br />

<strong>SPH</strong> estimate<br />

∑<br />

∂A<br />

x<br />

− A W<br />

b bΔ xb<br />

=<br />

∂<br />

′<br />

b x = x<br />

2<br />

h 3<br />

A′′′ ˆ<br />

a s W ′ ds<br />

+ + …<br />

6<br />

( ) ( ) −β −<br />

( )<br />

β + 2 !<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

∫<br />

a<br />

exact derivative<br />

smooth<strong>in</strong>g <strong>error</strong><br />

β + 2<br />

⎛ Δx<br />

⎞ Bβ<br />

+ 2 1 ( ˆ β + 2 ( 1)<br />

( ) ˆ β + ) 2<br />

− 1 2 ⎡A ′<br />

a 4Ws = 2 2 β 1 Ws = 2 O ( h ) ⎤<br />

⎜ − + + + −<br />

h<br />

⎟ …<br />

⎝ ⎠<br />

⎣ ⎦<br />

discretisation <strong>error</strong>


Results – uniform particle spac<strong>in</strong>g<br />

s<strong>in</strong>usoidal test<br />

function A(x),<br />

wavelength λ<br />

10 th order<br />

polynomial<br />

kernel, β=4<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

10 0<br />

10 -1<br />

10 -2<br />

10 -3<br />

10 -4<br />

10 -5<br />

10 -6<br />

h/λ=<br />

0.2239<br />

0.0111<br />

0.0018<br />

10 -1<br />

Δx/h<br />

(b)<br />

analysis<br />

computation<br />

1<br />

6<br />

10 0


Results – uniform particle spac<strong>in</strong>g, 1D<br />

s<strong>in</strong>usoidal test<br />

function A(x),<br />

wavelength λ<br />

10 th order<br />

polynomial<br />

kernel, β=4<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

10 2<br />

10 0<br />

10 -2<br />

10 -4<br />

10 -6<br />

10 -4<br />

Δx/h=<br />

4/3<br />

4/7<br />

4/19<br />

4/21<br />

10 -3<br />

analysis, Δx/h=4/(2n+1)<br />

computation, Δx/h=4/(2n+1)<br />

10 -2<br />

h/λ<br />

(a)<br />

10 -1<br />

1<br />

2<br />

10 0


Results – uniform particle spac<strong>in</strong>g, 1D<br />

s<strong>in</strong>usoidal test<br />

function A(x),<br />

wavelength λ<br />

10th order<br />

polynomial<br />

kernel, β=4<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

10 2<br />

10 0<br />

10 -2<br />

10 -4<br />

10 -6<br />

10 -4<br />

Δx/h=<br />

4/3<br />

0.9<br />

4/7<br />

0.5<br />

0.3<br />

4/19<br />

4/21<br />

0.1<br />

10 -3<br />

analysis, Δx/h=4/(2n+1)<br />

computation, Δx/h=4/(2n+1)<br />

computation, Δx/h≠4/(2n+1)<br />

10 -2<br />

h/λ<br />

(a)<br />

10 -1<br />

1<br />

2<br />

10 0


Non-uniform particle distribution<br />

x b is the location of particle b<br />

xb<br />

A(x)<br />

is the centroid of a region associated with particle b<br />

xb<br />

x b<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

Δx b<br />

x<br />

x − x<br />

δ b =<br />

Δx<br />

b b<br />

b


Non-uniform spac<strong>in</strong>g<br />

∑<br />

∂A<br />

− A W<br />

b bΔ xb<br />

=<br />

∂<br />

′<br />

b x = x<br />

2<br />

( ˆ )<br />

h<br />

3<br />

− A′ 1<br />

ˆ<br />

a Wds − + A′′′ a s W ′ ds +<br />

6<br />

3 4<br />

1 ⎡ ⎛⎛ Δx ⎞ ⎞ Aa<br />

⎛ 2 1 ⎞ ⎛⎛ Δx<br />

⎞ ⎞⎤<br />

− ⎢Aaδ O ⎜ + δ + O ⎥<br />

h ⎜⎜ h<br />

⎟ ⎟<br />

⎜ ⎟<br />

2<br />

⎜<br />

12<br />

⎟ ⎜⎜ h<br />

⎟<br />

⎢ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎟<br />

⎣ ⎝ ⎠ ⎝ ⎠⎥⎦<br />

3<br />

⎡ ⎛⎛ Δx<br />

⎞ ⎞⎤<br />

A′ aδO<br />

⎜<br />

⎜⎜ ⎟<br />

h<br />

⎟ ⎟<br />

4<br />

⎡ A′′ a ⎛ Δx ⎞ A′′<br />

⎛<br />

a ⎛ Δx<br />

⎞ ⎞⎤<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

x<br />

− ⎢ ⎥<br />

⎢⎣ ⎝⎝ ⎠ ⎠⎥⎦<br />

a<br />

∫ ∫ …<br />

− h ⎢ δO<br />

O<br />

2<br />

⎜ +<br />

h<br />

⎟ ⎜ ⎟⎥<br />

2 ⎜⎜ h<br />

⎟ −…<br />

⎢ ⎝ ⎠ ⎝ ⎠ ⎟<br />

⎣ ⎝ ⎠⎦⎥<br />

smooth<strong>in</strong>g <strong>error</strong><br />

discretisation<br />

<strong>error</strong>


Non-uniform spac<strong>in</strong>g – results<br />

Normally distributed<br />

random perturbation<br />

of standard deviation<br />

σ imposed on uniform<br />

particle distribution.<br />

s<strong>in</strong>usoidal test<br />

function,<br />

wavelength λ<br />

10 th order<br />

polynomial kernel,<br />

β=4<br />

Δx/h = 0.364<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

10 0<br />

10 -1<br />

10 -2<br />

10 -3<br />

10 -4<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

10 -3<br />

σ/Δx=0.2<br />

σ/Δx=0.02<br />

σ/Δx=0.002<br />

σ/Δx=0<br />

10 -2<br />

1<br />

h/λ<br />

1<br />

10 -1<br />

1<br />

2<br />

10 0


Non-uniform spac<strong>in</strong>g – results<br />

Normally distributed<br />

random perturbation<br />

of standard deviation<br />

σ imposed on uniform<br />

particle distribution.<br />

s<strong>in</strong>usoidal test<br />

function,<br />

wavelength λ<br />

10 th order<br />

polynomial kernel,<br />

β=4<br />

Δx/h = 0.364<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

10 0<br />

10 -1<br />

10 -2<br />

10 -3<br />

10 -4<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

1<br />

0.1 0.5 1<br />

Δx/h<br />

(a)<br />

3<br />

σ/Δx=<br />

0.2<br />

0.02<br />

0.002<br />

0


First-order consistent kernel (C<strong>SPH</strong>, RKPM…)<br />

∑<br />

∂A<br />

− A W<br />

b bΔ xb<br />

=<br />

∂<br />

′<br />

b x = x<br />

2<br />

( ˆ )<br />

h 2 ˆ h<br />

3<br />

− A′ 1<br />

ˆ<br />

a Wds − + A′′ a s W ′ ds + A′′′ a s W ′ ds +<br />

2 6<br />

3 4<br />

1 ⎡ ⎛⎛ Δx ⎞ ⎞ Aa<br />

⎛ 2 1 ⎞ ⎛⎛ Δx<br />

⎞ ⎞⎤<br />

− ⎢Aaδ O ⎜ + δ + O ⎥<br />

h ⎜⎜ h<br />

⎟ ⎟<br />

⎜ ⎟<br />

2<br />

⎜<br />

12<br />

⎟ ⎜⎜ h<br />

⎟<br />

⎢ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎟<br />

⎣ ⎝ ⎠ ⎝ ⎠⎥⎦<br />

3<br />

⎡ ⎛⎛ Δx<br />

⎞ ⎞⎤<br />

A′ aδO<br />

⎜<br />

⎜⎜ ⎟<br />

h<br />

⎟ ⎟<br />

4<br />

⎡ A′′ a ⎛ Δx ⎞ A′′<br />

a ⎛ Δx<br />

⎞ ⎤<br />

⎛ ⎞<br />

− h ⎢ δO<br />

+ O<br />

2<br />

⎜<br />

h<br />

⎟ ⎜<br />

2<br />

⎜<br />

h<br />

⎟ ⎟⎥<br />

−…<br />

⎢ ⎝ ⎠ ⎜⎝ ⎠ ⎟<br />

⎣ ⎝ ⎠⎥⎦<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

x<br />

− ⎢ ⎥<br />

⎢⎣ ⎝⎝ ⎠ ⎠⎥⎦<br />

a<br />

∫ ∫ ∫ …<br />

smooth<strong>in</strong>g <strong>error</strong><br />

discretisation<br />

<strong>error</strong>


First-order consistent kernel – results<br />

First-order<br />

convergence<br />

observed <strong>in</strong><br />

discretisationlimited<br />

<strong>error</strong><br />

s<strong>in</strong>usoidal test<br />

function,<br />

wavelength λ<br />

10th order<br />

polynomial<br />

kernel, β=4<br />

Δx/h = 0.7<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

10 -1<br />

10 -2<br />

10 -3<br />

10 -4<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

σ/Δx=0.2<br />

σ/Δx=0.02<br />

10 -3<br />

1<br />

1<br />

σ/Δx=0, 0.002<br />

10 -2<br />

h/λ<br />

(a)<br />

10 -1<br />

1<br />

2<br />

10 0


3D <strong>SPH</strong><br />

Normally distributed<br />

random perturbation<br />

of standard<br />

deviation σ imposed<br />

on uniform particle<br />

distribution.<br />

s<strong>in</strong>usoidal test<br />

function,<br />

wavelength λ<br />

10 th order<br />

polynomial kernel,<br />

β=4<br />

non-dimensionalised L 2 norm <strong>error</strong><br />

10 0<br />

10 -1<br />

10 -2<br />

10 -3<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

σ/Δx=0.2<br />

0.02<br />

0<br />

0.02<br />

0.2<br />

0.01 0.05<br />

h/λ<br />

(a)<br />

0.1<br />

1<br />

0<br />

1<br />

Δx/h=0.50<br />

Δx/h=0.98<br />

1<br />

2


3D standard <strong>SPH</strong><br />

σ/Δx = 0<br />

(uniform)<br />

log 10(h/λ)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

log 10 (Δx/h)<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard and corrected <strong>SPH</strong><br />

σ/Δx = 0<br />

(uniform)<br />

log 10(h/λ)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

log 10(Δx/h)<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard <strong>SPH</strong><br />

σ/Δx = 0.02<br />

(low disorder)<br />

log 10(h/λ)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

log 10 (Δx/h)<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard and corrected <strong>SPH</strong><br />

σ/Δx = 0.02<br />

(low disorder)<br />

log 10(h/λ)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

log 10(Δx/h)<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard <strong>SPH</strong><br />

σ/Δx = 0.2<br />

(high disorder)<br />

log 10 (h/λ)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

log 10 (Δx/h)<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard and corrected <strong>SPH</strong><br />

σ/Δx = 0.2<br />

(high disorder)<br />

log 10(h/λ)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

log 10(Δx/h)<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard <strong>SPH</strong><br />

σ/Δx = 0<br />

(uniform)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

neighbours<br />

Δx/h<br />

93 81 33 19<br />

0.7 0.8 1.0 1.2<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard <strong>SPH</strong><br />

σ/Δx = 0.02<br />

(low disorder)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

neighbours<br />

Δx/h<br />

93 81 33 19<br />

0.7 0.8 1.0 1.2<br />

log 10 (non-dimensionalised <strong>error</strong>)


3D standard <strong>SPH</strong><br />

σ/Δx = 0.2<br />

(high disorder)<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006<br />

neighbours<br />

Δx/h<br />

93 81 33 19<br />

0.7 0.8 1.0 1.2<br />

log 10 (non-dimensionalised <strong>error</strong>)


Conclusions<br />

Error depends on<br />

• h (smooth<strong>in</strong>g length) – second order<br />

• Δx/h ∝ (number of neighbours) –1 – dependent on kernel smoothness<br />

<strong>SPH</strong> estimates do not necessarily converge with h<br />

Optimal number of neighbours depends on smooth<strong>in</strong>g length<br />

Non-uniform spac<strong>in</strong>g can cause divergence of standard <strong>SPH</strong> as h is<br />

reduced<br />

Consistency-corrected kernels ensure convergence<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006


Acknowledgements<br />

Supported by Basic Research Grant<br />

SC/2002/189 from the Irish Research<br />

Council for Science, Eng<strong>in</strong>eer<strong>in</strong>g and<br />

Technology under the Embark Initiative,<br />

funded by the National Development<br />

Plan.<br />

First <strong>SPH</strong>ERIC Workshop, Rome, 2006

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!