Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
879eb5f
fix normalization error in k_ionization and error in ddt(T) sink
Thrysoe Jun 29, 2022
b7c2966
remove global vorticity sink
Thrysoe Jun 29, 2022
0ebc7ff
use normalized neutral density
Thrysoe Jun 30, 2022
37d973c
Merge branch 'runehoejlund:master' into master
Thrysoe Jul 5, 2022
219a8d1
indroduce recombination, restructure soure terms, redefine sink layer
Thrysoe Aug 23, 2022
be32997
Merge branch 'master' of https://github.com/PPFE-Turbulence/north-sim…
Thrysoe Aug 23, 2022
9005792
Renaming of Bout.inp variables. use 40 processors
runehoejlund Sep 12, 2022
7ab4262
update variable names in python to match bout.inp
runehoejlund Sep 12, 2022
7750a44
Updated Readme.md
runehoejlund Sep 12, 2022
3e759dc
debugging and module purge in sbatch-file
runehoejlund Sep 12, 2022
da58eb4
data analysis scripts
runehoejlund Sep 12, 2022
feef742
adjustable vorticity sink
runehoejlund Sep 12, 2022
b603214
Updated sbatch file
runehoejlund Sep 12, 2022
21fb1c7
parameter scan analysis
runehoejlund Sep 12, 2022
8d84cc6
remove square brackets in BUT.inp
runehoejlund Sep 12, 2022
08e08c8
sbatch change vorticity
runehoejlund Sep 12, 2022
cf7ef21
fix foss toolchain version
runehoejlund Oct 3, 2022
f730c90
vorticity sink parameter scan
runehoejlund Oct 3, 2022
ca19f3d
Updated ReadMe
runehoejlund Nov 29, 2022
2911da3
Added correct vort term, apply centerBCs after RHS
runehoejlund Nov 29, 2022
d49eecc
Plot B-field
runehoejlund Nov 29, 2022
d7c9529
Update scratch directory in sbatch script
runehoejlund Nov 29, 2022
a9eeec3
Notes on which runs are with which terms
runehoejlund Nov 29, 2022
796e544
Updated diffusion coefficients
runehoejlund Nov 29, 2022
c35bd63
Use Michael Løitens BC implementation
runehoejlund Nov 29, 2022
8526d3e
Latest running simulation (still macro-rotation)
runehoejlund Dec 5, 2022
474596d
Main results analysis
runehoejlund Dec 6, 2022
e8cad82
reverted to my implementation of centerBCs
runehoejlund Dec 6, 2022
e9d270b
Stable model
runehoejlund Dec 6, 2022
25f36ed
sbacth for stable run
runehoejlund Dec 6, 2022
c8f63a1
ignore cached data
runehoejlund Dec 6, 2022
ece9fc2
main results update
runehoejlund Dec 7, 2022
622a40d
Updated ReadMe.md
runehoejlund Dec 7, 2022
0f08be8
cleanup
runehoejlund Dec 7, 2022
b002fa3
Presentation of main results
runehoejlund Dec 22, 2022
5ae410b
presentation of main results
runehoejlund Dec 22, 2022
ac9712b
Merge branch 'runehoejlund:master' into master
Thrysoe Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
playground
shared/BOUT-dev/
plots*
cached_data/*

# Ignore log files
*.log
Expand Down
83 changes: 58 additions & 25 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# North Simulation
Numerical model for a magnetically confined plasma in the NORTH tokamak. Note: The bout++ model was developed at DTU Physics by the Plasma Physics and Fusion Energy group. We use [BOUT++](http://boutproject.github.io/) for numerical simulation.
Numerical reduced fluid model of perpendicular dynamics a magnetically confined plasma in the NORTH tokamak. We use [BOUT++](http://boutproject.github.io/) for numerical simulation. Note: The bout++ model is an implementation of the ESEL equations, developed at DTU Physics by the Plasma Physics and Fusion Energy group.

The results can be seen in the folder [presentation of main results](https://github.com/PPFE-Turbulence/north-simulation/tree/master/presentation%20of%20main%20results).

To reproduce the main results of the data analysis, open and run the iPython Notebook `main_results.ipynb`. Note: It requires data from a simulation run. See the documentaion below on how to run simulations either on the Niflheim environment or (perhaps easier for a start) on your personal computer.

## Getting started
---------------------------------------------------------
Expand All @@ -15,7 +19,12 @@ cd ./north-simulation
```
. ./install_bout_env_niflheim.sh north-simulation
```
3. Navigate to the shared directory and clone and compile the Bout-dev git (make sure the path `~/north-simulation` equals the path to the repo directory):
3. Install python-requirements to the python venv with pip:
```
. ~/local/venv/north-simulation/bin/activate
pip install -r requirements.txt
```
4. Navigate to the shared directory and clone and compile the Bout-dev git (make sure the path `~/north-simulation` equals the path to the repo directory):
```
module restore bout
cd ~/north-simulation/shared
Expand All @@ -39,6 +48,52 @@ make
```
./north_full_ESEL
```
**NOTE:** The command above starts simulations directly on the node, which is not recommended (but it's useful for verifying that the code will evens start running). Instead you should queue the simulations using slurm:

### Niflheim: Slurm Commands
I've included the script `./shared/NORTH/sbatch_north_full_ESEL.sh` which takes care of queuing simulations using SLURM. Here is how to do it:
- Before running the sbatch script: Navigate to `shared/NORTH/`. In there, create a directory for output logs:
```
mkdir slurm_out
```
- Submit batch job (look at Slurm Batch job script in `shared/NORTH/` for how to write a sbatch file):
```
sbatch sbatch_north_full_ESEL.sh
```
- show your queue
```
squeue -u $USER
```
- Cancel all your jobs:
```
scancel -u $USER
```
- Cancel all pending jobs:
```
scancel -t PD
```
- Stop job gracefully (run file with `stopCheck=true` as is done in the slurm sbatch script), then add `BOUT.stop` file:
```
touch ./data/BOUT.stop
```

### Niflheim/VSCode: Trouble-Shooting
**bash: fork: retry: No child processes**

If VSCode causes a [fork bomb](https://stackoverflow.com/questions/47143093/linux-ssh-bash-fork-retry-no-child-processes) with the error message: `bash: fork: retry: No child processes`, simply open up a terminal and write
```
kill -9 -1
```

**Python Interpreter Problems**

If the VSCode Python Extension won't recognize your Python Interpreter. Pressing cmd/ctrl + shift P with the following command names are useful:
- `Python: Create Terminal`
- `Python: Run Python File in Terminal`
- `Python: Select Interpreter` > Enter Interpreter Path (e.g. `~/local/venv/north-simulation/bin/python`). If this doesn't work:
- `Python: Clear Workspace Interpreter Settings`

Alternatively, try downgrading the Python Extension by going to Extensions > Python (SSH - Installed, not Local - Installed) > click the down arrow next to the uninstall button and choose "Install another version" > 2022.18.2

---------------------------------------------------------
### Personal Computer: First time setup
Expand Down Expand Up @@ -126,7 +181,7 @@ conda activate north-simulation
pip install -r requirements.txt
```

Run the file `data_analysis.py` to reproduce the main results.
To reproduce the main results of the data analysis, refer to the iPython Notebook `main_results.ipynb`.

## Usefull commands
here are some usefull commands. If you're on your personal computer, I assume you have Docker running, started a Docker container and navigated to the north directory.
Expand All @@ -143,26 +198,4 @@ here are some usefull commands. If you're on your personal computer, I assume yo
- Help on command line options
```
./north_full_ESEL -h
```

### Niflheim: Slurm Commands
- Submit batch job (look at Slurm Batch job script in `shared/NORTH/` for how to write a sbatch file):
```
sbatch sbatch_north_full_ESEL.sh
```
- show your queue
```
squeue -u $USER
```
- Cancel all your jobs:
```
scancel -u $USER
```
- Cancel all pending jobs:
```
scancel -t PD
```
- Stop job gracefully (run file with `stopCheck=true` as is done in the slurm sbatch script), then add `BOUT.stop` file:
```
touch ./data/BOUT.stop
```
66 changes: 0 additions & 66 deletions Video_script copy.py

This file was deleted.

130 changes: 0 additions & 130 deletions Video_script.py

This file was deleted.

77 changes: 0 additions & 77 deletions analyze_data__student.py

This file was deleted.

Binary file removed contours.gif
Binary file not shown.
Loading