radia – a cpu-efficient 3d magnetostatics computer code

29
RADIA – RADIA – a CPU-Efficient 3D a CPU-Efficient 3D Magnetostatics Computer Magnetostatics Computer Code Code O. Chubar, P. Elleaume, J. Chavanne (ESRF, France)

Upload: venecia-arthur

Post on 31-Dec-2015

49 views

Category:

Documents


0 download

DESCRIPTION

RADIA – a CPU-Efficient 3D Magnetostatics Computer Code. O. Chubar, P. Elleaume, J. Chavanne (ESRF, France). Topics. Motivation Previous Codes Approach: Volume (/ Magnetization) Integrals Examples: Undulators, Accelerator Magnets, Inverse Problems Possible Evolution. H ( r ). SR. e -. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA –RADIA –a CPU-Efficient 3D Magnetostatics a CPU-Efficient 3D Magnetostatics

Computer CodeComputer Code

O. Chubar, P. Elleaume, J. Chavanne (ESRF, France)

Page 2: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

TopicsTopics

Motivation Previous Codes Approach: Volume (/ Magnetization) Integrals Examples: Undulators, Accelerator Magnets,

Inverse Problems Possible Evolution

Page 3: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

MotivationMotivation

Computation of stationary Magnetic Field produced by Permanent Magnets, Coils and Iron Blocks in 3D space

Optimized for the design of Insertion Devices (Undulators and Wigglers) for SR Sources, as well as Accelerator Magnets

e-

H(r) SR

Page 4: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

Computer Codes Using Similar ApproachComputer Codes Using Similar Approach

Solving 3D Magnetostatics ProblemsSolving 3D Magnetostatics Problems via Volume (/ Magnetization) Integrals via Volume (/ Magnetization) Integrals

– GFUN (Trowbridge et. al., Rutherford Laboratory, 1970s)

– B3D (P.Elleaume, J.Chavanne, ESRF, 1989-95)

– RADIA (O.Chubar, P.Elleaume, J.Chavanne, ESRF, 1996-…)

Page 5: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

3D Magnetostatics3D MagnetostaticsMagnetic Field created by Uniformly Magnetized VolumesMagnetic Field created by Uniformly Magnetized Volumes

;)(

4

1)(

, )()(

: Si

, )(

4

1 )(

4

1)(

,

4

1

4

1)(

,

,

,

,0

3

33

0

Sd

SdVd

SdVd

S

S

S

S

V

S

S

V

rr

nrrrQ

MrQrH

constM

rr

nMrr

rr

MrrrH

rr

nM

rr

Mr

M

H

MHB

B

Poisson equation for scalar magnetic potential:

Solution through volume and surface integrals:

Magnetic field created by uniformly magnetized volume:

)()( bcacba

Page 6: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

3D Magnetostatics 3D Magnetostatics Uniformly Magnetized PolyhedronUniformly Magnetized Polyhedron

, s=1,2,…,N , - coord. of vertex points of the face n- external normal to the face Nf - number of faces(x0,y0,z0) – coord. of observation point

1111

121

112

0

0

0

11

1

11

1

1

1

1

~~ ,~~

, )1()1(

)1()1(

; ~

~

~

,

,)()(

,

),,,,(),,,(),,,(

),,,(),,,(

),,,(),,,(

4

1

,)(

yyxx

nnn

nnnnnnn

nnnnnnn

zz

yy

xx

z

y

x

xayb

xxyya

zbaxxzbaxfzbaxf

zbaxfzbaxf

zbaxfzbaxf

NN

zyx

yzzxzyx

xzyxzzy

s

s

s

s

s

ssss

sssss

N

s

ssssssszsssz

sssysssy

sssxsssx

N f

TT

F

TkFTQ

(~ , ~ ,~ )x y zs s s

MQH Magnetic field:

Page 7: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

010

20-5

051015

0

10

20

-5051015

-5 0 5

-50

51015

-10

0

10

20

-50

51015

- 5- 2.5

02.55

X - 10- 50510 Y

- 10

- 5

0

5

10

Z

- 5- 2.5

02.55

X- 10

- 5

0

5

10

Z

3D Magnetostatics 3D Magnetostatics Space Transformations and SymmetriesSpace Transformations and Symmetries

),(),( 1 VV rTTHTrH

1

0

1

0

),(),()(m

i

iim

i

itot VV rTHTTrHrH

Treatment of Symmetries reduces memory requirements and speeds up computation

Space Transformations

Symmetries (multiplicity m > 1)

V TV

V TV

T2V T3V

Page 8: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

3D Magnetostatics 3D Magnetostatics RelaxationRelaxation

Interaction Matrix and Material Relations

H Q M H

M f H

exi ik kk

N

i

i i i i N

1

1 2

,

( ), , ,..., ,

Relaxation Scheme

Hi - total field strength in the center of object i

Hex i - external field the center of the object i

Mk - magnetization in the object k

Qik - component of the Interaction Matrix (being itself a 3 x 3 matrix)

fi(H) - magnetization vs. field strength law for the material of the object i

),(

),~

(][

,~

,,

,1

1,,

11,

1

1,,

)(

piipi

iiipipiiiipi

N

ikpkki

i

kpkikipi

HfM

MQHHχQEH

MQMQHH

rex

exex

- local susceptibility tensor for the material

of the object iMr i - remnantg magnetization in the object i

i ( )H

,0|| , (0)

,0|| , ]||)||([)(

HE

HEHHHχ

i

ii f

fThis scheme is robust:no “relaxation parameter” required (!)

for nonlinear isotropic material:

Page 9: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

3D Magnetostatics 3D Magnetostatics RADIA Implementation: C++RADIA Implementation: C++

Main Classes

Field Source

“Rec. Current” “Arc. Current” “Filament Cur.”

Container

Space Transf.

General Methods for Field Sources– computation of Magnetic Field Strength, Vector Potential, Field Integral, Energy, Force, Torque– subdivision (segmentation)

RADIA is interfaced to:- Mathematica (Wolfram Research)- IGOR Pro (Wavemetrics)

Exists on Windows, Linux, Mac OS platforms Available for download from ESRF and SOLEIL Web sites (Insertion Devices pages)

Permanent

Coils Backgr. Field

3D GraphicsRelaxation

MaterialRelaxable

“Rec. Mag.” Extr. Polygon Polyhedron Nonlin. Isotr. Linear Unisotr.

Page 10: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA ExamplesRADIA ExamplesAPPLE-II PPM UndulatorAPPLE-II PPM Undulator

0 20 40 60 80

0.4

0.2

0

0.2

0.4

0 20 40 60 80

0.4

0.2

0

0.2

0.4

Circular/Elliptical Polarization(parallel displacement of 2 magnet arrays)

Tilted Linear Polarization (anti-parallel displacement of 2 magnet arrays)

Gap: 17 mm

B [T]

Bz

Bx Bz Bx

s [mm] s [mm]

Invented by Sh.Sasaki et. al.0 0.5 1 1.5 2 2.5 3

0.1

0.2

0.3

0.4

0.5

0.6

0.7B [T]

BxBz

A B C D

Peak Field vs Shift bw Magnet Arrays

Mr = 1.1 T

Magnet Dimensions: 40 mm x 20 mm

Page 11: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

The integral field Ibz for differents gaps

-20

-15

-10

-5

0

5

10

15

20

5,5 7 8 9 10 11 12 13 14 15 16 17 18 19

Gap (mm)

IBz (

G.c

m)

RADIA ExamplesRADIA ExamplesHybrid Undulator U20 (SOLEIL)Hybrid Undulator U20 (SOLEIL)

Optimization by C.Benabderrahmane

Page 12: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA / SRW ExamplesRADIA / SRW ExamplesHybrid WigglerHybrid Wiggler

3T Hybrid WigglerMagnetic design by J.Chavanne, ESRF

Magnetic Field and Electron Trajectory

Spectrum vs Phot. Energyat diff. obs. points

Spectral Fux per Unit Surfacevs Horizontal and Vertical Positions

Magnets are designed using RADIA

SR computations are done using SRW

Page 13: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA ExamplesRADIA ExamplesElectromagnet Elliptical Undulator HU640 (SOLEIL)Electromagnet Elliptical Undulator HU640 (SOLEIL)

Vertical and Horizontal Magnetic Fields

Magnetic design by O.Marcouille

Pure coil structure (no iron parts)Consumed electrical power: ~100 kW

Page 14: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

The Structure (A.Dael - P.Vobly)The Structure (A.Dael - P.Vobly) Magnetic Fields at Max. Currents (Radia)Magnetic Fields at Max. Currents (Radia)IIz maxz max= 180 A, I= 180 A, Ix maxx max= 250 A= 250 A

Specifications:Specifications:

Circular Polar.: Circular Polar.: 1 min1 min < 10 eV < 10 eVLinear Hor. Polar.: Linear Hor. Polar.: 1 min1 min < 10 eV < 10 eVLinear Vert. Polar.: Linear Vert. Polar.: 1 min1 min < 20 eV < 20 eV

Aperture: 0.7 mr x 0.7 mrAperture: 0.7 mr x 0.7 mr

Calculated Spectra at Maximal CurrentsCalculated Spectra at Maximal Currents

RADIA Examples RADIA Examples Electromagnet Elliptical Undulator HU256 (SOLEIL-BINP)Electromagnet Elliptical Undulator HU256 (SOLEIL-BINP)

Page 15: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

On-Axis Magnetic Field Magnetic Field “Roll-Off”

General Parameters u 65 mm; Lu 1.6 m

Min. gap: 16 mm Kx1 max Kz1 max 1.5

Coils Imax < 300 A

Conductor cross-section: 7 x 7 mm2

Number of Layers: 8

Yoke Pole transv. size: 40 mm Pole longit. size: 12 mm Material: iron (laminated )

Permanent Magnets Block dimensions: 30 x 17 x 15 mm3

Transv. distance bw blocks: ~ 5 mm Material: Sm2Co17

RADIA Examples: RADIA Examples: Fast-Switching Elliptical Undulator for XMCDFast-Switching Elliptical Undulator for XMCDPreliminary Design, derived from ESRF EMPHUPreliminary Design, derived from ESRF EMPHU

RADIA model with reduced number of periods(coil layer changes are not taken into account)

Original design by J.Chavanne

Page 16: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA ExamplesRADIA ExamplesAccelerator MagnetsAccelerator Magnets

A: dipoleB: quadrupole with integrated sextupole componentsimulations by L-J.Lindgren

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

-300 -200 -100 0 100 200mm

tesl

a

0.53

0.54

0.55

-30 -20 -10 0 10 20 30mm

tesl

a

1.47

1.48

1.49

1.5

1.51

1.52

-30 -20 -10 0 10 20 30mm

tesl

a

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-80 -60 -40 -20 0 20 40 60

mm

tesl

a

0

0.1

0.2

0.3

-600 -500 -400 -300 -200 -100 0 100mm

tesl

a

A

B

Edge Field (vs longitudinal position) Transverse Field

low excitation

high excitation

Discrepancy between Radia simulations and measurements: < 1% (peak field)

MAX-IIMagnets

Page 17: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA Examples RADIA Examples Accelerator Magnets: SOLEIL DipolesAccelerator Magnets: SOLEIL Dipoles

Central Field vs Longitudinal Position

400 450 500 550 600 650 700 7500

0.25

0.5

0.75

1

1.25

1.5

0 100 200 300 400 500

1.64

1.66

1.68

1.7

1.72

B [T]

y [mm]

B [T]

y [mm]

Edge Field vs Longitudinal Position

Page 18: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

Radia Examples Radia Examples Comparison with a commercial FEM CodeComparison with a commercial FEM Code

Chamfer Optimization of ESRF Quadrupolesimulation by J.Chavanne

FLUX3D200 000 Tetrahedrons200 MB of Memory3 Hours of CPU

RADIA1500 Polyhedrons200 MB of Memory1 Hour of CPU

Page 19: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

Radia Examples Radia Examples Radia vs commercial FEM Code FLUX3DRadia vs commercial FEM Code FLUX3D

Hybrid Wiggler Simulation ComparisonCase A: Solution for 1% accuracy in peak field

Case B: Solution for 10 G-cm abs. accuracy in on-axis field integral

RADIA FLUX3D CPU time A

B 10 s

100 s 200 s

Number of 3D elements A B

400 980

~15 000

Memory required A B

7 MB 27 MB

11 MB ?

Accuracy of the field inside magnet blocks

poor* same as in the air

* accuracy is high only in centers of 3D elements

Page 20: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

Evaluation:

1 2 3 4 5 6 7 8

5 4 8 1 7 2 6 3 7 2 6 35 4 8 1

1 3 5 7

2 4 6 8

Possible Variation Operators for Permutations (i.e. for Sorting):

Mutation : -- e.g. e.g. swap magnets at two randomly chosen positionsswap magnets at two randomly chosen positions -- [ 5 4 8 1 7 2 6 3 ]

Crossover : -- e.g. e.g. «order 1» «order 1» - - [ 1 2 3 4 5 6 7 8 ]

[ 3 5 6 8 1 2 7 4 ][ ? ? ? 4 5 6 7 ? ] [ 8 1 2 4 5 6 7 3 ]

Goals:Goals: Find optimal distribution of individual magnets (or magnet displacements) which would allow to compensate existing magnet imperfections and to reach required ID magnetic field characteristics

Ordered Magnet Ordered Magnet Sequence(s)Sequence(s)

«Decoded» «Decoded» Undulator Undulator StructureStructure

Magnetic Measurements DataMagnetic Measurements Dataon Individual Magnets (/ Modules)on Individual Magnets (/ Modules)& Partly Assembled Undulator& Partly Assembled Undulator

Mathematical Model Mathematical Model / Total Field Calc. Method / Total Field Calc. Method

Undulator Undulator Magnetic Field Magnetic Field (/ Field Integrals)(/ Field Integrals)

CharacteristicsCharacteristics/ Fitness Terms/ Fitness Terms

Electron Trajectory Electron Trajectory StraightnessStraightness

Radiation Phase ErrorRadiation Phase Error

Field Integral Field Integral deviation from zerodeviation from zero

Integrated MultipolesIntegrated Multipoles

Fitness Fitness

WeightsWeights

. . .

Genetic Genetic AlgorithmsAlgorithms

[ 5 4 6 1 7 2 8 3 ]

ID Magnet Sorting was pioneered by A.Cox and B.Youngman (1985)

ID Magnet Shimming was pioneered at ESRF and ELETTRA (199x)

Radia Examples / Inverse Problems Radia Examples / Inverse Problems SortingSorting and and ShimmingShimming Insertion Device Magnets Insertion Device Magnets

RADIARADIA

Page 21: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

Shim Signatures of In-Vacuum Hybrid Undulator U20Shim Signatures of In-Vacuum Hybrid Undulator U20RADIA Model for Central Part RADIA Model for Central Part

(A-, B- Modules and Poles)(A-, B- Modules and Poles)RADIA Model for Extremities RADIA Model for Extremities

(E- Modules)(E- Modules)

Variation of On-Axis FieldVariation of On-Axis Fielddue to 25 due to 25 m displacement of m displacement of

A-, B-, E-Modules and PolesA-, B-, E-Modules and Poles

Variation of Field IntegralsVariation of Field Integralsdue to 25 due to 25 m displacement of m displacement of

A-, B-, E-Modules and PolesA-, B-, E-Modules and Poles

Page 22: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

On-Axis Single-Electron Spectra Before and After ShimmingOn-Axis Single-Electron Spectra Before and After Shimming (10 m from source)(10 m from source)

Evolution of 11Evolution of 11thth Harmonic Harmonic of Single-Electron Spectrumof Single-Electron Spectrum

On-Axis Spectrum Taking into account On-Axis Spectrum Taking into account E-Beam Emittance and Energy SpreadE-Beam Emittance and Energy Spread

x = 3.7 nm; E/E = 10-3RMS Radiation Phase Error after Shimming ~2.6RMS Radiation Phase Error after Shimming ~2.6

““Spectral” Shimming of In-Vacuum Hybrid Undulator U20Spectral” Shimming of In-Vacuum Hybrid Undulator U20

Page 23: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

APPLE-II Undulator HU80-PLEIADES: APPLE-II Undulator HU80-PLEIADES: Evolution of Electron Trajectory and Field Integrals Evolution of Electron Trajectory and Field Integrals

(Min. Gap, Zero Phase)(Min. Gap, Zero Phase)Horizontal First Field IntegralHorizontal First Field Integral

Vertical First Field IntegralVertical First Field Integral

Horizontal Trajectory Horizontal Trajectory (Periodic Mode)(Periodic Mode)

Q.-P. Mode realized by 11 mm displacement of some Q.-P. Mode realized by 11 mm displacement of some longitudinally-polarized magnets.longitudinally-polarized magnets.

Horizontal Trajectory Horizontal Trajectory (Quasi-Periodic Mode)(Quasi-Periodic Mode)

Page 24: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

RADIA “ToDo” ListRADIA “ToDo” List Short-Term Tasks

- Simplifying definition of 3D geometries, by importing files from CAD / 3D meshing software (R. Carr)- Releasing RADIA for Python- Compiling and testing 64-bit versions for Windows and Linux- Updating all existing versions for Windows, Linux and Mac OS- Updating RADIA distribution pages at SOLEIL web site

Longer-Term Tasks- Further improving relaxation procedure (cases of many sub-volumes, non-linear mater.)- Implementing coils / conductors with polygonal cross-section- Addressing inverse problems of 3D magnetostatics (software for magnet sorting and shimming was the first step in this direction)- Implementing solvers of time-dependent direct problems (e.g. Eddy currents)- Supporting other similar direct problems of electrodynamics (e.g. electrostatics, potential current flow)- Fast 2D version of RADIA (?)

Page 25: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

Acknowledgements Acknowledgements

J.-L. Laclare, J.-M. Filhol, D. RaouxO. Rudenko, A. Dael

All Users of RADIA and SRW

Page 26: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code
Page 27: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

In-Vacuum Hybrid Undulator U20 (-SWING): In-Vacuum Hybrid Undulator U20 (-SWING):

GA-Based Module Sorting and Magic Finger GA-Based Module Sorting and Magic Finger AdjustmentAdjustmentHorizontal Field IntegralsHorizontal Field Integrals Vertical Field IntegralsVertical Field Integrals

at 5.5 mm Gapat 5.5 mm Gap

at 10 mm Gapat 10 mm Gap

97 full periods, 390 magnet modules

Page 28: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

HU80 Field Integrals at Minimal Gap (15.5 mm)HU80 Field Integrals at Minimal Gap (15.5 mm)Horizontal Vertical

TEMPO

PLEIADES

FOC(after extra shimming)

Page 29: RADIA – a CPU-Efficient 3D Magnetostatics Computer Code

APPLE-II Undulator HU80-APPLE-II Undulator HU80-Foc: Foc: Extra Shimming to Reduce MultipolesExtra Shimming to Reduce Multipoles

Field Integrals at Minimal Gap and Different PhasesField Integrals at Minimal Gap and Different PhasesVerticalVertical Phase-Dependent Normal Quad VariationPhase-Dependent Normal Quad Variation

HU80-HU80-Foc was originally supplied by ELETTRA. Extra Shimming of the HU80-Foc was originally supplied by ELETTRA. Extra Shimming of the HU80-Foc was performed at SOLEIL. Foc was performed at SOLEIL. The Extra Shimming was based on The Extra Shimming was based on Genetic OptimizationGenetic Optimization and it took into account and it took into account Phase-Dependent Magn. Interaction EffectsPhase-Dependent Magn. Interaction Effects. . Only ELETTRA “native” spare parts (mechanical shims and “magic fingers”) were used.Only ELETTRA “native” spare parts (mechanical shims and “magic fingers”) were used.

Before Extra ShimmingBefore Extra Shimming After Extra ShimmingAfter Extra Shimming

HorizontalHorizontal Phase-Dependent Skew Quad VariationPhase-Dependent Skew Quad VariationBefore Extra ShimmingBefore Extra Shimming After Extra ShimmingAfter Extra Shimming