3
$\begingroup$

I may be incorrect, but it seems like commercial graphics codes typically use smoothed particle hydrodynamics (SPH) to produce stunning simulations and not continuum based methods. Why is this? Is SPH much less costly than continuum methods?

If it is that case the SPH is much less expensive than direct numerical simulation (DNS), why do we use DNS at all?

I have only ever worked with finite element method, finite volume method, and finite difference method for PDEs, so I'm curious how these methods compare to SPH.

Thanks

$\endgroup$
  • 2
    $\begingroup$ You are indeed incorrect. Most commercial graphics codes for offline animation, such as Maya and Houdini, use a semi-Lagrangian or particle-in-cell method, with a Chorin-style incompressibility projection applied on a finite difference grid. SPH tends to be favoured for real-time animation because at very low resolutions it degrades better visually than grid-based methods, as @leftroundabout pointed out. $\endgroup$ – Rahul Oct 22 '18 at 7:47
  • 1
    $\begingroup$ Relevant references which form the basis of commercial graphics solvers: (1) Stam, "Stable fluids", SIGGRAPH 1999, (2) Bridson and Müller-Fischer, "Fluid simulation for computer animation", SIGGRAPH 2007 course notes, (3) Jiang et al., "The affine particle-in-cell method", SIGGRAPH 2015. $\endgroup$ – Rahul Oct 22 '18 at 7:54
  • $\begingroup$ @Rahul why don't you make that an answer? $\endgroup$ – leftaroundabout Oct 22 '18 at 8:58
  • $\begingroup$ @leftaroundabout I guess because I'm disagreeing with the motivation for the question, but not answering the actual question about the relative computational cost of SPH and DNS. $\endgroup$ – Rahul Oct 22 '18 at 9:20
2
$\begingroup$

It is extremely difficult to achieve greater than second order accuracy using SPH. Hence once cannot compare SPH with DNS (FVM or FDM). Also the computational cost is much higher for SPH for the same order of accuracy. However, SPH produces realistic looking results even for low resolutions due to its ability to track interfaces implicitly. With FVM, one has to resort to more involved techniques such as the Volume of Fluids method to capture the surfaces of liquids. SPH is a meshless method. Hence one could avoid pre-processing steps such as mesh building and refinement. All these advantages of SPH outweighs the disadvantages with respect to computer graphics applications. When it comes to solving engineering problems, accuracy becomes important and SPH becomes an expensive approach, at least for single phase flow scenarios.

$\endgroup$
  • 1
    $\begingroup$ Interesting. On what ground do you say >2nd order accuracy is more difficult in SPH? I'm not that familiar with SPH, but I'd think it quite straightforward to extend something based on Gaussian smoothing to high order. Even if this doesn't work, how meaningful is that? Most FVMs are only 2nd-order accurate too (even that's only a reconstruction, FVM by construction if 1st order), but as such in many applications superior to higher-order FDM or discontinuous-Galerkin approaches, since these break down at shocks anyway, needing limiters which basically falls them back to 1st order at the shocks. $\endgroup$ – leftaroundabout Oct 22 '18 at 0:04
  • 1
    $\begingroup$ In principle, one could achieve very high orders of accuracy on a regular arrangement of particles and with a simplified flow such as inviscid. But SPH comes with an additional difficulty: the convolution operation. This is essentially a numerical integration over all neighbor particles using a summation. For an arbitrary arrangement of particles, one cannot achieve partition of unity. This deteriorates whatever accuracy you achieve from the choice of your smoothing kernel. $\endgroup$ – user38161 Oct 22 '18 at 8:29
  • 1
    $\begingroup$ I have one more comment. The question mentions "and not continuum based methods." All the methods we discuss here are continuum methods including SPH. Even though we use particles, these are essentially interpolation points conceived as a result of discretizing the continuum equations. $\endgroup$ – user38161 Oct 23 '18 at 19:17
1
$\begingroup$

I don't think you can say that SPH is always much less costly than continuum methods. Less costly than implicit DNS methods, perhaps, but explicit ones can be faster. These have their own problems though, mainly that it can be tricky to predict how the time step will be chosen according to the CFL criterion. That makes them at least pretty useless for real-time applications – you can't rely on it that the needed frame rate will be fulfilled. SPH in principle also needs well-chosen time steps, but like with implicit DSL these aren't all-important in the sense that the solver goes completely berserk when you exceed it – you'll merely get a solution that doesn't really obey the physics equations.

This is probably the main reason that the different approaches are differently popular in science and graphics: in science and engineering, you want results that can well be reasoned about. You want to be able to evaluate local quantities in absolute terms, confirm some theoretical prediction within given error bounds, etc.. DNS (even though it's often enough still rather shaky theoretically speaking, “we've tried two different resolutions and the result agrees, probably this is close enough to the exact solution”) can fulfill those goals pretty well.

In graphics, you scarcely care about such quantitative concerns. What you care about is that it should look good and in particular without obvious artifacts. Both DNS and SPH do cause artifacts, but in DNS they tend to be visually “obviously digital” blocking etc. effects. For SPH it'll be more of a randomly-scattered blurring. For science that's actually a bit of a problem because it can be tricky to predict and recognise, but for graphics that's an advantage because you really don't want the viewers to notice it when the results are unphysical, unlike in science where physical correctness is the most important thing and it's actually good if artifacts are visually obvious.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.