Computational Astrophysics Lecture 1: Introduction to numerical methods Lecture 2:The SPH formulation Lecture 3: Construction of SPH smoothing functions Lecture 4: SPH for general dynamic flow Lecture 5: N-body techniques Lecture 6: Numerical Implementation Project Work (5-6 weeks) David Hobbs Lund Observatory ASTM22
Introduction SPH for general dynamic flow General form of conservation equations shown in Lecture 1 Navier-Stokes equations show that changes in momentum in infinitesimal volumes of a fluid are simply the sum of dissipative viscous forces (similar to friction), changes in pressure, gravity, and other forces acting on the fluid. This leads to a set of ordinary differential equations (ODE's) with respect to time The ODE's can then be solved via time integration. The general SPH formalism for dynamical flow also includes: Artificial viscosity Artificial heat External forces
Finite control volume and infinitesimal fluid cell (1/2) The Lagrangian description used in SPH employs the total time derivative and the control volume moves with the fluid. The movement of fluids inside the control volume, V, leads to a change in an control surface, S, which in turn causes a change in the control volume. In the figure, the volume change, ΔV, due to the movement of an infinitesimal control surface ds over time Δt is where n is the unit vector perpendicular to the surface, ds, and v is the velocity.
Finite control volume and infinitesimal fluid cell (2/2) The total change of the Lagrangian control volume is: dividing by Δt and applying the divergence theorem gives If the control volume, ΔV, is shrunk to an infinitesimal, δv, we can assume a constant velocity Replacing Δ by the total time derivative D we have The velocity divergence is the time rate of volume change per unit volume.
Mass conservation or the continuity equation The continuity equation is based on conservation of mass, the mass m contained in the control volume is Where ρ is the density. As mass is conserved the time derivative is constant Which can be rewritten as Using the velocity divergence term gives the continuity equation that we first saw in Lecture 1.
Momentum conservation The momentum equation is based on conservation of momentum, which in continuum mechanics is replaced by Newton's second law: The net force on a Lagrangian fluid cell is equal to its mass times the acceleration of the fluid cell. The net force consists of body forces - gravitational, magnetic etc. surfaces forces - pressure and stresses The surface force includes pressure, from external fluid cells sheer stress and normal stress which results in shear deformation and volume change respectively Note, that strain is the geometrical expression of deformation caused by the action of stress on a physical body and is therefore proportional to the applied stress. See ref. [1] and [3] or Appendix A on next slide.
Appendix A
Energy Conservation The energy equation is based on the conservation of energy, which is a representation of the first law of thermodynamics. The equation states that the time rate of change of energy inside an infinitesimal fluid cell should equal to the sum of net heat flux into the fluid cell the time rate of work done (W=Fd [Nm]) by the body and surface forces acting on the cell Again we shall just quote the results below (see ref [1] and [3] or Appendix B for further details)
Appendix B
Navier-Stokes equations The Navier-Stokes are an explicit statement of the conservation of mass, momentum and energy. They generalize the conservation equations in the Lagrangian frame. The continuity equation The momentum equation add +F α for external forces Note: To include the coordinate indices properly we do double summation over the ε terms The energy equation σ is the total stress tensor. It is made up of the isotropic pressure p and the viscous stress τ. The viscous stress should be proportional to the strain rate ε through the dynamic viscosity µ: where
Particle approximation for Navier-Stokes equations We now apply the particle approximation to each of the Navier-Stokes equations. We have already learnt how to do this is Lecture 2 so only the main results will be presented. There are two approaches for density: Summation Density Continuity Density Additionally, different forms of the equations are possible with slightly different properties, e.g. symmetric, particle differencing, normalization, etc.
Summation density This directly applies the SPH approximation to the density itself. For a given particle i we have alternatively where N is the number of support domain particles and m j is the mass of j. W ij is the smoothing function of particle i evaluated at j where W ij has units of inverse volume. is the relative distance of i and j, and r ij is the scalar distance.
Continuity density Here the density is obtained from the continuity equation, possible forms are alternatively Similarly particle approximations for the equations can be obtained, the most popular forms are summarized on the next slide.
Summary of Lagrange form Navier-Stokes equations Claude-Louis Navier (10 February 1785 21 August 1836 ) was a French engineer and physicist who specialized in mechanics. Sir George Gabriel Stokes, (13 August 1819 1 February 1903), was a mathematician and physicist, who at Cambridge made important contributions to fluid dynamics (including the Navier Stokes equations), optics, and mathematical physics. He was secretary, then president, of the Royal Society.
Artificial Viscosity Special treatment is needed to model shock waves, to avoid the simulation developing unphysical oscillations. Applying the conservation equations across a shock wave front requires a transformation of kinetic energy to heat energy. This can be represented by a form of viscous dissipation which led to the development of the Neumann-Richtmyer viscosity is given by: where this quadratic expression of velocity divergence, Π 1, needs only to be present during material compression, a 1 is an adjustable constant. Δx = h i.e. the smoothing length. More sophisticated models of viscosity exist, including effects such as artificial shear viscosity, etc. see ref. [3] and ref. [5] for further details.
Artificial Heat Excessive heating can also occur, for example, when a stream of gas is brought to rest against a wall. Monaghan ref. [5] solved this by adding an artificial heat term, H i, which can be added to the energy equation.
Finally how are they used in SPH? Both of these and other effects can be modeled in SPH by including them in the appropriate Navier-Stokes equations. A popular form is: Artificial viscosity External forces +F i α Heat term Viscous stress, where ε is the strain rate and µ is the dynamic viscosity