Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma...

21
Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD, UK BOUT++ Workshop 15 th September 2014 Ben Dudson, YPI BOUT++ Workshop 2014 (1 of 21)

Transcript of Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma...

Page 1: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Introduction and overview of BOUT++

Ben Dudson

York Plasma Institute, Department of Physics,University of York, Heslington, York YO10 5DD, UK

BOUT++ Workshop

15th September 2014

Ben Dudson, YPI BOUT++ Workshop 2014 (1 of 21)

Page 2: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Tokamak edge simulations

Transition region betweenhot core and materialsurfaces

Understanding this region isvital to ITER operation,fusion reactor design andoptimisation

Complex nonlinear physics:plasma turbulence, neutrals,impurities, material surfaces

Complex geometry

Figure: ITER Organisation

0 50 100 150 200 250

0

50

100

150

200

250

Density [×1018m−3 ]

0.00

0.06

0.12

0.18

0.24

0.30

0.36

0.42

0.48

0.54

0.60

Figure: 2D BOUT++ edge turbulence simulation

Ben Dudson, YPI BOUT++ Workshop 2014 (2 of 21)

Page 3: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

BOUT++ overview

What BOUT++ is:

A toolbox for solving PDEs on parallel computers. Aims toreduce duplication of effort, and allow quick development andtesting of new models

A collection of examples and test cases

Focussed on flute-reduced plasma models in field-alignedcoordinate systems, though has more general capabilities

And is not:

A single plasma model or simulation

A general library of numerical methods. Other libraries likePETSc are available for that

Magic. Appropriate numerical methods depend on theproblem, and must be chosen intelligently by the user

Ben Dudson, YPI BOUT++ Workshop 2014 (3 of 21)

Page 4: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

BOUT++: A toolbox for plasma simulations

Collection of useful data types and associated routines.Occupies a middle ground between problem-specific codesand general libraries (e.g. PETSc, Trilinos, Overture,Chombo,...)

Has its origins in the BOUT code123. Re-written andre-designed (at least once) in C++45

Researchers can make use of a (mostly) well tested library ofsimulation code and input / output tools

Greatly reduces the time needed to develop a new simulation

1X.Q. Xu and R.H. Cohen, Contrib. Plasma Phys. 38, 158 (1998)2Xu, Umansky, Dudson, Snyder, CiCP 4, 949-979 (2008)3Umansky, Xu, Dudson et al. Comp. Phys. Comm. 180, 887-903 (2008)4Dudson, Umansky, Xu et al. Comp. Phys. Comm 180, 1467 (2009)5Dudson et al. to appear J. Plasma Phys. (2014).

Preprint: http://arxiv.org/abs/1405.7905Ben Dudson, YPI BOUT++ Workshop 2014 (4 of 21)

Page 5: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

BOUT++ key features

Finite difference initial value code in 3D

Implicit or explicit time integration methods

Coordinate system set in metric tensor components

Handles topology of multiple X-points

Written in C++, quite modular design

Open source (LGPL), publicly available

To get a copy:git clone https://github.com/boutproject/BOUT-dev.git

Ben Dudson, YPI BOUT++ Workshop 2014 (5 of 21)

Page 6: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Growing BOUT++ community

Open source project, available on github

http://boutproject.github.io

Users in labs and universities in UK, US, China, India, Japan,S.Korea, Denmark,...

Ben Dudson, YPI BOUT++ Workshop 2014 (6 of 21)

Page 7: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

BOUT++ models

A number of fluid and gyrofluid models have been developed usingBOUT++ and applied mainly to ELM simulations

Fluid Gyrofluid Physics3-field 1 + 0 Peeling-ballooning mode

(ω,P,A||) (niG , ne ,A||)4-field 2 + 0 + acoustic mode

(ω,P,A||,V||) (niG , ne ,A||,V||)5-field + Thermal transport

(ω,P,A||,Ti ,Te) no acoustic wave6-field 3 + 1 + additional drift wave

(ω,P,A||,V||,Ti ,Te) (niG , ne ,A||,V||, instabilitiesTi⊥,Ti||,Te)

Snyder-Hammett model

Ben Dudson, YPI BOUT++ Workshop 2014 (7 of 21)

Page 8: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

BOUT++ geometry

The BOUT++ coordinate system isfield-aligned:

x = ψ − ψ0 y = θ

z = φ −

∫ θ

θ0

RBθdlθ

hence the y unit vector ey is along themagnetic field. This coordinate systemhas a singularity at the X-point

A flux-surface aligned mesh is used,similar to that used by e.g. SOLPS

The domain therefore has abranch-cut, and hole at the X-pointitself

Ben Dudson, YPI BOUT++ Workshop 2014 (8 of 21)

Page 9: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Numerical methods - Time integration

Method of Lines, either fully explicit or fully implicit1

Implicit time integration methods operate Jacobian-free

Users only need to implement the (nonlinear) function F (·)which operates on state vector f:

∂f∂t

= F (f)

Standard explicit methods e.g. RK4, Karniadakis with orwithout adaptive timestepping

Implicit methods through the PETSc and SUNDIALS libraries→ Most simulations use: adapive order, adaptive timestepBDF method from SUNDIALS

Optional preconditioning also implemented. Problem specific,usually “physics-based” preconditioner

1Some work on split operator, IMEX schemes ongoingBen Dudson, YPI BOUT++ Workshop 2014 (9 of 21)

Page 10: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Numerical methods - Spatial operators

A number of operators are available, which users combine toimplement models e.g

∂n∂t

= − [φ, n] + 2ρs

Rc

∂n∂z

+ Dn∇2⊥n

becomes:

ddt(n) = - bracket(phi, n, BRACKET_ARAKAWA)

+ 2*DDZ(n)*(rho_s/R_c)

+ D_n*Delp2(n)

The method to be used can be set globally (input file orcommand-line), per-dimension, or per-operatorDiffusion-like operators: 2nd-order, 4th-order central differenceor 3rd-order CWENOAdvection operators: Arakawa, CTU, 1st -order and 4th-orderupwind, 3rd-order WENO

Ben Dudson, YPI BOUT++ Workshop 2014 (10 of 21)

Page 11: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Application: Blob transport

3D simulations of blobs using BOUT++23

3D drift waves play an important role in breaking up blobs∂n∂t

+ vE · ∇n = 2csρs (b × κ) · ∇n + ∇||J||e

ρ2sn

ddt∇2⊥φ = 2csρs (b × κ) · ∇n + ∇||

J||e

J|| =σ||Te

en(∇||n − n∇||φ)

2J.R.Angus, M.V.Umansky, S.I.Krashenninikov PRL 108 215002 (2012)3J.R.Angus, M.V.Umansky, S.I.Krashenninikov Contrib. Plasma Phys. 52 348-352 (2012)

Ben Dudson, YPI BOUT++ Workshop 2014 (11 of 21)

Page 12: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Application: Flux-tube simulations

Influence of X-point region on blob dynamics can be studied influx-tube geometry – previous work by N.Walkden on MAST4

Shear in X-point region found todecouple midplane and divertordynamics

Has been extended to study Super-Xconfigurations→ N.Walkden PSI poster

Would initially model effect ofconfiguration on density transport, notthermal energy

More sophisticated model includesthermal transport

See John’s talk4N R Walkden, B D Dudson, G Fishpool PPCF 55 (2013) 105005

Ben Dudson, YPI BOUT++ Workshop 2014 (12 of 21)

Page 13: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Applications: Edge Localised Modes

Good agreement with ELITE for lineargrowth-rates (at least for ballooningmodes)

Linear stability of Snowflakeconfigurations

Nonlinear multi-mode simulation ofELMs in limiter and X-point geometry

Importance of small-scale dissipationin determining the size of ELM crash(reconnection).

T.Y. Xia et al. Nucl. Fusion 53 073009 (2013)X.Q. Xu et al. Physics of Plasmas 20, 056113 (2013)

J.F. Ma et al. Nucl. Fusion 54 033011 (2014)

0 10 20 30 40 50 600.0

0.1

0.2

0.3

0.4

0.5

Toroidal Mode Number (n)

GATO (480x960)

ELITE (R/B=1.5)

BOUT++Growth

rate

(γ/ω

A)

Ben Dudson, YPI BOUT++ Workshop 2014 (13 of 21)

Page 14: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Key developments since 2013 BOUT++ workshop

Improvements to boundary conditions

Verification using the Method ofManufactured Solutions

Implementation of Flux CoordinateIndependent (FCI) method

Improved tokamak geometry meshgeneration in IDL and Python

Coupling to SLEPSc for eigenvaluecalculations [Experimental]

Numerous small improvements andbug fixes

∼ 10,400 additional lines of code0.0 0.5 1.0 1.5 2.0

2

1

0

1

2

0

0

1 1

2

2

3

4

5

3

6

7

4

8

-0.000803

Major radius [m]

Heigh

t[m

]

Ben Dudson, YPI BOUT++ Workshop 2014 (14 of 21)

Page 15: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

BOUT++ users at the University of York

Ben Dudson [Uni. York staff]

David Dickinson [EFDA Fellow]

Samad Mekkaoui [EFDA Fellow, with Julich]

Jarrod Leddy [PhD student, with CCFE]

Brendan Shanahan [PhD student]

Joint supervision of PhD students based at CCFE:

Nicholas Walkden

Luke Easy

Ben Dudson, YPI BOUT++ Workshop 2014 (15 of 21)

Page 16: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

B.Dudson: Edge turbulence and neutral gas

2D and 3D simulations of tokamak edge turbulence, andimproving predictions of divertor fluxesInteraction of neutral gas with edge plasmas

Divertor detachment dynamicsRecycling and fuelling of the plasma edge

Improving numerical methods for edge simulations

0 50 100 150 200 250

0

50

100

150

200

250

Density [×1018m−3 ]

0.00

0.25

0.50

0.75

1.00

1.25

1.50

1.75

2.00

(1)φUL

VE×B(2)

fU

fD

fL fR

(3)

φUR

φDRφDL

10 5 0 5 10Radius from separatrix [cm]

0

10

20

30

40

Polo

idal dis

tance

[cm

]

0.0

0.3

0.6

0.9

1.2

1.5

1.8

2.1

2.4

Ben Dudson, YPI BOUT++ Workshop 2014 (16 of 21)

Page 17: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

D.Dickinson: Gyro-fluid modelling

Implementing GEM gyrofluidmodel [arXiv:0710.4899v3]

Electrostatic doneStill need to finish A||calculation (may involvecode addition to BOUT++)Benchmark in coreconditions with GS2 thenpush outwards

Adding SLEPSc solver implementation to find eigenvaluesImplemented and (seems to) work. Need to find best way tointegrate with rest of BOUT++Useful for linear studies, analysing impact of artificial terms,finding time step limits etc.

Ben Dudson, YPI BOUT++ Workshop 2014 (17 of 21)

Page 18: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Samad Mekkaoui: BOUT++ / EIRENE coupling

Work ongoing to couple BOUT++ to EIRENE

Starting in linear geometry (LAPD, PSI-2, Magnum-PSI)

Technical coupling completed. Both codes run in parallel(MPI), passing data in memory

Initial turbulence simulations beginning→ Some issues related to initialisation transients

Ben Dudson, YPI BOUT++ Workshop 2014 (18 of 21)

Page 19: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

J.Leddy: Drift reduction and core-edge coupling

Analysis of large eddy simulationtechniques for fluid models (Hazeltine andHasegawa-Wakatani)

Development of non-orthogonal gridmetrics for use in BOUT++ to usesimulation grids that match realisticdiverter geometries

Simulations to confirm analytic lineargrowth rates for drift-wave instabilities indrift-reduced and full velocity fluid models

Pairing of BOUT++ and CENTORI for 3D,2-fluid integrated modelling of core andedge

Ben Dudson, YPI BOUT++ Workshop 2014 (19 of 21)

Page 20: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

B.Shanahan: Modelling of X-point configurations

Influence of magnetic X-points on blob propagation andturbulenceCurrently using drift-reduced cold ion modelsStudies in linear geometry for comparison with experimentExtensions to toroidal geometry: Verify against TorpexexperimentsAim is simulation of tokamak X-point regions

Ben Dudson, YPI BOUT++ Workshop 2014 (20 of 21)

Page 21: Introduction and overview of BOUT++ · Introduction and overview of BOUT++ Ben Dudson York Plasma Institute, Department of Physics, University of York, Heslington, York YO10 5DD,

Purpose of this workshop

To discuss key physics and computational issues related tothe edge of fusion devices

To share new developments, and prepare researchers to useand further develop BOUT++

To promote collaborations within the BOUT++ community andbeyond

Ben Dudson, YPI BOUT++ Workshop 2014 (21 of 21)