Particle conservation in numerical models of the tokamak plasma edge
Vladislav Kotov

TL;DR
This paper discusses numerical diagnostics and algorithms to ensure particle conservation in Monte-Carlo models of tokamak edge plasma, addressing errors caused by statistical methods and residuals, and proposing solutions for efficient, accurate simulations.
Contribution
It introduces diagnostics and algorithms to identify and reduce particle balance errors in Monte-Carlo tokamak edge models, enabling larger time-steps without sacrificing accuracy.
Findings
Diagnostics can unambiguously identify residual-induced errors.
Algorithms allow large time-steps while maintaining particle conservation.
Techniques improve the accuracy and efficiency of plasma edge modeling.
Abstract
The test particle Monte-Carlo models for neutral particles are often used in the tokamak edge modelling codes. The drawback of this approach is that the self-consistent solution suffers from random error introduced by the statistical method. A particular case where the onset of nonphysical solutions can be clearly identified is violation of the global particle balance due to non-converged residuals. There are techniques which can reduce the residuals - such as internal iterations in the code B2-EIRENE - but they may pose severe restrictions on the time-step and slow down the computations. Numerical diagnostics described in the paper can be used to unambiguously identify when the too large error in the global particle balance is due to finite-volume residuals, and their reduction is absolutely necessary. Algorithms which reduce the error while allowing large time-step are also discussed.
| case | ||||
|---|---|---|---|---|
| =20, =3e-7 | 0.74 | 1.39 | 6.77 | 0.023 |
| =1, =1e-4 | 0.32 | 91.5 | 99.3 | 4.6 |
| =1+99, =1e-4∗ | 1.8 | 16.1 | 14.0 | 0.53 |
| ∗this case is discussed in Section V | ||||
| case | ||||||
|---|---|---|---|---|---|---|
| =20, =3e-7 | 0.02 | 0.14 | -1.54 | 3.10 | 0.67 | -10.63 |
| =1, =1e-4 | 91.6 | 1.06 | -1.98 | 100.7 | -0.11 | 0.15 |
| =1+99, =1e-4∗ | 0.17 | 16.3 | 0.19 | -0.10 | 4.52 | 8.92 |
| ∗this case is discussed in Section V | ||||||
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Particle conservation in numerical models of the tokamak plasma edge
Vladislav Kotov
Forschungszentrum Jülich GmbH, Institut für Energie- und Klimaforschung - Plasmaphysik, Partner of the Trilateral Euregio Cluster (TEC), 52425 Jüich, Germany
Abstract
The test particle Monte-Carlo models for neutral particles are often used in the tokamak edge modelling codes. The drawback of this approach is that the self-consistent solution suffers from random error introduced by the statistical method. A particular case where the onset of nonphysical solutions can be clearly identified is violation of the global particle balance due to non-converged residuals. There are techniques which can reduce the residuals - such as internal iterations in the code B2-EIRENE - but they may pose severe restrictions on the time-step and slow down the computations. Numerical diagnostics described in the paper can be used to unambiguously identify when the too large error in the global particle balance is due to finite-volume residuals, and their reduction is absolutely necessary. Algorithms which reduce the error while allowing large time-step are also discussed.
I Introduction
A combination of a 2D finite-volume plasma transport code with a kinetic Monte-Carlo model for neutral particles is typically applied for numerical modelling of the tokamak edge and divertor plasmas. A well known example of such modelling tool is the code package B2-EIRENE ReiterJNM1992 ; Reiter_EIRENE2005 (SOLPS) widely used in the field. The Monte-Carlo method allows physically accurate description of atomic and molecular kinetics in complex geometries, but has a disadvantage of random error - statistical noise in the calculated quantity. There were always concerns that this statistical noise can have detrimental impact on the coupled solution Maddison1994 .
In the present paper one specific noise related issue which can lead to pathological solutions is addressed - violation of the global particle balance. It is shown that the error in the steady-state particle balance can be presented as a sum of three terms. Those are the operator splitting error, residual of the fluid solver, and the time-derivative. Whereas the first term can be effectively reduced by the source re-scaling, the reduction of residuals may require iterative solution of the discretized fluid equations after each call of the Monte-Carlo model. This can, in turn, pose severe restrictions on the time-step and lead to a very long overall run-time. E.g. in the ITER modelling studies KukushaFED2011 one model run could take several months of wall-clock time. Special diagnostics for monitoring of the particle balance allow to clearly identify the cases when reduction of residuals is absolutely necessary, and the corresponding measures must be taken.
This paper presents in condensed form the most important findings from the dedicated studiy of the SOLPS code KotovJul2014 . Prototypes of the numerical diagnostics were implemented and tested in the code SOLPS4.3 which is the legacy version of B2-EIRENE used in the past for the ITER design modelling KukushaFED2011 . The approach itself is thought to be applicable to any finite-volume edge code. The numerical convergence is analyzed here only in terms of the global balances and criteria of the (quasi-)steady-state. It is not attempted to use the stricter methods of analysis proposed recently for the combination of fluid and Monte-Carlo models in GhoosJCP2016 . Only steady-state solutions are considered.
The rest of the paper is organized as follows. In the next section a finite-volume fluid code with source terms calculated by Monte-Carlo is described in general terms. In Section III the diagnostics for monitoring of the particle balance are introduced. An example of calculations with different error (residual) reduction techniques is discussed in Section IV. Further methods which can be used to reduce the residuals and the associated error in the particle balance are outlined in Section V. Last section summaries the conclusions.
II Coupling of a finite-volume and a Monte-Carlo models
Here only minimal information about numerical procedure of the code B2-EIRENE is given which is required for the subsequent discussion. The plasma transport code B2 BraamsPhDThesis ; BraamsNET solves a set of 2D (axi-symmetric) equations for particle conservation, parallel momentum balance, electron and ion energy. The full set of equations can be found in Ref. BraamsNET, , Chapter 2. The computational domain comprises the scrape-off-layer (SOL) region outside of the 1st magnetic separatrix, and the edge of the core plasma inside the separatrix.
Finite-volume discretization of the differential equations PatankarBook1980 ; BraamsNET leads to a set of algebraic equations which can be symbolically written as:
[TABLE]
Here is the solution vector: is the number density and is the parallel velocity of the ion fluid , and are the electron and ion temperatures. The discrete variables are defined in the cell centers or on the cell faces of the grid. is the non-linear vector function, are the source terms calculated by the test particle Monte-Carlo method in each grid cell.
To find the solution of Equations (1) a discrete time-derivative is added to the equations, and iterations over time are performed. On each time-iteration the solution of the following set of equation has to be found:
[TABLE]
The “time derivative” is defined such that . E.g. for the particle continuity , where is the time-step. The notation with tilde underlines that this source term is calculated by Monte-Carlo and contains random error, as opposite to the “exact” value which would be obtained with the infinite number of test particles.
In the code B2 the set of non-linear algebraic equations (2) is solved by simple iterations and block Gauss-Seidel algorithm (splitting by equations). The so called “internal iterations” of B2 are described in detail in Ref. BraamsNET, , Chapter 3, one may also refer to Ref. KotovJul2014, , Chapter 1.2. Approximate solution obtained at the end of internal iteration can be inserted back into Equation (2) to find the residual:
[TABLE]
That is, the found fulfills the equation:
[TABLE]
By comparing with Equation (1) one can see that the difference between and the right hand side of Equation (4) can be seen as generalization of the common residual .
In the simplest procedure the source terms are calculated at the beginning of internal iterations and are fixed afterward. That is, they stay as . However, certain modifications of the sources can be made in the iterative solver to adjust them with the changed plasma solution . This modification is reflected in the notation as .
II.0.1 Measures to ensure particle conservation
Critical importance of very high accuracy in the global particle balances for the reactor-scale edge modelling was recognized back at the early stages of the ITER analysis KukushaFED2011 ; KukushaPPCF2002 . To reach this high accuracy the Monte-Carlo neutral transport code must ensure perfect particle conservation in its solution. The internal balance in the neutral solver is usually achieved by re-scaling of the volumetric ion sources estimated by the statistical procedure to make them entirely consistent with the primary sources of neutral particles. To increase accuracy the particles originating from the different primary sources are sampled independently from each other - the source is split into independent “strata”. The primary sources of neutrals are: i) recombination of ions on the solid surfaces - “recycling”; ii) volumetric recombination in plasma; iii) gas puff; iv) erosion. The strength of recycling sources is proportional to the ion fluxes.
If the volumetric ion sources stay fixed, but the fluxes of neutralized (recycled) ions change in the course of internal iterations, then an imbalance in the sinks and sources occurs. To compensate for this inconsistency the sources of ions coming from recycling strata : , must be re-scaled as follows:
[TABLE]
Here is the index of internal iteration, , is the total flux of neutralized ions to which the source is proportional. E.g. if is He+ then is the sum of the fluxes of He+ and He*++*.
III Monitoring of the particle balance
Numerical diagnostic for monitoring of the steady-state global particle balance can be derived from Equation (4) by transforming it into the form:
[TABLE]
Error (inconsistency) in the particle balance is defined separately for each ion species . “Ion species” here is the chemical element as opposite to “ion fluids” which are charged states of an element. E.g. species Carbon includes 6 ion fluids from C+ to C6+.
Equation (6) is applied to the discretized continuity equation for each ion fluid in each cell . Then the sum is calculated:
[TABLE]
Here is the sum over all grid cells, is the sum over all ion fluids which belong to ion species . It is readily seen that zero left hand side of Equation (7) means perfect balance between volumetric sources and fluxes, and the right hand side is the error in the global particle balance of species .
Alternative way of writing the particle balance uses formulation via fluxes KukushaFED2011 ; KukushaPPCF2002 :
[TABLE]
Here is the strength of external particle source - gas puff, is the ion flux through the core grid boundary, is the flux sputtered (eroded) from the solid surfaces, is the flux (of both ions and neutrals) absorbed on solid surfaces - pumped flux, is the flux of atoms which leak to the core.
The final steady-state solution has to self-adjust in such way that the rate with which the particles are removed from the system becomes equal to the particle input:
[TABLE]
That is, serves as a scale with which the particle balance error has to be compared. The numerical solution can be considered as physically meaningful only if this error .
Coming back to Equation (7), its right hand side yields the following expression for the relative error:
[TABLE]
[TABLE]
[TABLE]
[TABLE]
First term contains residuals calculated with Equation (3) after the end of internal iterations. This is the error in the solution of the set of nonlinear finite-volume equations on each time-iteration. The term is due to inconsistency of the neutral-related sources calculated on the “old” and “new” plasma. It can be called an operator splitting error. This term can become large if, e.g., the re-scaling procedure, Equation (3), is not implemented. Last term is the time derivative which is considered as error when a stationary solution is looked for.
If the plasma fluxes in Equation (8) are taken from the solution , and the neutral fluxes are calculated on the same plasma, then it is easy to show that Equations (8) and (10) must yield exactly same result when one extra condition is fulfilled. This condition is the discrete analogue of the divergence theorem:
[TABLE]
Here is the total flux of ions of species to the grid boundaries. The total ion source is calculated as the total source of neutral particles minus their pumped and leaked fluxes:
[TABLE]
Volume recombination does not appear in Equation (12) because atoms originating from recombination which re-ionize back in plasma do not contribute to the net source, and particles which are removed from the system are already included in and . Subtracting Equation (11) from Equation (12) yields the nominator of Equation (8).
In practice it makes sense to use both diagnostics in parallel. Incorrect particle balance in the solution for neutrals or a mistake in the transfer of ion fluxes to the Monte-Carlo code manifests itself as non-physical particle sinks or sources. The diagnostic of Equation (10) may not be able to detect them because it does not distinguish between “legitimate” and “illegitimate” sources and sinks of neutrals. This distinction is made in Equation (8). The two diagnostics are complimentary to each other and enable an additional consistency check.
IV An example of case study
An example discussed here is based on a SOLPS4.3 run from the data-base of ITER simulations KukushaNF2009 (case #1568vk4, see Ref. KotovJul2014, , Chapter 4.2). The model plasma consists of all charged states of D, He and C. Power entering the computational domain from the core is equal to =80 MW, 47 % of is radiated, mainly by C ions. The D particle content is controlled by the gas puff =1.17e22 D-ats*-1* and ion flux from the core =0.91e22 s*-1*. Influx of He ions from the core is set to =2.1e20 s*-1*. All plasma facing components in the model are covered by carbon. The pump is modelled by an absorbing surface in divertor beneath the dome. The solution represents a relatively hot attached plasma in front of divertor targets, with insignificant parallel momentum losses and volume recombination.
In the ITER modelling studies KukushaFED2011 ; KukushaPPCF2002 ; KukushaNF2009 the B2-EIRENE code was always applied with internal iterations in the fluid solver. In the model run in question =20 internal iterations are used, the time-step is =3e-7 sec. Significant increase of the time-step is not possible: with 1e-6 sec a numerical instability develops and no stationary solution can be found. It turns out that can be increased by orders of magnitude if no internal iterations are applied, that is . In this case no visible instability develops even with =1e-4 sec. However, solutions obtained with and without internal iterations - they are shown in Figure 1 - strongly deviate from each other.
Strictly-speaking, in the presence of Monte-Carlo noise in the source terms the solutions never reach true steady-state. One can only speak about quasi-steady-state solution which randomly oscillates around some average. As applied to the B2-EIRENE runs, the “quasi-steady-state” is defined through characteristic decay times of selected parameters derived from their time-traces, see Appendix. In practice the run is regarded as converged if the condition of quasi-steady-state is fulfilled, and if errors in the global power and particle balances are small.
Errors in the balances for the two model runs considered here are given in Table 1. The power balance error is defined by Equation (13), are calculated using Equation (8). One can see that is small in both cases. The situation is completely different for the particle balance. Whereas in the simulation made with both \Delta\Gamma^{D,He}$$<10 %, in the “fast” run the error approaches 100 %. That is, in the solution obtained with the pumped fluxes are negligible compared to .
Individual terms of the error are shown in Table 2 for both recycling species D and He. There is a good agreement between and calculated independently by two diagnostics. From Table 2 the reason of the large error in case immediately becomes clear. While and always remain relatively small, becomes very large if the code is operated without internal iterations after each Monte-Carlo call.
Particle balance is much more difficult to converge than the power balance because of different relation between the controlling flux and internal sources and sinks in the system. For the power the sources and sinks in plasma are smaller than . In contrast, the particles are “recycled” between the plasma and solid surfaces and the total volumetric ion sources by far exceed . In the present example =4.3e24 s*-1* and =8.1e22 s*-1*. Those numbers are by more than two orders of magnitude larger than of those species. This problem does not appear for C because in the present model all incident C particles are absorbed on the surfaces - this species does not recycle.
In the B2-EIRENE model run above extra measures for reduction of residuals on each time-iteration were absolutely necessary. Only in this case a solution can be obtained which is correct in terms of the global balances. The techniques such as internal iterations in B2 can impose severe limitation on the time-step, and it is not attractive from the run-time point of view to operate the code in this mode. Experience has shown that the use of B2-EIRENE with =1 does not always lead to deviations as dramatic as that shown in Figure 1. E.g. in ITER cases with single fluid (D only) plasma was found to be sufficiently small both with and without internal iterations, and the obtained solutions are close to each other, see example in Ref. KotovJul2014, , Chapter 4.1.
The multi-fluid simulation analyzed here clearly demonstrates that this must not always be the case. This example emphasizes that in each simulation the particle balance has to be carefully monitored with the special diagnostics. Too large error detected by the diagnostic is an unequivocal indication that the residual reduction techniques must be applied irrespective of the run-time penalty which they impose.
V Reduction of residuals
A series of studies was undertaken with the B2-EIRENE code to find algorithms which would deliver sufficiently good accuracy without penalizing the run-time. Their outcome may be of general interest for developers and users of other edge modelling codes as well. Main results are briefly summarized in this section.
As a simplest remedy to the particle balance problem a “0D correction” was first tried, see Ref. KotovJul2014, , Chapter 5.5. The ion density in the whole computational domain is multiplied by a constant factor calculated in such way that with the corrected ion fluxes automatically becomes zero. It was found that this method cannot be used because it always produces solutions oscillating in time, and no stationary solutions.
Much more success was achieved with a correction based on iterative relaxation of the finite-volume continuity equations. Technical details of the implementation in B2 can be found in Ref. KotovJul2014, , Chapter 5.2-5.4. This algorithm works as follows. The whole set of equations for particle, momentum and energy balances is relaxed only on the first internal iteration. On subsequent iterations only equations for particle continuity are relaxed. To be precise, in the code B2 those are pressure correction equations where both the density and velocity fields are modified. (B2 uses compressible version of the Patankar’s SIMPLE algorithm, see Ref. PatankarBook1980, , Chapter 6.7 and Ref. BraamsNET, , Chapter 3.) Nevertheless, correction of the particle balance via relaxation of the pressure correction equations was found to be very reliable. Tests performed for the same ITER model as in Section IV showed that such iterations robustly converge with time-steps up to =1e-4 sec.
Results obtained with this algorithm can be found in the last row in Tables 1 and 2. The run was performed with 99 iterations for continuity equations after one full internal iteration, which is reflected in the designation =1+99. Despite increased the method leads to significant reduction of the total error due to reduction of . As expected, the main disadvantage of this procedure is that it increases residuals of other equations. Closer investigations (Ref. KotovJul2014, , Chapter 6.1) showed that especially the parallel momentum balance suffers. However, comparison of the solutions obtained with full internal iterations and with the reduced scheme demonstrates that they are close to each other: the =1+99 case is shown by dashed lines in Figure 1. Moreover, the tests demonstrated that this result holds even for the ITER model with high density detached divertor, see Ref. KotovJul2014, , Chapter 6.4. Hence, the method can be suggested for use in a two stage approach for fast finding of the initial approximation to the solution which is then refined on the second “slow” stage by more accurate techniques.
As a next step a scheme was proposed where coupled continuity and parallel momentum balance equations are iterated - without equations for temperatures. This kind of “incomplete internal iterations” was implemented in B2-EIRENE and tested as well, but the results were found to be unsatisfactory: Ref. KotovApr2015, , Chapter 2.3. Tests showed that similar to the full internal iterations the “incomplete iterations” are prone to numerical instabilities with large time-steps, and therefore bring no advantages. The SIMPLE pressure correction which introduces extra non-linearity is a possible reason of this behavior. The scheme could be improved if monolithic coupling of the continuity and momentum equation would be applied instead. That is, when corrections for both the density and the velocity fields are calculated simultaneously in a one set of linear equations.
A fairly simple technique which increases accuracy and can be easily implemented in any code is time-averaging of source terms, Ref. KotovJul2014, , Chapter 3. Although this algorithm can be helpful in many cases, it was found to be not always efficient enought in reducing , in particular with impurities, see example in Ref. KotovJul2014, , Chapter 4.2. In KawashimaPFR2006 a more advanced “piling method” is described which do not reset the whole history as the calculation of the new average starts.
Finally, the brute force method can always be applied to decrease both the statistical error in the source terms and the residuals - massive increase of the number of test particles. Applicability of this solution strongly depends on the available computing hardware. The test particle Monte-Carlo algorithm is easy to parallelize, and the increased number of particles does not necessarily mean the increased wall-clock run time. Experience KotovJul2014 has indicated that the pure “brute force compensation” of the particle balance issue described in Section IV is likely to require 100 processors to be practical.
VI Conclusions
Use of the test particle Monte-Carlo for neutrals in the tokamak edge modelling codes has an unpleasant side effect of random error in the source terms. If no special measures are taken, then this persistent statistical noise leads to residuals of the discretized fluid equations which do not converge, but saturate at a certain level. In the present paper one particular well identified issue caused by the saturated residuals has been described. It has been shown that too large finite-volume residuals can cause crude violation of the global particle balance. In turn, for the system in question - the tokamak edge and divertor plasma - violation of the particle conservation may have a very strong (“zero order”) non-local impact on the whole numerical solution.
There are computational techniques which can effectively reduce the residuals. E.g. in the code B2 which uses splitting by equations an extra loop of simple iterations on each time-iteration is applied. However, severe restriction imposed by those internal iterations on the time-step leads to a very long overall model run-time when this option is used. With numerical diagnostics proposed in this work it can be unambiguously identified when the too large error in the particle balance is caused by the saturated residuals, and the residual reduction techniques must be applied to obtain the physically meaningful solution. The diagnostics can be implemented in any finite-volume edge code.
The problem describe here would become less of an issue if solving the set of non-linear equations on each time-iteration would not require reduced time-step. If such solvers are not feasible, then the accuracy and run-time drawbacks may even outweight the very advantage of using the kinetic test particle Monte-Carlo in the self-consistent models. The drawbacks can be partly compensated by reducing the statistical error which is, in principle, only a matter of available computing resources. Emerging heterogeneous CPU-booster architectures DEEP could be particularly well suited for the combination of a fluid and a Monte-Carlo code. While the serial finite-volume part runs on CPU, the Monte-Carlo part can make use of massive parallelization on hundreds of processing units on the accelerator.
Acknowledgements.
This work was performed under EFDA Work Programme 2013 “Assessment Studies for SOLPS Optimisation” (WP13-SOL).
Appendix A Practical convergence criteria applied to the tokamak edge modelling code B2-EIRENE
Characteristic time-scale of the parameter is calculated from its time-trace by fitting it with a linear function:
[TABLE]
In the present paper the number of last time-iterations used for the fit was equal to , where is the number of points which cover last 5 of physical time. Least-square method is applied to find the parameters and . Same data-points were used to calculate average and in Table 1 and in Table 2.
The control parameters for which are calculated are the total amount of ions of species , total diamagnetic energy in electrons and ions :
[TABLE]
[TABLE]
as well as plasma parameters averaged along the magnetic separatrix: , , . Here the integration is performed over the whole computational grid, is geometrical volume, is the sum over all ion fluids, is the electron density, is the atomic mass of ions, is their average macroscopic velocity. The B2-EIRENE solutions analyzed in this paper were regarded as stationary when 3 sec for all the parameters listed above. For and 15 sec.
Besides this condition of steady-state the errors in the global particle and power balances are checked. The error in particle balance is expressed by Equation (8). Relative error in the power balance is defined as follows:
[TABLE]
Here is the power influx into the computational domain from the core plasma, is the power deposited by charged particles to the Plasma Facing Components (PFC), is the power deposited to PFC by neutrals, is the power radiated by both charged and neutral particles, is the power transferred by neutrals back to the core.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1(1) Reiter D J. Nuclear Mater. 196-198 80 (1992)
- 2(2) Reiter D, Baelmans M and Börner P Fus. Sc. Tech 47 172 (2005)
- 3(3) Maddison G P and Reiter D Recycling source terms for edge plasma fluid models and impact on convergence behaviour of the BRAAMS ”B 2” code Report Jül-2872 (1994) www.eirene.de/Maddison-coupling-report.pdf
- 4(4) Kukushkin A S, Pacher H D, Kotov V, Pacher G W and Reiter D Fus. Eng. Des. 86 2865 (2011)
- 5(5) Kotov V and Reiter D Convergence issues of the B 2-EIRENE code Report Jül-4371 (2014) www.eirene.de/Juel-4371-kotov.pdf
- 6(6) Kotov V Comparison of the different iterative schemes in B 2 for full-scale ITER modelling cases Report on Task 7.2 of Project WP-CD (2014) www.eirene.de/Kotov_WPCD-SOLPS-OPT_2014_final_report.pdf
- 7(7) Ghoos K, Dekeyser W, Samaey G, Börner P and Baelmans M J. Comp. Phys. 322 162 (2016)
- 8(8) Braams B J Computational studies in tokamak equilibrium and transport Ph.D. thesis Rijksuniversiteit Utrecht (1986)
