^{1}

^{1}

^{1}

We compare several approximations for second derivatives with Smoothed Particle Hydrodynamics (SPH). A first-order consistent approximation, derived from the zeroth-order consistent Corrective Smoothed Particle Method (CSPM), is proposed. The accuracy of the new method (ICSPM) is similar to that of the Finite Particle Method (FPM) and Modified Smoothed Particle Hydrodynamics (MSPH), but it is computationally less expensive. We demonstrate the accuracy of our method by studying heat conduction in a slab with discontinuous conductivity coefficients. We use both uniformly and pseudo-randomly distributed particles.

Smoothed Particle Hydrodynamics (SPH) is a spatial discretisation method to solve partial differential equations. It is a mesh-free, Lagrangian method in which the system is represented by a finite set of particles. SPH was originally developed to solve astrophysical problems [

As opposed to the astrophysical problems that SPH was initially applied to, most fluid and solid mechanics problems have solid/physical domain boundaries. As a consequence, the support domain of particles close to these boundaries overlaps with the empty area behind it, which has a major negative influence on the accuracy of the SPH approximations. Consistency is also lost if particles are not uniformly distributed, which is the case in most simulations. Restoring the consistency for functions and first-derivative approximations is fairly straight- forward and can be achieved by using correction terms as in, e.g. [

Second derivatives (or the Laplacian) appear in viscous terms, conduction equations and in the pressure Poisson equation that is used in incompressible SPH. Flebbe et al. [

In this work we only consider methods that use conventional smoothing functions. This excludes the previously mentioned RKPM. We describe the original SPH method to approximate second derivatives, as well as the methods by Chen and Beraun [

There are two approaches to derive the SPH equations for fluid flows in the literature. The first one is primarily concerned with choosing a density estimate. Substituting this estimate into the Lagrangian then leads to a system of equations conserving both linear and angular momentum. This approach is explained in detail by Price [

Consider a function f , defined on a domain Ω . Then the value of f at an arbitrary point x ∈ Ω can be written as:

f ( x ) = ∫ Ω f ( x ˜ ) δ ( x − x ˜ ) d x ˜ . (1)

Here, δ ( ⋅ ) is the Dirac delta distribution:

δ ( z ) = ( ∞ if z = 0 , 0 otherwise . (2)

In SPH, δ ( ⋅ ) is replaced by a continuous function K ( ⋅ , h ) , with h > 0 a smoothing parameter. K is called the smoothing or kernel function and should converge to the Dirac delta distribution as h goes to zero. Preferably it is also radially symmetric, has compact support and satisfies the unity condition for all x ∈ Ω :

∫ Ω K ( x − x ˜ , h ) d x ˜ = 1. (3)

Not satisfying the unity condition―to be more precise, its discrete equiva- lent―is the main reason for inaccurate approximations. This will be explained in more detail later. Replacing the Dirac delta function by K leads to the following approximation:

f ( x ) ≈ ∫ Ω f ( x ˜ ) K ( x − x ˜ , h ) d x ˜ , (4)

which is called the kernel approximation of f . Note that it is a weighted average over the values of f at all points x ˜ ∈ Ω , including x itself.

To get a numerically useful expression, a quadrature rule is applied to (4). This results in a partitioning of the (computational) domain Ω by a finite number of so-called particles. The summation for a particular particle is limited to those particles that are within the support domain of the particle. This is illustrated in

〈 f i 〉 : = ∑ j ∈ S i f j K i j V j , (5)

where V j is the volume of particle j , f j denotes f ( x j ) and K i j : = K ( x i − x j , h ) . The approximation in (5) is called the particle approxima-

tion of f . When applied to a physical problem, the volume of a particle is usually replaced by the ratio of its mass and density, V j = m j / ρ j , but since this is not necessary for our derivations we will stick to the notation in (5).

Approximations for derivatives are found by replacing f by its derivatives in (4). For instance, substituting ∇ f leads to:

∇ f i ≈ ∫ Ω ∇ f ( x ˜ ) K ( x − x ˜ , h ) d x ˜ . (6)

Integrating by parts gives:

∇ f i ≈ B ( f ( x ˜ ) , K ( x − x ˜ , h ) ) | ∂ Ω − ∫ Ω f ( x ˜ ) ∇ x ˜ K ( x − x ˜ , h ) d x ˜ , (7)

where B is a function depending on f and K and ∂ Ω denotes the boundary of Ω . The first term on the right-hand side of (7) is a boundary term that is usually neglected, since it is zero for particles sufficiently far away from the boundaries. Hence, only the second term on the right-hand side remains and, after discretising, we find:

〈 ∇ f i 〉 : = − ∑ j ∈ S i f j ∇ x j K i j V j . (8)

Similarly, we can derive an approximation for the Laplacian by substituting ∇ 2 f for f in (4). Integrating by parts twice, neglecting boundary terms and discretising leads to:

〈 ∇ 2 f i 〉 : = ∑ j ∈ S i f j ∇ x j 2 K i j V j . (9)

Note that in both the approximation for the gradient and the Laplacian the derivative operator has switched from f to K . Since K is known, these expressions can be computed.

Substituting a Taylor series expansion for f j around x i in (9) reveals that the leading error term of this estimate can be subtracted to find the more accurate estimate:

〈 ∇ 2 f i 〉 SPH : = ∑ j ∈ S i ( f j − f i ) ∇ x j 2 K i j V j . (10)

Here, the subscript “SPH” was added to indicate that this is the standard SPH equation used in Section 5. In practice, (10) is rarely used. The reason is that for most kernels the second derivatives have very steep gradients, making the approximation very sensitive to irregularities in the particle distribution [

〈 ∇ 2 f i 〉 Brookshaw : = 2 ∑ j ∈ S i ( f j − f i ) x i j ⋅ ∇ x j K i j | x i j | 2 V j , (11)

where x i j : = x i − x j . This approximation uses first derivatives of the kernel function instead of second derivatives, which makes it less sensitive to changes in the particle distribution [

The simple expressions in (10) and (11) have a downside: their accuracy decreases for particles close to boundaries or when the particle distribution is irregular. This can be shown by substituting a Taylor series expansion for f j around x i . For (10), for instance, this gives:

∑ j ∈ S i ( f j − f i ) ∇ x j 2 K i j V j = ∑ j ∈ S i [ x j i T ∇ f i + 1 2 x j i T H f i x j i + O ( h 3 ) ] ∇ x j 2 K i j V j = ∑ j ∈ S i x j i T ∇ f i ∇ x j 2 K i j V j + ∑ j ∈ S i 1 2 x j i T H f i x j i ∇ x j 2 K i j V j + O ( h ) , (12)

where H f denotes the Hessian matrix of f . The term that we are approxi- mating, the Laplacian, is contained in the second term on the right-hand side of (12).

The first term on the right-hand side of (12) is an O ( h − 1 ) -error term that vanishes in the ideal conditions of a uniform particle distribution and no boundaries, but it does not if a particle is close to a boundary or is surrounded by irregularly located particles. A similar O ( h − 1 ) -error term can be found for (11).

Furthermore, it is impossible to distill the exact Laplacian from the second term, because the separate second-derivative terms have different coefficients. This leads to an additional O ( 1 ) -error, which also holds for (11). In the next section we discuss several methods that were designed to give more accurate approximations.

This chapter describes two methods that approximate the Laplacian with higher accuracy than the conventional estimate in (11). We discuss the Corrective Smoothed Particle Method (CSPM) and the Modified Smoothed Particle Hydrodynamics (MSPH) method.

This method, described in various papers by Chen and his colleagues [

f j = f i + x j i T ∇ f i + 1 2 x j i T H f i x j i + O ( h 3 ) . (13)

In all derivations to come, we assume Ω is a two-dimensional domain and x and y refer to the two independent spatial directions. We stress, however, that it is possible to extend everything in Sections 3 and 4 to three dimensions. To compute second derivatives, the first term on the right-hand side of (13) is first subtracted from both sides of the equation. The result is multiplied by the vector h K i j , with h defined as:

h f : = ( ∂ 2 f ∂ x 2 , ∂ 2 f ∂ x ∂ y , ∂ 2 f ∂ y 2 ) T . (14)

Multiplying (13) by V j and summing over all the particles leads to:

#Math_74# (15)

In (15) and in the rest of this paper, the derivatives in h K i j are taken with respect to x j . The first term on the right-hand side of (15) is a O ( h − 1 ) -term. We wish to subtract it from both sides of the equation, but since ∇ f i is unknown we are forced to use an approximation for that as well. A derivation similar to the one that led to (15), but with ∇ x j K i j instead of h K i j , gives:

∑ j ∈ S i ( f j − f i ) ∇ x j K i j V j = ∑ j ∈ S i ( x j i T ∇ f i ) ∇ x j K i j V j + O ( h ) (16)

= Γ i , ∇ ∇ f i + O ( h ) , (17)

where Γ i , ∇ is the normalisation matrix defined by:

Γ i , ∇ : = ∑ j ∈ S i ∇ x j K i j V j x j i T . (18)

Multiplying (16) by the inverse of Γ i , ∇ leads to a first-order accurate approximation for the gradient:

〈 ∇ f i 〉 CSPM : = Γ i , ∇ − 1 ∑ j ∈ S i ( f j − f i ) ∇ x j K i j V j = ∇ f i + O ( h ) . (19)

The gradient approximation in (19) is substituted for ∇ f i in (15). Subtracting the first term on the right-hand side gives:

∑ j ∈ S i ( f j − f i ) h K i j V j − ∑ j ∈ S i ( x j i T 〈 ∇ f i 〉 CSPM ) h K i j V j ≈ ∑ j ∈ S i 1 2 ( x j i T H f i x j i ) h K i j V j + O ( h ) . (20)

It can be shown that the first term on the right-hand side of (20) can be written as Γ i , h h f i , where Γ i , h is the normalisation matrix defined by:

Γ i , h : = ∑ j ∈ S i 1 2 h K i j V j ξ i j T , (21)

with ξ i j T the following vector:

ξ i j T : = ( ( x i − x j ) 2 , 2 ( x i − x j ) ( y i − y j ) , ( y i − y j ) 2 ) . (22)

Multiplying the left-hand side of (20) by the inverse of Γ i , h gives the final CSPM approximation for second derivatives:

〈 h f i 〉 CSPM : = Γ i , h − 1 ( ∑ j ∈ S i ( f j − f i ) h K i j V j − ∑ j ∈ S i ( x j i T 〈 ∇ f i 〉 CSPM ) h K i j V j ) . (23)

By using an approximation for ∇ f i in (15), an error was introduced, as indicated by the approximation symbol in (20). As a result, normalising the first term on the right-hand side of (20) does not lead to the desired first-order accurate approximation. Instead, the first-order error of the gradient estimate makes that the approximation in (23) is zeroth-order accurate, i.e.:

〈 h f i 〉 CSPM = h f i + O ( 1 ) . (24)

In Section 4 we show how this approximation can be improved to be first- order accurate.

Zhang and Batra [

φ i : = ( 〈 f i 〉 , 〈 ∇ f i 〉 T , 〈 h f i 〉 T ) T . (25)

This is achieved by multiplying (13) by K i j , ∇ K i j and h K i j , leading to six equations for six unknowns (in two dimensions) for each particle. Because all unknowns are put in one single vector, this method requires the inversion of 6 × 6 - matrices. This is computationally expensive, but it leads to more accurate results than with the method described in Section 3.1. In fact, if we isolate 〈 h f i 〉 from φ i , we find:

〈 h f i 〉 MSPH = h f i + O ( h ) . (26)

It is possible to achieve similar accuracy without using these larger matrices. For that we need only one adjustment to CSPM. This is described in Section 4.

In Section 3.1 we showed that the CSPM approximation for second derivatives is zeroth-order consistent. The crucial step in improving the accuracy is keeping the first-order terms in (16) separate from the second and higher-order terms. This gives:

∑ j ∈ S i ( f j − f i ) ∇ x j K i j V j = ∑ j ∈ S i ( x j i T ∇ f i ) ∇ x j K i j V j + ∑ j ∈ S i 1 2 ( x j i T H f i x j i ) ∇ x j K i j V j + O ( h 2 ) , (27)

so that, instead of (19), we find:

〈 ∇ f i 〉 CSPM = ∇ f i + Γ i , ∇ − 1 ∑ j ∈ S i 1 2 ( x j i T H f i x j i ) ∇ x j K i j V j + O ( h 2 ) . (28)

Accounting for the extra term in (28) leads to the adjustment of (20) to:

∑ j ∈ S i ( f j − f i ) h K i j V j − ∑ j ∈ S i ( x j i T 〈 ∇ f i 〉 CSPM ) h K i j V j = ∑ j ∈ S i 1 2 ( x j i T H f i x j i ) h K i j V j − ∑ j ∈ S i x j i T ( Γ i , ∇ − 1 ∑ j ∈ S i 1 2 ( x j i T H f i x j i ) ∇ x j K i j V j ) h K i j V j + O ( h ) = [ Γ i , h − ∑ j ∈ S i h K i j x j i T Γ i , ∇ − 1 V j ∑ j ∈ S i 1 2 ∇ x j K i j ξ i j T V j ] h f i + O ( h ) , (29)

with Γ i , h and ξ i j as defined in (21) and (22), respectively. Note that the nor- malisation matrix Γ i , h is the normalisation matrix used in CSPM. We propose to use the following approximation for second derivatives instead of (23):

〈 h f i 〉 ICSPM : = Γ ˜ i , h − 1 ( ∑ j ∈ S i ( f j − f i ) h K i j V j − ∑ j ∈ S i ( x j i T 〈 ∇ f i 〉 CSPM ) h K i j V j ) , (30)

with Γ ˜ i , h the normalisation matrix:

Γ ˜ i , h : = Γ i , h − ∑ j ∈ S i h K i j x j i T V j Γ i , ∇ − 1 ∑ j ∈ S i 1 2 ∇ x j K i j ξ i j T V j , (31)

which we designate as improved CSPM (ICSPM). This method is slightly more expensive than CSPM, but it requires the same effort regarding matrix inversions. Yet, it follows directly from the definition of Γ ˜ i , h and (29) that this approximation is first-order accurate:

〈 h f i 〉 ICSPM = h f i + O ( h ) . (32)

In Section 5 we explore the behaviour of ICSPM and compare it with the standard SPH, CSPM and MSPH approximations described in Sections 3.1, 3.2 and 2.3.

The methods described in Sections 3.1, 3.2 and 4 are more accurate, but also computationally more expensive than (11). Therefore, if the available computation time is limited, (11) is the approximation to go for. Also, if the domain has no boundaries, particles are distributed regularly, or if accuracy is simply not of great importance, (11) is a perfectly good estimate for the Laplacian. However, if accuracy is important and a somewhat higher computational cost is not an issue, CSPM, MSPH and ICSPM are attractive alternatives. Moreover, these methods give approximations for all second derivative-terms instead of just the Laplacian.

The MSPH method by Zhang and Batra [

With the improved normalisation step in Section 4, we have found a method that is computationally similar to CSPM―it only additionally requires the explicit computation of the sums in (31)―but which has the same order of accuracy as MSPH. We will verify this with numerical examples in Section 5.

In principle it is possible to increase the accuracy to any order. This might not be obvious with CSPM, but it is quite straightforward with MSPH. However, every increment in order introduces a number of extra equations to solve (simultaneously), so that it is not worth the effort for any order higher than one. Hence, if accurate approximations for second derivatives are required, we recommend ICSPM (30). This method is more accurate than CSPM, while the extra computational effort is negligible. MSPH has a similar accuracy, but is computationally more expensive.

This section describes three numerical case studies to compare the various methods that were discussed previously. The first one yields the computation of a one-dimensional second derivative. In the second and third case study we consider a time-dependent problem on a two-dimensional domain. In all three experiments we use the Wendland C 2 kernel, which, in one-dimension, is given by:

W 1 D ( R , H ) = 5 4 H ( 1 − R ) + 3 ( 3 R + 1 ) , (33)

where ( ⋅ ) + : = max ( ⋅ , 0 ) and H is the radius of the support domain. As suggested by Dehnen and Aly [

W 2 D ( R , H ) = 7 π H 2 ( 1 − R ) + 4 ( 4 R + 1 ) , (34)

with H = ( 18 / 5 ) h . In our test cases we use these kernels with R the ratio between particle distance and H .

We start with a one-dimensional domain Ω = [ 0 , 1 ] , on which we compute the second derivative of the given function f ( x ) = ( x − 0.5 ) 4 . This test case was also performed by Zhang and Batra [

E = max i = 1 , ⋯ , N | f ″ i − 〈 f ″ i 〉 | , (35)

where N is the total number of particles. We use h = 1.5 Δ x , with Δ x the (uniform) inter-particle distance, equal to that of Zhang and Batra [

We also calculate the errors according to (35) for several values of N . These are shown in the two right panels of

Next, we compute the time-dependent temperature distribution on a two-di- mensional domain Ω = [ 0 , 1 ] 2 , a test case by Cleary and Monaghan [

ρ c v ∂ T ∂ t = κ ∇ 2 T , (36)

with parameter choices ρ = 10 and c v = κ = 1 . Initially, we have the following temperature distribution:

T ( x , y , 0 ) = sin ( π x ) sin ( π y ) , (37)

which is shown in

analytical solution of this problem is known and reads:

T ( x , y , t ) = sin ( π x ) sin ( π y ) e − 2 π 2 α t , (38)

where α = κ / ( ρ c v ) . Since our main interest is the comparison between the various spatial discretisations, it is sufficient to use the explicit Euler time stepping scheme. The time step used depends on the spatial discretisation distance and is chosen as Δ t = 0.25 Δ x y 2 , where Δ x y = V ref , with V ref the reference volume, equal to the volume of an interior particle.

In this case study we use two expressions for the error. The first one is similar to (35), but looks at the temperature itself rather than the Laplacian:

E abs = max i = 1 , ⋯ , N | T i − 〈 T i 〉 | . (39)

The second one considers the relative errors at the positions of the particles instead of the absolute errors:

E rel = max i = 1 , ⋯ , N | T i − 〈 T i 〉 T i | . (40)

We choose the smoothing length to be h = 1.2 Δ x y , equal to that of Cleary and Monaghan [

The results in the left panel of

larger N the CSPM method is less accurate than both MSPH and ICSPM.

The results in the right panel in

In the final test case we study the effect of discontinuous parameters. Cleary and Monaghan [

κ i j : = 2 κ i κ j κ i + κ j . (41)

When the temperature variation of the outermost points is small, the analytical solution can be approximated by [

T ( x , y , t ) = T r κ r α l κ r α l + κ l α r { erfc ( ( 0.5 − x ) / ( 2 α l t ) ) , for x < 0.5 , 1 + κ l α r κ r α l erf ( ( x − 0.5 ) / ( 2 α r t ) ) , for x > 0.5. (42)

We start with a discontinuity only in the conductivity. For the left half it is set to κ l = 10 , while for the right it is κ r = 1 . The densities are ρ l = ρ r = 1000 and c v = 1 for both halves of the slab. We uniformly distribute 40 particles in the x - direction and 20 in the y -direction and we apply an explicit Euler time stepping scheme with time step size Δ t = Δ x 2 .

Brookshaw | ICSPM | |
---|---|---|

20 | 5.6286e−01 | 5.8289e−01 |

40 | 3.5167e−01 | 3.7193e−01 |

80 | 1.5544e−01 | 1.4564e−01 |

Brookshaw | ICSPM | |
---|---|---|

20 | 1.7908e−01 | 2.2687e−01 |

40 | 4.5102e−02 | 6.3108e−02 |

80 | 2.0079e−02 | 1.8011e−02 |

by Cleary and Monaghan and the ICSPM. To avoid dividing by small numbers we only consider particles for which x > 0.4 .

Next, we consider the case where both the conductivity and the specific heat are discontinuous. We choose κ l = c l = 1 , while κ r = c r = 3 . The temperature distribution at t = 5 is shown in the left panel of

Finally, we also take the density to be discontinuous at the interface. We choose κ l = c l = 1 and ρ l = 2000 , while κ r = 3 , c r = 1 and ρ r = 1000 . The temperature distribution at t = 2 is shown in the right panel in

Brookshaw | ICSPM | |
---|---|---|

20 | 6.4844e−02 | 5.8971e−02 |

40 | 3.1786e−02 | 1.2137e−02 |

80 | 2.4560e−02 | 2.4052e−03 |

Brookshaw | ICSPM | |
---|---|---|

20 | 1.3655e−01 | 2.5540e−01 |

40 | 5.9399e−02 | 1.6845e−01 |

80 | 5.1394e−02 | 6.5388e−02 |

We studied approximations of second-derivative terms (or the Laplacian) in Smoothed Particle Hydrodynamics (SPH). Second derivatives appear in viscosity and conduction terms, and in Poisson equations. Traditionally, second derivatives have been approximated with the second derivatives of the kernel function, but these showed to be sensitive to particle disorder. Therefore various other methods and improvements have been suggested in the literature.

We proposed an improvement to the Corrective Smoothed Particle Method (CSPM) that increased the consistency of the estimates from zeroth-order to first-order. This method, called improved CSPM (ICSPM), was―together with several other methods―applied to one and two-dimensional test cases. The one- dimensional test case clearly showed the high accuracy of ICSPM compared to CSPM. In the first two-dimensional test case we solved the heat equation and compared errors of the temperature itself, rather than the Laplacian. With the absolute error, the difference between CSPM and ICSPM was already clearly visible, but when we considered the relative error the difference between the two methods was even more obvious. In the third test case we computed the temperature distribution for an infinite slab consisting of two different materials. The results showed that our improved approximation is perfectly capable of handling discontinuous parameters.

ICSPM is computationally only slightly more expensive than CSPM. Yet, its accuracy is similar to that of more expensive methods, such as the Finite Particle Method (FMP) and Modified Smoothed Particle Hydrodynamics (MSPH), although MSPH proved to be a bit more stable in specific cases.

The first author kindly acknowledges support from the Nederlandse Organisatie voor Wetenschappelijk Onderzoek (NWO) VICI Grant 639.033.008. We also like to thank the reviewers for their helpful comments.

Korzilius, S.P., Schilders, W.H.A. and Anthonissen, M.J.H. (2017) An Improved CSPM Approach for Accurate Second-Derivative Approximations with SPH. Journal of Applied Mathematics and Physics, 5, 168-184. http://dx.doi.org/10.4236/jamp.2017.51017