Efficient 3D Space Charge Calculations by Self-adaptive Multigrid

0 downloads 0 Views 599KB Size Report
The solution method we investigate in this paper is a self- adaptive multigrid ... tributed by the Applied Numerical Algorithms Group of. Lawrence Berkeley ...
TUPP086

Proceedings of EPAC08, Genoa, Italy

EFFICIENT 3D SPACE CHARGE CALCULATIONS BY SELF-ADAPTIVE MULTIGRID METHODS USING THE CHOMBO FRAMEWORK∗ Christian R¨udiger Bahls† , Gisela P¨oplau, Ursula van Rienen, University of Rostock, Germany Abstract

Robin’s Boundary Condition

Current and future accelerator design requires efficient 3D space charge computations for high brightness bunches which should be as precise and fast as possible. One possible approach for space charge calculations is the particle-mesh-method, where the potential is calculated in the rest frame of the bunch by means of Poisson’s equation. For an efficient solution of this elliptic PDE an appropriate adaptive discretization of the domain is required. Especially it has to take into account discontinuities in the distribution of the particles. The solution method we investigate in this paper is a selfadaptive multigrid method applying composite grids. To accomplish this, we use the library Chombo which is being developed as a framework for adaptive multiresolution solvers for elliptic and hyperbolic partial differential equations.

The Robin boundary condition is a special case of an open boundary condition. It tries to match the solution on the boundary ∂Ω R of the domain Ω to the surrounding medium which can be thought of as being infinite. The Robin boundary condition was selected such that we get a good approximation of the analytical solution[2] for the potential of a charged sphere centred at the origin in an unbounded domain.

Poisson’s Equation We aim to estimate an approximation of the solution u(x) of Poisson’s equation in the domain Ω ⊆ R 3 : f (x),

∀x ∈ Ω.

Chombo is framework for the development of adaptive multiresolution (AMR) solvers for elliptic and hyperbolic partial differential equations. It is being developed and distributed by the Applied Numerical Algorithms Group of Lawrence Berkeley National Laboratory[1].

First Results

PRELIMINARIES

−Δ u(x) =

USING CHOMBO FOR THE SOLUTION OF ELLIPTIC PDE’S

(1)

As an example-implementation Chombo contains the solver ‘AMRPoisson’. AMRPoisson is a solver for elliptic partial differential equations on composite grids. This multigrid solver was used to compute the electric field of a charged sphere of radius 0.8 m with charge 1 μC inside a cube (2 m× 2 m× 2 m) with homogeneous Dirichlet boundary conditions on all faces.

In the context of space charge calculations u(x) denotes the potential and f (x) = ρ(x)/ε 0 the source term with the charge density ρ(x) and the vacuum permittivity ε 0 . We will use mixed boundary conditions on the boundary ∂Ω of the domain Ω. These will be Dirichlet boundary conditions on ∂ΩD and Robin boundary conditions on ∂Ω R , given as: u(x) = ∂u(x) = ∂n(x)

gD (x), ∀x ∈ ∂ΩD , u(x) − , ∀x ∈ ∂ΩR , r(x)

(2) (3)

where r(x) denotes the distance from the centre of the charged sphere. ∗ this

research is supported by Deutsche Forschungsgemeinschaft project No. RI 814/18-1 † [email protected]

05 Beam Dynamics and Electromagnetic Fields

1730

Figure 1: Potential and E-field (Dirichlet boundary) D05 Code Developments and Simulation Techniques

Proceedings of EPAC08, Genoa, Italy

Implementing Robin’s Boundary Condition Because Chombo did not already include in implementation of Robin’s boundary condition we implemented our own version for the usage in Chombo’s elliptic solver AMRPoisson.

TUPP086

Figure 4 shows the E x -component of the electric field and Figure 5 the difference between the analytic and the approximated solution in this component.

Figure 4: The E x -component (open boundary)

Figure 2: Potential and E-field (open boundary) To assess the correctness of our implementation we computed the potential and the electric field of a charged sphere for varying step-sizes and compared them with the analytical solutions.

Figure 5: The relative error in the E x -component As one can see the error is dominated by the discretization error at the boundary of the charged sphere. The relative error is in the order of 10 −2 . So we assume a relative tolerance of 10 −4 will be a sensible choice as a stopping criterion for the numerical error in following computations.

RESULTS

Figure 3: Computed potential and E-field (E x ) Figure 3 shows the numerical solution approaching the analytic solution for decreasing step-sizes. The approximation of the flux at the boundary interfaces improves for smaller step-sizes. This also improves the global accuracy. The effect is less pronounced for the error in the electric field whose approximation already was quite good. 05 Beam Dynamics and Electromagnetic Fields

After implementing Robin’s boundary condition and asserting it’s correctness we went on to solve for the electric field of an electron bunch in a cavity with rectangular crosssection. In the longitudinal (z)-direction we use Robin’s boundary condition. Transversally we assume the cavity to be made of perfectly electric conducting (PEC) material. It follows that we can use homogeneous Dirichlet boundary conditions on the boundaries in x and y direction. In following computations we use a spheroidal bunch with 1 mm semi axes in transversal direction (x and y) and 8 mm semi axis in longitudinal direction (z). This spatial extensions where taken from simulations of the XFEL[3] The cavity is 80 mm × 80 mm in transversal direction. In longitudinal direction the domain is 20 mm long. After implementing the appropriate right hand side f (x) = ρ(x)/ε0 we can use AMRPoisson to solve for the electric field.

Grid Refinement For our first experiments we used Chombo’s automatic grid refinement. The solid red line in Figure 6 shows the Ez -component of the E-field along a line through the centre of the bunch. D05 Code Developments and Simulation Techniques

1731

TUPP086

Proceedings of EPAC08, Genoa, Italy

Figure 7: The automatically generated grid Figure 6: The E z -component in longitudinal direction There are some discontinuities in the estimated electric field. This can be a consequence of the charge not being fully covered by the finest grid (Figure 7) 1 . We therefore prolongated the finer grids towards the boundary in z-direction. The dotted green line in Figure 6 shows the resulting smoother numerical solution. Another experiment involved using an ad-hoc formula to generate successively finer grids. The resulting grid is being compared with the automatically generated grid in Figure 9. The dashed blue line in Figure 6 shows the resulting Ez -component of the E-field.

Figure 8: The fine grids extended to the boundaries

Benchmarks We also measured the resource usage for runs with different grids. For comparison table 1 includes a run with Chombo’s grid statically defined to measure the run-time overhead of generating the grid. The runtime of Chombo with statically defined grid is comparable with results from other adaptive mesh methods[3]. Table 1: Benchmarks Type of Grid Generated Grid Statically Defined Prolongated Grid Geometrical Series

Runtime

grid-cells (finest)

1.63 sec 0.95 sec 1.31 sec 0.96 sec

256,128 (122,304) 256,128 (122,304) 347,776 (200,704) 262,848 (166,208)

CONCLUSION Out of the box the Chombo-framework is very well suited for the computation of numerical solutions to Poisson’s equation. For high aspect ratio of the bunch the grid generation routine will have to be augmented. The ad-hoc algorithm we used looks very promising in that regard. For space charge calculations with particle-meshmethods the large number of cells in the finest grid will make it difficult to distribute the macro particles. So one will use a smaller number of refinement levels for this kind of calculations. 1 This can also be an artefact of the visualisation software VisIt[4] using a nonconservative interpolation for the evaluation of the potential on the intersecting line.

05 Beam Dynamics and Electromagnetic Fields

1732

Figure 9: Comparison of the automatically generated (left) and the grid defined from a geometrical series (right)

REFERENCES [1] Chombo, Applied Numerical Algorithms Group of Lawrence Berkeley National Lab., http://seesar.lbl.gov/ANAG/chombo/ [2] G. P¨oplau, D. Potts, and U. van Rienen. Calculation of 3D space-charge fields of bunches of charged particles by fast summation. In Scientific Computing in Electrical Engineering, number 9 in Mathematics in Industry, pages 241–246, Berlin, 2006. Springer-Verlag. [3] G. P¨oplau, U. van Rienen, and K. Fl¨ottmann. The performance of 3D space charge models for high brightness electron bunches. In Proceedings of EPAC 2008 (11th European Particle Accelerator Conference), Genova, Italy, 2008. [4] VisIt, Lawrence Livermore National Laboratory (LLNL) http://wci.llnl.gov/codes/visit/home.html D05 Code Developments and Simulation Techniques

Suggest Documents