The XTOR-2F code simulates the 3D dynamics of full bi-fluid MHD instabilities in tokamak plasmas (Lütjens and Luciani 2010 J. Comput. Phys.229 8130). The original fixed boundary computational domain of the code was generalized to a free-boundary one, thus approaching closely the geometry of today's and future large experimental devices. The initial conditions for XTOR-2F are given by the CHEASE equilibrium code (Lütjens et al O 1996 Comput. Phys. Commun.97 219) inside the plasma. Outside the plasma, the solution is extended by fitting the magnetic potential at the CHEASE computation domain boundary with a set of external poloidal magnetic coils. The boundary conditions use Green functions to construct a response matrix matching the normal and tangential components of the outside magnetic field with the inside solution. A thin resistive wall can be added to the computational domain. This new numerical setup generalizes the XTOR-2F investigation field from internal MHD instabilities such as internal kinks and tearings towards external instabilities. The code linear behavior is validated with two families of instabilities, n = 0 axisymmetric modes and external kinks. In order to validate the nonlinear behavior with these magnetic structure modifications, nonlinear resistive MHD simulations of tearing modes at zero beta evolving to a stationary state have been performed.
FGE: a fast free-boundary Grad–Shafranov evolutive solver