https://github.com/bendudson/isothermal-4field
Plasma simulation based on BOUT++
https://github.com/bendudson/isothermal-4field
Last synced: 12 months ago
JSON representation
Plasma simulation based on BOUT++
- Host: GitHub
- URL: https://github.com/bendudson/isothermal-4field
- Owner: bendudson
- License: lgpl-3.0
- Created: 2017-12-19T11:16:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-16T21:51:47.000Z (about 8 years ago)
- Last Synced: 2025-02-27T18:31:09.692Z (over 1 year ago)
- Language: C++
- Size: 173 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Isothermal model for FCI simulations
====================================
[](https://img.shields.io/badge/license-GPL-blue.svg)
Evolves plasma density, vorticity, parallel current and momentum.
This code was written using [BOUT++ version 4.1](https://github.com/boutproject/BOUT-dev/releases).
Copyright 2017 Ben Dudson, University of York. Email: benjamin.dudson@york.ac.uk
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see .
Tokamaks
--------
To generate a grid, use [Zoidberg](http://bout-dev.readthedocs.io/en/latest/user_docs/zoidberg.html)
with a 'g' EQDSK format file.
```python
import numpy as np
import zoidberg
field = zoidberg.field.GEQDSK("g014220.00200") # Read magnetic field
grid = zoidberg.grid.rectangular_grid(100, 10, 100,
1.5-0.1, # Range in R (max - min)
2*np.pi, # Toroidal angle
3., # Range in Z
xcentre=(1.5+0.1)/2, # Middle of grid in R
yperiodic=True) # Periodic in toroidal angle
# Create the forward and backward maps
maps = zoidberg.make_maps(grid, field)
# Save to file
zoidberg.write_maps(grid, field, maps, gridfile="tokamak.fci.nc")
# Plot grid points and the points they map to in the forward direction
zoidberg.plot.plot_forward_map(grid, maps)
```
Then run the test case
```bash
$ make
$ ./isothermal-4field -d tokamak
```