Improving gradient evaluation in Smoothed Particle Hydrodynamics Domingo García Senz José A. Escartín Antonio Relaño Ruén M. Caezón Alino Perego Matthias Lieendörfer
Gradients in SPH < f r > = f r W r r dr f a (r) = n v =1 m ρ f r W(r a, h) n v m a f a (r) = a f ρ r =1 W a + m ρ f r a W a = n v =1 m ρ f r a W(r a, h) Standard SPH Analytical evaluation of derivatives (the kernel is always a known function) Low computational effort.
Gradients in SPH I r f r f r r r W a dr f r f r = f r r + Higher Orders f x 1 f x 2 f x 3 = τ 11 τ 12 τ 13 τ 21 τ 22 τ 23 τ 31 τ 32 τ 33 1 I 1 I2 I 3 τ ij = x i x i x j x j W a dr Integral Approach to the Derivatives (IAD)
Gradients in SPH IAD SPH Analytical evaluation of derivatives. The derivative of linear functions is exactly otained. f x 1 f x 2 f x 3 = τ 11 τ 12 τ 13 τ 21 τ 22 τ 23 τ 31 τ 32 τ 33 1 I 1 I2 I 3 τ ij = x i x i x j x j W a dr I r f r f r r r W a dr Ex: 1D SPH df dx a = m (f ρ f a )(x x a )W a m (x ρ x a ) 2 W a Taking f a = px a + q; f = px + q We otain df dx a = p
Gradients in SPH IAD SPH Analytical evaluation of derivatives. The derivative of linear functions is exactly otained. Standard SPH derivative is a particular case of IAD SPH. f x 1 f x 2 f x 3 = τ 11 τ 12 τ 13 τ 21 τ 22 τ 23 τ 31 τ 32 τ 33 1 I 1 I2 I 3 τ ij = x i x i x j x j W a dr I r f r f r r r W a dr If we use the Gaussian Kernel W G u, h = 1 e u2 πn 2 We otain τ ii = h 2 2, then: f r = f r f r W a dr = f r W a dr Which in SPH parlance ecomes, a f a (r) = n v =1 m ρ f r a W(r a, h)
Gradients in SPH Starting from the Lagrangian of an inviscid fluid we can derive the equation of momentum. For Standard SPH: For IAD SPH: P a x i,a = m Ω a ρ 2 i,a W a (h a ) + a P Ω ρ 2 i,a W a (h ) With: P a x i,a = m Ω a ρ 2 a A i,a h a + P Ω ρ 2 A i,a h 2 P a A ρ a ρ i,a h a d AI r i,a h a = f r c f ij,a hr a xr j, rx W a j,a Wdr a (h a ) j=1 d m ρ j=1 A i,a h = f(rc ij, h x j, x j,a W a (h ) )(r r a )W a (h a ) IAD 0
Gradients in SPH Starting from the Lagrangian of an inviscid fluid we can derive the equation of momentum. For Standard SPH: For IAD SPH: P a x i,a = m Ω a ρ 2 i,a W a (h a ) + a P Ω ρ 2 i,a W a (h ) P a x i,a = m Ω a ρ 2 a For IAD 0 SPH: A i,a h a + P Ω ρ 2 A i,a h 2 P a A ρ a ρ i,a h a With: P a x i,a = m Ω a ρ 2 a d A i,a h a + P Ω ρ 2 A i,a h A i,a h a = c ij,a h a x j, x j,a j=1 d A i,a h = c ij, h x j, x j,a j=1 W a (h a ) W a (h )
Computational overhead of IAD
Hydrodynamical instailities Kelvin-Helmholtz instaility 2D squared lattice. Periodic oundary conditions. 62,500 particles. Perfect gas EoS with γ = 5 3. Cuic spline / Harmonic kernels. Jump in density of factor 2, smoothed with a Ramp function. Perturation seeded as a sinusoidal function: v y = v y sin(2πx) With v y = 0.1, 0.01 cm/s V 2 = -0.5 cm/s V 1 = 0.5 cm/s V 2 = -0.5 cm/s
Hydrodynamical instailities IAD 0 v y = 0.1 cm/s STD v y = 0.1 cm/s IAD 0 v y = 0.01 cm/s STD v y = 0.01 cm/s
Hydrodynamical instailities
Hydrodynamical instailities Rayleigh-Taylor instaility 2D squared lattice. Periodic oundary conditions. 62,500 particles. Perfect gas EoS with γ = 5 3. Cuic spline / Harmonic kernels. Jump in density of factor 2, smoothed with a Ramp function. Gravity: g = 0.5 cm/s 2 Perturation seeded as a sinusoidal function with v y = 0.01 cm/s g = -0.5 cm/s 2
Hydrodynamical instailities Terminal velocity for a rising ule: Layzer, ApJ, 122 (1955) v = 0.51 A t gl = 0.104 cm/s Growth rate not so good, ut due to smooth initial conditions. Terminal velocity also for spikes, when drag takes over after exp. phase.
Supersonic tests Wall heating shock test Sedov explosion test
Neutron star merger
Janka et al. astroph/0612072 Core-collapse Supernovae Fe core grows y Si urning eyond Ch. limit (s,y e ). Y e decreases y e-capture Accelerates collapse. neutron enrichment. -decay+partial photodesintegration. ρ~10 12 g/cm 3 trapping (t diff > t coll ) Homologous collapse. ρ~10 14 g/cm 3 nuclear matter (low compress.) Sonic wave Shock. Bounce. Dissociation free nucleons e-capture Shock overpass -sphere urst. Energy loss + accetion Shock stalls ( 100 km) No prompt explosion PNS grows. (BH if M * >25M ) Pair production + (e,, ) difussion Cooling. and ν captures. Gain region Heating. Slow down of the accreted material. Shock revival 1D. Multi-D. Violent convection in gain region.
Core-collapse Supernovae Ingredients for a CCSN numerical simulation Conservation laws Baryon & Lepton numers Energy Momentum Magnetic flux Radiative transfer for Equation of state Lattimer & Swesty (Liquid Drop) Shen et al. (Rel. Mean Field) Hempel et al. (NSE + RMF) Hempel, Schaffner-Bielich. NPA, 837 (2010) Coherent scattering of neutrinos on nuclei ν + A, Z ν + (A, Z) Neutrino-electron scattering ν + e ν + e Electron / neutrino capture on nuclei ν e + A, Z e + (A, Z + 1) Coherent scattering of neutrinos on nuclei ν e + n e + p νe + p e + + n Neutrino-nucleon scattering ν + N ν + N Pair creation / annihilation e + e + ν + ν Nucleon-Nucleon remsstrahlung e Pair annihilation pair creation Rotation Magnetic Fields General Relativity
Core-collapse Supernovae SPH is a fully lagrangian hydrocode. The system is discretized in particles that evolve with the fluid, following the HD equations. Physical properties, in every particle position, are retrieved through interpolation over close neighors. 3D SPH MPI+OpenMP code (SPHYNX): 500,000 particles. Burns-Hut octal tree for self-gravity. Adaptive smoothing-length. < f r > = f r W r r dr f a (r) = m ρ f r W(r a, h) Integral Approach to Derivatives (IAD). García-Senz, Caezón, Escartín. A&A 583 (2012) Lattimer-Swesty EOS. 15 M Heger et al. model. Heger, Woosley, Spruit. ApJ 626 (2005) Initial model y Sool distriution and stretching. Spectral neutrino transport: - IDSA. Lieendörfer, Whitehouse, Fischer. ApJ 698 (2009) - ASL. Perego, Caezón, Lieendörfer (2013) 20 energy ins. (3-300 MeV) 3 neutrino flavors. 1D optical-depth. 1G / time-step n v =1
Core-collapse Supernovae
Core-collapse Supernovae
Core-collapse Supernovae
Core-collapse Supernovae
Core-collapse Supernovae
Conclusions The Integral Approach to Derivatives (IAD) is a more general method for evaluating gradients in SPH. Captures hydrodynamical instailities that are suppressed with the standard SPH scheme. It can e used in complex numerical simulations improving the overall mixing and energy conservation. It adds a 20% computational urden in serial calculation, ut it has good parallelization properties, reducing the overhead in complex calculations elow a 10%.
Thank you!