of 167 /167
Numerical Magnetohydrodynamics Oslo07-1 Numerical Magnetohydrodynamics Rony Keppens Centre for Plasma-Astrophysics, K.U.Leuven (Belgium) & FOM-Institute for Plasma Physics ‘Rijnhuizen’ & Astronomical Institute, Utrecht University Oslo 2007, 19-29 June 2007 With material based on PRINCIPLES OF MAGNETOHYDRODYNAMICS by J.P. Goedbloed & S. Poedts (Cambridge University Press, 2004) and on ADVANCED MAGNETOHYDRODYNAMICS by J.P. Goedbloed R.Keppens & S. Poedts (CUP, in preparation)

folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

  • Upload
    others

  • View
    16

  • Download
    0

Embed Size (px)

Text of folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics...

Page 1: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-1

Numerical Magnetohydrodynamics

Rony KeppensCentre for Plasma-Astrophysics, K.U.Leuven (Belgium)

& FOM-Institute for Plasma Physics ‘Rijnhuizen’

& Astronomical Institute, Utrecht University

Oslo 2007, 19-29 June 2007

With material based on PRINCIPLES OF MAGNETOHYDRODYNAMICS

by J.P. Goedbloed & S. Poedts (Cambridge University Press, 2004)

and on ADVANCED MAGNETOHYDRODYNAMICS

by J.P. Goedbloed R.Keppens & S. Poedts (CUP, in preparation)

Page 2: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-2

Numerical Magnetohydrodynamics

Overview for day 1

• Numerical MHD in brief: governing MHD equations; example numerical applica-tions; focus of this course.

• Ideal MHD and conservation laws: general theory for nonlinear conservation laws;illustration for 1.5D isothermal MHD.

• Nonlinear scalar conservation law: Riemann problem; shocks, rarefactions andcompound waves; basic conservative numerical discretizations.

• TVDLF scheme for nonlinear systems: TVD concept; TVDLF discretization; linearreconstructions; 1.5D isothermal MHD simulations.

Page 3: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-3

Magnetohydrodynamic model:

• macroscopic dynamics of perfectly conducting plasma

⇒ ideal MagnetoHydroDynamic – MHD – description

⇒ continuum, single fluid description of plasma in terms of ρ, v, p, B

⇒ conservation of mass, momentum, energy, and magnetic flux

• magnetic field B introduces Lorentz force J × B

⇒ perpendicular to field lines and current J

⇒ attractive/repulsive forces between parallel current-carrying wires

• no magnetic sources or ‘monopoles’ hence ∇ · B = 0

⇒ contrast to electric charges (sources of electric field)

⇒ magnetic field lines (tangent to B) have no beginning or end

⇒ always form closed loops

Page 4: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-4

Governing equations:

• 8 non-linear PDE for density ρ, velocity v, temperature T , B

∂ρ

∂t+ ∇ · (vρ) = 0

ρ

(∂v

∂t+ v · ∇v

)

+ ∇p− (∇× B) × B = ρg

ρ

(∂T

∂t+ v · ∇T

)

+ (γ − 1)p∇ · v = Sq

∂B

∂t−∇× (v × B) = SB

• pressure p = ρT (ideal gas only), external gravity g

⇒ Euler for gas dynamics + pre-Maxwell equations

• Add ∇ · B = 0 ⇒ no magnetic monopoles

• Ideal MHD : no heat source/sink Sq, no source term SB

Page 5: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-5

• conservation of mass: local density value can alter in 2 ways

∂ρ

∂t= − ρ∇ · v

︸ ︷︷ ︸local compressions

− v · ∇ρ︸ ︷︷ ︸

advected density gradients

⇒ total mass is conserved (no sinks/sources)

• momentum equation (Newton’s law)

ρ

(∂v

∂t+ v · ∇v

)

+ ∇p− (∇× B)︸ ︷︷ ︸

J

×B = ρg

⇒ inertial effects, pressure gradients, Lorentz force, exte rnal gravity

⇒ current found from B directly: Ampere’s law

J = ∇× B

⇒ neglects displacement current term in Maxwell equations

⇒ non-relativistic plasma flows v ≪ light speed cl

Page 6: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-6

The induction equation:

• evolutionary equation for B in ideal MHD: Faraday’s law

∂B

∂t−∇× (v × B)

︸ ︷︷ ︸−E

= 0

⇒ field lines are frozen in plasma

⇒ unimpeded flow along B, flow ⊥ B displaces field line

⇒ analytically: if ∇ · B = 0 initially, then always

• electric field in co-moving frame for perfectly conducting fluid

E′ = E + v × B = 0

Page 7: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-7

Ideal MHD and flux conservation:

• magnetic flux through surface intersecting B lines Ψ ≡∫ ∫

S

B · ndS

S1

S2

⇒ identical for any surface S along ‘flux tube’

⇒ easily found from Gauss theorem:∫ ∫ ∫

V

∇ · B dV =

∫ ∫

σ

B · ndσ = −∫ ∫

S1

B1 · n1dS1 +

∫ ∫

S2

B2 · n2dS2 = 0

• conservation of magnetic flux: basic law of ideal MHD

⇒ flux through surface element moving with fluid will remain con stant:

Ψ =

∫ ∫

C

B · ndσ = constant

⇒ for closed contour C moving with plasma

Page 8: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-8

Ideal MHD and conservation laws:

• equivalently: conservation laws for density ρ, momentum density m = ρv, H and B

∂ρ

∂t+ ∇ · (vρ) = Sρ

∂m

∂t+ ∇ · (vρv − BB) + ∇ptot = Sρv

∂H∂t

+ ∇ · (vH + vptot − BB · v) = Se

∂B

∂t+ ∇ · (vB − Bv) = SB

• ptot ≡ thermal pressure + magnetic pressure

• total energy density H has 3 contributions

H =p

γ − 1︸ ︷︷ ︸internal

+ρv2

2︸︷︷︸kinetic

+1

2B2

︸︷︷︸magnetic

• Sources (Sinks) of conserved quantities in right hand side

Page 9: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-9

Scale invariance:

• units of length, mass, time (plus µ0 = 1)

⇒ trivially scale out of equations

⇒ take lengthscale l0, field strength B0, density ρ0

⇒ speed v0 = B0/√ρ0 timescale from t0 = l0/v0

• pure MHD signal at Alfv en speed B0/√ρ0

⇒ field line wiggles: magnetic tension as restoring force

x

z

k

y

B0

v1+B0 B1

• MHD can be applied to laboratory, solar, galactic dimensions alike!

⇒ macroscopic dynamics of plasmas in dimensionless form

Page 10: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-10

Example applications:

• consider STATIC MHD equilibria v = 0, leaves only−∇p + (∇× B) × B + ρg = 0

and ∇ · B = 0

⇒ governing equations for stratified, magnetostatic equilibria

• Tesla strong B intokamaks

• neglect g, axisym-metry

⇒ 2D in cross-section

• Prominences in solarcorona

• translational symme-try

⇒ 2D in cross-section

Page 11: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-11

Computing prominence equilibria:

• 2D Problem in cross-section governed by second order elliptic PDE

⇒ in terms of flux function ψ(y, z), field lines on isosurfaces

⇒ along poloidal flux contour: pressure gradient balances gravity

• use 2D Finite Element discretization, Picard iterate to solution

⇒ use local expansion functions , of given polynomial form (here bicubic)

⇒ isothermal, double prominence (left); non-isothermal three-part structure (right)

(from Petrie et al, ApJ, 2007)

Page 12: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-12

Geodynamo simulations:

• Earth’s magnetic field is currently mostly dipolar:

– evidence from magnetized rocks that orientation reverses every few 100000years, taking a few 1000 years for full reversal.

• Earth consist of inner core, outer core, mantle, crust:

– liquid iron outer core (1300 < R < 3400 km) must maintain field

– rotation and convection in moving conducting fluid described by Ohm’s law

E + v × B = η j .

– Inhomogeneity of magnetic field decays in time τD determined by resistivity ηand length scale l0 ∼ ∇−1 of inhomogeneity:

τD = µ0l20/η = l20/η .

– resistive diffusion time scale τD ∼ 5 × 1011 s = 16 000 years

– need sustained B generation by molten iron motion

– convection driven by heat from radioactive decay in inner solid core

Page 13: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-13

• Full 3D MHD simulations by Glatzmaier & Roberts (1995):

– simulated several 100000 years of geodynamo activity

– inner core mediates reversals: its B changes on diffusion time

– captured reversal event, changed dipole orientation in 1000 years:

http://www.es.ucsc.edu/ glatz/(website Gary Glatzmaier)

• spectral method : all variables written in expansion exploiting global functions ,in particular here: Chebyshev polynomials (radial variation) and spherical harmonics(both angular variations)

Page 14: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-14

Eruptive event studies:

• simulating 3D kink-unstable loop evolution

⇒ Torok & Kliem, ApJ 2005, 630, L97

• Further ejection and CME initiation

• Finite difference/volume – Lax-Wendroff method : update local function valuesthrough fluxes computed from neighboring grid points. Here for zero-beta p = 0conditions, neglect g, stabilized by added viscosity terms and ‘artificial smoothing’

Page 15: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-15

Numerical discretizations and MHD:

• 3 examples given meant to demonstrate

⇒ diversity of MHD problems : static, dynamic, long term slow evolution versussudden events, different geometries, . . .

⇒ diversity of employed discretizations (FEM, spectral, finite difference, finitevolume) and numerical algorithms

• This course can NOT treat all of these in detail

⇒ I will focus on modern, shock-capturing schemes

⇒ pay attention to nonlinear ideal MHD in particular

⇒ give state-of-the-art examples, for Finite Volume approaches

⇒ end with outlook to advanced approaches (e.g. Adaptive Mesh refinement,Relativistic MHD, Radiative MHD treatments)

Page 16: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-16

Reference material:

• Throughout this course, I use material based on

⇒ Principles of Magnetohydrodynamics , Goedbloed & Poedts , CUP 2004

⇒ Advanced Magnetohydrodynamics , Goedbloed, Keppens & Poedts , inpreparation

• I also recommend (mostly HD):

⇒ P. Wesseling, Principles of Computational Fluid dynamics (Berlin, Springer-Verlag, 2001)

⇒ E. F. Toro, Riemann Solvers and Numerical Methods for Fluid dynamics. Apractical Introduction (2nd Edition) (Berlin, Springer-Verlag, 1999)

⇒ R. J. LeVeque, Numerical Methods for Conservation Laws (Berlin, Birkhauser Verlag, 1990)

⇒ R. J. LeVeque, Finite Volume Methods for Hyperbolic Problems (CUP, 2002)

⇒ R. J. LeVeque, D. Mihalas, E. A. Dorfi and E. Muller, Computational Methodsfor Astrophysical Fluid Flow (Berlin, Springer Verlag, 1998)

Page 17: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-17

Conservative versus Primitive formulations:

• system of conservation laws expressed in conservation form:

∂U

∂t+ ∇ · F(U) = 0

⇒ conservative variables U, fluxes F(U)

• ideal MHD, conservative variables U = (ρ,m,H,B)T

⇒ specific functions of density ρ, velocity v, pressure p, and B

• latter are ‘primitive variables’

⇒ can be any set involving v, B and 2 thermodynamic quantities (internal energye, temperature T , specific entropy s, S ≡ pρ−γ = f(s), ln(ρ), . . . )

Page 18: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-18

Allowing for discontinuities

• Suppose interest in shock-dominated scenarios

⇒ allow discontinuous transitions, i.e. moving shock fronts

⇒ Moving shock front separates two ideal regions

δ

p

x

2 1

shocked unshocked

• Neglecting thickness δ of shock (not the shock itself), derive jump relations acrossthe infinitesimal layer

⇒ Limiting cases of the conservation laws at shock fronts

⇒ need non-ideal treatment of internal shock structure, when really desired

Page 19: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-19

Procedure to derive the jump conditions

Integrate conservation equations across shock from ©1 (undisturbed) to ©2 (shocked)

• Only contribution from gradient normal to the front:

limδ→0

∫ 2

1

∇f dl = − limδ→0

n

∫ 2

1

∂f

∂ldl = n(f1 − f2) ≡ n [[f ]]

• In frame moving with the shock at normal speed u :

(Df

Dt

)

shock=∂f

∂t− u

∂f

∂lfinite ≪ ∂f

∂t≈ u

∂f

∂l∼ ∞

⇒ limδ→0

∫ 2

1

∂f

∂tdl = u lim

δ→0

∫ 2

1

∂f

∂ldl = −u [[f ]]

n

u1

2

v1v2

• Hence, jump conditions follow from conservation laws by substituting

∇f → n [[f ]] , ∂f/∂t→ −u [[f ]]

Page 20: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-20

MHD jump conditions

• Conservation of mass,∂ρ

∂t+ ∇ · (ρv) = 0 ⇒ −u [[ρ]] + n · [[ρv]] = 0

• Conservation of momentum,∂

∂t(ρv) + ∇ · [ ρvv + (p + 1

2B2) I − BB ] = 0

⇒ −u [[ρv]] + n · [[ρvv + (p + 12B2) I − BB]] = 0

• Conservation of total energy,∂

∂t(12ρv

2 + ρe + 12B

2) + ∇ · [(12ρv

2 + ρe + p +B2)v − v · BB] = 0

⇒ −u [[12ρv2 + 1

γ−1 p + 12B

2]] + n · [[(12ρv

2 + γγ−1 p +B2)v − v · BB]] = 0

• Conservation of magnetic flux,

∂B

∂t+ ∇ · (vB − Bv) = 0 , ∇ · B = 0

⇒ −u [[B]] + n · [[vB − Bv]] = 0 , n · [[B]] = 0

Page 21: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-21

Quasi-linear forms

• restrict to 1D, set of conservation laws

∂U∂t + ∂F(U)

∂x = 0

⇒ n conservative variables U(x, t)

• many equivalent formulations in primitives V(x, t)

⇒ governing equations will have quasi-linear form

∂V∂t +W ∂V

∂x = 0

⇒ square n× n matrix W (V)

• change in variables from U to V

⇒ quantified by transformation matrix

dU = UVdV

⇒ when invertable dV = U−1V dU

Page 22: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-22

• start from ∂U∂t + ∂F(U)

∂x = 0

⇒ exploit flux Jacobian matrix FU

∂U

∂t+ FU

∂U

∂x= 0

⇒ primitive variables V with coefficient matrix W (V) obeys

FU = UVW (V)U−1V

⇒ similarity relation for matrices FU and W (V)

⇒ identical eigenvalues, related eigenvectors

• eigenvalues computed from

| FU − λpIn |= 0

or

| W − λpIn |= 0

.

⇒ dimensional analysis: λp indicate velocities: characteristic speeds

Page 23: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-23

• hyperbolic equations: n real eigenvalues λp for p = 1, . . . , n

⇒ corresponding sets of right ~rp and left eigenvectors ~lp from

FU~rp = λp~r

p

~lpFU = ~lpλp

• write the set ~rp as columns of matrix R

FUR = RΛ

⇒ diagonal matrix Λ = diag(λ1, . . . , λn)

⇒ eigenvalues always distinct: strictly hyperbolic

Page 24: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-24

• strictly hyperbolic case: linearly independent right eigenvectors in R

⇒ compute left eigenvectors ~lp by inverting matrix R

⇒ rows of R−1 contain left eigenvectors

⇒ then left and right eigenvectors orthonormal, i.e. ~lq · ~rp = δqp

• Denote R as matrix with right eigenvectors ~rp for W (V) in its columns, then

R = U−1V R

⇒ left eigenvectors~lp form rows of

R−1 = R−1UV

Page 25: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-25

Riemann Invariants

• may try to find set of variables R for which equations write

∂R∂t

+ Λ∂R∂x

= 0

⇒ Riemann invariants : constant on curves dx = λpdt in (x, t) plane

⇒ latter curves are the characteristics of the hyperbolic PDE

• for n = 2 unknowns, can always find both Riemann invariants

⇒ can solve initial value problem graphically

⇒ draw pair of characteristics (with slopes λp) from each point on x-axis

⇒ ‘propagate’ constant value of their respective RI

Page 26: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-26

• method of characteristics : U = (u1(x, t), u2(x, t))T at (x, t) determined by back-

tracing local values of RI along their corresponding characteristics to t = 0

λ1R1

dx= dt

(u , u ) 1 2(R , R )1 2

R

dx= dt

2

x

t

• R = (R1(u1, u2),R2(u1, u2))T provides mapping (u1, u2) ↔ (x, t) plane

• region in (x, t) space where 1 of 2 RI constant: simple wave region , there u2(u1)

• for n > 2 conserved quantities: full set of RIs may not exist

⇒ full set should obey proportionalities

∂R∂t

∝ R−1∂U

∂t= R−1∂V

∂t∂R∂x

∝ R−1∂U

∂x= R−1∂V

∂x

Page 27: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-27

• generalize simple wave concept to n > 2 variables U = (u1(x, t), . . . , un(x, t))T

⇒ region of (x, t) where one-parameter variation ui(u1) for all i = 1, . . . , n

• n simple wave constructions possible, one for each λp

⇒ p-th characteristic field introduces n− 1 generalized Riemann invariants

dUi

~rpi=dUj

~rpjfor i 6= j ∈ 1, . . . , n

or equivalently fromdVi

~rpi=dVj

~rpjfor i 6= j ∈ 1, . . . , n

⇒ n− 1 relations yield n− 1 functions Jp(U) obeying

∇UJp · ~rp = 0

∇VJp ·~rp = 0

• simple wave regions are essential ingredients in nonlinear wave problems: a regionin (x, t) bordering constant state U = U0 will be a simple wave region!

Page 28: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-28

Example: 1.5D Isothermal MHD

• isothermal MHD: for plasma at fixed, uniform temperature

⇒ justified in various astrophysical contexts, when cooling time very short com-pared to all other dynamical time scales

⇒ in dilute environments with irradiation from star

⇒ relax energy conservation

• Restrict to 1D MHD, ∇ · B = 0 turns Bx parameter

⇒ 1.5D means including By(x), vy(x) for ∂∂y = 0

⇒ isothermal: p = c2iρ, squared isothermal sound speed c2i

Page 29: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-29

• 1.5D isothermal MHD in conservation form:

ρmx

my

By

t

+

mxm2

x

ρ − B2x + c2iρ +

B2x+B

2y

2mxmy

ρ−BxBy

Bymx

ρ−Bx

my

ρ

x

=

0000

• primitive formulation

ρvxvyBy

t

+

vx ρ 0 0c2iρ vx 0

By

ρ

0 0 vx −Bx

ρ

0 By −Bx vx

ρvxvyBy

x

=

0000

⇒ eigenvalues for FU and matrix W (V) found to be

λ1 = vx − cf λ2 = vx − csλ3 = vx + cs λ4 = vx + cf

Page 30: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-30

• introduces slow cs and fast cf magnetoacoustic speeds computed from

c2f,s =1

2

(

c2i +B2x +B2

y

ρ

)

± 1

2

√(

c2i +B2x +B2

y

ρ

)2

− 4c2iB2x

ρ

⇒ some of the 4 eigenvalues coincide in certain limits

⇒ non-strictly hyperbolic system!

• right eigenvectors ~rp for Jacobian matrix FU in columns

R =

1 1 1 1vx − cf vx − cs vx + cs vx + cf

vy +cfBxBy

ρc2f−B2xvy +

csBxBy

ρc2s−B2xvy − csBxBy

ρc2s−B2xvy − cfBxBy

ρc2f−B2x

c2fBy

ρc2f−B2x

c2sBy

ρc2s−B2x

c2sBy

ρc2s−B2x

c2fBy

ρc2f−B2x

⇒ note indeterminacies where ρc2s,f = B2x

⇒ left eigenvectors of FU in rows of R−1

Page 31: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-31

• primitive variable formulation: right eigenvectors

R =

1 1 1 1−cf

ρ −csρ

csρ

cfρ

cfρ

BxBy

ρc2f−B2x

csρ

BxBy

ρc2s−B2x−cs

ρBxBy

ρc2s−B2x−cf

ρBxBy

ρc2f−B2x

c2fBy

ρc2f−B2x

c2sBy

ρc2s−B2x

c2sBy

ρc2s−B2x

c2fBy

ρc2f−B2x

⇒ left eigenvectors from R−1

• Use columns in R to derive generalized Riemann invariants

⇒ for the wave family associated with λ1 = vx − cf find

cf dρ + ρ dvx = 0

Bx(c2f − c2i ) dvx + Byc

2f dvy = 0

ρcf dvy −Bx dBy = 0

Page 32: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-32

• 3 generalized Riemann invariants per wave family, integrate equations as above

⇒ some in closed form

⇒ fast and slow magnetoacoustic RIs (not involving vx, vy)

Js,f =−c2s,f + ρc4i

B2x

c2s,f − c2i+c2s,f − c2ic2s,f

− 2 ln

∣∣∣∣∣

c2s,f − c2ic2s,f

∣∣∣∣∣

⇒ used later to verify correctness of numerical solutions!

Page 33: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-33

Scalar nonlinear conservation law

• nonlinear scalar conservation law for u(x, t) written as

ut + (f(u))x = 0

• inviscid Burgers equation for f(u) = u2/2

⇒ quasi-linear form (assuming differentiability):

ut + uux = 0

⇒ characteristic speed from Jacobian, i.e. derivative, fu = u ≡ f ′(u)

⇒ similar to linear advection equation ut + v ux = 0 (fixed v), which has trivialsolution: u(x, 0) advected with speed v

u(x,0) profile

v t

u(x,t) profile

Page 34: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-34

• Nonlinearity in inviscid Burgers ut + uux = 0

⇒ advection with local speed u

• Consider t = 0 triangular pulse (width 2x0, height h0) given by

u(x, 0) =

u0 x ≤ −x0

u0 + h0x0+xx0

−x0 < x ≤ 0

u0 + h0x0−xx0

0 < x ≤ x0

u0 x > x0

⇒ wave steepening and shock formation expected!

• tip of triangle experiences fastest rightward advection

⇒ conserving total area underneath triangle, front edge steepens.

• discontinuity forms at times ts = x0/h0

⇒ tip of triangle catches up rightmost point of front edge

⇒ discrete equivalent of conservation law across discontinuity

⇒ Rankine-Hugoniot relation for left ul and right ur values

f(ul) − f(ur) = s (ul − ur)

Page 35: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-35

• for inviscid Burgers case, find shock speed s = (ul + ur)/2

• fully analytic solution to triangular pulse problem

⇒ after shock forms, base of triangle widens due to the speed difference betweenleft edge traveling with u0, and shocked right edge traveling at speed s(t). In accordwith conservation, the height of the triangle must therefore decrease in time.

t=0 pulse shock forms triangle widens, area conserving

⇒ we will use basic numerical schemes to simulate this evolution

Page 36: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-36

The Riemann problem

• specific initial condition separating 2 constant states

• Riemann problem for scalar conservation law

u = ul for x ≤ 0

u = ur for x > 0

• Rankine-Hugoniot states

f(ul) − f(ur) = s (ul − ur)

⇒ symmetric in arguments ul and ur

• For inviscid Burgers: only shock expected for ul > ur

⇒ extra condition for admissable shock: Lax entropy condition

f ′(ul) > s > f ′(ur)

⇒ shock speed between characteristic speeds of 2 states

⇒ characteristics ‘go into the shock’

p-shock

Ul Ur

p-characteristics

Page 37: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-37

• Rarefaction waves for Burgers equation

⇒ when ul < ur expect right state ‘runs away’ from left

⇒ try ‘centered simple wave’ u(ξ) = u(x/t)

⇒ conservation law translates into

f ′(u)du

dξ= ξ

du

⇒ rarefaction wave: for Burgers:

u(x, t) = u(x/t) =

ul x < ultx/t ult < x < urtur x > urt

⇒ u decreases (density: medium gets rarefied) when signal passes

Page 38: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-38

Compound waves

• flux f(u) in scalar conservation law convex when f ′′(u) has same sign everywhere

⇒ true for Burgers equation with flux function f(u) = u2/2

⇒ f(u) ≡ u3 then f ′′(u) = 6u changes sign at u = 0

⇒ characteristic speed is locally f ′(u) = 3u2

⇒ third possible outcome for Riemann problem!

• by analogy with Burgers equation: for f(u) ≡ u3

⇒ rarefaction wave occur when 0 < ul < ur with solution

u(x, t) = u(x/t) =

ul x < 3u2l t√

x3t 3 u2

l t < x < 3u2rt

ur x > 3u2rt

⇒ when 0 < ur < ul: discontinuity at shock speed s = u2l + ul ur + u2

r

Page 39: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-39

• allow for negative states u then find ‘compound’ solution:

⇒ ul > 0 > ur: seek intermediate state um < 0 which connects to ul dis-continuously, at shock speed s = u2

l + ul um + u2m, while um connects to ur by

rarefaction

⇒ compound solution emerges for ul > 0 > −ul/2 > ur and has

u(x, t) = u(x/t) =

ul x < s t =(u2l + ul um + u2

m

)t = 3 u2

mt−√

x3t

3 u2mt < x < 3u2

rtur x > 3u2

rt

⇒ (x, t)-schematic: 3 outcomes Riemann problem for nonconvex law

Compound wave Shock Rarefaction

• we will see that MHD allows for shocks, rarefactions, and com pound waves inboth fast and slow wave families!

Page 40: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-40

Numerical methods for nonlinear conservation law

• introduce spatial xi = i∆x and temporal tn = n∆t steps

⇒ try explicit scheme on Burgers, directly discretize ut + u ux = 0 to

un+1i − uni +

∆t

∆xuni(uni − uni−1

)= 0

⇒ initial data [1, 1, 1, 0, 0, 0] remains solution to this scheme

⇒ WRONG !!!! should be traveling shock at speed s = 0.5

• reason: above scheme non-conservative (but ok for continuous data!)

⇒ conservative scheme is of form

Un+1i = Un

i −∆t

∆x

[Fi+1/2 − Fi−1/2

]

⇒ numerical fluxes Fi+1/2: time-average fluxes over cell edges xi + 1

2∆x ≡ xi+1

2

Page 41: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-41

Explicit time integration

• calculate fluxes (and sources) from known time level tn

• Explicit: ∆t restricted by Courant, Friedrichs, Lewy conditiondomain of dependence of discretization must includePDE domain of dependence

⇒ ∆t ≤ crossing time of cells by fastest wave

⇒ ∆t ≤ ∆x/cmax with maximal physical speed cmax

ix i+1xi-1x

t

Physical DOD

DependenceDomain of

Numerical

nt

n+1

x

t

Page 42: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-42

Lax-Friedrichs, Lax-Wendroff, Max-Cormack methods

• Better explicit discretization: first order Lax-Friedrichs

un+1i =

uni+1 + uni−1

2− ∆t

2∆x

(fni+1 − fni−1

)

⇒ scheme is conditionally stable : restriction by CFL condition∣∣∣∣

∆t

∆xf ′(ui)

∣∣∣∣≤ 1

⇒ conservative scheme, identify numerical flux as

F LFi+1/2 =

1

2

fi+1 + fi −∆x

∆t[ui+1 − ui]

• first order accuracy: local truncation error ∝ ∆t

Page 43: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-43

• second order Lax–Wendroff scheme: use predictor–corrector approach

⇒ Richtmeyer two–step version of Lax–Wendroff method

‘predictor’: un+1

2

i+1

2

=uni+1 + uni

2− ∆t

2∆x(fni+1 − fni )

‘corrector’: un+1i = uni −

∆t

∆x

(

fn+1

2

i+1

2

− fn+1

2

i−1

2

)

⇒ predictor calculates intermediate values un+1/2i+1/2 by Lax–Friedrichs

⇒ clearly, the scheme is conservative!

• stencil of the method: space-time grid of points involved

n+1

tn+1/2

tn

tn+1

tn+1/2

tn

t

x

step 1 step 2

Two-step Lax-Wendroff

xi

xxi+1i-1

t

x xi

xxi+1i-1

t

Page 44: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-44

• another multilevel method: two-step MacCormack method:

‘predictor’: u∗i = uni −∆t

∆x(fni+1 − fni )

‘corrector’: un+1i = 1

2(uni + u∗i ) − 1

2

∆t

∆x

(f∗i − f∗i−1

)

⇒ step size in predictor now ∆t

⇒ equal to Lax–Wendroff for linear, better for nonlinear problems

• Numerically simulate triangular pulse for Burgers

⇒ in agreement with theory, except for the ‘wiggles’

Page 45: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-45

• MacCormack (& Lax-Wendroff) methods: dispersive

⇒ manifests Gibbs phenomenon : for linear advection of discontinuity

⇒ non-monotonicity preserving : monotone u(x, 0) develops extrema

Page 46: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-46

Total Variation Diminishing concept

• total variation of function u(x) on domain [0, 1] defined as

TV (u) ≡∫ 1

0

|dudx

| dx

⇒ total variation of numerical approximation of u

TV (un) =N∑

i=0

|uni+1 − uni |

• scheme is total variation diminishing (TVD) in time if

TV (un+1) ≤ TV (un) ∀n⇒ solution scalar conservation law has TVD property ∀t2 > t1

TV (u(x, t2)) ≤ TV (u(x, t1))

Page 47: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-47

• a TVD scheme is clearly monotonicity preserving!

⇒ a new local extremum would raise TV

• Harten: any scheme written in general form

un+1i = uni + Ai+1/2 (uni+1 − uni )︸ ︷︷ ︸

∆uni+1/2

−Bi−1/2

(uni − uni−1

)

︸ ︷︷ ︸∆un

i−1/2

⇒ is TVD when coefficients Ai+1/2 and Bi−1/2 obey

Ai+1/2 ≥ 0

Bi−1/2 ≥ 0

0 ≤ Ai+1/2 + Bi+1/2 ≤ 1

Page 48: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-48

• first order Lax-Friedrichs scheme is TVD , since rewrites as

un+1i = uni +

1

2

(

1 − ∆t

∆x

fni+1 − fni∆ui+1

2

)

∆ui+1

2

− 1

2

(

1 +∆t

∆x

fni − fni−1

∆ui−1

2

)

∆ui−1

2

⇒ TVD requirements translate to CFL condition∣∣∣∣

∆t

∆x

fni+1 − fniuni+1 − uni

∣∣∣∣≤ 1

⇒ generalize Lax-Friedrichs scheme to second order, keep TVD property

Page 49: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-49

TVDLF scheme

• Recall: numerical flux for first-order Lax-Friedrichs is

F LFi+1/2 =

1

2

fi+1 + fi −∆x

∆t[ui+1 − ui]

⇒ can improve scheme by changing to Local Lax-Friedrichs flux

F LLFi+1/2 =

1

2

fi+1 + fi − |αi+1

2

| [ui+1 − ui]

⇒ αi+1/2 =fn

i+1−fni

uni+1

−uni, proxy for local characteristic speed f ′(u)

⇒ still in accord with TVD, if CFL condition satisfied

Page 50: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-50

• turn into second order accurate TVDLF scheme by

⇒ use predictor-corrector approach (raise temporal accuracy)

⇒ use some form of linear interpolation in space (but keep TVD!)

• Numerically simulate triangular pulse for Burgers

⇒ Riemann problem for ul > ur

⇒ Riemann problem for ul < ur

Page 51: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-51

• simulate with TVDLF 3 Riemann problems for non-convex problem f(u) = u3

⇒ choose initial left-right states leading to compound/shock/rarefaction

Page 52: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-52

Integral form of conservation law

• consider cell [x1, x2] and quantity u(x, t) within cell

⇒ flux over cell edge f(u) changes total mass from t1 to t2 by∫ x2

x1

u(x, t2) dx =

∫ x2

x1

u(x, t1) dx +

∫ t2

t1

f(x1, t) dt−∫ t2

t1

f(x2, t) dt

⇒ integral form of scalar conservation law

ut + (f(u))x = 0

• integral form more general: allows for discontinuous solutions

⇒ differential form assumes differentiable functions

Page 53: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-53

• Finite Volume method in 1D for system of conservation laws

⇒ interpret Ui as average value of U(x, t) in [xi−1/2, xi+1/2]:

Ui(t) ≡1

∆xi

∫ xi+1/2

xi−1/2

U(x, t) dx ,

xix

’cell interfaces’

i-1 xi+1x xi+1/2i-1/2xi-3/2 xi+3/2

u(x)

uiui-1

i+1u

cell

⇒ update volume averages by

dUi

dt+

1

∆xi

(Fi+1/2 − Fi−1/2

)= 0 .

⇒ discretized equation is integral law, weak solutions obey conservation

Page 54: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-54

Linear reconstruction

• volume averaged value Ui: freedom to interpolate U(x ∈ [xi−1/2, xi+1/2])

⇒ take constant Ui ⇒ first order accuracy where

⇒ linear extrapolation within cell with slope σi

U(x ∈ [xi−1/2, xi+1/2]) = Ui + σix− xi∆xi

⇒ slope is difference

σi = Ui+1/2 − Ui−1/2 ≡ ∆Ui

⇒ yields a Left and Right edge centered state

ULi+1/2 = Ui + ∆Ui/2 and UR

i+1/2 = Ui+1 − ∆Ui+1/2

Page 55: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-55

• flux at cell edge takes average

Fi+1/2 = (F(ULi+1/2) + F(UR

i+1/2))/2

⇒ raises spatial accuracy to second order

• to remain TVD: limit slopes used in linear reconstruction

⇒ slope limiting process rather takes:

ULi+1

2

= Un+1/2i + ∆U

n+1/2i /2

URi+1

2

= Un+1/2i+1 − ∆U

n+1/2i+1 /2

⇒ take least steep slope, constant extrapolation when conflict

Page 56: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-56

• different flavours of slope limiters exist, ensure TVD

⇒ strictly speaking only true for a single scalar nonlinear equation!

⇒ robust slope limiter is ‘minmod’ limiter

∆Ui = sgn(Ui−Ui−1) max [0,min | Ui − Ui−1 |, (Ui+1 − Ui)sgn(Ui − Ui−1)]⇒ stencil becomes 5 cells wide

• reconstruction on primitive V or conservative U

Page 57: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-57

TVDLF scheme

• Robust, general scheme to ANY hyperbolic system, ensures TVD (for scalar)

⇒ Predictor-corrector approach for temporal advance

Un+1/2 = Un +∆t

2[−∇ · F(Un) + S(Un)]

Un+1 = Un + ∆t[

−∇ · F(Un+1/2) + S(Un+1/2)]

⇒ CFL condition links ∆t with ∆x (explicit scheme)

• slope limited linear reconstruction and flux expression

Fi+1

2

=1

2

F(ULi+1

2

) + F(URi+1

2

)− | cmax(ULi+1

2

+ URi+1

2

2) |[

URi+1

2

− ULi+1

2

]

⇒ scalar cmax denotes maximal physical propagation speed

⇒ for 1D MHD cmax = |vx| + cf

⇒ may even exploit it for zero-beta (p = 0) plasma

Page 58: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-58

TVDLF simulations for 1.5D isothermal MHD

• numerically solve Riemann problems for 1.5D isothermal MHD

• Test 1: unit domain, discontinuity at x = 0.4 separates

Vl = (1, 0, 0, 1) Vr = (0.125, 0, 0,−1)

⇒ parameters Bx = 0.75 and c2i = 1

• simulate till t = 0.15

⇒ leftgoing fast rarefaction, a slow compound wave (shock with rarefaction waveattached to it), a rightgoing slow shock and fast rarefaction

Page 59: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-59

• now verify: plot fast and slow magnetoacoustic Riemann invariants

⇒ fast invariant stays constant through fast rarefactions

⇒ slow invariant constant through rarefaction part of the slow compound wave

Page 60: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-60

• Test 2: discontinuity at x = 0.3, states Vl = (1, 0, 0,−1) and Vr = (1, 2.5, 2.5,−1)

⇒ parameters Bx = 1 and c2i = 1, generate solution up to t = 0.15

• simulate till t = 0.15

⇒ fast compound wave, two slow rarefaction waves, fast compound wave

Page 61: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-61

• now verify: plot fast and slow magnetoacoustic Riemann invariants

⇒ fast invariant stays constant through fast rarefaction parts

⇒ slow invariant constant through slow rarefactions

Page 62: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-62

• Alfven waves in zero-beta plasma

⇒ density ρ = 1, pulse in transverse velocity vy = 0.001 at x ∈ [1, 2]

⇒ pulse splits into 2 equal sized Alfv en signals

⇒ propagation and polarization in accord with linear shear Alfven wave

Page 63: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-1

Numerical Magnetohydrodynamics

Rony Keppens

Overview for day 2

• Characteristic based schemes for MHD: Godunov method; the MHD Riemannproblem; Roe-solver for MHD.

• 1D MHD numerical tests: the good, the bad, and the ugly.

• Strategies for multi-D extensions: Strang splitting; Finite volume on unstructuredgrids; Example application: MHD ‘Kelvin-Helmholtz’ evolution.

Page 64: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-2

Godunov method

• Recall: FV method uses time-averaged fluxes over cell interfaces

⇒ Godunov: consider values Uni as piecewise constant, concentrate on discon-

tinuous Riemann problems that arise at cell interfaces.

• solution of local Riemann problem in essence self-similar in x/t

⇒ restrict time step: no wave interaction in one cell ∆x within ∆tn+1

∆tn+1 <∆x

2 max | λnp |

• Godunov method uses exact nonlinear solution U of Riemann problems

⇒ U(x−xi+1/2

t ,Uni ,U

ni+1

)

appears in numerical flux as

Fi+1/2 (Ui,Ui+1) = F(U (0,Uni ,U

ni+1))

Page 65: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-3

• Recall: 1.5D isothermal MHD system (subset of full MHD!)

⇒ Riemann problem gives rise to 4 wave signals, typically

⇒ two fast, two slow ‘waves’

• showed that fast or slow can be: shock/rarefaction/compound

⇒ also allow for the case where 1 or more wave is absent: 44 = 256 outcomes

• 33 more possibilities are (mathematically) feasible

⇒ merging of both left-going waves to ‘overcompressive’ shock: 42 = 16

⇒ merging of both right-going waves to ‘overcompressive’ shock: 42 = 16

⇒ merging of both left- and right-going waves to ‘overcompressive’ shocks

• Exact nonlinear Riemann solver practically impossible

⇒ in 1D MHD, three more equations ⇒ 3 more waves!

Page 66: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-4

Ingredients for a characteristic solver

• consider 1D MHD in primitive formulation Vt +WVx = 0

ρvxvyvzpBy

Bz

t

+

vx ρ 0 0 0 0 0

0 vx 0 0 1ρ

By

ρBz

ρ

0 0 vx 0 0 −Bx

ρ0

0 0 0 vx 0 0 −Bx

ρ

0 ρc2 0 0 vx 0 00 By −Bx 0 0 vx 00 Bz 0 −Bx 0 0 vx

ρvxvyvzpBy

Bz

x

=

0000000

⇒ use to compute characteristic wave speeds

• equivalent to eigenvalues of flux Jacobian from Ut + (F(U))x = 0

Page 67: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-5

• eigenvalues for W (V), and hence for Jacobian FU

vx − cf , vx − bx, vx − cs, vx, vx + cs, vx + bx, vx + cf

⇒ slow, fast magnetoacoustic speeds, flow speed vx, Alfven speed bx = |Bx|/√ρ

⇒ compute right eigenvectors ~rp for W (V) and find

αfρ 0 αsρ 1 αsρ 0 αfρ−αfcf 0 −αscs 0 αscs 0 αfcfαscsβyβx −βz −αfcfβyβx 0 αfcfβyβx βz −αscsβyβxαscsβzβx βy −αfcfβzβx 0 αfcfβzβx −βy −αscsβzβxαfρc

2 0 αsρc2 0 αsρc

2 0 αfρc2

αscβyρ1

2 −βzρ1

2βx −αfcβyρ1

2 0 −αfcβyρ1

2 −βzρ1

2βx αscβyρ1

2

αscβzρ1

2 βyρ1

2βx −αfcβzρ1

2 0 −αfcβzρ1

2 βyρ1

2βx αscβzρ1

2

• scaled such that dimension is like V, with dimensionless

α2s =

c2f − c2

c2f − c2s, α2

f =c2 − c2sc2f − c2s

, βx =Bx

|Bx|, βy =

By

B⊥, βz =

Bz

B⊥

Page 68: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-6

• wave speed degeneracies:

1.By = 0 = Bz, and b2x 6= c2: either of both fast (bx > c) or both slow (bx < c)characteristic speeds coincide with the Alfven signals at vx ± bx: doubleumbilic point.

2. tangential field components vanish as well as b2x = c2: the slow, Alfvenand fast wave speeds coincide, vx ± bx triple umbilic points.

3.Bx = 0: both Alfven and slow pairs collapse: quintuple umbilic point vx.

⇒ MHD is not strictly hyperbolic

• may need special numerical treatment, partly dealt with by scaling

• possible to derive equation for entropy S = pρ−γ

⇒ IDEAL MHD has entropy conserved, hence Riemann invariant

∂S∂t

+ v · ∇S = 0

⇒ will remain constant through fast/slow simple waves (rarefactions)

Page 69: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-7

Rarefaction waves

• analyse self-similar solutions U(x, t) = U(x/t) ≡ U(ξ)

⇒ centered simple wave construction

• since ∂U∂t

= −xU′/t2 and ∂U∂x

= U′/t, find from Ut + FUUx = 0 that

FUU′ = ξU′

⇒ ξ must be eigenvalue λp of flux Jacobian FU

⇒ U′ proportional to right eigenvector ~rp

ξ = λp(U(ξ)) and U′ = α(ξ)~rp(U(ξ))

• Curves in state space U along which tangent coincides with an eigenvector aretermed integral curves

Page 70: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-8

• Differentiate to ξ and find

1 = (∇Uλp) · U′

⇒ since U′ ∝ ~rp, proportionality constant α(ξ) from

α(ξ) =1

(∇Uλp) · ~rp.

• construction fails when structure coefficient sp = (∇Uλp) · ~rp = 0

⇒ then p-th wave field is linearly degenerate

⇒ can also use primitive eigenvectors sp = (∇Vλp) ·~rp

⇒ sp coefficients relate to tendency of wave family to steepen or spread

⇒ sp = 0: p-th wave mode propagates by means of finite discontinuities

Page 71: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-9

• 1D MHD: entropy and Alfven wave families: linearly degenerate

⇒ s2, s4 and s6 = 0: propagate by finite discontinuities

⇒ no rarefaction waves possible for them

• Generalized Riemann invariants yield

entropy: λ4 = mx

ρ dvx = dvy = dvz = dp = dBy = dBz = 0

Alfven: λ2,6 = mx

ρ∓ βxBx

ρ1

2

dρ = dvx = dp = dB⊥ = 0 ,

dvy = ±βxρ

1

2

dBy, dvz = ±βxρ

1

2

dBz

⇒ entropy family: contact discontinuities, only jump in ρ (or S, T , H)

⇒ Alfv en: rotational discontinuities, total field magnitude is co nserved andtangential field B⊥ gets rotated

Page 72: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-10

• fast and slow families have structure coefficients

s1,7 = ∓αfcf(γ

2α2f + α2

s +1

2

)

s3,5 = ∓αscs(γ

2α2s + α2

f +1

2

)

⇒ not garantueed non-zero: non-convex nature of MHD!

⇒ rarefaction waves possible

⇒ can deduce differential equations governing integral curves

• generalized Riemann Invariants for slow/fast yield

dvydvz

=dBy

dBz=By

Bz

⇒ through fast or slow simple waves: transverse field and flow do not rota te,but only vary in overall magnitude!

Page 73: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-11

Shock relations in MHD

• Already stated substitution recipe for Rankine-Hugoniot relations

⇒ conservation across a moving discontinuity

F(U) − F(U∗) = s(U − U∗) .

⇒ defines Hugoniot locus for fixed state U∗

⇒ for system of n equations, n one-parameter families

• write U(ζ,U∗) and s(ζ,U∗), where U(0,U∗) = U∗

⇒ analyse weak shocks, then can derive

FU(U(0,U∗))U′(0,U∗) = s(0,U∗)U′(0,U∗)

⇒ U′(0,U∗) is eigenvector of flux Jacobian evaluated in U∗

⇒ n families for shocks associated with n eigenvalues of FU

⇒ weak shocks: shock speed s = λp(U∗)

⇒ not for strong shocks!

Page 74: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-12

• selection criteria on Hugoniot locus for physically admissable shocks

⇒ generalization of Lax entropy condition

⇒ jump in the p-th wave family obeying Rankine-Hugoniot ok when

λp(Ul) > s > λp(Ur)

⇒ p-characteristics enter the p-shock from both sides

• additional arguments needed to select physically admissable shocks

⇒ system of n nonlinear equations can have more than one of the n characteristicfamilies on each side converge into the shock: overcompressive shock

Page 75: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-13

• true nonlinear MHD Riemann solver

⇒ exploits both RH relations, and differential equations for integral curves

⇒ needs to handle special cases (degeneracies: umbilic points)

• overall outcome schematically: up to 7 wave speeds

⇒ x− t sketch of Riemann problem

v+cs

x

v

v+cv−c

ff

sv−cv−b

v+bx

x

⇒ slow/fast signals could be shocks or rarefactions, compound waves

Page 76: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-14

Roe-type approximate Riemann solver

• general procedure to solve system Ut + (F(U))x = 0

⇒ local Riemann problem from left and right interface values Ul and Ur.

⇒ instead of exact nonlinear solution, solve a linear Riemann problem

Ut + (G(U))x = 0

⇒ G(U) = F(Ur) + A(U − Ur) includes constant matrix A = A (Ul,Ur)

⇒ matrix must satisfy conditions

1.F(Ul) − F(Ur) = A(Ul,Ur) (Ul − Ur),2.A(Ul,Ur) → FU(Ur) as Ul → Ur,3.A(Ul,Ur) has only real eigenvalues,4.A(Ul,Ur) has a complete system of eigenvectors.

⇒ exact solution obtained when initial states obey Rankine-Hugoniot relations

⇒ consistency and solvability of the linear Riemann problem.

Page 77: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-15

• if Roe matrix A found, Roe scheme uses the numerical flux

Fi+1/2 (Ui,Ui+1) = F(Ui) + Ai+1/2

(

U − Ui

)

⇒ U = U(0,Ui,Ui+1) is exact solution of linear Riemann problem

• Latter solution easy: when Ai+1/2~rp = λp~r

p write

Ui+1 − Ui =∑

αp~rp

⇒ can show that the solution along the (x, t) ray (x− xi+1

2

)/t = 0

U =Ui + Ui+1

2+

1

2

λp<0

−∑

λp>0

αp~rp

• fill in for Roe flux, use first Roe condition to get

Fi+1/2 = 12 (F(Ui) + F(Ui+1)) − 1

2

∑ | λp | αp~rp

⇒ ‘upwinding’: characteristic speeds and wave directionality taken into account

Page 78: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-16

• Needed: Roe matrix A, its eigenvalues λp, its right eigenvectors ~rp, and the wavestrengths αp

⇒ when left eigenvectors ~lp given, wave strengths

αp = ~lp · (Ui+1 − Ui)

• In practice: use for A the Flux Jacobian FU, evaluated in average state, e.g. arith-metic average of Ul and Ur

⇒ then not all Roe conditions fullfilled though

⇒ all ingredients known: eigenvalues (characteristic speeds), eigenvectors fromR = UVR, left eigenvectors from R−1

⇒ wave strengths also computed from primitive jumps

αp =~lp · (Vi+1 − Vi)

Page 79: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-17

• Roe solver uses proper characteristic decomposition to ‘weight’ the information prop-agating in different directions

⇒ approximates time-averaged flux for state of Riemann fan along t-axis

⇒ ‘upwind’ concept key issue for numerically stable, conservative schemes.

• TVDLF method: replaces all |λp| → |cmax|⇒ retains a crude form of upwinding, with more numerical diffusion

• current trend away from using full 7-wave structure

⇒ gas dynamic solvers adopted to MHD, in effect replace Riemann fan by 2-waveor 3-wave structure.

xx

λ

λ

λ−

o

+U *

U *U *

Ul UrUl Ur

λ

λ−

+

HLLCHLL

l

r

Page 80: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-18

1D MHD simulations: the good

• use approximate Riemann solver scheme: compute Riemann problems

⇒ system including all vector components: 7 wave speeds

• entropy disturbances advected at flow speed vx

⇒ density/entropy/temperature jump (Contact Discontinuity)

• Alfven signals traveling at vx ±Bx/√ρ ≡ vx ± bx

⇒ non-compressive disturbances in tangential vector components

• slow and fast compressive magneto-acoustic signals vx ± cf,s

c2s,f =1

2

γp +B2

ρ∓

√(γp +B2

ρ

)2

− 4γp

ρ

B2x

ρ

• ordered cs ≤ bx ≤ cf

Page 81: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-19

• Test 1 : from Torrilhon, J.Plasma Phys. 2003

⇒ left state Vl = (3, 0, 0, 0, 3, 1, 0) right state Vr(1, 0, 0, 0, 1, cos(1.5), sin(1.5))

⇒ take γ = 5/3 and Bx = 3/2, evolve till t = 0.38

⇒ fast rarefaction, rotational discontinuity, slow rarefaction, contact discontinuity,slow shock, rotational discontinuity, fast shock.

⇒ entropy invariant fast/slow rarefactions, Alfven discontinuities

Page 82: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-20

• plot solution in state space of transverse magnetic field components

⇒ only Alfven signals rotate the field, fast and slow shocks and rarefactions altermagnitude of transverse field.

Page 83: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-21

• Test 2 : take γ = 5/3 and B1 = 1, simulate till t = 80

(ρ, v1, v2, v3, p, B2, B3)L = (0.5, 0, 1, 0.1, 1, 2.5, 0)

(ρ, v1, v2, v3, p, B2, B3)R = (0.1, 0, 0, 0, 0.1, 2, 0)

⇒ density and v3 at t = 80: FR – A – SR – CD – SS – A – FS

Page 84: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-22

• Can do planar MHD problems: 1.5D variables (ρ, ρv1, ρv2,H, B1, B2)

⇒ problem reduces to

ρm1

m2

HB2

t

+

m1m2

1

ρ− B2

1 + (γ − 1)H− (γ − 1)m21+m

22

2ρ+ (2 − γ)B

21+B

22

2m1m2

ρ − B1B2

m1

ρ

(

γH− (γ − 1)m21+m

22

2ρ+ (2 − γ)B

21+B

22

2

)

− B1(B1m1

ρ+B2

m2

ρ)

B2m1

ρ− B1

m2

ρ

x

= 0

⇒ 5-component PDE system, constants γ and B1

⇒ at most 5 waves in Riemann fan

Page 85: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-23

• Test 3: Riemann problem γ = 5/3 and B1 = 2 separating

(ρ, v1, v2, p, B2)L = (0.5, 0, 2, 10, 2.5)

(ρ, v1, v2, p, B2)R = (0.1,−10, 0, 0.1, 2)

⇒ FR – SR – CD – SS – FS, shown at time t = 30

Page 86: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-24

• Test 4: Brio-Wu Riemann problem with γ = 2 and B1 = 0.75

⇒ plasma at rest with (ρ, p,B2)L = (1, 1, 1) and right state (0.125, 0.1,−1)

⇒ FR – slow compound wave – CD – SS – FR , shown at time t = 0.1

Page 87: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-25

• not always 5 states: verify recognition of single nonlinear wave

• Test 5: γ = 5/3 and B1 = −0.7 separating states

(ρ, v1, v2, p, B2)L = (1,−4.6985,−1.085146, 0.2327, 1.9680)

(ρ, v1, v2, p, B2)R = (0.727,−4.0577,−0.8349, 0.13677916, 1.355)

⇒ same entropy states, fast rarefaction emerges

Page 88: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-26

• Test 6: Rankine-Hugoniot solution, γ = 5/3 and B1 = 0.1

(ρ, v1, v2, p, B2)L = (1, 1.5, 0, 10−6, 1)

(ρ, v1, v2, p, B2)R = (1.6111, 0.9310409, 0.04103, 0.04847, 1.6156)

⇒ stationary fast shock , note m1,L = m1,R

⇒ cross Mfast = 1 and B2 ↑: B-line bends away from shock normal

Page 89: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-27

• Test 7: Alfven waves: perturb straight field with ⊥ velocity

⇒ take γ = 1.4, B1 = 1 and ρ = 1 and pth = 10−9

⇒ square velocity pulse v2 = 0.001 for x ∈ [1, 2] solve on x ∈ [0, 3]

⇒ splits in two Alfven pulses traveling along field line

Page 90: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-28

1D MHD simulations: the bad

• 1D MHD still poses numerical challenges to modern schemes

⇒ Torrilhon, JCP 2003: non-coplanar RP with unique, regular solution

⇒ Vl = (1, 0, 0, 0, 1, 1, 0) and Vr = (0.2, 0, 0, 0, 0.2, cos(3), sin(3))

⇒ unique exact solution: FR, A, SS, CD, SS, A, FR

• all modern methods pseudo-converge to wrong solution containing a compound wavefor up to several 1000 grid points

⇒ true convergence to exact, regular solution: grid-adaptivity.

Page 91: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-29

1D MHD simulations: the ugly

• And what for non-conservative formulations?

⇒ redo Test 3 (from Falle, ApJ 577, 2002)

Page 92: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-30

• Modern schemes may fail (numerical instabilities!)

⇒ catalogue of flaws inherent to characteristic based schemes

⇒ James Quirk, Inter. J. for Numer. Meth. Fluids 18, 555 (1994)

• known problems in computing Euler (HD) flows in 1D, 2D and 3D

⇒ many unknown failures for (M)HD simulations, lots of cures exist!

• conservation form stresses conservative variables (ρ,m,H,B)

⇒ need primitive variables (ρ,v, p,B) to calculate fluxes

⇒ typically, no guarantee to have positive pressure

• HD: kinetic energy ≫ thermal energy (very high Mach M = v/cs ≫ 1)

• MHD: dominant kinetic energy or magnetic energy (low β = 2p/B2)

• possible remedies

⇒ switch to more diffusive limiter (minmod)

⇒ switch to more diffusive scheme (Roe → TVDLF)

⇒ use ‘pressure correction’: add (minute) thermal energy locally

• latter remedy destroys overall conservation!

Page 93: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-31

Multi-D MHD

• from 1D to multi-D by ‘dimensional’ or ‘operator’ splitting

⇒ Strang:

Un+1 = Lx∆t/2Ly∆tL

x∆t/2U

n

⇒ alternatively:

Un+2 = Lx∆tLy∆tL

y∆tL

x∆tU

n

⇒ reduce multi-D problem to succession of 1D problems

• for characteristic-based schemes

⇒ dimensional splitting assume waves travel ⊥ to cell interfaces

⇒ perhaps not always justified to neglect dynamics ‖ cell edge

Page 94: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-32

Finite Volume on unstructured grids

• Finite volume approach: natural on general 2D and 3D unstructured grids uiui1 ui+1Siui+k PPPPPq um(ui;ui+1)• multidimensional set of conservation laws

∂U

∂t+ ∇ · F = 0

⇒ in 3D, the ∇ · F with three Cartesian coordinate axes

∇ · F =∂Fx

∂x+∂Fy

∂y+∂Fz

∂z

Page 95: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-33

• discretize space in control volumes Vi

⇒ bounding surfaces ∂Vi, unit normal n = (nx, ny, nz)

d∫

ViU(x, t) dx

dt= −

∂Vi

F · n dS

= −∫

∂Vi

(Fxnx + Fyny + Fznz) dS

⇒ introduce matrix T (n) which rotates all vector quantities to local orthogonalcoordinate system formed by n, t, s ≡ n× t, where latter are tangential unit vectorswithin ∂Vi

1 0 0 0 0 0 0 00 sin θ cosϕ sin θ sinϕ cos θ 0 0 0 00 cos θ cosϕ cos θ sinϕ − sin θ 0 0 0 00 − sinϕ cosϕ 0 0 0 0 00 0 0 0 1 0 0 00 0 0 0 0 sin θ cosϕ sin θ sinϕ cos θ0 0 0 0 0 cos θ cosϕ cos θ sinϕ − sin θ0 0 0 0 0 − sinϕ cosϕ 0

.

Page 96: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-34

• MHD equations must be unchanged under rotation

Fxnx + Fyny + Fznz = T−1(n)Fx (T (n)U)

⇒ obtain essentially 1D problem in direction normal to volume boundary

d∫

ViU(x, t) dx

dt= −

∂Vi

T−1(n)Fx (T (n)U) dS

• control volumes with multiple, flat surface segments

⇒ integral over boundary into discrete sum over its sides

⇒ only information of grid: volumes Vi, and geometry of cells: number of boundingsurface segments, their surface area and their normal directions.

Page 97: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-35

Handling strong background fields

• low beta plasma: numerically challenging

⇒ keep p positive, small B error ⇒ unphysical dynamics

• Stellar coronae: low beta plasma; also for earth’s magnetosphere

⇒ ratio of fluctuations to intrinsic dipole components: small!

• Tanaka, JCP 111 (1994): Finite volume TVD scheme for 3D MHD

⇒ unstructured grid employed

⇒ split off static strong background potential field B0(x)

⇒ hence use ∇× B0 = 0 and ∂B0

∂t = 0

• new variables are ρ, m, H1 = H− B1 · B0 − B20

2, B1

⇒ similar equations as before, with added fluxes and source terms

Page 98: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-36

• Can reformulate Roe-solver for new variables

⇒ used to simulate solar-wind magnetosphere interaction

⇒ supersonic wind: Mach 2.5 and β = 5, impinges low-beta magnetosphere

Page 99: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-37

• Recent other astrophysical application: young star environment

⇒ Bessolaz et al: work in progress, use TVDLF plus splitting strategy

⇒ simulating magnetized, rotating star plus accretion disc interaction

⇒ resistive disk treatment, gravitationally stratified corona

⇒ analyse angular momentum exchange due to funnel flows

⇒ disc accretion halted and diverted along stellar field lines

Page 100: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-38

Example multi-D MHD study

• Kelvin-Helmholtz unstable v ∝ tanh yex-profile

⇒ role of B in vortex flow : ρ at saturation

⇒ single billow M = 1 MA = 10 (β = 120): exclude subharmonic modes

• wish to study vortex disruption and interactions

Page 101: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-39

• Mach number M = V/cs, V total velocity jump

⇒ M = 1 ‘transonic’ layers

• Alfven Mach number: initial B strength

⇒ Weak BMA = 100 vortex pair/merge β = 12000

Page 102: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-40

• stronger B: M = 1, Alfven Mach MA = 7 (β = 58.8)

⇒ reconnection disrupts single billows

⇒ trend to large scale by pairing/merging

⇒ 22 wavelengths of most unstable mode

• Baty et al., PoP 10(12), 2003, 4661

Page 103: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-41

• single layer: M = 1 MA = 7 or β = 58.8

Page 104: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-42

• ‘transition’ HD – disruptive MHD MA = 30 or β ≃ 1000

⇒ locally amplified B survives > 1 roll-ups

⇒ pairing/merging joins antiparallel field: tearing events at vortex periphery

⇒ transit to turbulence + coalescence

Page 105: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-43

• deterministic runs of two identical vortices

⇒ exciting λ1 = Lx and λ2 = Lx/2 or only Lx

⇒ study dependence on phase difference: Φ = 0 or Φ = π/2

• only pair/merge when subharmonics excited and near-zero phase difference

• Extended study to double layers, or ‘slab jets’

⇒ H. Baty & R. Keppens, 2006, Astron. & Astrophys. 447, 9-22

Page 106: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-44

• M = 1 MA = 7 close layers Rjet = 2.5 a

Page 107: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-45

• M = 1 MA = 50 close near HD layers (β = 3000)

⇒ ‘Batchelor’ coupling events

⇒ counterrotating vortices pair without merging, leaving jet core

Page 108: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-46

• M = 6 MA = 7 supersonic β = 1.63 layers

⇒ Rapid shock-dominated transition

Page 109: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-47

3D jets

• Astrophysical jets:

⇒ launched from β ≃ 1 accretion disks

⇒ helical interior B, equipartition (β ≃ 1)

⇒ include jet rotation

⇒ Supersonic terminal v: M ≃ 7.7, MA ≃ 10

• penetration into denser, near unmagnetized cloud

⇒ study density contrast of ρcloud/ρjet = 10

⇒ ‘hot’ MHD jet

Page 110: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-48

• bow shock and cocoon develops

⇒ behind contact separating shocked cloud from jet: ‘hot spot’

⇒ helical field fills entire cocoon

Page 111: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-1

Numerical Magnetohydrodynamics

Rony Keppens

Overview for day 3

• Multi-D MHD: MHD wave anisotropies; ∇ · B = 0 for shock-capturing schemes

• Demonstrative applications: transmagnetosonic winds, CME initiation, sun-to-earth modeling (and beyond), astrophysical jets

• Advanced topics: non-ideal MHD, Adaptive Mesh Refinement, relativistic MHDcomputations, Outlook

Page 112: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-2

Multi-D MHD and ∇ · B = 0

• multi-D MHD and MHD wave anisotropies

• dimensionality > 1 → non-trivial ∇ · B = 0 constraint

⇒ even if satisfied exactly t = 0: can numerically generate ∇ · B 6= 0

⇒ due to non-linearities of shock-capturing numerical methods

⇒ ∇ · B 6= 0 build-up ⇒ numerical instability (+ physical nonsense)

⇒ need to control this somehow

• strategies for ∇ · B = 0

Page 113: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-3

MHD wave signals

• locally (δ-function) perturb homogeneous magnetized plasma at rest

⇒ take γ = 5/3, ρ = 1, pth = 0.6 and B = 0.9ex (c = 1, b = 0.9)

⇒ simulate on (x, y) ∈ [−0.5, 0.5]2 in 2.5D MHD (include vz, Bz)

⇒ perturb at origin with δρ = 0.1, δvz = 0.01 and δpth = 0.06

⇒ MHD counterpart of ‘throwing a stone in a puddle’

⇒ entropy, total pressure, Bz at finite time

Page 114: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-4

• 7 waves: return in Friedrichs diagram

⇒ group velocity for wave package (and energy flow direction)

vgr =∂ω(k)

∂k=∂ω

∂kxex +

∂ω

∂kyey +

∂ω

∂kzez

⇒ using wave frequency ω and wave vector k

• at origin: local entropy (density) disturbance remains (plasma at rest)

• slow magnetosonic wave signals: cusp-like features: anisotropic!

• fast magnetosonic waves: ‘like’ sound waves (would be spherical signal)

⇒ velocity c =√

γp/ρ along B [generally max(c, b = B/√ρ)]

⇒ faster in ⊥ direction√b2 + c2

• Alfven waves: extreme anisotropy: point-like along B

⇒ sample magnetic field line at Alfven speed b

• note different polarizations: s only shows entropy wave, p shows slow and fast, Alfvenonly visible in vz, Bz

Page 115: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-5

∇ · B = 0

• physically: only exact solenoidal field is allowed

⇒ numerics: discretization error + machine precision unavoidable

• conservative form of momentum equation:

⇒ uses divergence of Maxwell stress tensor

⇒ equal to Lorentz force IF ∇ · B = 0 since

∇ ·(

IB2

2− BB

)

= −(∇× B) × B− B (∇ · B)

⇒ force orthogonal to B if solenoidal field

• would like discrete ∇ · B = 0, orthogonal Lorentz force, conservative form

⇒ difficult to satisfy all demands simultaneously

⇒ but possible, cfr. Toth JCP 182, 346 (2002)!!!

Page 116: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-6

Vector potential

• rewrite MHD equations in terms of vector potential A defined from

B = ∇× A

⇒ keeps ∇ · B = 0 exactly analytically

⇒ still need discrete ∇ · (∇× .) = 0

⇒ increases order of occuring spatial derivatives (accuracy loss)

⇒ Boundary Conditions on A not always straightforward

⇒ ‘conflicts’ with characteristic based solvers using B

Page 117: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-7

Projection scheme

• sufficient to control numerical value of ∇ · B⇒ enforce constraint in particular discretization to given accuracy

• Take corrective action by ‘projection scheme’ [Brackbill & Barnes 1980]

⇒ scheme yields B∗ with ∇ · B∗ 6= 0

⇒ correct to solenoidal B = B∗ −∇φ, solve

∇2φ = ∇ · B∗

⇒ Poisson eqn., solve by (iterative) scheme up to desired accuracy

⇒ projects B∗ on subspace of zero divergence solutions

⇒ no change in current density

• accuracy: does not need to be machine precision!

Page 118: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-8

• does not violate conservation properties

⇒ indirectly affects local thermal/magnetic balance in total energy

• same ideas in use for incompressible HD (where ∇ · v = 0)

• uniform Cartesian grids: projection scheme makes smallest possible correction toremove divergence of B provided by base scheme

⇒ given B∗, find closest field B from minimizing

‖ B − B∗ ‖2

⇒ under solenoidal constraint ∇ · B = 0

• does not affect order of accuracy of base scheme

⇒ Toth (2000): scheme is consistent for weak solutions

• Can use projection to eliminate finite divergence of discrete initial B

Page 119: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-9

Powell source terms

• solution ok up to truncation error: same goes for ∇ · B = 0

⇒ maintaining constraint to truncation error is sufficient

• system of 8 PDEs for ideal MHD equations in conservation form

⇒ not Galilean invariant

⇒ 8 × 8 system has eigenvalues zero, and v, v ± cs, v ± b, v ± cf

⇒ spurious eigenvalue which conflicts with constraint ∇ · B = 0

⇒ carries a jump in normal (to cell edge) component of B

• restore Galilean invariance by writing system as

Ut + (∇ · F) = S

⇒ sources S = (Sρ,Sρv, Se,SB) proportional to ∇ · B

Page 120: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-10

• Powell suggests following sources:

0−(∇ · B)B

−(∇ · B)B · v−(∇ · B)v

⇒ restore Galilean invariance, replace zero with extra v eigenvalue

⇒ introduces ‘8-wave’ approximate Riemann solver

• induction equation with source term

∂B

∂t+ ∇ · (vB − Bv) = −v(∇ · B)

⇒ equivalent to evolution equation for ∇ · B given by

∂∇ · B∂t

+ ∇ · (v(∇ · B)) = 0

⇒ passively convected scalar field ∇ · B/ρ

Page 121: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-11

• idea: numerical divergence errors get advected away

⇒ potential problems at internal flow stagnation points

• sources destroy conservation form

⇒ potential violation of Rankine Hugoniot across shock

⇒ case with incorrect jumps across discontinuities in Toth (2000)

⇒ usually does work correctly though!

• can be used with non-Riemann solver based method (e.g TVDLF)

• restore conservation of momentum/energy by only taking SB along

⇒ arguments given by Janhunen (2000) and Dellar (2001)

⇒ Lorentz (instead of Galilean) invariance makes momentum and energy equa-tions conservative

Page 122: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-12

Constrained Transport

• enforce ∇ · B = 0 in one particular discretization

⇒ kept zero to machine precision in one discretization

⇒ must have initial field with zero ∇ · B in chosen discretization

⇒ must have BCs compatible with zero ∇ · B in chosen discretization

• typical CT approaches employ staggered magnetic field representation

⇒ with ρ, H at cell center, take B at cell edges

⇒ fluxes in induction eqn at cell vertex (corners), ∇ · B cell centered

• Toth (2000): CT recast in FV sense: no staggering needed!

⇒ VAC: 5 different variants of CT/central difference type schemes

⇒ Toth (2000): 2 new finite volume CD type schemes!

Page 123: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-13

• Evans & Hawley CT: magnetic field components on cell interfaces

⇒ 2D: electric field Ez ≡ Ω = −(v × B)z at cell corners

Ω

Ωb

b .bb

Ω

x

by

x

y

Ω

⇒ update cell interface B = (Bx, By) from induction equation as

Bx,n+1j+1/2,k − Bx,n

j+1/2,k

∆t= −Ωj+1/2,k+1/2 − Ωj+1/2,k−1/2

∆y

By,n+1j,k+1/2 − By,n

j,k+1/2

∆t= +

Ωj+1/2,k+1/2 − Ωj−1/2,k+1/2

∆x

Page 124: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-14

• then ∇ · Bn+1 = 0 if ∇ · Bn = 0 with

(∇ · B)j,k =Bxj+1/2,k −Bx

j−1/2,k

∆x+Byj,k+1/2 −By

j,k−1/2

∆y

⇒ up to accuracy of round-off errors (machine precision)

• note: CT does not ensure ∇ · B = 0 in any other discretization!

⇒ O(1) errors at discontinuities for other discretization . . .

Page 125: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-15

• variations of CT idea without staggering

⇒ use spatio-temporal interpolations from cell-centered v and B

by

by

bx

bx

Ω

ΩΩ

Bx

By

Ω

v B v B

v Bv B

BBx

v B B xv B

v BxByv Bx

x

y

Bx

⇒ Field interpolated CT (spatial + temporal interpolation) versus Field interpolatedCentral Difference (latter uses only temporal interpolation)

⇒ can both be written as FV conservative update on cell-centered B

⇒ involves averaged fluxes for B update with certain stencil

Page 126: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-16

Diffusive treatment

• add diffusion type source terms to energy/induction equation

⇒ diffuse ∇ · B errors at maximal rate

⇒ maximal rate = allowed by unchanged CFL condition

⇒ for parabolic equation

∂B

∂t= ηD∇2B get CFL constraint ∆t < ∆x2/ηD

⇒ take ηD ∝ ∆x2 and use sources

00

B · Cd∆x2∇(∇ · B)

Cd∆x2∇(∇ · B)

⇒ diffusion coefficient Cd ≈ 0.2

Page 127: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-17

• source terms destroy strict conservation (like Powell)

⇒ could retain source term for induction equation alone

⇒ then keep energy conservation

• ‘parabolic’ approach: errors are damped at maximal rate

⇒ can be adapted to curvilinear grids

• ‘hyperbolic’ divergence cleaning strategy: Dedner et al. (2002)

⇒ ∇ ·B transported at maximal admissable speed AND damped simultaneously

• source term strategies easy for grid-adaptive simulations

Page 128: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-18

Numerical tests

• taken from Toth (2000): 7 strategies on 9 2D MHD tests

⇒ fair comparison: same (approximate Riemann solver) base scheme

⇒ ‘best’ strategy is projection/field-CD/flux-CT scheme

⇒ need a strategy for ∇ · B, usually does not matter too much which

Page 129: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-19

• 2D rotated shock tube: 1D Riemann problem in 2D rotated over angle

⇒ must maintain constant B‖ (parallel to shock tube direction)

⇒ RH violation by Powell source terms

Page 130: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-20

• Orszag-Tang (1979) MHD vortex simulation (Picone & Dahlburg 1991)

⇒ 2D domain [0, 2π]2 with double periodic sides

⇒ t = 0 uniform ρ = 25/9, p = 5/3, velocity vortex = (− sin y, sin x)

⇒ magnetic islands 6= horizontal wavelength B = (− sin y, sin 2x)

⇒ with γ = 5/3: Mach 1 flow conditions

⇒ mimics evolution to compressible (supersonic) MHD turbulence

Page 131: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-21

• Orszag-Tang vortex problem, temperature at t = 3.14

Page 132: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-22

Some references for ∇ · B

• G. Toth, J. Comp. Phys. 161, 605 (2000)

• K.G. Powell et al., J. Comp. Phys. 154, 284 (1999)

• P.J. Dellar, J. Comp. Phys. 172, 392 (2001)

• P. Janhunen, J. Comp. Phys. 160, 649 (2000)

• G. Toth, J. Comp. Phys. 182, 346 (2002)

• J.U. Brackbill, D.C. Barnes, J. Comp. Phys. 35, 426 (1980)

• A. Dedner et al., J. Comp. Phys. 175, 645 (2002)

• W. Dai, P.R. Woodward, Astrophysical Journal 494, 317 (1998)

• C.R. Evans, J.F. Hawley, Astrophysical Journal 332, 659 (1988)

Page 133: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-23

Parker wind solution:

• Solar Coronal plasma at 106 K, density drops for increasing r

– Pressure gradient drives continuous outflow: solar wind

– Predicted by Parker in 1958 , later observed by satellites

• Model with hydrodynamic equations, spherical symmetry:

– Look for stationary solutions ∂/∂t = 0

– Assume isothermal corona (fixed temperature T ), include gravity:

d

dr(r2ρv) = 0 ⇒ r2ρv = const

ρvdv

dr+ v2

th

dr+GM⊙

ρ

r2= 0

– uses constant isothermal sound speed p/ρ ≡ v2th

Page 134: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-24

• Scale v ≡ v/vth (Mach number) and r ≡ r/R⊙ to get

F (v, r) ≡ 12v2 − ln v − 2 ln (

r

rc) − 2

rcr

+ 32

= C , rc ≡ 12

GM⊙R⊙v2

th

– Implicit relation determining v(r)

– unique solution with transonic acceleration

• when changed from isothermal to polytropic p ∝ ργ

⇒ numerical approach needed: critical point location not known a priori

Page 135: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-25

Transmagnetosonic wind solution:

• stationary magnetizedwind solution

⇒ 1.5D MagnetoHydroDynamic equations with ∂t = 0

⇒ take spherical (r, θ, ϕ) coordinates, axisymmetry ∂ϕ = 0

• restrict solution to equatorial plane , but include star rotation Ω

⇒ θ = π/2 and vθ = 0 = Bθ

⇒ assume polytropic relation p ∝ ργ (replaces energy eqn)

• solve for vr(r), vϕ(r), Br(r), Bϕ(r) and ρ(r)

⇒ undertaken analytically by Weber & Davis (ApJ, 148, 1967, 217)

Page 136: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-26

Numerical simulations of Weber-Davis winds

• time-evolve 1.5D MHD equations till numerical steady state is obtained

⇒ use as initial guess: polytropic, rotating Parker solution, set Bϕ = 0

⇒ fix Br to its known analytic 1/r2 dependence

⇒ relax to obtain steady-state ρ(r), vr(r), vϕ(r) and Bϕ(r)

• solar values taken at reference radius r0 = 1.25R⊙

• BCs in numerical calculation are

⇒ zero gradient at supermagnetosonic end

⇒ at r = 1 fix ρ = 1 (p = 1/γ) and fix initial gradient for mr and Bϕ

⇒ base mϕ = ρvϕ from ensuring vϕ−Ωr0vr

=Bϕ

Br

⇒ v and B parallelism in corotating frame ensured at base

Page 137: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-27

Numerical transmagnetosonic winds

• steady state plotted as slow, Alfven and fast Mach number

⇒ three transonic points at rs = 7.4, rA = 29.2 and rf = 31.2

⇒ sonic transition roughly at rs

⇒ note how vϕ ≃ rΩ up to rA: ‘effective corotation’ up to Alfven point

⇒ A&A, 343, 1999, 251

Page 138: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-28

Verifying numerical winds

• Weber-Davis wind: characterized by 5 constants of motion

⇒ constant mass flux, [∇× (v × B)]ϕ = 0, constant angular momentum flux L,constant energy E per unit mass, constant r2Br (trivial)

Page 139: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-29

Multi-D MHD winds• Generalization to multi-D, include closed-

open field

• Solve for numerical ideal MHD steady-state:

– MHD: 3 Mach numbers, critical transi-tions as hourglass curves,

– Axisymmetric magnetized wind witha ‘wind’ and a ‘dead’ zone.

– color: Bϕ due to solar (differential) rota-tion

[simulation by Keppens & Goedbloed,

Ap. J. 530, 1036 (2000) , using VAC]

Page 140: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-30

Multi-D MHD winds and stellar spindown

• rate of change of solar AM = - AM flux

⇒ for 2.5D axisymmetric wind

dJzdt

= −2π

∫ π

0

r3 sin2 θ(ρvrvφ−BrBφ)dθ

⇒ AM flux: partly due to advection,partly due to magnetic tension

• dead zone: total flux one order of mag-nitude smaller than Weber–Davis esti-mate!

• for sun: AM loss basically magnetic

100 101

Ω/Ωsun

1030

1031

1032

1033

1034

1035

-dJ/

dt[d

yne

cm]

linear Dynamo, Weber-Davissaturated Dynamo (Ωsat=10), Weber-Davissaturated Dynamo (Ωsat=5), Weber-Davislinear Dynamo, 2.5D wind+dead zone

Page 141: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-31

Corona: eclipse images

• At solar max: coronal helmet streamers.

• 3D structure can be ‘predicted’ from MHDmodels.

⇒ Mikic et al, PoP 6, 2217, 1999

Page 142: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-32

Space weather modeling

• Modern MHD simulations:

– trigger (flux emergence, cancellation, shearing) + evolution of CMEs

– Mikic et al., SAIC San Diego: CME by flux cancellation (Mikic-flx2d.anim.qt)

• Jacobs, Poedts et al. (VAC): 3D CME evolution in background solar wind

Virtual coronagraph view

Page 143: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-33

• Compute impact effect on Earth’s magnetosphere faster than real time

– computing challenge (few days), significant range of scales

– BATS-R-US code (block-adaptive tree solver Roe upwind scheme)

– Gombosi, Toth et al., Univ. of Michigan:Centre for Space Environment movie (Toth-CSEM2004-Zoom.mov)

• http://csem.engin.umich.edu/

– Center Space Environment Modeling: coupled simulations!

• Space weather affects all planets! Near-alignment of Earth, Jupiter, Saturn (2000)

⇒ Series of CMEs (seen by SOHO) leading to interplanetary shock (overtakingand merging shocks), detected as auroral storms on Earth (Polar orbiter), observedin Jovian radio activity as measured by Cassini (fly-by on its way to Saturn), seen byHubble as auroral activity on Saturn.

⇒ MHD model (using VAC code) used to simulate time evolution.

Page 144: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-34

• First observation of CME event traced all the way from Sun to S aturnPrange et al., Nature, 432(4), 78 (2004). Right: comparison with VAC simulations,

with input from WIND spacecraft.

Sun (SOHO)LASCO & EIT

Earth (POLAR)aurora image

Jupiter (Casini)radio signal

Saturn (HST)aurora image

Page 145: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-35

Launching astrophysical jets

• Forming star environment (HH 30 in Taurus):

– optical HST image (Burrows et al. 1996)

– edge-on flaring disk,reflection nebula, jets,

– collimated emission-line jets from center,

– jet-knots move at afew hundred km/s.

Page 146: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-36

• Link between accretion disk and jet?

– observed proportionality jet/disk luminosity.

• B in accretion, angular momentum transport?

• Jet variability (knots):

– internal or disk instabilities?

– non-straight: precess or deformed helically?

• Jet collimation: magnetically?

• Jet launch: how divert order 10 % of accreting mass from inner (hottest) disk regionsinto outflow?

• To be studied in MHD framework!

Page 147: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-37

• Axially symmetric MHD simulations with VAC by Casse & Keppens, ApJ 2002–2004:

– disk with initial vertical B: self-consistently forms collimated jet (launch.qt)

– 15 % of accreted mass persistently ejected.

T=20.0T=8.0T=0.0

Page 148: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-38

• Jet ejection mechanism: axial (vertical) force analysis

⇒ thermal pressure gradient lifts matter out of disk at surface

• magnetic torque (J × B)θ changes sign at disk surface:

⇒ brakes matter in disk, gravity wins from centrifugal: accretion

⇒ spins up jet: magnetocentrifugal acceleration of jet matter

⇒ AM is transported by magnetic field

⇒ AM flux purely parallel to poloidal flow vp/Bp configuration

Page 149: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-39

• Mechanism for launch:

– magnetic torque brakes disk materialazimuthally and spins up jet matter

– mass source for jet: disk

– B collimates

– B accelerates

• Launching jets (MAES-AXI.qt)

Page 150: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-40

Resistive MHD

• spatio-temporal resistivity profile η(x, t) introduces

⇒ Ohmic heating term in energy equation Se = ∇ · (B × ηJ)

⇒ diffusion term in induction equation SB = −∇× (ηJ)

⇒ uniform resistivity: η(J2 + B · ∇2B

)and η∇2B

• ideal (η = 0) versus resistive MHD

⇒ topological constraint on B alleviated

⇒ field lines can reconnect in regions of strong currents

Page 151: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-41

Petschek reconnection

• Petschek model (1964) for fast magnetic field annihilation

⇒ two plasma regions containing oppositely directed field lines

⇒ realize steady-state with X-type magnetic neutral point

⇒ stationary slow shocks where B bends towards shock front normal

• at X-point: flow controlled by diffusion

• within region bounded by slow shocks: purely Bx, ‘constant’ ρ

⇒ shock front half-width δ(y) = ρe

ρi

vx,e

VA,e| y | (external/internal)

⇒ shock fronts have constant opening angle (away from neutral point)

⇒ fluid moves to boundary layer and is ejected along it

Page 152: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-42

• stationary configurationδ2

y

x

⇒ use symmetry to simulate corner region [0, 1] × [0, 4] only

Page 153: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-43

• solve resistive MHD equations incorporating resistivity profile

η(x, y) = η0 exp[−(x/lx)

2 − (y/ly)2]

⇒ anomalous η centered on origin η0 = 0.0001, lx = 0.05, ly = 0.1

• initial field configuration B = (0, tanh(x/L))

⇒ initial current sheet width L = 0.1

⇒ γ = 5/3, p(x) = 1.25 −B2y(x)/2 and ρ(x) = 2p(x)/β1

⇒ isothermal initial condition with β1 = β(x = 1) = 1.5

• fix Alfven Mach number of inflow at x = 1: vx(x = 1) = −0.04

⇒ evolves self-consistently to Petschek reconnection config uration

• VAC test for implicit scheme: Toth et al, A&A, 332, 1159 (1998)

Page 154: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-44

• field lines, velocity field, current density evolution

⇒ checks with theoretical opening angle in steady-state!

Page 155: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-45

Need for grid-adaptivity in MHD

• Shock tube: pure 1D MHD on x ∈ [−1, 1.5], γ = 5/3,

x < 0 : (ρ, vx, vy, vz, p, Bx, By, Bz) = (1, 0, 0, 0, 1, 1, 1, 0) ,x > 0 : = (0.2, 0, 0, 0, 0.2, 1, cos 3, sin 3) .

⇒ shock-capturing schemes: pseudo-converge to wrong solution!

⇒ Torrilhon (2003): need several 10000 grid points

• with adaptive grid: easily affordable, t = 0.4 solution at > 100000 cells

Page 156: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-46

• AMRVAC: Keppens et al, CPC 153, 317 (2003)

⇒ any-D implementation of Adaptive Mesh Refinement

⇒ advection, hydro, MHD, relativistic (M)HD modules

• diagonal ‘VAC’ advection: 2 approaches to nested grids

⇒ patches (left) versus hybrid block-based (right)

⇒ van der Holst & Keppens, JCP 2007, in press

Page 157: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-47

Richtmeyer-Meshkov instability

• 2D planar configuration between reflective walls

⇒ Mach 10 shock impinging on density incline

⇒ HD simulation , effective resolution 7680 × 1536

Page 158: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-48

• Shock accelerates in lower density medium

⇒ relative acceleration across discontinuity causes RM instability

• forward bent shock front reflects off top wall

⇒ Mach reflection with triple point, Mach stem, jet formation

⇒ in turn Kelvin-Helmholtz unstable at slip line and jet boundary

Page 159: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-49

Time-stepping on AMR hierarchies

• hypothetical sequence of 3 timesteps

⇒ complicated by advance–update–refineoperations

timestep

1 2 3 4level

t

t

t

t

1n+3

1

n+2

n+1

1

1n

• shock problems: need conservative scheme across grid levels

⇒ involves flux fix adjacent to coarse-fine boundaries

⇒ refine evaluates/adjusts grid hierarchy relative to arbitrary level

Page 160: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-50

Handling curvilinear coordinates

• need restriction (fine to coarse) & prolongation (coarse to fine) formulae

⇒ must be 2nd order for smooth solutions

⇒ must be conservative: ρij∆Vij =∑

m

n ρmn∆Vmn

• general prolongation strategy for Curvilinear coordinates

⇒ when Jacobian seperable: J = J(x1, x2) = J1(x1)J2(x2) in 2D

⇒ introduce new coordinates dyi = Ji(xi)dxi

⇒ arithmetic xi center divides, Taylor expand about yi arithmethic center

Page 161: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-51

Curvilinear coordinates

• end result for computing fine cell center values

ρi+1/4j+1/4 = ρij +1

2∆1ρij

∆Vi−1/4j+1/4

∆Vi−1/4j+1/4 + ∆Vi+1/4j+1/4

+1

2∆2ρij

∆Vi+1/4j−1/4

∆Vi+1/4j−1/4 + ∆Vi+1/4j+1/4

⇒ involves volumes & (limited) slopes per direction

⇒ applicable to polar, cylindrical, spherical grids and generalizations

• planar HD shock tube solved in polar coordinates

Page 162: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-52

Relativistic MHD

• special relativistic magnetofluids → flat Minkowski space-time

⇒ particle, tensorial energy-momentum conservation, Maxwell

⇒ full Maxwell, including displacement current!

• ideal magnetohydrodynamic: vanishing electric field in comoving frame

⇒ fix Lorentz frame, use 1 + 3 split (time/space), obtain

∂tU + ∂iFi = 0

⇒ conserved variables U = (D,S, τ,B)

• D = rest mass density ρ × Γ

⇒ lab frame density DΓ

⇒ Lorentz factor Γ =(1 − v2

)−1/2with v spatial 3-velocity.

Page 163: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-53

Special relativistic MHD

• primitive variables (ρ,v, p,B) in conservation laws:

∂tD + ∂i(Dvi) = 0,

∂t((ξ + B2)vj − (v · B)Bj

)

+∂i

(

(ξ +B2)vjvi − BjBi

Γ2− (v · B)(Bjvi + vjBi) + δijptot

)

= 0,

∂tτ + ∂i(τvi + ptotv

i − (v · B)Bi)

= 0,

∂tBj + ∂i

(Bjvi − vjBi

)= 0, , ∂iB

i = 0.

• total pressure ptot = p + (v·B)2

2 + B2

2Γ2

• energy density τ = ξ + B2

2+ 1

2(v2B2 − (v · B)2) − p−D

• enthalphy related quantity ξ = Γ2(

ρ + γpγ−1

)

≡ Γ2w

Page 164: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-54

Riemann problems: RMHD

• Generic Alfven test Giacomazzo & Rezzolla (J.Fl.Mech., 562, 223, 2006)

⇒ test containing all 7 wave types: FR, AD, SS, CD, SS, AD, FS

⇒ solution shown at t = 1.5, compares well with exact solution

⇒ all waves resolved with 7 level AMR run (effective 12800 points)

Page 165: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-55

• relativistic analogue of 2D MHD Orszag-Tang test

• use diffusive monopole treatment, AMR res. 2560 × 2560, 7 levels

⇒ double periodic, supersonic relativistic (Γ = 7) vortex rotation

⇒ initial field configuration: double island structure

⇒ current sheets form, shock interactions, reconnections

Page 166: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-56

Outlook

• multi-fluid MHD in space weather modeling, young star environments

• relativistic MHD jets (also for Gamma Ray Bursts)

• Adaptive Mesh and Algorithm Refinement (AMAR)

⇒ Garcia et al., JCP 154, 134 (1999)

⇒ coupling different physical descriptions across grid hierarchies

⇒ particle treatments (direct Monte Carlo) with compressible NS

⇒ future: coupling kinetic modeling with MHD?

• And what about Radiative transport + MHD

⇒ MuRAM (Utrecht: Vogler), CO5BOLD (Freytag, Wedemeyer-Bhom et al,), . . .

⇒ efforts ongoing at Oslo (Hansteen), Denmark (Nordlund, Galsgaard), . . .

⇒ going from grey towards time-dependent NLTE modeling

⇒ typically combined with centered difference schemes for MHD

⇒ very specialized topic, still lot to research!

Page 167: folk.uio.nofolk.uio.no/matsc/school-07/keppens/slides_Keppens.pdf · Numerical Magnetohydrodynamics Oslo07-2 Numerical Magnetohydrodynamics ☞ Overview for day 1 • Numerical MHD

Numerical Magnetohydrodynamics Oslo07-57

Acknowledgements

• this course benefitted from many fruitful collaborations with

H. Baty, N. Bessolaz, F. Casse, J.P. Goedbloed, Z. Meliani, S. Poedts, G. Toth, B.van der Holst

• thank you for your interest!

• Further info:

⇒ http://perswww.kuleuven.be/∼u0016541

⇒ Comments, critiques, suggestions: Rony.Keppens AT wis.kuleuven.be