Large Poster Version of the CBline talk

Download Report

Transcript Large Poster Version of the CBline talk

Algorithms for Real Time Magnetic Field Tracing and Optimisation
B.D.
Closed magnetic field lines are the basis of magnetic confinement of plasma,
ultimately for the production of fusion energy from the heavy hydrogen in water.
It is important that the closed lines twist around each other (rotational transform),
and form closed, nested magnetic surfaces, in the shape of a torus.
Plasma confinement and stability are related to the rotational transform (twist per
turn around the torus).
nested magnetic surfaces that enclose no conductors
the magnetic field can be evaluated very quickly
iota (twist per turn) ~ 1: aspect ratio low ~ 5-10 (“fat” torus)
highly 3D, so that codes and algorithms are tested thoroughly
represent by real conductors to ensure that
Maxwell’s Eqns are satisfied
H.J.
4
Gardner
Simulated annealing:
virtual temperature T
accept a new configuration even if slightly worse (up to T)
“heat” to explore new configurations
“cool” to “home in” on optimum
• Speed is increased by
–
–
–
Mesh Interpolation
Perturbation Calculation of iota
Pre-calculate magnetic field B on hierarchy of rectangular meshes
using a cubic tri-spline interpolation method
•
Find a nearby rational surface by iteration ~ middle order
– say ~ 30 circuits
B
H-1 heliac
• mesh hierarchy(blue) underneath the hierarchy of
magnetic macro-elements (“sub-systems”)
•
central
core
Helmholtz
3 meshes of
coils
16×128×16
– e.g. H-1 has 3 meshes for main field, but one
Toroidal
coarse mesh for VF (Helmholtz) coils. Additional
coils
small, finer grids can be placed in critical
areas that are heavily travelled e.g. near helical core
1 mesh
– Splitting coils into subsystems allows quick
3 meshes of
64×64×32
configuration adjustment by varying currents
32×128×32
(linear combination I1M1 + I2M2 + I3M3)
•
•
3x3 submeshes
32×128×32
• copy of mesh in neighborhood stored as array to fit into CPU cache
B0
Store B and derivatives along this closed path
For each iteration of the perturbing winding locus, integrate
x  B/B0
• existing conductor set is a “standard heliac”
• Constraint: additional conductor lies anywhere inside a torus, periodicity N=3
where B is the perturbing field
and B0 the original field
– (actually end-point and middle point fixed in each period)
(Alternatively integrate cpt of B in the surface, normalized to B0 and the
puncture spacing at that point ~ Boozer )
• Seek maximum in transform/(length  current)
• Result is very close to the “flexible heliac” configuration proposed for transform and well control
by Harris et al, 1985
• mesh filled on demand and/or in background
– (see also Gourdon code, Zacharov’s code (Hermite polynomials))
Accuracy of perturbation calculation of / I
• Check perturbation calculation of /I
by direct calculation of  in the initial
and slightly perturbed configurations.
Cubic Spline Mesh Convergence
0
-0.5
0
-1
-2
y = 6.02x + 5.07
-3
Meshes of 10-50MByte are
adequate even near edge
-4
-5
to allow for regions of high gradient near
conductors, the distance to the nearest conductor
is recorded in each cell, and Bline automatically
reverts to direct calculation if too close to a
conductor.
log(Error Sum)
y = 5.23x + 2.65
-6
log(Max Error)
Linear (log(Error Sum))
Linear (log(Max Error))
Change in transform
0.02
• Ultra high accuracy (<1e-7) calculations
0
of iota necessary to check /I when
0.88
perturbation is small to avoid non-0.01
linearity
Mesh spacing (log(m))
-1
Change in transform vs Coil current Ratio
-7
0.9
0.92
0.94
0.96
0.98
1
1.02
1.04
1.06
-0.02
• Direct iota measurement uses apodised
least-squares fit, converges
exponentially once significant Fourier
cpts are captured.
-0.03
y = 0.3039x - 0.3038
R2 = 1
-0.04
• Correction for area change
can be significant
Optimum conductor outside plasma:
R=R0 constraint  “sawtooth coil”
– only 4 simple elements (finite filaments)
– iota ~ 0.6, bean shaped, (similar to Tom Todds?)
Multi-processing
– slow evaluation
Multi-threading is an efficient way to utilize a low cost,
multi-processor shared memory machine
•
use windows threads (posix under linux) (Multiple Instruction Single Data)
– needs semaphore system (e.g. no tracing while loading a new mesh)
•
Comparison of the optimised
conductor (blue) with the
“flexible heliac” toroidal helix.
Differences are mainly due to
incomplete annealing.
Perturbation result: 0.315 cf 0.304
5th order or better in x
• “single loop” toroidal helix: curiosity
The optimized winding is
shown in pink, and exaggerated
in thickness for clarity against
the thinner basic (existing)
conductor configuration.
0.01
Convergence of mesh tracing (NEW)
-1.5
Optimization of iota reproduces flexible heliac
Given an existing coil set, what is the most efficient way to add rotational
transform (twist-per-turn)?
– subarray of mesh representing the neighbourhood of a point would be spread over a large fraction of
memory, and would not fit into the Level 2 (512K) cache on the Pentium II.
– keep local copy (4x4x4) of mesh in neighbourhood of present position
– only one face has to be updated - usually the next trace step is quite close
– 3D array derivatives calculated on demand from B and stored only in local mesh
– reduces the time penalty for the large mesh “get” method (the local copy is accessed as an array)
-2
use of perturbation technique for calculating transform
incremental changes in conductor locus - only two elements change
3 fold and up/down symmetry speed up by a factor of 6x.
• Minimization by steepest descent less suitable - highly multi-variate - typically 30-1000
variables, similarity to travelling salesman problem.
• “triator”
Real Confinement Geometries
Computer Optimization of Transform
• Annealing more tolerant of occasional anomalies in “goodness” function, e.g. local minima or
discontinuities (resonances)
Computational Techniques
Minimal Confinement Geometries
–
–
–
–
–
A.C.
3
Searle and
–
–
–
–
A magnetic field line is traced by direct and meshbased calculations. The average and worst
case difference of the mesh-based from the
direct calculation are shown. Convergence is
better than 5th order in x.
What is the simplest possible magnetic configuration that has the basic properties of,
and similar parameters, to realistic plasma configurations? We require:
B.
Error (log())
Background:
2
McMillan ,
1 Plasma Research Laboratory, RSPhysSE, 2 present address: Department of Physics, Melbourne University)
3 Department of Physics, Faculty of Science, 4 Department of Theoretical Physics, RSPhysSE and Department of Computer Science FEIT,
The Australian National University, Canberra, ACT 0200, Australia
+61 2 6249 2482, FAX +61 2 6249 2575, [email protected]
Abstract
We describe a fast, flexible multi-mesh interpolation method for tracing vacuum
magnetic field lines in complex geometries, with a post processing perturbation
method for computer optimisation of magnetic surface properties. Real-time,
interactive tracing (~20,000 steps/second) of advanced magnetic geometries for
fusion plasma confinement is possible on an inexpensive personal computer with 3D
graphics acceleration. Recent advances in plasma theory and computation allow the
design of highly sophisticated new magnetic confinement devices for plasma
fusion[1] The methods described here enable detailed optimisation of the magnet
coils. Magnetic fields are defined by a set of “systems” of conductors or macroelements which are made up of finite filament segments or circular filaments.
Magnetic field values are calculated directly or interpolated by a cubic tri-spline on
regular rectangular cubic meshes for optimum speed of evaluation. A hierarchy of
meshes may be employed by associating each system of magnetic macro-elements
with any number of meshes to provide the required resolution for the various regions
of interest, such as regions very close to conductors. The mesh arrays are populated
systematically in idle cycles, or when required by the algorithm if tracing is active in
a mesh that is not already populated. In refining a new magnetic configuration, the
basic coil set may be conveniently described by a system of ~ 103 elements for each
coil set, with fully pre-calculated meshes, allowing only variation in the current. The
“additional” coil presently under study is represented by a simpler polygon for which
the magnetic field is evaluated directly, allowing manipulation of both currents and
vertices in real time. The above method results in tracing rates an order slower than a
single mesh, accurately defining the magnetic properties of the surface (rotational
transform, magnetic well) in much less than a minute. Alternatively these properties
may be estimated by a perturbation method in a fraction of a second, allowing
construction of computer optimization loops. The perturbation analysis considers
small angular deviations from an unperturbed trace produced by the magnetic field of
the additional coil system in calculating the change in rotational transform it
produces. Associated algorithms described include an efficient single evaluation
predictor-corrector integrator, a rapidly converging high precision evaluation of
rotational transform, and coil shape optimisation algorithms, implemented in C++.
Multi-threading techniques, making efficient use of a shared memory dual processor,
have enabled real-time visualisation and interaction in a virtual environment
(“Wedge”[2]) described in detail in that paper.
1
Blackwell
Fast, Single Evaluation Predictor-Corrector
• Constrain conductor to lie on a cylinder, periodic (N=3)
• Seek maximum transform near the axis of a heliac per unit (length 
current)
• Base configuration is heliac
• Reproduces approximate “sawtooth coil”
The most popular integration methods for magnetic field line tracing are
Runge-Kutta (4th order - used by most codes to start up, no previous points requ’d)
4 evals
Predictor-Corrector (The HELIAC code uses 3rd order predictor, 4th order corrector
2 evals
In magnetic field line tracing applications, the derivative evaluation step is time consuming, so it is desirable to minimize the
number of derivative evaluations per step.
multi-threaded code runs fine on single processor
(some priority tuning useful on single processor)
There are many magnetic configurations which confine plasma successfully
Theheliac of the H-1 National Facility is shown below in cBline, and rendered to the right
To the far right is a modular coil stellarator.
•
initial scheme
– tracing thread, display thread and mesh-filling threads
– large caches on Intel machines favour each thread working in distant memory locations to avoid
slowdown by cache overlap conflicts
•
multi-threading  object oriented coding
The BLINE code uses a single evaluation predictor-corrector
Predictor: (four step, fourth order Adams-Bashforth)
xpred = xi-1 + h/24 (55ƒ(xi-1) - 59ƒ(xi-2) + 37ƒ(xi-3) - 9ƒ(xi-4)) (no
new evaluations)
Corrector: (four step, fifth order Adams-Moulton)
xi = xi-1 + h/24 (9ƒ(xpred) + 19ƒ(xi-1) - 5ƒ(xi-2) + ƒ(xi-3))
(only one evaluation of B(r))
The resulting speed improvement is a factor of 1.55 (Fujitsu VP2200) - 2x
This modular stellarator (right)
was computer optimized by a
much lengthier, more complete
process taking into account
plasma pressure. The coils
have not been optimised from
an engineering viewpoint:
although they have the
inportant propoerty of not
linking any other coils (for
disassembly, maintenance),
their shape could me
smoothed.
Conclusions and Future Work
• Very useful for following particles out of machine (so far, not a drift calculation)
• Very fast (50k/sec) configuration evaluation for varying current ratios in existing
coil system (e.g. H-1 flexibility studies)
• Fast evaluation (10k/sec) of new winding (“simple”) in arbitrarily complex
existing configuration
• Iota perturbation calculation works, and is fast.
• Well perturbation calculation implemented, but not debugged
• Possibly extend to island width as in Rieman & Boozer 1983
• optimization principle demonstrated
• “standard results” recovered
• real time operation  possibility of human guidance during optimization
Develop/find “Meta-Language” for description of symmetries and constraints