This work considers two algorithms of a finite-volume solver for the MHD equations with a real-gas equation of state (EOS). Both algorithms use a multistate form of Harten-Lax-Van Leer approximate Riemann solver as formulated for MHD discontinuities. This solver is modified to use the generalized sound speed from the real-gas EOS. Two methods are tested: EOS evaluation at cell centers and at flux interfaces where the former is more computationally efficient. A battery of 1D and 2D tests are employed: convergence of 1D and 2D linearized waves, shock tube Riemann problems, a 2D nonlinear circularly polarized Alfvén wave, and a 2D magneto-Rayleigh-Taylor instability test. The cell-centered EOS evaluation algorithm produces unresolvable thermodynamic inconsistencies in the intermediate states leading to spurious solutions while the flux-interface EOS evaluation algorithm robustly produces the correct solution. The linearized wave tests show this inconsistency is associated with the magnetosonic waves and the magneto-Rayleigh-Taylor instability test demonstrates simulation results where the spurious solution leads to an unphysical simulation.
The JOREK extended magneto-hydrodynamic (MHD) code is a widely used simulation code for studying the non-linear dynamics of large-scale instabilities in divertor tokamak plasmas. Due to the large scale-separation intrinsic to these phenomena both in space and time, the computational costs for simulations in realistic geometry and with realistic parameters can be very high, motivating the investment of considerable effort for optimization. In this article, a set of developments regarding the JOREK solver and preconditioner is described, which lead to overall significant benefits for large produ…
A new MHD solver, based on the Nektar++ spectral/hp element framework, is presented in this paper. The velocity and electric potential quasi-static MHD model is used. The Hartmann flow in plane channel and its stability, the Hartmann flow in rectangular duct, and the stability of Hunt's flow are explored as examples. Exponential convergence is achieved and the resulting numerical values were found to have an accuracy up to $10^{-12}$ for the state flows compared to an exact solution, and $10^{-5}$ for the stability eigenvalues compared to independent numerical results.
MRX: A differentiable 3D MHD equilibrium solver without nested flux surfaces
Courant Institute of Mathematical Sciences, New York University(纽约大学柯朗数学科学研究所);William E. Boeing Department of Aeronautics and Astronautics, University of Washington(华盛顿大学威廉E.波音航空航天系)
The dispersive character of the Hall-MHD solutions, in particular the whistler waves, is a strong restriction to numerical treatments of this system. Numerical stability demands a time step dependence of the form $Δt\propto (Δx)^2$ for explicit calculations. A new semi--implicit scheme for integrating the induction equation is proposed and applied to a reconnection problem. It it based on a fix point iteration with a physically motivated preconditioning. Due to its convergence properties, short wavelengths converge faster than long ones, thus it can be used as a smoother in a nonlinear multigr…
Many problems in physics are inherently of multi-scale nature. The issues of MHD turbulence or magnetic reconnection, namely in the hot and sparse, almost collision-less astrophysical plasmas, can stand as clear examples. The Finite Element Method (FEM) with adaptive gridding appears to be the appropriate numerical implementation for handling the broad range of scales contained in such high Lundquist-number MHD problems. In spite the FEM is now routinely used in engineering practice in solid-state and fluid dynamics, its usage for MHD simulations has recently only begun and only few implementa…
In this work we present a general strategy for constructing multidimensional Riemann solvers with a single intermediate state, with particular attention paid to detailing the two-dimensional Riemann solver. This is accomplished by introducing a constant resolved state between the states being considered, which introduces sufficient dissipation for systems of conservation laws. Closed form expressions for the resolved fluxes are also provided to facilitate numerical implementation. The Riemann solver is proved to be positively conservative for the density variable; the positivity of the pressur…
We describe a high-order numerical magnetohydrodynamics (MHD) solver built upon a novel non-linear entropy stable numerical flux function that supports eight travelling wave solutions. By construction the solver conserves mass, momentum, and energy and is entropy stable. The method is designed to treat the divergence-free constraint on the magnetic field in a similar fashion to a hyperbolic divergence cleaning technique. The solver described herein is especially well-suited for flows involving strong discontinuities. Furthermore, we present a new formulation to guarantee positivity of the pres…
In this paper we present a genuinely two-dimensional HLLC Riemann solver. On logically rectangular meshes, it accepts four input states that come together at an edge and outputs the multi-dimensionally upwinded fluxes in both directions. This work builds on, and improves, our prior work on two-dimensional HLL Riemann solvers. The HLL Riemann solver presented here achieves its stabilization by introducing a constant state in the region of strong interaction, where four one-dimensional Riemann problems interact vigorously with one another. A robust version of the HLL Riemann solver is presented …
We propose and analyze a class of robust, uniformly high-order accurate discontinuous Galerkin (DG) schemes for multidimensional relativistic magnetohydrodynamics (RMHD) on general meshes. A distinct feature of the schemes is their physical-constraint-preserving (PCP) property, i.e., they are proven to preserve the subluminal constraint on the fluid velocity and the positivity of density, pressure, and specific internal energy. Developing PCP high-order schemes for RMHD is highly desirable but remains a challenging task, especially in the multidimensional cases, due to the inherent strong nonl…
A high-order method to evolve in time electromagnetic and velocity fields in conducting fluids with non-periodic boundaries is presented. The method has a small overhead compared with fast FFT-based pseudospectral methods in periodic domains. It uses the magnetic vector potential formulation for accurately enforcing the null divergence of the magnetic field, and allowing for different boundary conditions including perfectly conducting walls or vacuum surroundings, two cases relevant for many astrophysical, geophysical, and industrial flows. A spectral Fourier continuation method is used to acc…
We present a new method for numerical hydrodynamics which uses a multidimensional generalisation of the Roe solver and operates on an unstructured triangular mesh. The main advantage over traditional methods based on Riemann solvers, which commonly use one-dimensional flux estimates as building blocks for a multidimensional integration, is its inherently multidimensional nature, and as a consequence its ability to recognise multidimensional stationary states that are not hydrostatic. A second novelty is the focus on Graphics Processing Units (GPUs). By tailoring the algorithms specifically to …
We propose a new Harten-Lax-van Leer discontinuities (HLLD) approximate Riemann solver to improve the stability of shocks and the accuracy of low-speed flows in multidimensional magnetohydrodynamic (MHD) simulations. Stringent benchmark tests verify that the new solver is more robust against a numerical shock instability and is more accurate for low-speed, nearly incompressible flows than the original solver, whereas additional computational costs are quite low. The novel ability of the new solver enables us to tackle MHD systems, including both high and low Mach number flows.
The relativistic magnetohydrodynamics (RMHD) set of equations has recently seen increased use in astrophysical computations. Even so, RMHD codes remain fragile. The reconstruction can sometimes yield superluminal velocities in certain parts of the mesh. In this paper we present a reconstruction strategy that overcomes this problem by making a single conservative to primitive transformation per cell followed by higher order WENO reconstruction on a carefully chosen set of primitives that guarantee subluminal reconstruction of the flow variables. For temporal evolution via a predictor step we al…
A numerical method for the quasi-neutral two-fluid (QNTF) plasma model is described. The basic equations are ion and electron fluid equations and the Maxwell equations without displacement current. The neglect of displacement current is consistent with the assumption of charge neutrality. It thus reduces to the ideal magnetohydrodynamic (MHD) equations in the long wavelength limit, but the two-fluid effect appearing at ion and electron inertial scales is fully taken into account. It is shown that the basic equations may be rewritten in a form that has formally the same structure as the MHD equ…
The time-dependent equations of computational electrodynamics (CED) are evolved consistent with the divergence constraints. As a result, there has been a recent effort to design finite volume time domain (FVTD) and discontinuous Galerkin time domain (DGTD) schemes that satisfy the same constraints and, nevertheless, draw on recent advances in higher order Godunov methods. This paper catalogues the first step in the design of globally constraint-preserving DGTD schemes. The algorithms presented here are based on a novel DG-like method that is applied to a Yee-type staggering of the electromagne…
This work is a continuation of our efforts to develop an efficient implicit solver for multidimensional hydrodynamics for the purpose of studying important physical processes in stellar interiors, such as turbulent convection and overshooting. We present an implicit solver that results from the combination of a Jacobian-Free Newton-Krylov method and a preconditioning technique tailored to the inviscid, compressible equations of stellar hydrodynamics. We assess the accuracy and performance of the solver for both 2D and 3D problems for Mach numbers down to $10^{-6}$. Although our applications co…
Efficient simulation of plasmas in various contexts often involves the use of meshes that conform to the intrinsic geometry of the system under consideration. We present here a description of a new magnetohydrodynamic code, Gamera (Grid Agnostic MHD for Extended Research Applications), designed to combine geometric flexibility with high-order spatial reconstruction and constrained transport to maintain the divergence-free magnetic field. Gamera carries on the legacy of its predecessor, the LFM (Lyon-Fedder-Mobarry), a research code whose use in space physics has spanned three decades. At the t…
We describe a novel Godunov-type numerical method for solving the equations of resistive relativistic magnetohydrodynamics. In the proposed approach, the spatial components of both magnetic and electric fields are located at zone interfaces and are evolved using the constrained transport formalism. Direct application of Stokes' theorem to Faraday's and Ampere's laws ensures that the resulting discretization is divergence-free for the magnetic field and charge-conserving for the electric field. Hydrodynamic variables retain, instead, the usual zone-centred representation commonly adopted in fin…
We present a second-order Godunov algorithm for multidimensional, ideal MHD. Our algorithm is based on the unsplit formulation of Colella (J. Comput. Phys. vol. 87, 1990), with all of the primary dependent variables centered at the same location. To properly represent the divergence-free condition of the magnetic fields, we apply a discrete projection to the intermediate values of the field at cell faces, and apply a filter to the primary dependent variables at the end of each time step. We test the method against a suite of linear and nonlinear tests to ascertain accuracy and stability of the…
In the numerical simulation of ideal MHD, keeping the pressure and density positive is essential for both physical considerations and numerical stability. This is a challenge, due to the underlying relation between such positivity-preserving (PP) property and the magnetic divergence-free (DF) constraint as well as the strong nonlinearity of the MHD equations. This paper presents the first rigorous PP analysis of the central discontinuous Galerkin (CDG) methods and constructs arbitrarily high-order PP CDG schemes for ideal MHD. By the recently developed geometric quasilinearization (GQL) approa…
The multidimensional gas-kinetic scheme for the Navier-Stokes equations under gravitational fields [J. Comput. Phys. 226 (2007) 2003-2027] is extended to resistive magnetic flows. The non-magnetic part of the magnetohydrodynamics equations is calculated by a BGK solver modified due to magnetic field. The magnetic part is treated by the flux splitting method based gas-kinetic theory [J. Comput. Phys. 153 (1999) 334-352 ], using a particle distribution function constructed in the BGK solver. To include Lorentz force effects into gas evolution stage is very important to improve the accuracy of th…
In various astrophysics settings it is common to have a two-fluid relativistic plasma that interacts with the electromagnetic field. While it is common to ignore the displacement current in the ideal, classical magnetohydrodynamic limit, when the flows become relativistic this approximation is less than absolutely well-justified. In such a situation, it is more natural to consider a positively charged fluid made up of positrons or protons interacting with a negatively charged fluid made up of electrons. The two fluids interact collectively with the full set of Maxwell's equations. As a result,…
Since the advent of Taylor-Woltjer theory [J B Taylor, PRL, 33, 1139 (1974), L Woltjer, PNAS, 44, 489 (1958)], it has been widely believed that situations with perfectly conducting boundaries and near ideal conditions, the final state of MHD system would be force-free Taylor-Woltjer states defined as $\vec{\nabla} \times \vec{B} = α\vec{B}$ with $α$ as a constant and $\vec{B}$ is the magnetic field defined over a volume $V$. These states are of fundamental importance in fusion plasmas [J B Taylor, RMP 58, 741 (1986)]. More recently, several new MHD models have been proposed - for example Reduc…
The semi-implicit leapfrog time-discretization is a workhorse algorithm for initial-value MHD codes to bridge between vastly separated time scales. Inclusion of atomic interactions with neutrals breaks the functional structure of the MHD equations that exploited by the leapfrog. We address how to best integrate atomic physics into the semi-implicit leapfrog. Following the Crank-Nicolson method, one approach is to time-center the atomic interactions in the linear solver and use a Newton method to include the nonlinear contributions. Alternatively, another family of methods are based on operator…
The self-consistent modeling of vacuum polarization due to virtual electron-positron fluctuations is of relevance for many near term experiments associated with high intensity radiation sources and represents a milestone in describing scenarios of extreme energy density. We present a generalized finite-difference time-domain solver that can incorporate the modifications to Maxwell's equations due to vacuum polarization. Our multidimensional solver reproduced in one-dimensional configurations the results for which an analytic treatment is possible, yielding vacuum harmonic generation and birefr…
A new Riemann solver is presented for the ideal magnetohydrodynamics (MHD) equations with the so-called Boris correction. The Boris correction is applied to reduce wave speeds, avoiding an extremely small timestep in MHD simulations. The proposed Riemann solver, Boris-HLLD, is based on the HLLD solver. As done by the original HLLD solver, (1) the Boris-HLLD solver has four intermediate states in the Riemann fan when left and right states are given, (2) it resolves the contact discontinuity, Alfvén waves, and fast waves, and (3) it satisfies all the jump conditions across shock waves and discon…
We present a numerical solver for plasma dynamics simulations in Hall magnetohydrodynamic (HMHD) approximation in one, two and three dimensions. We consider both isotropic and anisotropic thermal pressure cases, where a general gyrotropic approximation is used. Both explicit energy conservation equation and general polytropic state equations are considered. The numerical scheme incorporates second-order Runge-Kutta advancing in time and Kurganov-Tadmor scheme with van Leer flux limiter for the approximation of fluxes. A flux-interpolated constrained-transport approach is used to preserve solen…
The magnetohydrodynamics (MHD) equations are generally known to be difficult to solve numerically, due to their highly nonlinear structure and the strong coupling between the electromagnetic and hydrodynamic variables, especially for high Reynolds and coupling numbers. In the first part of this work, we present a scalable augmented Lagrangian preconditioner for a finite element discretisation of the $\mathbf{B}$-$\mathbf{E}$ formulation of the incompressible viscoresistive MHD equations. For stationary problems, our solver achieves robust performance with respect to the Reynolds and coupling n…
We develop structure-preserving finite element methods for the incompressible, resistive Hall magnetohydrodynamics (MHD) equations. These equations incorporate the Hall current term in Ohm's law and provide a more appropriate description of fully ionized plasmas than the standard MHD equations on length scales close to or smaller than the ion skin depth. We introduce a stationary discrete variational formulation of Hall MHD that enforces the magnetic Gauss's law exactly (up to solver tolerances) and prove the well-posedness and convergence of a Picard linearization. For the transient problem, …
We describe a new Godunov algorithm for relativistic magnetohydrodynamics (RMHD) that combines a simple, unsplit second order accurate integrator with the constrained transport (CT) method for enforcing the solenoidal constraint on the magnetic field. A variety of approximate Riemann solvers are implemented to compute the fluxes of the conserved variables. The methods are tested with a comprehensive suite of multidimensional problems. These tests have helped us develop a hierarchy of correction steps that are applied when the integration algorithm predicts unphysical states due to errors in th…
Force-free plasmas are a good approximation where the plasma pressure is tiny compared with the magnetic pressure, which is the case during the cold vertical displacement event (VDE) of a major disruption in a tokamak. On time scales long compared with the transit time of Alfven waves, the evolution of a force-free plasma is most efficiently described by the quasi-static magnetohydrodynamic (MHD) model, which ignores the plasma inertia. Here we consider a regularized quasi-static MHD model for force-free plasmas in tokamak disruptions and propose a mimetic finite difference (MFD) algorithm. Th…
A new multidimensional simulation code for relativistic two-fluid electrodynamics (RTFED) is described. The basic equations consist of the full set of Maxwell's equations coupled with relativistic hydrodynamic equations for separate two charged fluids, representing the dynamics of either an electron-positron or an electron-proton plasma. It can be recognized as an extension of conventional relativistic magnetohydrodynamics (RMHD). Finite resistivity may be introduced as a friction between the two species, which reduces to resistive RMHD in the long wavelength limit without suffering from a sin…
We modify an existing magnetohydrodynamics algorithm to make it more compatible with a dimensionally-split (DS) framework. It is based on the standard reconstruct-solve-average strategy (using a Riemann solver), and relies on constrained transport to ensure that the magnetic field remains divergence-free (div B = 0). The DS approach, combined with the use of a single, cell-centred grid (for both the fluid quantities and the magnetic field), means that the algorithm can be easily added to existing DS hydrodynamics codes. This makes it particularly useful for mature astrophysical codes, which of…
There is a great need in several areas of astrophysics and space-physics to carry out high order of accuracy, divergence-free MHD simulations on spherical meshes. This requires us to pay careful attention to the interplay between mesh quality and numerical algorithms. Methods have been designed that fundamentally integrate high order isoparametric mappings with the other high accuracy algorithms that are needed for divergence-free MHD simulations on geodesic meshes. The goal of this paper is to document such algorithms that are implemented in the geodesic mesh version of the RIEMANN code. The …
The ideal MHD equations are a central model in astrophysics, and their solution relies upon stable numerical schemes. We present an implementation of a new method, which possesses excellent stability properties. Numerical tests demonstrate that the theoretical stability properties are valid in practice with negligible compromises to accuracy. The result is a highly robust scheme with state-of-the-art efficiency. The scheme's robustness is due to entropy stability, positivity and properly discretised Powell terms. The implementation takes the form of a modification of the MHD module in the FLAS…
GAMER, a parallel Graphic-processing-unit-accelerated Adaptive-MEsh-Refinement hydrodynamic code, has been extended to support magnetohydrodynamics (MHD) with both the corner-transport-upwind (CTU) and MUSCL-Hancock schemes and the constraint transport (CT) technique. The divergent preserving operator for adaptive mesh refinement (AMR) has been applied to reinforce the divergence-free constraint on the magnetic field. GAMER-MHD has fully exploited the concurrent executions between the GPU MHD solver and other CPU computation pertinent to AMR. We perform various standard tests to demonstrate th…
Three object-oriented implementations of a prototype solver of the advection equation are introduced. The presented programs are based on Blitz++ (C++), NumPy (Python), and Fortran's built-in array containers. The solvers include an implementation of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA). The introduced codes exemplify how the application of object-oriented programming (OOP) techniques allows to reproduce the mathematical notation used in the literature within the program code. A discussion on the tradeoffs of the programming language choice is presented…
We present the FARGO3D code, recently publicly released. It is a magnetohydrodynamics code developed with special emphasis on protoplanetary disks physics and planet-disk interactions, and parallelized with MPI. The hydrodynamics algorithms are based on finite difference upwind, dimensionally split methods. The magnetohydrodynamics algorithms consist of the constrained transport method to preserve the divergence-free property of the magnetic field to machine accuracy, coupled to a method of characteristics for the evaluation of electromotive forces and Lorentz forces. Orbital advection is impl…