Magnetised laser-plasma physics simulation code
This code has been written to simulate laser-plasma interactions in the long (~1ns) pulse regime. Given the collisionality of this regime allows us to model the plasma using MagnetoHydrodynamics (MHD) coupled to a Paraxial laser solver.
Clone the repository and cd into the main directory. Ensure the environment variables are set for the PETSc directory; this should be in the .bashrc file. Install with the command make all
. This will create a binary in the bin directory.
Modify the files Initial.cpp and Global.cpp to set the initial condition and simulation parameters respectively.
The Global.cpp file contains global variables that are set at compile time.
The Physical State
section contains definitions of:
n0
,T0
, Z
(which at present only works up to Z=8),Collisional Parameters
should not be changed.Mesh Variables
section contains a set of parameters that set the mesh parameters. The only ones that should be changed are the variables m,nx,ny,nz
which set the number of timesteps and the number of cells in x,y,z respectively.Laser Variables
section contains the parameters for the laser solver. The parameters one can change are:wl
in metres,Intensity
in watts per square metre,Output Varibales
section defines whether a field should be saved to file as output from the simulation, and tfrac
defines how many steps there are between output dumps (tfrac=10
means output is dumped every 10 timesteps).Boundary conditions
section defines the boundaries in x, y and z.In the Inital.cpp file one can set the initial profile of the various fields. To set a profile, find the discrete form of the profile on a cartesian mesh (with cell position i,j,k for the x,y and z dimensions respectively). Ensure the profile is set in normalised units. The initvalue
array contains the intial state of the code, with the indicies nin
representing number density, Tin
temperature, Vxin
the x velocity and Bxin
the magnetic field in x. The laser field is defined on the z=0
boundary, as such only profiles with k=0
should be used.
Once all modifications to the Global and Initial files are complete, recompile the source using make all
.
Set the number of OpenMP threads using OPENMP_NUM_THREADS=N
where the number of threads is N. Run with the command ./bin/MAGNET
. The output can be found in raw ASCII format and VTK format in the output
directory.