Implementation of kinematic dynamo using parareal and Dedalus
This project uses the open source Dedalus project spectral solver code. The source code can be found in the Astrophysical Source Code Library Dedalus code.
The code implements the Parareal algorithm to parallelise simulations of the kinematic dynamo in time as well as in space.
-
A set of initial conditions can be created by running
python3 generate_initial_conditions.py. This will create a set random numpy arrays of magnitude 1e-5 at high resolution, and a set of initial conditions of lower resolution generated by fourier resampling. -
Galloway_proctor_serial.pyandRoberts_serial.pywill run serial or spatial parallelised simulations of the Galloway Proctor and Roberts dynamos respectively. These scripts can be run in serial withpython3 script.py ..., or in parallel by usingmpiexec -n X python3 script.py .... -
Typing any script as
python3 script.py -hwill show the parameters required by the script to run. -
Galloway_proctor_parareal.pyandRoberts_parareal.pywill run simulations of the dynamos with Parareal algorithm included. These must be run usingmpiexec -n X python3 script.py ..., with at least 5 processors (for 5 time slices.). -
Parallel in time and space simulations can be carried out by using the
-pxoption with the parareal scripts, with a number greater than 1. Best performance is found from numbers like 2n, for FFTW performance. The script should be executed using (Nspace x Ntime) processors. -
Simulations should be merged after completion using either
merge_serial.pyormerge_paraeal.py. -
Multiple serial simulations with different dt or different resolution can be used to estimate convergence properties. After completing the simulations in the same folder, use the
Serial_dt_converge.pyorSerial_space_converge.pyscripts. -
Scaling results can be estimated using
Parareal_plot_scaling.py. At least one serial run using the same conditions as the fine solver should be carried out as the base measure of run time. -
Growth rate and time series data can be found by using the
Serial_growth_rate.pyscript. -
Parareal simulations do not stop once converged. Convergence testing and runtime estimates are carried out after simulations are complete. Automatic stopping of simulations is set to be added in a future version.