implicit solvers in full-f ... - irma.math.unistra.fr · j.a. heikkinen jcp 2008. full-f approach...
TRANSCRIPT
Implicit solvers in full-f gyrokinetic particle-in-cell simulation code Elmfire and extension to SOL
T. P. Kiviniemi, T. Korpilo, S. Leerink, P. Niskala, R. Rochford, L. ChônéAalto University, Finland
Contents
● Elmfire features (numerical scheme etc)● Implicit solver + domain decomposition● Momentum conservation interpolation● Sources and sinks● Noise● Initialization● Boundary conditions, SOL
Elmfire features● Electrostatic gyrokinetic particleincell code [Heikkinen et al JCP 2008]● Full distribution function (error ~1/√N )● Kinetic electrons (both ITG and TEM instability) ● Concentric circle analytical magnetic field background● From magnetic axis to actual wall, including SOL
● Potential solved in toroidal coordinates, 3D grid usually adjusted to rL ( N→
pol increases in r)
● Field aligned coordinates for particle following● Binary collisions (Takizuka, JCP'77) neoclassical physics, o→ ne impurity species can be included● 1D domain decomposition 2DDD (under testing) 3DDD (in progress) → →
● Direct implicit ion polarization and electron acceleration sampling of coefficients in GK equation● Polarisation drift in the equations of motion (not in Poisson equation) ● KrylovBoholuibov method, not the standard method [see Wang et al Phys. Plasmas 17, 124702
(2010)]
dRdt
=1
BΩdEdt
dv‖dt
=qE‖
m
Numerical Scheme
Particle position
Data output
Displacement of implicit terms
Binary collisions Displacement of explicit terms
Sampling charge density
Sampling implicit terms in matrix
Solving potential by matrix inversion
dRdt
=Ub'μq
b x∇ BB‖
b x∇Φ
B‖
dv‖dt
=b'm
(μ∇B)
dRdt
=1
BΩdEdt
dv‖dt
=qE‖
m
Particle initialization on orbits
J.A. Heikkinen JCP 2008
Full-f approach● Fullf and nonlinear:
a) when measuring fluctuations from particles one needs to calculate the averages from the same particles choice of →proper average important
b)When trying to do linear test one needs to filter the potential during the simulations
● Fullf required especially for the plasma edge pedestal and SOL (while e.g. the radial propagation of GAMs seen also with delta f codes)
● Equal weights lower density = worse statistics. To overcome the noise many →particles per grid cell required (3000 ppc ~ 1%)
● Neither gradient nor fluxes are fixed: Observed particle/energy balance is sum of sources/sinks + transport (+ numerics e.g. grid/noise/integrators) if the sources and →sinks do not balance out profiles will evolve selfconsistently
● Total plasma current fixed adjusting loop voltage, recycling of lost particles as particle source
GK-Poisson problem in Elmfire
● Explicit: Particle movement is first calculated without ion polarization or Ez acceleration of electrons.
● Implicit: The code calculates the electrostatic field so that the remaining implicitly calculated drifts return the plasma to neutrality.
● Matrix element Aij contains the effect of jcell potential into icell density (Aij = dni/dΦj).
● ELMFIRE builds the GKPoisson problem matrix from particle data every timestep.
Implementation into Elmfire (Direct implicit solver for ion polarization)
● Solve potential by isolating ion polarization drift contribution from density.
● That contribution is calculated implicitly every timestep using also previous values of the potential.
● The gyroaveraged electric field is interpolated from grid potential values for the ion polarization drift.
● These contribution from unknown potentials lead to huge matrix which requires lot of memory
p’th point on the Larmororbit of the k’th ion
gyro-center of the k’th ion
k
xp,yp
py+
py-
py0
px-
px0
px+
ds
x
yi’th subparticle cloud
Larmor circle
ki
Implicit solver for electron parallel nonlinearity
A.B Langdon et al (1983)
● E field in ∆xa is calculated at advanced time but at the position after free streaming
● Criterion: |∆xfs|>>|∆xa| ∆t << 1→ μs
Verlet:
Δ va=aΔ tEuler:
Momentum conserving interpolation
● Momentum conservation in PIC codes depends on symmerty between sampling of density and force.
● Quasineutrality requires: ρk = Σ
i q
iS(x
k x
i) = 0
● For this, the momentum conservating interpolation is: Ei = Σ
kE
kS(x
k x
i)
● Prove: dP/dt = Σiq
iE
i =
Σ
iq
iΣ
kE
kS(x
k x
i)=
Σ
kE
kΣ
iq
iS(x
k x
i) =
Σ
kE
kρ
k=0
● In 3D toroidal PIC GK plasma simulation in a tokamak this evaluation of E is unstable due to the invalid divergence of E×B flow of particles [Byers, 1994] i.e. x E 0
● In Elmfire, the method is stabilized by forcing (x E) = 0 by second
order corrections to Er given in Ref. [Heikkinen, CPC 2012] but in radial direction there is no force symmetry between electrons and ions.
Conservation of energy and momentum in electron parallel nonlinearity
A.B Langdon et al (1983)
● Energy conservation depends on numerical heating due to accuracy of electron parallel accelaration
Without momentum conservation (black), with mom cons (blue) and Verlet (red)
Domain decomposition
● 1D: MPI (ready several years): In 1D-DD version Elmfire simulations are limited to small (or
annulus of middle-sized) tokamaks (toroidal)● 2D: openMP+1DMPI (100 % ready, under testing): full torus simulations of middle-sized
tokamaks. Extra “dimension” = Shared memory / domain cloning.● 3D: openMP+ 2DMPI (under development): memory for full torus simulations of JET and
ITER (but available CPU sets the limit). DD in both toroidal and radial direction (particle load imbalance alleviated by openMP).
1D domain decomposition without domain decomposition
Sources and sinks• Power balance ∂
t(1.5nT)+ Q∇⋅
r=P is determined by energy transport and P
ohmic P
rad P
wall
• Radiation losses are modeled by cooling the electrons according to the experimentally measured radiation loss rate profile
• Particles lost to limiter recycled back as cold (2 eV) neutral i–e pairs according to assumed neutral density profile → energy loss to the limiter plates is inherently incorporated
• Particle balance ∂tn+ Γ∇⋅
r=S is determined by balance between recycling and particle transport
Analysis of particle balance (left) and power balance (right) [Korpilo CPC2016]
Ohmic heating, conductivity, magnetic background
• Simple magnetic configuration for rapid calculations: BT = B
T0R
0/R, B
p =
(μ0Ip/r)R
0/R
• The Ohmic current included by feedback control of the Vloop
which sustains
prescribed Itot
(a).
• When using I(r, Te) from ASTRA, also the profile shape is sustained
conductivity in Elmfire vs analytic formulas
[Kiviniemi PPCF 2014] ASTRA I-profile is maintained in Elmfire
simulation (t /10) [Korpilo CPC2016]
Influence of noise● Cloudincell (linear weigth) sampling and gyroaveraging significantly decrease the noise in density [realspace analytic formula: Kiviniemi, CPC 2016]
● Pure noise can be seen in the initial phase of simulation before the turbulence starts to grow (or in case without turbulence drive)
● Relation between density and potential is predicted to follow /T δϕ~ 1/N1/2ρs (W.W.Lee JCP 1987), in some tests stronger ~1/Nδϕ
dependence
Initialization
● Loading particles for local Maxwellian velocity distribution and desired density and temperature profiles usually satisfactory
● However, in tokamaks neoclassical equilibrium conditions difficult to initialize
● Finite orbit effects can be accounted for by initialising particles according to orbit invariants (Hively, 1981) load electrons on ion gyroorbits→
● Equal weights for particles are used
● Small relaxation in density due to orbit initialisation is iteratively corrected with particle balance equation. Relaxation in temperature is alleviated scaling the particle velocities accordingly.
● Possible issues: 1) physics: banana vs. collisional regime, 2) parallelization (load balance), 3) scrapeofflayer (no complete orbits)
Testing of the code● Implicit solver has passed Cyclone Base case test (S. Janhunen,
PhD thesis 2013)
● Included in ITM benchmark (limited agreement in transport coefficients due to changing profiles) [Falchetto, 2012]
● GAM verification test ongoing
● Neoclassical tests: effect of impurities on GAMs and <Er> [Leerink, 2012], parallel conductivity and bootstrap current [Kiviniemi, 2014]
● Comparision to experiments: simulations reproduce mean flows, oscillating zonal flows and turbulence spectra [Leerink, 2012], turbulence modulation at the GAM frequency [Gurchenko, 2015] and isotope effect in particle confinment [Gurchenko, 2016] in qualitative agreement with experiments.
Ongoing: particle confinement● Isotope effect in particle confinement: Elmfire (global fullf PIC) gives similar results as
Gene (local delta f Vlasov) both in qualitative agreement with experiments where (tau_p,D = 1.4 tau_p,H) [P. Niskala, Varenna 2016]
● Exact agreement is not expected for small machines where local approximation is assumed to overestimate particles. Also, GENE does not include neoclassical contribution.
Boundary conditions
• Code version which includes axis and scrapeofflayer is under testing• Pro: removes artificial boundary condition from inner boundary and has also shown to stabilize the outer boundary. • Cons: most of the CPU used in center even if we are interested in edge + coordinate singularity which requires special techniques [Korpilo, CPC 2016]
Boundary conditions on and particles in a torus
r
r=rl
i=0 i=1
ij
Ghost particle
Simulation particle
1) i0 ij=0
2) i 0 ij=1j+’(i-1)r
• ij is calculated only for i1 (green grid points).• Both the ghost and simulation particles are
sampled to find particle density andcoefficient matrix for ij.
rl
rr
reflection
• Gc-points are reflected at the boundaries
Previous New
SOL boundary conditions (1/2)
● The extension to the material surface includes the formulation of boundary conditions that are suitable for a gyrokinetic particle approach. ● The Bohm potential verified [Korpilo, CPP 2016]● T
e profile in the simulation does not
indicate exponential decay and strongly varies as a function of poloidal angle effect of poloidal →extent of limiter and radial width of SOL under testing
SOL boundary conditions (2/2)
• Quasiballooning coordinates do not work use toroidal →coordinates instead• Orbit initialization in SOL does not work Maxwellian →can be used due to high * • When using equal weights, noise is largest where the density is smallest good statistics in core, but not in →SOL
– Solutions: 1) brute force, 2) just simulating annulus, 3) unequal weights
– Equal weights are for binary collisions, unequal weights should work for nocollision case
– Also the fluctuations are large in SOL
Summary
• Present status of fullf gyrokinetic particleincell code Elmfire was presented
• Improvements both in momentum and energy conservation were shown
• Upgrade of domain decomposition from 1D to 3D is ongoing
• SOL version of the code is under testing
Acknowledgements:● CSC, PRACE, DECI, HPC-FF
● Tekes, Academy of Finland, EUROFUSION