# Multi-Region OpenFOAM Solver Development for Compact Toroid Transport in Drift Tube
## 2 Models
### Multi-Region Coupling Framework and Interface Coupling Boundary Conditions  
Multi-region coupling methods are mainly divided into monolithic and segregated coupling. Monolithic coupling integrates the governing equations of multiple regions into a unified system and solves them synchronously with the coupling conditions treated implicitly. Its advantage lies in the direct consideration of interactions between regions and theoretically better convergence, but it faces challenges such as large matrix systems, high computational resource requirements, and high implementation complexity. In contrast, segregated coupling solves equations in each region independently and achieves inter-region coupling through custom internal interface boundary conditions (such as transfer boundary conditions), iterating multiple times until convergence. Segregated coupling often uses non-overlapping domain decomposition methods, also known as Schwarz methods, with the typical example being the Dirichlet-Neumann algorithm. This method imposes Dirichlet boundary conditions and Neumann boundary conditions on opposite sides of the interface to achieve data exchange [28; 29]. mhdMRF is based on the chtMultiRegionFoam framework. By modifying the PIMPLE loop and adding n iterations at the outermost level, it performs multi-region coupling iterations to ensure that the coupled physical quantities between regions converge after n cycles. The above mhdF solver and magnetic diffusion solver are embedded into this framework. Through the boundary relationships of magnetic flux density and the flux of magnetic flux density at internalinterfaces, data transfer is achieved via custom interface coupling boundary conditions. The internal interface coupling boundary condition of the magnetic field is introduced as follows.  
From the boundary relationships in electromagnetic theory,  
\[B_{1n}=B_{2n} \tag{9}\]  
\[\mathbf{H_{1t}}-\mathbf{H_{2t}}=\mathbf{J_{s}} \tag{10}\]  
Here, \(B_{1n}\), \(B_{2n}\) are the normal components of the magnetic flux density at the interface in region 1 and region 2, respectively. The normal direction is taken to be the same. \(\mathbf{H_{1t}}\) and \(\mathbf{H_{2t}}\) are the tangential components of the magnetic field intensity in region 1 and region 2, respectively. \(\mathbf{J_{s}}=\lim\limits_{h\to\infty}\mathbf{J}\Delta h\) refers to the surface current density at the interface, where \(\mathbf{J}\) is the conduction current in the medium and \(\Delta h\) denotes the thickness of the computational region. It can be shown that in a finite-conductivity medium, \(\mathbf{J_{s}}=0\), meaning the surface current density at the interface is zero. Since the magnetic permeability of the CT is approximately equal to the vacuum permeability, and if the conductor wall is made of non-magnetic materials such as copper or aluminum, then the magnetic boundary conditions of interface can be simplified to  
\[B_{1n}=B_{2n} \tag{11}\]  
\[\mathbf{B_{1t}}=\mathbf{B_{2t}} \tag{12}\]  
That is, both the normal and tangential components of the magnetic flux density are continuous at the internal interface. Therefore, the normal and tangential fluxes of magnetic flux density at the interface should also be continuous:  
\[\eta_{m1}\frac{\partial B_{1n}}{\partial n}=\eta_{m2}\frac{\partial B_{2n}}{ \partial n} \tag{13}\]  
\[\eta_{m1}\frac{\partial\mathbf{B_{1t}}}{\partial n}=\eta_{m2}\frac{\partial\mathbf{B_ {2t}}}{\partial n} \tag{14}\]  
\(\eta_{m1}=1/\mu_{0}\sigma_{1}\) and \(\eta_{m2}=1/\mu_{0}\sigma_{2}\) represent the magnetic diffusion coefficients in the two media, reflecting the speed at which the magnetic field diffuses in the medium.  
With the above conditions of continuity of values and fluxes at the interface, this work implements a custom magnetic field interface coupling boundary condition using the Dirichlet-Neumann algorithm, named magneticCoupleBC.