Searching for the solar dynamo in a computer
Dhrubaditya Mitra NORDITA
16th January 2011 Bangalore
Collaborators
● Reza Tavakol, QMUL.● Axel Brandenburg, NORDITA.● Petri Kapyla, Helsinki Observatory.● Maarit Mantere, Helsinki Observatory
Solar magnetic field
Solar dynamo: important features.
● Oscillations and polarity reversal, 22 year solar cycle.
● Equatorward migration of sunspots. ● At the solar surface the azimuthally
averaged radial field is rather weak (about 1G) compared to the peak magnetic field in sunspots (about 2 kG).
Turbulence in the sun.
● Observation from MDI (Schou et al 1998)
Convection zone
Radiative core
● Helioseismology
● Large scale shear or differential rotation.
● Convection and rotation.
Tachocline
Dream of dynamo simulations
● A model which incorporates the essential ingredients (MHD, rotation, convection, differential rotation).
● Shows large-scale magnetic field. ● The large-scale magnetic field shows
spatio-temporal behaviour similar to the Sun.
● And the dynamics persists even for very high magnetic Reynolds number.
Compressible Magnetohydrodynamics (MHD)
D UDt =−∇ p
J X B Fvisc f
∂ ∂ t =−∇⋅
U
J = ∇ X B∂ B∂ t = ∇ X
U X B− J
Advective derivative Lorentz force
viscous force
Magnetic diffusivity
PencilPencilCodeCode
● Started in Sept. 2001 by Axel Brandenburg and Wolfgang Dobler
● High order (6th order in space, 3rd order in time)
● Cache & memory efficient● MPI, can run PacxMPI (across countries!)● Maintained/developed by ~40 people (SVN)● Automatic validation (over night or any
time)● Max resolution so far 10243 , 4096 procs
• Isotropic turbulence– MHD, passive scl, CR
• Stratified layers– Convection, radiation
• Shearing box– MRI, dust, interstellar– Self-gravity
• Sphere embedded in box
– Fully convective stars– geodynamo
• Other applications– Homochirality– Spherical coordinates
9
Pencil formulationPencil formulation
● In CRAY days: worked with full chunks f(nx,ny,nz,nvar)– Now, on SGI, nearly 100% cache misses
● Instead work with f(nx,nvar), i.e. one nx-pencil● No cache misses, negligible work space, just 2N
– Can keep all components of derivative tensors● Communication before sub-timestep● Then evaluate all derivatives, e.g. call curl(f,iA,B)
– Vector potential A=f(:,:,:,iAx:iAz), B=B(nx,3)
10
Switch modulesSwitch modules● magnetic or nomagnetic (e.g. just hydro)● hydro or nohydro (e.g. kinematic dynamo)● density or nodensity (burgulence)● entropy or noentropy (e.g. isothermal)● radiation or noradiation (solar convection, discs)● dustvelocity or nodustvelocity (planetesimals)● Coagulation, reaction equations● Chemistry (reaction-diffusion-advection equations)
Other physics modules: MHD, radiation, partial ionization, chemical reactions, selfgravity
11
High-order schemesHigh-order schemes
● Alternative to spectral or compact schemes– Efficiently parallelized, no transpose necessary– No restriction on boundary conditions– Curvilinear coordinates possible (except for
singularities)● 6th order central differences in space● Non-conservative scheme
– Allows use of logarithmic density and entropy– Copes well with strong stratification and temperature
contrasts
12
Wavenumber characteristicsWavenumber characteristics
( )kx
dxkxdkeff sin/cos
−=
( ) xkkx
dxkxdk Nyeff δπ / ,cos/cos 222 =
−=
13
Evolution of code sizeEvolution of code size
User meetings:User meetings:2005 Copenhagen2006 Copenhagen2007 Stockholm2008 Leiden2009 Heidelberg2010 New York
14
Increase in # of auto testsIncrease in # of auto tests
15
Faster and bigger machinesFaster and bigger machines
From cartesian to spherical● The code is modular such that it uses only the
vector operator. ● To convert a code from cartesian to spherical
polar we need to recode the vector operators. ● We do this by co-variant derivatives.
Simulations of 3-d spherical dynamos● Inelastic Ash Code (Gilman, Glatzmaier, …,
Brun, Meisch, Browning)● Ash code: Finite-difference in radial direction,
spectral in other two. Simulations done in a spherical shell.
● Weakly compressible pencil code: Finite-difference in all the three directions. Simulations done in spherical wedge
● Ghizaru, Charbonneau and Smolarkiewicz, ApJ 2010.
Kapyla et al 2010
Kapyla et al 2010
Migration:
Results from other groups:
Kinetic helicity and differential rotation:
Beasts: ● Banana cells in convection (Meisch et al 2000).● Sea serpents (Kosovichev et al)
Summary ● Numerical simulation results are consistent with
the theory but neither the theory nor simulations describes the sun.
● Simulations are of course not in the right parameter range.
● Need for sub-grid scale modelling.● Resolving near-surface shear layer, in other
words MASSIVE RESOLUTION. ● Cartesian simulations of forced turbulence
shows large scale magnetic field.
Simulations with two signs of kinetic helicity.
● Consider simulations with two hemispheres with an external force which injects negative (positive) helicity in northern (southern) hemisphere.
● Rotation and stratification in the sun creates the neagtive (positive) kinetic helicity in the northern (southern) hemisphere.
● No differential rotation/shear● We observe large scale magnetic field
which shows fascinating dynamical behaviour.
Space-time diagram
DNSPFC
Mean-Field,PFC
DNS of north withtwo openboundaries
Frequencies of oscillations
Diamonds: DNS results, Asterices : Mean field Results. The frequency of oscillations essentially does not dependon magnetic Reynolds number.
Magnetic helicity in open domains
Caveats
● Although the frequency of oscillations are not resistively limited the initial growth phase is.
● The magnetic field in the mean-field simulations is catastrophically quenched, which may be alleviated by diffusive flux of magnetic helicity across the equator.
● Presumably simulations with stratification+rigid rotation will reproduce this results but at much higher resolutions.
Open questions
● In the absence of any other mechanism, magnetic helicity is transported across equator by diffusion. Can we define a diffusion coefficient and how does that compare with turbulent diffusivity ?
● Include convection+rigid rotation. ● How will differential-rotation change all these ?● How shall the picture change (if at all ) as we go
close to the pole ? (Mean field simulations suggest no change at all.)