BackgroundThis post summarises preliminary work to build and test the astrophysical code Tristan-MP.
The Tristan-MP code is a particle in cell code for modelling astrophysical plasmas. It is used for modelling processes resulting in the formation of collisionless shocks. The particle in cell code takes a collection of particles representing ions and electrons, these particles are then updated using the Lorentz force.
Electromagnetic fields in the model are updated using a numerical implementation of the Maxwell equations.
For details of tristan-mp see:
Simulations of relativistic collisionless shocks: shock structure and particle acceleration
A good overview of astrophysical shocks by Spitovsky is at:
Injection and Acceleration in Astrophysical Shocks
In this study we want to investigate shocks such as bow shock formed when the solar wind impinges on the earths magnetosphere. In particular we investigate mechanisms for particle acceleration.
Building Tristan-MPEarlier work testing tristan-mp is described in the following post
Our version of tristan-mp was cloned from the following repository
The version of tristan-mp used here is available on github
if(i .le. midvars) then !intel compiler bug mem_space and file_space ids cannot be defined inline infunction MKG 25/1/2019 file_space_id = filespace(i) mem_space_id=memspace !call h5dwrite_real_1(dset_id(i), H5T_NATIVE_REAL, & ! temporary0_vec(1:all_ions_lng(procn+1)/stride), & ! dimsfiions,error,file_space_id, & ! mem_space_id) call h5dwrite_f(dset_id(i), H5T_NATIVE_REAL, & temporary0_vec(1:all_ions_lng(procn+1)/stride), & dimsfiions,error,file_space_id, & mem_space_id)
!call h5dwrite_real_1(dset_id(1),H5T_NATIVE_REAL,realdata(i) & ! ,dimsf,error)
call h5dwrite_f(dset_id(1),H5T_NATIVE_REAL,realdata(i) & ,dimsf,error)
Shock Model Set UpIn this model, a shock is simulated with a 2D model which has an in-palne B-field. Plasma is propagated through the simulation box in the -x direction, the flow is reflected from the left wall of the simulation box.
The counterpropagating flows thermalise and the result is a shock wave propagating in the +x direction.
The model inputs are:
We used the sample input file for the shock model provided with Tristan-mp
|sigma = 0.1 # magnetization number (omega_c/omega_p)^2, including gamma0|
maxptl0 = 3e7 # max number of particles in the simulation
ppc0 = 4 # number of particles per cell
delgam = 1.e-4 # delta gamma (temperature control)
me = 1. # electron mass
mi = 1. # ion mass (actually mass to charge ratio)
gamma0 = 15. # flow drift gamma. If < 1, interpreted as v/c.
c_omp = 10 # electron skin depth in cells
For our sample model runs we varied the angle btheta between 0 and 85 degrees.
btheta = 85 # bfield angle bphi=0 -> bz, bph=90 in x-y plane, bth=0-> parallel
The results for our model runs and the input files are provided at
ResultsThe plots below show the velocity field, electron density field, ion density field and Bz field. In each group of four pictures the top 2 pictures show the respective field at a given time step. The bottom two pictures show the mean of the field value over the y direction at each x position and for each time step. The time steps are shown on the y-axis.
|Velocity field for Theta=30 after 5 iterations|
|Density and Magnetic Field (Bz) field for Theta=30 after 5 iterations|
|Velocity field for Theta=30 after 20 iterations|
|Density and Magnetic Field (Bz) field for Theta=30 after 20 iterations|
|Velocity field for Theta=15 after 5 iterations|
|Density and Magnetic Field (Bz) field for Theta=15 after 5 iterations|
|Velocity field for Theta=15 after 20 iterations|
|Density and Magnetic Field (Bz) field for Theta=15 after 20 iterations|
The results show that as we increase the angle theta form 0 to 85 degrees, the high density region moves from right to left across the simulation domain.