# Multi-Region OpenFOAM Solver Development for Compact Toroid Transport in Drift Tube
## 3 Program Verification
### The mhdF Solver Verification
#### 3.1.2 Brio-Wu Shock Tube Problem  
The Brio-Wu shock tube problem is a classic one-dimensional benchmark test in magnetohydrodynamics (MHD) used to evaluate a solver's ability to handle the interaction between magnetic fields and shock waves [31]. It was first proposed by [PERSON] and [PERSON] in 1988. After non-dimensionalization, the initial conditions are shown in Figure 3. At time \(t=0\), the thin layer between the two regions ruptures, and the gases on either side interact to form a system of shock waves in the center of the tube. Due to the limited  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \(\mathbf{N}\) & \(\delta_{N}(B_{x})\) & \(\delta_{N}(B_{y})\) & \(\delta_{N}(\mathbf{U_{x}})\) & \(\delta_{N}(\mathbf{U_{y}})\) & \(\delta_{N}\) & \(\mathbf{R_{N}}\) \\ \hline
50 & 0.19712 & 0.20513 & 0.23659 & 0.19642 & 0.20881 & — \\
100 & 0.11271 & 0.11359 & 0.13713 & 0.10884 & 0.11807 & 0.82 \\
200 & 0.05668 & 0.05661 & 0.06963 & 0.05531 & 0.05956 & 0.90 \\
300 & 0.03443 & 0.03243 & 0.04792 & 0.03846 & 0.03831 & 0.95 \\
400 & 0.01792 & 0.01764 & 0.02222 & 0.01736 & 0.01878 & 1.16 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Relative errors and convergence orders of the velocity components and magnetic induction components for the Orszag–Tang MHD vortex problem.  
capability of the mhdF solver in handling shock problems, a modification was made to the original initial conditions: the magnetic field was reduced from 1 to 0.5. Figure 4 shows the simulation results at time t from both the mhdF solver and the Roe solver implemented in the Athena++ code. It can be seen that the results for the magnetic field component \(B_{y}\) and the density \(\rho\) produced by the two solvers are largely consistent.  
The following section analyzes the Brio-Wu shock tube problem to examine the temporal stability and spatial convergence of the mhdF solver. The relative numerical error in density is defined as follows:  
\[\delta_{N}(\rho)=\frac{\sum\limits_{i=1}^{N}\left|\rho_{i}^{N}-\rho_{i}^{\text {exact}}\right|}{\sum\limits_{i=1}^{N}\left|\rho_{i}^{\text{exact}}\right|} \tag{20}\]  
Here, \(\rho_{i}^{\text{exact}}\) refers to the density value at position \(x_{i}\) computed by the Roe solver in the Athena++ code with a grid resolution of \(N=3072\), which is treated as the reference solution. The relative errors in density computed by the mhdF solver under grid resolutions of \(N=500,1000,2000\) are then evaluated, and the results are shown in Figure 5. For all simulations--including both the Athena++ Roe solver and the mhdF solver--the one-dimensional Courant number \(Co\equiv U_{\text{max}}\Delta t/\Delta x\) is kept below 0.2. Here, \(\Delta t\) denotes the time step size and \(\Delta x\) the spatial grid spacing. The results show that the error produced  
Figure 4: Simulation results of the Brio–Wu shock tube problem at time \(t=0.1\): (**a**) distribution of the y-component of magnetic induction intensity; (**b**) distribution of density.  
Figure 3: Initial conditions of the Brio–Wu shock tube problem.  
by the mhdF solver does not exhibit abrupt changes over time and remains relatively stable, indicating good temporal stability. Moreover, as the number of grid points increases, the error decreases significantly, and the fluctuation in the error over time is also suppressed to a certain extent. This demonstrates that the mhdF solver has good spatial convergence properties.