Fluid Dynamics. Part 2. Massimo Ricotti. University of Maryland. Fluid Dynamics p.1/17

Similar documents
Fluid Dynamics. Massimo Ricotti. University of Maryland. Fluid Dynamics p.1/14

Smoothed Particle Hydrodynamics (SPH) 4. May 2012

Smoothed Particle Hydrodynamics (SPH) Huamin Wang

Numerical Simulations. Duncan Christie

Godunov methods in GANDALF

Physics-Based Animation

Computational Astrophysics

Fluid Animation. Christopher Batty November 17, 2011

PDE Solvers for Fluid Flow

Burgers equation - a first look at fluid mechanics and non-linear partial differential equations

Treecodes for Cosmology Thomas Quinn University of Washington N-Body Shop

Chapter 2: Fluid Dynamics Review

Math background. Physics. Simulation. Related phenomena. Frontiers in graphics. Rigid fluids

2. FLUID-FLOW EQUATIONS SPRING 2019

Smooth Particle Hydrodynamic (SPH) Presented by: Omid Ghasemi Fare Nina Zabihi XU Zhao Miao Zhang Sheng Zhi EGEE 520

2.2. Methods for Obtaining FD Expressions. There are several methods, and we will look at a few:

Game Physics. Game and Media Technology Master Program - Utrecht University. Dr. Nicolas Pronost

The Center for Astrophysical Thermonuclear Flashes. FLASH Hydrodynamics

Advection / Hyperbolic PDEs. PHY 604: Computational Methods in Physics and Astrophysics II

A Study on Numerical Solution to the Incompressible Navier-Stokes Equation

An Overview of Fluid Animation. Christopher Batty March 11, 2014

Introduction to Finite Volume projection methods. On Interfaces with non-zero mass flux

CSCI1950V Project 4 : Smoothed Particle Hydrodynamics

Quick Recapitulation of Fluid Mechanics

Soft Bodies. Good approximation for hard ones. approximation breaks when objects break, or deform. Generalization: soft (deformable) bodies

Computational Astrophysics

Advection, Conservation, Conserved Physical Quantities, Wave Equations

Block-Structured Adaptive Mesh Refinement

3.4. Monotonicity of Advection Schemes

NUMERICAL METHODS IN ASTROPHYSICS An Introduction

The one-dimensional equations for the fluid dynamics of a gas can be written in conservation form as follows:

Smoothed Particle Hydrodynamics

Overview of the Numerics of the ECMWF. Atmospheric Forecast Model

Pressure corrected SPH for fluid animation

Consistency analysis of a 1D Finite Volume scheme for barotropic Euler models

Lecture Administration. 7.2 Continuity equation. 7.3 Boussinesq approximation

Numerical Solutions for Hyperbolic Systems of Conservation Laws: from Godunov Method to Adaptive Mesh Refinement

Toy stars in one dimension

arxiv:astro-ph/ v2 22 Nov 1996

The Evolution of SPH. J. J. Monaghan Monash University Australia

7 Hyperbolic Differential Equations

Summary of the Equations of Fluid Dynamics

SW103: Lecture 2. Magnetohydrodynamics and MHD models

Chapter 1. Introduction

Numerical Hydrodynamics: A Primer. Wilhelm Kley Institut für Astronomie & Astrophysik & Kepler Center for Astro and Particle Physics Tübingen

Finite Volume Schemes: an introduction

Lecture 5: Kinetic theory of fluids

Geostrophic and Quasi-Geostrophic Balances

Math 660-Lecture 23: Gudonov s method and some theories for FVM schemes

A New Fourth-Order Non-Oscillatory Central Scheme For Hyperbolic Conservation Laws

PROBLEM SET. Heliophysics Summer School. July, 2013

Finite Volume Method

1 Introduction to Governing Equations 2 1a Methodology... 2

Basic Aspects of Discretization

Weighted ENO Schemes

CHAPTER 4. Basics of Fluid Dynamics

The Navier-Stokes Equations

Daniel J. Jacob, Models of Atmospheric Transport and Chemistry, 2007.

Accretion Disks I. High Energy Astrophysics: Accretion Disks I 1/60

Ideal Magnetohydrodynamics (MHD)

Divergence-free interpolation of vector fields from point values exact B = 0 in numerical simulations

Advection in two dimensions

( ) Notes. Fluid mechanics. Inviscid Euler model. Lagrangian viewpoint. " = " x,t,#, #

arxiv: v3 [astro-ph] 2 Jun 2008

Semi-Lagrangian Formulations for Linear Advection Equations and Applications to Kinetic Equations

Introduction to Partial Differential Equations

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

Chapter 3. Finite Difference Methods for Hyperbolic Equations Introduction Linear convection 1-D wave equation

Conservation of Mass (Eulerian Framework)

The RAMSES code and related techniques 2- MHD solvers

The Distribution Function

Chapter 3. Forces, Momentum & Stress. 3.1 Newtonian mechanics: a very brief résumé

Notes. Multi-Dimensional Plasticity. Yielding. Multi-Dimensional Yield criteria. (so rest state includes plastic strain): #=#(!

Construction of very high order Residual Distribution Schemes for steady problems

X i t react. ~min i max i. R ij smallest. X j. Physical processes by characteristic timescale. largest. t diff ~ L2 D. t sound. ~ L a. t flow.

ESCI 485 Air/Sea Interaction Lesson 1 Stresses and Fluxes Dr. DeCaria

Radiative & Magnetohydrodynamic Shocks

Formulation and performance of the Variable-Cubic Atmospheric Model

A Hamiltonian Numerical Scheme for Large Scale Geophysical Fluid Systems

Applying Asymptotic Approximations to the Full Two-Fluid Plasma System to Study Reduced Fluid Models

Diffusion / Parabolic Equations. PHY 688: Numerical Methods for (Astro)Physics

MECH 5810 Module 3: Conservation of Linear Momentum

Smooth Particle Applied Mechanics: The Method, with Three Example Problems

State of the Art MHD Methods for Astrophysical Applications p.1/32

Review of fluid dynamics

N-body Simulations and Dark energy

Physics Dec Time Independent Solutions of the Diffusion Equation

Smoothed Particle Hydrodynamics

Chp 4: Non-linear Conservation Laws; the Scalar Case. By Prof. Dinshaw S. Balsara

13. ASTROPHYSICAL GAS DYNAMICS AND MHD Hydrodynamics

2.20 Marine Hydrodynamics Lecture 3

Getting started: CFD notation

Improving gradient evaluation in Smoothed Particle Hydrodynamics

Gas Dynamics: Basic Equations, Waves and Shocks

EKC314: TRANSPORT PHENOMENA Core Course for B.Eng.(Chemical Engineering) Semester II (2008/2009)

Tests of Spurious Transport in Smoothed Particle Hydrodynamics

PHYS 643 Week 4: Compressible fluids Sound waves and shocks

Modeling of Water Flows around a Circular Cylinder with the SPH Method

Lecture 3: 1. Lecture 3.

Plasmas as fluids. S.M.Lea. January 2007

Transcription:

Fluid Dynamics p.1/17 Fluid Dynamics Part 2 Massimo Ricotti ricotti@astro.umd.edu University of Maryland

Fluid Dynamics p.2/17 Schemes Based on Flux-conservative Form By their very nature, the fluid equations (1) (3) can be written in flux-conservative form. In 1-D, with no external forces, u t + F(u) = 0, x where u = ρ ρv e F(u) = ρv ρv 2 + p (e + p)v (E.F.T.S.). Recall e ρ(ε + 1 2 v2 ) = energy density.

Fluid Dynamics p.3/17 When written in this form, it is clear that the techniques described before can be applied immediately (given an equation of state for p). E.g., two-step Lax-Wendroff: u n+1 j = u n j t x ( ) F n+1/2 j+1/2 F n+1/2 j 1/2, where etc. F n+1/2 j±1/2 = F(un+1/2 j±1/2 ), Note that all components of u must be at same location on mesh = staggered mesh not needed (compare with operator split method, below). Scheme is stable provided ( v + c) t/ x < 1, where c 2 = γp/ρ (c = sound speed).

Fluid Dynamics p.4/17 Operator Split Schemes Simplest schemes, developed long ago by von Neumann, Richtmeyer, etc. The fluid equations (1) (3) can be written as sum of two steps. In 1-D: A ρ/ t + v ρ/ x = 0 (ρv)/ t + v (ρv)/ x = 0 e/ t + v e/ x = 0 B ρ/ t = 0 ρ v/ t = p/ x e/ t = p v/ x

Fluid Dynamics p.5/17 Equations in A are all the form of scalar advection equations. Adopt high-order upwind schemes to solve A = advection step (transport). Equations in B are all source terms in the equations that can be differenced directly = source step. Best to adopt staggered mesh with v at cell edges, p, ρ, e at cell centers. p i p i+1 v i 1/2 v i v i +1/2 +3/2 (In multi-d, v defined at cell faces naturally describes flux of fluid into/out of cell.)

Fluid Dynamics p.6/17 Leads to 2 nd -order accurate FDEs for the source terms. I.e., v n+1 i 1/2 = vi 1/2 n t(p i p i 1 ) 1 2 (ρ i + ρ i 1 ) x, e n+1 i = e n i t(v i+1/2 v i 1/2 )p i. x Operator split schemes are simple, easy to code, and easy to extend with more complex physics, e.g., MHD, radiation, etc. But, they don t treat regions with sharp p gradients as well as more modern schemes (e.g., Godunov).

Smoothed Particle Hydrodynamics So far we have only considered methods that require dividing space into a grid. Can we represent the local fluid density without a grid? Advantage: not confined to a specific geometry, more adaptable. Strategy (cf. Monaghan 1992, ARAA 30, 543): Represent fluid by large number ( 10 4 6 ) of particles. Each particle has a mass, Lagrangian position and velocity, internal energy, and possibly an initial density. Other quantities derived by smoothing over an interpolating kernel W (units: 1/volume). In this way the statistical properties of the real fluid elements are treated in an average sense. Solve fluid equations in comoving frame with these smoothed Fluid Dynamics p.7/17 quantities using any familiar method (leapfrog, RK, etc.)

Fluid Dynamics p.8/17 The interpolating kernel If f is some quantity (e.g., density), then its kernel estimate (per unit volume) f is given by f(r) = f(r )W(r r ; h) dr, where the integral is over all space, W(r r ; h) dr = 1, and lim W(r h 0 r ; h) = δ(r r ). (h is called the smoothing length and is typically chosen so that N 15 particles lie within h of any particle. The error for using this approximation goes as O(h 2 ).)

Fluid Dynamics p.9/17 For numerical work, split the fluid into small volume elements τ of mass ρ τ, where ρ is a representative density for the small fluid element. The integral can then be approximated by f(r) = j m j f(r j ) ρ(r j ) W(r r j; h). (Note m j /ρ j takes the place of dr.) The interpolating kernel can be any analytically differentiable function that satisfies the normalization and limiting properties above. E.g., 3-D Gaussian kernel: W(r; h) = 1 2 /h 2. (πh 2 ) 3/2e r

Fluid Dynamics p.10/17 3-D spline kernel: W(r; h) = 1 πh 3 1 3 2 s2 + 3 4 s3, 0 s < 1 1 4 (2 s)3, 1 s < 2 0, s 2, where s r/h. In practice, choose W so that it falls off rapidly for r r j h, hence only need to sum over nearest neighbours.

Fluid Dynamics p.11/17 Note the kernel estimate of the gradient of f(r) is just f(r) = j m j f(r j ) ρ(r j ) W(r r j; h) (since the operator is taken with respect to the space coordinates r and W is the only quantity that depends on r). However, it is often better to use the identity ρ f = (ρf) f ρ to give a ρ i f i = m j (f j f i ) i W ij, j where i W ij is the gradient of W(r i r j ; h) w.r.t. the coordinates of particle i. a Because i (ρ i f i ) = j m jf j i W ij and f i i ρ i = j m jf i i W ij.

Fluid Dynamics p.12/17 The equations of fluid dynamics, SPH version Recall the continuity equation Dρ Dt = ρ v, where the derivative is taken in the fluid frame. The SPH equivalent would be Dρ i Dt = j m j v ij i W ij, where v ij v i v j (we used that vector identity again, replacing the gradient with the divergence).

Fluid Dynamics p.13/17 But we could estimate the density everywhere directly by ρ(r) = j m j W(r r j ; h). This means we don t really need to solve the continuity equation (except in practice it turns out it is better to solve the equation for technical reasons; see Monaghan 1992). The momentum equation without external forces Dv Dt = 1 ρ p becomes Dv i Dt = j m j ( p j ρ 2 j + p i ρ 2 i ) i W ij,

Fluid Dynamics p.14/17 where the pressure gradient has been symmetrized by ( ) p p ρ = ρ + p ρ 2 ρ in order to ensure conservation of linear and angular momentum (the momentum equation becomes a central force law between particles i and j, assuming W is Gaussian).

Fluid Dynamics p.15/17 Finally, the energy equation Dε Dt = p ρ ( v) becomes Dε dt = 1 2 ( m j j p j ρ 2 j + p i ρ 2 i ) v ij i W ij, where the factor of 1/2 comes from symmetrization (it is a characteristic of SPH that gradient terms can be written in many different ways, just as there are a variety of FDE representations).

Fluid Dynamics p.16/17 Particles are moved using Dr i Dt = v i, or, to ensure particles move with a velocity similar to the average velocity in their neighbourhood, Dr i Dt = v i + ɛ j m j ( vji ρ ij ) W ij, where ρ ij (ρ i +ρ j )/2 and 0 ɛ 1 is a constant (the X factor). As usual, also need an equation of state. Can add other forces, i.e., viscosity, magnetic fields, etc. Can implement adaptive smoothing lengths.

Fluid Dynamics p.17/17 Summary SPH is based on microscopic picture of real fluid. But real fluid has many more particles than can be followed on a computer, so smoothing is used. Advantage of scheme is that it is adaptive particles go where density is high. Good for following dynamics where gravity dominates because of its N-body-like foundation. Disadvantage of scheme is that it does not resolve low-density regions well, it does not handle regions with strong p gradients well (shocks), and it is expensive (need a way to find nearest neighbours = tree code!). Finite differencing methods are attractive because mathematical properties of FDEs well studied, and can prove/analyze stability, convergence rate, etc. of various schemes.