Changes between Version 13 and Version 14 of AstroBearProjects/resistiveMHD


Ignore:
Timestamp:
08/23/11 20:40:23 (13 years ago)
Author:
Shule Li
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • AstroBearProjects/resistiveMHD

    v13 v14  
    77[[latex($\frac{\partial \textbf{B}}{\partial t}=\nabla \times (\eta \nabla \times \textbf{B})$)]]
    88
    9 The magnetic diffusivity eta is a function of temperature as we all know. Now one simplification can be made that eta is a constant across the domain. This will simplify the above equation into the following form:[[BR]]
    10 
    11 [[latex($\frac{\partial \textbf{B}}{\partial t}=\eta \nabla^2 \textbf{B}$)]]
    12 
    13 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]]
    14 
    15 In the constant diffusivity case, matrices 1, 2, 3 are identical, the expanded matrix is still tridiagonal and can be blocked into three identical parts. [[BR]]
     9The magnetic diffusivity eta is a function of temperature as we all know. [[BR]]
     10
    1611Now for the first equation, what if we want to include the temperature dependence into the code? From the next section, you can see that when a field configuration in equilibrium is subject to strong diffusion, usually heating would occur and surppress the local resistivity and thus the diffusivity. By expanding the first equation, we have the form:[[BR]]
    1712
     
    4641
    4742= ====================== =
     43= Resistivity Solver in AstroBEAR =
     44= ====================== =
     45
     46Here I overview four approaches to solve the resistive MHD equations. [[BR]][[BR]]
     47(1)Solving the decomposed format with divergence cleaning (Implicit) [[BR]]
     48This 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
     52This 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
     56In 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
     61The matrix equation can be solved using linear solvers at hand in parallel.[[BR]]
     62The 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
     66We 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]]
     67Now 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
     71We 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
     75Since phi is cell centered, its gradient is face centered which matches the face centered field components. So this method is exact. [[BR]]
     76
     77The 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
     91Here we consider the full equation:[[BR]]
     92
     93[[latex($\frac{\partial \textbf{B}}{\partial t}=\nabla \times (\eta \nabla \times \textbf{B})$)]]
     94
     95Here we treat the face centered field components directly by looking at the following diagram: [[BR]]
     96
     97[[dia2]]
     98
     99We 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= ====================== =
    48103= Real Magnetic Diffusivity and its Scaling =
    49104= ====================== =