Skip to content

gyselax/tokam2d

Repository files navigation

Installation

  1. Create a Python environment (recommended Python 3.11 or later). You can use either venv or conda:

Ex: With conda

conda create --name tokam_env python=3.11
conda activate tokam_env
  1. A few packages are needed, in particular JAX (the code is optimized for GPU but also runs on CPUs). To install them:
cd <TOKAM2D_directory>
pip install -r requirements_gpu.txt or
pip install -r requirements_cpu.txt

Run Tokam2D

cd <TOKAM2D_directory>
python3 main.py -i input_files/input_file.yaml (-o output_folder)

Output data (saved as dictionnary stored in HDF5 format)

  • Simulation results containing
    • the evolved fields, (e.g. density, electric potential) as 3D arrays, as real signal and/or fourier components depending on the simulation input;
    • the time and space coordinates arrays.
  • The parameters used for the simulation;
  • The metadata (code version, date, etc.).
  • The log file of the simulation.

Use the diagnostic tools

Use the notebook in diagnostics/diag_main.ipynb to explore the results of a simulation or create movies.

SOL - Uniform - driftwave & interchange
SOL - Blob - driftwave only
SOL - Blob - interchange only
Hasegawa-Wakatani
Modified Hasegawa-Wakatani

About

A 2D spectral solver for various turbulence schemes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published