Download presentation
Presentation is loading. Please wait.
Published byCharity Stafford Modified over 8 years ago
1
Pencil Code: multi-purpose and multi-user maintained Axel Brandenburg (Nordita, Stockholm) Wolfgang Dobler (Univ. Calgary) and now many more…. (...just google for Pencil Code)
2
Pencil Code Started in Sept. 2001 with Wolfgang Dobler High order (6 th order in space, 3 rd 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 1024 3, 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
3
3 Pencil 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)
4
4 Switch 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
5
5 High-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
6
6 (i) High-order spatial schemes Main advantage: low phase errors x x x x x x x x x Near boundaries: ghost zonesinterior points
7
7 Wavenumber characteristics
8
8 Higher order – less viscosity
9
9 Less viscosity – also in shocks
10
10 (ii) High-order temporal schemes Main advantage: low amplitude errors 3 rd order 2 nd order 1 st order 2N-RK3 scheme (Williamson 1980)
11
11 Shock tube test
12
12 Increase in # of auto tests
13
13 Evolution of code size User meetings: 2005 Copenhagen 2006 Copenhagen 2007 Stockholm 2008 Leiden 2009 Heidelberg
14
14 Pencil Code check-ins
15
15 Vector potential B=curlA, advantage: divB=0 J=curlB=curl(curlA) =curl2A Not a disadvantage: consider Alfven waves B-formulation A-formulation 2 nd der once is better than 1 st der twice!
16
16 Comparison of A and B methods
17
17 Faster and bigger machines
18
18 256 processor run at 1024 3
19
19 Hyperviscous, Smagorinsky, normal Inertial range unaffected by artificial diffusion Haugen & Brandenburg (PRE, astro-ph/0402301) height of bottleneck increased onset of bottleneck at same position
20
20 Online data reduction and visualization non-helically forced turbulence
21
21 Scalars on periphery of the box
22
22 MRI turbulence MRI = magnetorotational instability 256 3 w/o hypervisc. t = 600 = 20 orbits 512 3 w/o hypervisc. t = 60 = 2 orbits
23
23 Vorticity and Density See poster by Tobi Heinemann on density wave excitation!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.