Download Exercise Session 2: Blast waves with PLUTO

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
NBIA PHD SCHOOL ON COMPUTATIONAL ASTROPHYSICS
Exercise Session 2: Blast waves with PLUTO
1. Static grid with PLUTO
PLUTO is a shock capturing code, used to model astrophysical objects in a variety of regimes. In today’s
exercise, we will start by modelling jets with the static grid version of PLUTO. We will model blast waves, with
PLUTO using the adaptive mesh refinement library, Chombo.
We will start off modelling a jet with PLUTO in static grid mode.
Start up your virtual machine, the pluto files are already in place.
$ cd pluto/PLUTO/Test_Problems/MHD/Jet
You can set up pluto using a python menu to select
$ python ../../../setup.py
You can leave all the options as the default.
Edit the pluto.ini file in your favourite editor. You can select output by defining a nonnegative frequency for
the format you desire. If you want to view with visit, change the -1 in the 2nd column to 0.5. This will write
all data to the a vtk file every 0.5 time units. Similarly, you can add ppm or png output to see snapshot of the
density as a portable pixel map or portable network graphics file.
[Uniform Grid Output]
uservar
0
dbl
0.5 -1
single_file
flt
-1.0 -1
single_file
vtk
0.5 -1
single_file
tab
-1.0 -1
ppm
0.5 -1
png
-1.0 -1
Run make:
make
Run pluto in parallel using mpirun, with your preferred number of processors (-np ?? e.g. 1 or 2 ), in the
background.
$ mpirun -np 2 ./pluto &
You can examine the output in pluto.log
Compare the results for an under dense jet with an over dense jet. The equation for advance speed of a shock
is
√
η
(1)
vadvance = vjet
√
1+ η
Here the advance speed is a function of the jet velocity vjet and the density ratio η = ρjet /ρambient . An under
dense jet with η = 0.1 will give an advance speed of about 0.24 vjet An over dense jet will give a value of about
0.76. Try a few different values of η, by changing ETA in the pluto.ini file and compare with the analytical
prediction.
2. Hydrodynamic blast wave
You need to download the init.c from the Exercises webpage:
$ cd ~/pluto/PLUTO/Test_Problems/MHD/Blast
You can set up pluto using a python menu to select
$ python ../../../setup.py --with-chombo
1
Note we are configuring with the Chombo library, which incorporates all the AMR functionality.
Select DIM=2, PHYSICS=HD,
Run make:
make
Run pluto in parallel using mpirun, 2 processors (-np 2 ), in the background.
$ mpirun -np 2 ./pluto &
PLUTO outputs its configuration and t and dt at each timestep, you can inspect this in the file pout.0
$ less pout.0
The hdf5 data from the simulation is compatible with a few viewers, including VisIt, Paraview and IDL
Start up IDL to visualise. You need to add the PLUTO IDL Tools to your IDL path
$ export IDL_PATH="+~/PLUTO/Tools/IDL:<IDL_DEFAULT>"
$ idl
At the IDL prompt to read in a file
IDL > pload, 1 , /hdf5, level=4
to display a variable, e.g. log10 pressure:
IDL > display, x1=x1,x2=x2, alog10(prs), ims=1
You can also overplot the AMR mesh
IDL > oplotbox, ctab=3
3. MHD blast wave
For the MHD version, follow the same steps but this time, enable MHD in the python setup.
Here we can use VisIt to show the field lines.
At the command line type
$ visit
From the menu you can open the hdf5 files.
You should select the data*.hdf5 database, if you have produced a few files.
In the menu option Controls → Add Expression
Add a vector mesh variable called b, by clicking New, then change the name to b, then change the type to
Vector Mesh Variable, defining the expression:
{bx1,bx2}
Click Add → Streamlines then double click Streamlines to get the attributes window.
Here change the Source type to Line. Change the Start to 0.2 0.2 and End to 0.8 0.8
then the samples to 10 and then the streamline direction to both.
Now you can plot streamlines of b.
Click Draw and the play button to see Visit make a movie of the streamlines.
You can record your session as a python script. (Controls → Command → record)
By changing the field strength, you can control the geometry of the blast wave.
PLUTO allows you to select many different types of Riemann solvers, time stepping schemes, limiters. Try
changing the Riemann solver to one that is more diffusive (hll). What happens?
You can vary the initial parameters in the pluto.ini file, try changing the adiabatic index (GAMMA), and
the pressure inside and outside the initial radius. The file init.c allows you to control the density, pressure and
velocity at each point. Try adding an small obstacle to the blast wave (e.g. increasing the density in a small
region). What will happen to it?
The hydrodynamic blast wave radius, R, expands as a function of time, t according to the Sedov relation
R = Kt2/5
where K is a constant.
You can plot the increase in R vs t and see how well it compares with analytical estimate.
2