# MHD mixed results

The MHD run ran out to frame 99 = 12 Myr before beginning to throw out Nan's in the reconstruction… So I copied the 5 GB file and loaded it into Visit - and looked at the results…

# First the Good

—- Here are density isocontours

movie |

—- And here is a close up of a single core with Field lines

movie |

—- And here is the same but with shifted velocity stream lines

movie |

# And the bad

—- The velocity shows a red/black pattern (that is brought out by the color table

—- But the density also shows red/black fluctuations of order 1

# Glimmer of hope

However given that the field lines look ok

—- and the velocity stream lines show that this material is not reaching the collision region

—- And that it only seems to be on the root level

Perhaps there is a way to salvage the run… Obviously the boundary conditions need to be modified - but perhaps some diffusion/filter could be used to smooth out the 'ambient' to allow the run to continue?

After more analysis I believe what happened was that early on, outward velocities were achieved in the ambient around the incoming flow. Since the boundary conditions were 'outflow only', the boundary conditions were extrapolated for these cells - I don't know why gravity did not reverse this effect, or why the neighboring cells were able to maintain their 'inflow'… But given the red-black pattern - i suspect hypre truncation errors were somehow amplified by the boundary conditions… However, I don't know why this was not seen in the hydro runs..

movie |

—-

movie |

—-

So I did three fixed grid simulations to see what was responsible

movie |

And it looks like magnetic fields make the difference - although self-gravity seems to exacerbate the problem.

So I also tried a reflecting wall boundary condition to see if that would prevent the striations - and that will finish soon. But in the meantime…

## Fixing the striations

It is high frequency noise that could potentially be filtered? Though we don't want to introduce any divergence… Another option is to add local diffusion… ie \(q_{i,j,k} = q_{i,j,k}+ G_{i,j-½,k}-G_{i,j+½,k} +H_{i,j,k-½} - H_{i,j,k+½} \) where \(G_{i,j+½,k} = \alpha_y \left ( q_{i,j,k} -q_{i,j+1,k} \right ) \) and so on…

This would give a new value of \(q_{i,j,k}=q_{i,j,k} \times \left (1 - 2\alpha_y-2\alpha_x-2\alpha_z \right ) + \alpha_x \left (q_{i-1,j,k}+q_{i+1,j,k} \right ) + \alpha_y \left (q_{i,j-1,k}+q_{i,j+1,k} \right ) + \alpha_z \left (q_{i,j,k-1}+q_{i,j,k+1} \right ) \)

This can be repeated as needed, but setting \(\alpha_x = \alpha_y = \alpha_z = 1/12\) should give reasonable results…

Now to keep the B-field divergence free, we need to calculate an 'emf' to update the B-field with… \(\mathbf{B}=\mathbf{B}+\nabla \times \mathbf{E}\). Now we want to diffuse the B-field using \(\mathbf{B}=\mathbf{B}+\alpha \nabla^{2 \mathbf{B} = \mathbf{B}-\alpha \nabla \times \left ( \nabla \times \mathbf{B} \right ) \) so we can identify \(E=-\alpha \nabla \times \mathbf{B} \)
This can be discretized as \(E}z_{i+½,j+½,k} = -\alpha \left (B^{y_{i+1,j+½,k}-B}y_{i,j+½,k} + B^{x_{i+½,j,k}-B}x_{i+½,j+1,k} \right ) \) and so on…

This would give

Now if we are only worried about Bx, and smoothing in y and z we can simplify this to

This should keep the ratio of \(\rho / B_x\) constant… consistent with flux freezing.

We can also reduce the diffusion where the mixing parameter is high - or where the grid is refined… if we use a diffusion factor \(f = 1 - e^{{1-4 \left ( \frac{\rho_L+\rho_R}{\rho}\right )}2 } \) and then set \( f = 0\) if a cell is refined. In addition we can force diffusion near the inflow boundaries by scaling \(f = \max(f, \left (\frac{r-.75}{.25} \right ) ^{2 ) \) where \(r \) is a parameter that goes from 0 at the midplane - to 1 at the boundaries.
}

### Attachments (19)

- MHD0000.bmp (2.1 MB) - added by 11 years ago.
- MHDsphere0028.bmp (1.6 MB) - added by 11 years ago.
- MHDBV20059.bmp (1.6 MB) - added by 11 years ago.
- MHD.AVI (3.6 MB) - added by 11 years ago.
- MHDzoom.AVI (13.9 MB) - added by 11 years ago.
- MHDBV.AVI (9.2 MB) - added by 11 years ago.
- Trouble0000.png (296.5 KB) - added by 11 years ago.
- Trouble0001.png (144.1 KB) - added by 11 years ago.
- Trouble0002.png (152.5 KB) - added by 11 years ago.
- Trouble0003.png (181.9 KB) - added by 11 years ago.
- Trouble0004.png (97.5 KB) - added by 11 years ago.
- BoundaryTroublesTBx0018.png (83.1 KB) - added by 11 years ago.
- BoundaryTroubles0099.png (76.5 KB) - added by 11 years ago.
- BoundaryTroublesTBx.gif (2.1 MB) - added by 11 years ago.
- BoundaryTroubles.gif (19.7 MB) - added by 11 years ago.
- diff20000.png (154.3 KB) - added by 11 years ago.
- vx_comp0036.png (121.3 KB) - added by 11 years ago.
- vx_comp.gif (13.4 MB) - added by 11 years ago.
- diff20001.png (166.4 KB) - added by 11 years ago.

## Comments

No comments.