1 | | = ====================== = |
2 | | = Resistivity in AstroBEAR = |
3 | | = ====================== = |
4 | | |
5 | | The resistive equation can be written as:[[BR]] |
6 | | |
7 | | [[latex($\frac{\partial \textbf{B}}{\partial t}=\nabla \times (\eta \nabla \times \textbf{B})$)]] |
8 | | |
9 | | The magnetic diffusivity eta is a function of temperature as we all know. [[BR]] |
10 | | |
11 | | Now 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]] |
12 | | |
13 | | [[latex($\frac{\partial \textbf{B}}{\partial t}=\eta \nabla^2 \textbf{B} + \nabla \eta \times (\nabla \times \textbf{B})$)]] |
14 | | |
15 | | Now the second term depends on all of the three components of B. So we end up with equations in which the time variance of Bx, By and Bz depend on each other.[[BR]] |
16 | | |
17 | | So the coefficient array is thus no longer a tri-diagonal matrix. For cases where resistive speed is slow (which is usually the case), we can use explicit solver to treat the problem instead.[[BR]] |
18 | | |
19 | | One may wonder if it is possible to throw away the second term on the right hand side of the diffusion equation to just let the diffusivity to vary with position but ignore its own spacial variation. This would give us a form of resistive MHD similar to that of the thermal diffusion case but with temperature dependence built in. [[BR]] |
20 | | |
21 | | [[latex($\frac{\partial \textbf{B}}{\partial t}=\eta (T) \nabla^2 \textbf{B}$)]] |
22 | | |
23 | | Unfortunately, this does not work because the diffusion equation itself has to be divergence free. Our roughest approximation, treating the resistivity as a constant satisfies the requirement as long as the divergence and the laplacian are commutable. If we try to do the same thing to the above equation, we end up getting:[[BR]] |
24 | | |
25 | | [[latex($\frac{\partial \textbf{B}}{\partial t}=\eta \nabla^2 (\nabla \cdot \textbf{B}) + (\nabla \eta \cdot \nabla)\textbf{B}$)]] |
26 | | |
27 | | The first term on the right hand side is zero but the second term is not, especially at sharp temperature fronts where grad(T) is large.[[BR]] |
28 | | So this approximation only works under '''slowly varying temperature''' situation.[[BR]] |
29 | | |
30 | | Upon a closer look at the simulations conducted below, we can observe that the energy inside the domain does not conserve. There is a small increase of total energy during the evolution, especially for the force-free field case. This phenomenon is explained below. [[BR]] |
31 | | In the case of resistive MHD, the energy can be dissipated in the form of Joule heat, comparing to the infinite conductivity case, where the voltage inside the fluid is everywhere zero, and no heat is generated by the current. [[BR]] |
32 | | If we dot the resistive induction equation with the magnetic field B, we obtain the time evolution equation for magnetic energy:[[BR]][[BR]] |
33 | | [[latex($\partial (B^2)/\partial t + \nabla \cdot S = - \textbf{J}\cdot\textbf{E}$)]][[BR]][[BR]] |
34 | | Since we know that:[[BR]][[BR]] |
35 | | [[latex($\textbf{J}=\eta\textbf{E}$)]][[BR]] |
36 | | and also:[[BR]][[BR]] |
37 | | [[latex($\textbf{E}=\nabla \times \textbf{B}$)]][[BR]][[BR]] |
38 | | This leads to an extra energy source term:[[BR]][[BR]] |
39 | | [[latex($\rho\frac{\partial e}{\partial t}=\eta (\nabla \times \textbf{B})^2$)]][[BR]][[BR]] |
40 | | This term can be large in the fast-varying field region, and can be a major mechanism of the dissipation of energy released by the magnetic reconnection. [[BR]][[BR]][[BR]] |
41 | | |
42 | | = ====================== = |
43 | | = Resistivity Solver in AstroBEAR = |
44 | | = ====================== = |
45 | | |
46 | | Here I overview two 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 | | [[Image(http://www.pas.rochester.edu/~shuleli/rmhd_matrix1.png, 20%)]][[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 | | [[Image(http://www.pas.rochester.edu/~shuleli/rmhd_dia1.png, 20%)]][[BR]][[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 | | [[Image(http://www.pas.rochester.edu/~shuleli/rmhd_dia2.png, 30%)]][[BR]]]] |
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 Bz alone, but also the field components of Bx and By. The second order accurate scheme requires 12 closest points surrounding the face center. In the diagram, F denotes face centers, X denotes edge centers. The face centers F1 to F8 have distance of [[latex($sqrt{1/2}$)]], and the face centers F9 to F12 have distance of 1. A larger lattice cell can be considered using further face centers when a higher accuracy is required. The correlation vector C in this case has 13 elements which relates the face center we are considering F0 to the 12 adjacent face centers F1 to F12. Its elements can be written as: [[BR]] |
100 | | |
101 | | [[latex($C_0 = -(k_{X0} + ... + k_{X4})$)]][[BR]] |
102 | | [[latex($C_1 = -k_{X0}$)]][[BR]] |
103 | | [[latex($C_2 = k_{X0}$)]][[BR]] |
104 | | [[latex($C_3 = k_{X2}$)]][[BR]] |
105 | | [[latex($C_4 = -k_{X2}$)]][[BR]] |
106 | | [[latex($C_5 = k_{X3}$)]][[BR]] |
107 | | [[latex($C_6 = -k_{X3}$)]][[BR]] |
108 | | [[latex($C_7 = -k_{X4}$)]][[BR]] |
109 | | [[latex($C_8 = k_{X4}$)]][[BR]] |
110 | | [[latex($C_9 = k_{X1}$)]][[BR]] |
111 | | [[latex($C_{10} = k_{X2}$)]][[BR]] |
112 | | [[latex($C_{11} = k_{X3}$)]][[BR]] |
113 | | [[latex($C_{12} = k_{X4}$)]][[BR]] |
114 | | |
115 | | where k are the CFL number at the edge centers. Since the CFL are defined at the cell centers initially, we need to interpolate the edge centered CFL using the four nearest cell center temperatures. The relation between temperature and the diffusivity is described in the next section. Remember that because the x, y, z field components now reside on different face centers, the value of C vector for a certain cell will be different for different field components. [[BR]] |
116 | | |
117 | | The matrix equation has the form of: [[BR]] |
118 | | |
119 | | [[Image(http://www.pas.rochester.edu/~shuleli/rmhd_matrix2.png, 20%)]][[BR]]]] |
120 | | |
121 | | where M_x, M_y and M_z are the diagonal contributions from the face centers F9 to F12: M = [C_0, C_9, C_10, C_11, C_12, ....]-[1,0,0,0...]; and the blocked M is different for x, y and z components as stated before. There are also nondiagonal blocks which connect Bx block to By and etc. These are marked by D, which comes from the C_1 to C_8 contributions. The source vector is obtained by construct the matrix with -C_0-1; C1; C2; ... C12 and dot it with the field vector: [Bx1 ... Bxn; By1 ... Byn; Bz1 ... Bzn]. The scheme involves looking at each face centers and find out it C vector. Once the C vector is obtained, it can be used to construct the matrix and the source vector. [[BR]] |
122 | | This matrix equation is still solvable using linear solver package in parallel, but the construction of the linear system is much more complicated comparing to approach (1).[[BR]] |
123 | | |
124 | | (A1) Overall more sophisticated than (1), can treat rapid changing temperature. [[BR]] |
125 | | (A2) Method can be extended to treating viscosity. [[BR]] |
126 | | (A3) Using a curl field as the source thus preventing unwanted field divergence from generating. [[BR]] |
127 | | (D1) Computationally much more intense while still requires subcycling. The CFL is instead given by [[latex($\eta dt/l^2$)]][[BR]][[BR]] |
128 | | |
129 | | = ====================== = |
130 | | = Real Magnetic Diffusivity and its Scaling = |
131 | | = ====================== = |
132 | | |
133 | | In cgs units, the real magnetic diffusivity can be written as:[[BR]] |
134 | | |
135 | | [[latex($\eta = c^2/4\pi \sigma$)]] |
136 | | |
137 | | where [[latex($\sigma$)]] is the material conductivity which depends on the electron-ion collision rate [[latex($\nu_{ei}$)]] which in term depends on the electron temperature [[latex($T^{-3/2}$)]]. [[BR]] |
138 | | The cross field diffusivity can thus be expressed as function of electron temperature[[BR]] |
139 | | |
140 | | [[latex($\eta = 0.14 m_{e}^{1/2} c^2 Z \ln \Lambda (k_B T_{e})^{-3/2}$)]] |
141 | | |
142 | | where [[latex($\ln \Lambda$)]] is the Coulomb logarithm:[[BR]] |
143 | | |
144 | | [[latex($\ln \Lambda = 16.3+1.5 \ln T - 0.5\ln n$, (for $T < 4.2 \times 10^{5}$ K)\\$\ln \Lambda =$$22.8+1.5 \ln T - 0.5\ln n$, (for $T > 4.2 \times 10^{5}$ K) )]][[BR]][[BR]] |
145 | | |
146 | | THe Coulomb logarithm for interested number density is plotted below: [[BR]] |
147 | | [[Image(http://www.pas.rochester.edu/~shuleli/CoulombLog.png, 30%)]][[BR]] |
148 | | [[BR]][[BR]] |
149 | | |
150 | | The parallel diffusivity however, is dependent on[[BR]] |
151 | | |
152 | | [[latex($F(Z) = \frac{1+1.198Z+0.222Z^2}{1+2.996Z+0.753Z^2}$)]] |
153 | | |
154 | | For [[latex($Z = 1$)]] case, parallel diffusivity is about half of cross field diffusivity.[[BR]] |
155 | | |