T1: Free-fall collapse;
first simulations

Before the tutorials:

As discussed in the lecture, structures in the universe collapse under their own gravity. This holds from the larges structures like galaxy clusters where dark matter dominates the potential down to star formation, where gaseous clouds collapse.

Units are important (and tricky). Typical units for cosmological structures are chosen to be kpc for lengths, 1010 M for masses, and km/s for velocities. Think about what this means for the time unit in such simulations.

During the tutorials:

As in the previous tutorial, get a copy of the code and the configuration file Config.sh. But before compiling, change the following settings in the Config.sh file:

Do not forget the module load compiler openmpi command before compiling.

As in the first tutorial, copy the parameter file box.param and modify it to be non-periodic and choose a reasonable unit system and adapt the times according to your calculated free-fall time for the galaxy cluster:

As the simulations get more demanding, edit the job script runme.sh and modify the number of CPUs used per task by changing --cpus-per-task=4, i.e., using 4 OpenMP threads per MPI rank.

First Step

Use the prepared ICs to do your simulation:

Now run the simulation and look at the result. Note that you can already watch the results from the existing snapshots while the simulation is still running. Try to modify your plotting scripts from last time to the new simulation.

Second Step

Now try to create the initial conditions on your own.

Extend the program which you used last time to create a sphere of particles as a representation of a collapsing cloud for the galaxy cluster case. As you treat dark matter particles this time, set the particle number in npart[1] instead of index [0] as last time. You also do not need to create a rho field for the density.

Now you can run the simulation as last time and use the same tools to visualize the results.

Third Step

Now try to play around with the parameters.

Now you can run the simulation as last time and use the same tools to visualize the results.

Now you can run the simulation as last time and use the same tools to visualize the results.

Programming goals for T1:

Goal of this tutorial is that you learn better how to create initial conditions files and how to plot the results from a simulation. You should also learn to run the same simulation with different parameters and compare the results.

Solutions