Boundary conditions are required at the radially limiting flux surfaces and .
In GRILLIX, the magnetic axis can be treated easily. In this case only a boundary condition at the outer limiting flux surface is needed. Most often, however, also some is chosen as an artifical boundary for practical reasons (e.g. code performance).
Radial boundaries are somewhat artificial but have to be chosen consistently via an educated guess such that there is no flux of particles and energy through the radial boundary. Our typical set is
A special role is attributed to the potential. At the outer wall, it became standard to set , for consistency with sheath physics. Note however that this allows fluxes through the wall. If the wall is far enough away from the separatrix, and the plasma has enough time to flow out in parallel direction, this can work fine, but it can also become a problem.
In order to avoid fluxes through the inner limiting flux surface, the potential must be a constant at the core, . Following GDB 2018, also in GRILLIX this constant is chosen as the zonal average , allowing the potential to float. This is called 'zonal Neumann' boundary conditions.
Additionally buffer zones are present close to the radial boundaries, where perpendicular diffusion is drastically increased, damping out turbulent fluctuations. Mathematically, this transforms hyperbolic (advective) PDE's into parabolic (diffusive) ones, for which boundary conditions are easier to set and are well defined.
Theory on sheath boundary conditions can be found e.g. in "The Plasma Boundary of Magnetic Fusion Devices" by Peter Stangeby. If the magnetic field is strictly orthogonal to the boundary, one may use strictly sonic or allow supersonic sheaths, i.e. where the sign corresponds to the boundary where the magnetic field is directed towards the plate and the away from the target. According to the above references, the strictly sonic boundary condition only holds in the isothermal case. Usually, is employed.
In the case where the magnetic field hits the boundary under a glancing angle of incidence, which is the standard case in tokamaks and stellarators, the generalised Bohm boundary condition taking into account the drift (Rozhansky 2001) has to be employed: the total particle velocity along the boundary normal vector pointing outside of the domain (towards the boundary) has to be where again the sonic or the supersonic version can be used.
For the parallel current, isolating sheath boundary conditions are implemented, i.e. with We note that in Oliveira & Body 2022 it was found that works somewhat better in some cases, but most of the time it does not seem to make a difference.
No parallel boundary condition on is needed as no parallel operator acts on it, but it is set consistently with .
The electron temperature is set according to with the effective sheath heat transmission coefficient (only on the conducted heat flux, i.e. subtracting 2.5 from the convective heat flux). Strictly speaking, is only constant if , or equivalently if .
A similar option is implemented for . However, it is not clear which coefficient should be used. Typical choices are (0 - 0.1).
We remark that this set of boundary conditions is physics motivated and not necessarily mathematically consistent. It is implemented via the penalisation method - to be added to documentation! - which might hide mathematical problems.
The insulating sheath boundary conditions run stable, but are not perfetly physically valid, because currents can actually flow through the divertor (and other walls). Describing this is challenging, since it might require the consideration of electric circuits outside the plasma volume. Local conducting sheath boundary conditions, e.g. from Loizu 2012, have been implemented and used in many codes. But in our experience, they are ill defined and ill behaved in tokamak geometry, particularly with complex divertors (they do work in slab). At least this is the case for strongly fluctuating turbulent dynamics, where such boundary conditions can even lead to spurious energy inflows.
It remains to discuss density and vorticity boundary conditions. Since they are supposed to flow out, in principle, no boundary condition is needed. However, in our experience (perhaps due to mimetic centered finite differences), in practise something must be set. The options are where (extrapolation) would be equivalent to no boundary conditions, but does not work in practise. For density, the only practical boundary condition is (homogeneous Neumann). For vorticity, both and work equally well.
We want to mention that boundary conditions are a complicated and rich topic by itself and are subject of current research.