PLUTO Test Problems  4.4-patch2
Functions
init.c File Reference

Magnetic field diffusion in 2D and 3D. More...

Functions

void InitDomain (Data *d, Grid *grid)
 

Detailed Description

Sets the initial conditions for a magnetic field diffusion problem in 2 or 3 dimensions. This is a useful test to check the ability of the code to solve standard diffusion problems. The magnetic field has initially a Gaussian profile, and an anisotropic resistivity is possible. This problem has an analytical solution given, in 2D, by

\[ B_x(y,t) = \exp(-y^2/4\eta_zt)/\sqrt{t} \quad\quad\quad B_y(x,t) = \exp(-x^2/4\eta_zt)/\sqrt{t} \quad\quad\quad B_z(x,y,t) = \exp(-x^2/4\eta_yt)\exp(-y^2/4\eta_xt)/t \]

and in 3D by

\[ \begin{array}{lcl} B_x(y,z,t) &=& \exp(-y^2/4\eta_zt)\exp(-z^2/4\eta_yt)/t \\ \noalign{\medskip} B_y(x,z,t) &=& \exp(-x^2/4\eta_zt)\exp(-z^2/4\eta_xt)/t \\ \noalign{\medskip} B_z(x,y,t) &=& \exp(-x^2/4\eta_yt)\exp(-y^2/4\eta_xt)/t \end{array} \]

The initial condition is simply set using the previous profiles with t=1. In order to solve only the parabolic term in the induction equation ( $ \nabla\times\vec{J}=\nabla\times(\eta\nabla\times\vec{B})$) we give to the fluid a very large intertia using a high density value. Moreover, to avoid any fluid motion, the velocity is reset to zero at each time step by using the INTERNAL_BOUNDARY.

The runtime parameters that are read from pluto.ini are

3D-cart-0.jpg
Initial and final profiles of the numerical (points) and analytical (lines) solutions for a component of the magnetic field.

The configurations use both EXPLICIT and STS time integrators and different geometries are explored:

Conf.GEOMETRY DIMT.STEPPING<th>divBRESISTIVITY
#01 CARTESIAN 3 RK2 8W EXPLICIT
#02 CARTESIAN 3 HANCOCK GLMSTS
#03 CARTESIAN 3 RK3 CT EXPLICIT
#04 CARTESIAN 3 HANCOCK GLMEXPLICIT
#05 POLAR 3 RK2 8W EXPLICIT
#06 POLAR 3 RK2 8W STS
#07 SPHERICAL 3 RK2 8W EXPLICIT
#08 SPHERICAL 3 RK2 8W STS
#09 SPHERICAL 3 RK3 CT EXPLICIT
#10 CARTESIAN 2 HANCOCK CT EXPLICIT
#11 CARTESIAN 3 HANCOCK CT EXPLICIT
#12 CARTESIAN 2 HANCOCK CT STS
#13 SPHERICAL 3 RK2 CT STS
#14 CARTESIAN 3 HANCOCK GLMRKL
#13 SPHERICAL 3 RK2 GLMRKL
Authors
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
T. Matsakos (titos.nosp@m.@odd.nosp@m.job.u.nosp@m.chic.nosp@m.ago.e.nosp@m.du)
Date
March 03, 2017

Function Documentation

◆ InitDomain()

void InitDomain ( Data *  d,
Grid *  grid 
)

Assign initial condition by looping over the computational domain. Called after the usual Init() function to assign initial conditions on primitive variables. Value assigned here will overwrite those prescribed during Init().