Presentation is loading. Please wait.

Presentation is loading. Please wait.

Magnetic Fields and MHD 17 February 2003 (snow permitting) Astronomy G9001 - Spring 2003 Prof. Mordecai-Mark Mac Low.

Similar presentations

Presentation on theme: "Magnetic Fields and MHD 17 February 2003 (snow permitting) Astronomy G9001 - Spring 2003 Prof. Mordecai-Mark Mac Low."— Presentation transcript:

1 Magnetic Fields and MHD 17 February 2003 (snow permitting) Astronomy G9001 - Spring 2003 Prof. Mordecai-Mark Mac Low

2 MHD Approximation Maxwell’s Equations in a gas Mestel, Stellar Magnetism The displacement current vanishes if electrons & ions move together This happens when thermal fluctuations can’t separate electrons, ions. Balance TE to electric PE (Debye length)

3 Generalized Ohm’s Law Hall term so long as ions are not very massive (eg dust grains) we may neglect the Hall term. If σ large, then E+(v/c  B) = 0

4 Induction Equation From Maxwell’s equations,

5 Lorentz Force Ampère’s law, in absence of displacement current: The Lorentz force density: so Lorentz force Remember vector identity: magnetic tension magnetic pressure net force always acts perpendicular to B

6 Magnetic Resistivity If σ finite, then we can use Ohm’s law and Maxwell’s equations: magnetic diffusivity λ Magnetic Reynolds #:

7 Flux Conservation If σ  , then magnetic flux through any parcel of gas remains constant: Gas remains tied to field lines C dS

8 Flux Conservation Consequences Flux cannot be created or destroyed without resistive effects (reconnection) So where did Galactic field come from? Flux carried with gas during collapse How come stars do not have same mass to flux ratio as interstellar gas?

9 MHD Waves Linearize MHD equations: Jackson, Ch. 10 Classical Electrodynamics



12 MHD waves Robert McPherron, UCLA

13 MHD Shocks If B  v then shock jump conditions are v1v1 v2v2 B1B1 B2B2 Mestel, Stellar Magnetism continuity of flux transport

14 MHD shock perpendicular shock:

15 Oblique shocks Field at arbitrary angle to shock normal Parallel field must be conserved Momentum conservation in frame w/ –no magnetic energy flow across shock Momentum conservation then gives

16 Oblique Shocks Three solutions (e.g. Mestel, p. 50 ): v1v1 slow shock fast shock intermediate (Alfvèn) shock

17 Partially Neutral Gas Only ions feel Lorentz force from B field Ions, neutrals couple through collisions, adding symmetric terms to momentum eqn

18 J-Shocks vs. C-Shocks Classical shock is a discontinuous jump or J-shock If v Ai > v s >c sn then ions see continuous compression by magnetic precursor Neutrals dragged by ions into continuous compression: C- shock (Mullan 1971, Draine 1980) Smith & Mac Low 1997


20 Nonlinear Development Mac Low & Smith 1997 time Log ρ

21 Current Sheet Formation Brandenburg & Zweibel (1994, 1995) showed that nonlinear nature of field diffusion from ion-neutral drift produces sharp structures. Analogous to shock formation in strong sound waves: magnetic pressure higher in peaks, so waves spread and steepen. Zweibel & Brandenburg (1997) emphasized that current sheets form, driving reconnection. Seems to explain numerical results well.

22 Next week’s assignments Read Slavin & Cox (1993, ApJ, 417, 187) on the filling factor of hot gas with non- thermal pressures included Read Stone & Norman (1992b, ApJS, 80, 791) -- the MHD ZEUS paper Complete the blast exercise

23 Parallelization Additional issues: –How to coordinate multiple processors –How to minimize communications Common types of parallel machines –shared memory, single program eg SGI Origin 2000, dual or quad proc PCs –multiple memory, multiple program eg Beowulf Linux clusters, Cray T3E, ASCI systems

24 Shared Memory Multiple processors share same memory Only one processor can access memory location at a time Synchronization by controlling who reads, writes shared memory U of Minn Supercomputing Inst.

25 Shared Memory Advantages –Easy for user –Speed of memory access Disadvantages –Memory bandwidth limited. –Increase of processors without increase of bandwidth will cause severe bottlenecks

26 Distributed Memory Multiple processors with private memory Data shared across network User responsible for synchronization U of Minn Supercomputing Inst.

27 Distributed Memory Advantages –Memory scalable with number of processors. More processors, more memory. –Each processor can read its own memory quickly Disadvantages –Difficult to map data structure to memory organization –User responsible for sending and receiving data among processors To minimize overhead, data should be transferred early and in large chunks.

28 Methods Shared memory –data parallel –loop level parallelization Implementation –OpenMP –Fortran90 –High Performance Fortran (HPF) Examples –ZEUS-3D Distributed memory –block parallel –tiled grids Implementation –Message Passing Interface (MPI) –Parallel Virtual Machine (PVM) Examples –ZEUS-MP –Flashcode –GADGET

29 OpenMP Designate inner loops that can be distributed across processors with DOACROSS command. Dependencies between loop instances prevent parallelization Execution of each loop usually depends on values from neighboring parts of grid. ZEUS-3D only parallelizes out to 8-10 processors with OpenMP

30 Cache Optimization Modern processors retrieve 64 bytes or more at a time from main memory –However it takes hundreds of cycles Cache is small amount of very fast memory on microprocessor chip –Retrievals from cache take only a few cycles. If successive operations can work on cached data, speed much higher –Fastest changing array index should be inner loop, even if code rearrangement required

31 Parallel ZEUS-3D To run ZEUS-3D in parallel, set the variable iutask = 1 in setup block, recompile. –inserts DOACROSS directives –compiles with parallel flags turned on if OS supports them. Set the number of processors for the job (usually with an environment variable) Run is otherwise similar to serial.

32 Use of IDL Quick and dirty movies for i=1,30 do begin & $ a=sin(findgen(10000.)) & $ hdfrd,f=’zhd_’+string(i,form=’(i3.3)’)+’aa’,d=d,x=x & $ plot,x,d[4].dat & end Scaling, autoscaling, logscaling 2D arrays tvscl,alog(d) tv,bytscl(d,max=dmax,min=dmin) Array manipulation, resizing tvscl,rebin(d,nx,ny,/s) ; nx, ny multiple tvscl,rebin(reform(d[j,*,*]),nx,ny,/s) pause

33 More IDL plots, contours plot,x,d[i,*,k],xtitle=’Title’,psym=-3 oplot,x,d[i+10,*,k] contour,reform(d[i,*,*]),nlev=10 slicer3D dp = ptr_new(alog10(d)) slicer3D,dp Subroutines, functions

Download ppt "Magnetic Fields and MHD 17 February 2003 (snow permitting) Astronomy G9001 - Spring 2003 Prof. Mordecai-Mark Mac Low."

Similar presentations

Ads by Google