The repository to my semester project in computational physics in FS24. The complete report can be found here.
After installing IPPL, paste the dsmc-code folder inside the downloaded ippl folder. In that folder add the code to the CMakeLists.txt:
..............
FetchContent_MakeAvailable(googletest)
add_subdirectory (unit_tests)
endif ()
# add these to lines relatively at the end
add_subdirectory (05.03.dsmc/dsmc-code-simple)
message (STATUS "Added 05.03.dsmc source.")
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake )
install (
..............Go to the terminal and run the following commands
module load gcc/11.4.0 cmake/3.26.3 cuda/12.1.1 openmpi/4.1.4
./ippl-build-scripts/999-build-everything -t serial -k -f -i -u
./ippl-build-scripts/999-build-everything -t openmp -k -f -i -u
./ippl-build-scripts/999-build-everything -t cuda -k -f -i -uChoose how you want to compile the code. Then there are three possibilities to run the code (inside the build_... folder):
-
./Nanbu convergence 5 5.0 Nanbu 200 0.49049 false --info 10: Choose the Trubnikov test (with "convergence"),5is the number of realizations,5.0is the final time of the simulation,Nanbuis the collision model (also possible:TakAbe,Nanbu2andBird),200is the number of particles,0.49049is$\nu_0\Delta t$ andfalseinidicates no debug output. -
./Nanbu delta 64 5 5.0 Nanbu 200 0.001 200 false false false --info 10: Choose delta "function" as initial distribution, a64^3grid,5realizations,5.0as the final time,Nanbuas the collision algorithm,200as number of particles,0.001as$d_x$ (explained in the report), and three bools (use adaptive mesh grid, use collisions and output debug). -
./Nanbu sphere 32 156055 1000 true true false true Nanbu 327.59496 0.0 1.0 10 --info 10: Choose the "Cold Sphere Heating" testcase, a32^3grid,156055particles,1000timesteps, four bools (use self consisten electrical field, compute collisions, output debug, use adaptive mesh),Nanbuis the collision algorithm,327.59496is the timestepsize,0.0is a initial velocity scaling factor,1.0is a multipliert to the confinement force and10is the number of realizations.
Make sure to create a data folder in the same folder as the Nanbu executable.
All plots created for the report are produced using Python 3 and the Jupyter Notebooks listed here. They are separated by test case and contain all code necessary. The same folder also contains all data files (mostly .csv) generated using the command described above with the parameters mentioned in the report at the respective section.
The final results were presented at PSI on August 22nd, 2024. LaTeX code and PDF for the final presentation can be found here.