| 43 | = Resistivity Solver in AstroBEAR = |
| 44 | = ====================== = |
| 45 | |
| 46 | Here I overview four approaches to solve the resistive MHD equations. [[BR]][[BR]] |
| 47 | (1)Solving the decomposed format with divergence cleaning (Implicit) [[BR]] |
| 48 | This is the simplest method in terms of solving scheme. This method is based on the simplification that in some cases eta is a constant in the region of interest. This will simplify the above equation into the following form:[[BR]] |
| 49 | |
| 50 | [[latex($\frac{\partial \textbf{B}}{\partial t}=\eta \nabla^2 \textbf{B}$)]] |
| 51 | |
| 52 | This equation holds true for each separate field component, and the form resembles the linear isotropic thermal conduction equation. We can solve the elliptic equation for three times or we can write a expanded linear system so that the solver is only called once: [[BR]] |
| 53 | |
| 54 | [[matrix1]][[BR]] |
| 55 | |
| 56 | In the constant diffusivity case, the matrix M are identical for the Bx, By and Bz components. Define C=[-6k,k,k,k,k,k,k], where [[latex($k = \eta dt/dx^2$)]]. One can immediately recognize that k is the diffusion CFL number. Then the expanded matrix is still "tridiagonal" in a 3-D sense and can be blocked into three identical parts: [[latex($M_i=C-[1,0,0,0,0,0,0]$)]] on each row. The RHS vector are source terms that can be easily obtained by the following the CR scheme:[[BR]] |
| 57 | [[BR]] |
| 58 | [[latex($S_{xi}=(-C-[1,0,0,0,0,0,0]) \cdot B_{xi}$)]][[BR]] |
| 59 | [[BR]] |
| 60 | |
| 61 | The matrix equation can be solved using linear solvers at hand in parallel.[[BR]] |
| 62 | The field obtained above resides at cell centers. We can do interpolations to retrieve the new magnetic field at each cell faces. But since we are treating the x, y and z fields independently and applying sources that is not necessarily divergence free to them, we are running the risk of introducing divergence to the face centered magnetic field components which should be divergence free. Experiments show that this decomposing method can introduce large divergence to the face centered field. Thus a divergence cleaning scheme is required once we finish the diffusion update. Here we introduce the divergence cleaning scheme implemented in AstroBEAR. Considering a cell with face centered field components:[[BR]] |
| 63 | |
| 64 | [[dia1]][[BR]] |
| 65 | |
| 66 | We can find the divergence source term: [[latex($d=\nabla \cdot B$)]]. It is obvious that if B is face centered, then its divergence should be cell centered.[[BR]] |
| 67 | Now we solve the following equation system: [[latex($\nabla^2 \phi = d$)]] by using d as a source. This equation system is again well defined, and can be constructed using the same C vector described before with k = 1. Once we obtained phi, we can go back to clean the face centered field: [[BR]] |
| 68 | |
| 69 | [[latex($B'=B-\nabla \phi$)]] [[BR]] |
| 70 | |
| 71 | We can easily see that the new field is divergence free: |
| 72 | |
| 73 | [[latex($\nabla \cdot B' = \nabla \cdot B - \nabla \cdot \nabla \phi = \nabla \cdot B - \nabla^2 \phi = 0 $)]] [[BR]] |
| 74 | |
| 75 | Since phi is cell centered, its gradient is face centered which matches the face centered field components. So this method is exact. [[BR]] |
| 76 | |
| 77 | The advantages and disadvantages are listed below: [[BR]] |
| 78 | |
| 79 | (A1) Simple scheme, works fine with slowly varying temperature situations. [[BR]] |
| 80 | |
| 81 | (A2) The divergence cleaning scheme is simple and exact. [[BR]] |
| 82 | |
| 83 | (D1) The scheme requires constructing cell centered field components and then reconstruct the face centered field components from the updated cell centered field. The cell centered field components are not divergence free to start with, which is diffused using a decomposed scheme. The process may introduce divergence that is large enough that the cleaning mechanism could not work well enough. [[BR]] |
| 84 | |
| 85 | (D2) The divergence cleaning scheme has a flexible boundary condition. Normally in the code, we take the Neumann boundary condition. This condition impose the requirement that the face centered field components at the domain boundaries do not need to be adjusted. The condition in itself may not be optimistic, and is likely to be depending on the specific problem. [[BR]] |
| 86 | |
| 87 | (D3) Cannot treat fast varying temperature situation where the temperature length scale is comparable or smaller comparing to the field length scale. [[BR]] |
| 88 | |
| 89 | (2)Solving the coupled format with varying temperature (Explicit) [[BR]] |
| 90 | |
| 91 | Here we consider the full equation:[[BR]] |
| 92 | |
| 93 | [[latex($\frac{\partial \textbf{B}}{\partial t}=\nabla \times (\eta \nabla \times \textbf{B})$)]] |
| 94 | |
| 95 | Here we treat the face centered field components directly by looking at the following diagram: [[BR]] |
| 96 | |
| 97 | [[dia2]] |
| 98 | |
| 99 | We use Bz at the top face of the cell as an example for demonstration. Here, the changing of Bz does not only depend on the |
| 100 | |
| 101 | |
| 102 | = ====================== = |