Skip to main content

Free boundary tokamak plasma equilibrium Grad-Shafranov solver for time evolution

Project description

FreeGS4E: Free boundary Grad-Shafranov solver for time evolution

FreeGS4E is a package based on FreeGS, which calculates plasma equilibria for tokamak fusion experiments by solving the free boundary Grad-Shafranov equation. FreeGS4E is forked from FreeGS 0.6.1 and includes some performance optimisations that may also limit the use cases.

The primary use case for FreeGS4E is to provide a fast equilibrium solver for the FreeGSNKE code. This has resulted in some changes to the FreeGS codebase that mean FreeGS4E is no longer a drop-in replacement for FreeGS. FreeGS4E is also not intended to be a standalone equilibrium solver, and some features have been removed to improve performance. Users looking for a static equilibrium solver should use FreeGS.

Installing

  1. Create a new virtual environment.
  2. Download this repository and install locally using pip install -e .

Documentation

The FreeGS manual is in the docs subdirectory.

Examples

The Jupyter notebooks contain examples with additional notes

  • MAST-example.ipynb

There are also some Python scripts to run short tests and examples

$ python 01-freeboundary.py

This solves a free boundary problem, specifying the desired location of two X-points. Writes the equilibrium to a G-EQDSK file "lsn.geqdsk"

$ python 02-read-geqdsk.py

Reads in the file "lsn.geqdsk", inferring the coil currents from the plasma boundary and profiles in the G-EQDSK file.

$ python 03-mast.py

Calculates a double-null (CDND) equilibrium for MAST from scratch. Writes solution to G-EQDSK file "mast.geqdsk"

$ python 04-read-mast-geqdsk.py

Reads the file "mast.geqdsk", inferring the coil currents.

$ python 05-fixed-boundary.py 

This example solves a fixed boundary problem, in which the square edges of the domain are fixed. The plasma pressure on axis and plasma current are fixed.

$ python 06-xpoints.py

This demonstrates the coil current control code, finding X-points, and marking core region These routines are used inside the free boundary solver

Contributing

To install FreeGS4E for development, clone the repository and install the package in editable mode with the development dependencies:

git clone https://github.com/freegs4e/freegs4e
cd freegs4e
pip install -e ".[dev]"

Pre-commit hooks are used to ensure code quality. To install the pre-commit hooks, run:

pre-commit install

License

Copyright 2024 Nicola C. Amorisco, George K. Holt, Adriano Agnello, and other contributors.

FreeGS4E is licensed under the GNU Lesser General Public License version 3. The license text is included in the file LICENSE.

The license text for FreeGS is reproduced below:

Copyright 2016-2021 Ben Dudson, University of York, and other contributors.
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 <http://www.gnu.org/licenses/>.

References

Versions

0.1.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freegs4e-0.1.0.tar.gz (86.9 kB view details)

Uploaded Source

Built Distribution

freegs4e-0.1.0-py3-none-any.whl (114.5 kB view details)

Uploaded Python 3

File details

Details for the file freegs4e-0.1.0.tar.gz.

File metadata

  • Download URL: freegs4e-0.1.0.tar.gz
  • Upload date:
  • Size: 86.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for freegs4e-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9e17ade141c8c7f79dd927683c52c265f9ddf8ff0bbe344ad74a648eb502affd
MD5 d9b1aeaee61c154f00bcb095eee7ec07
BLAKE2b-256 ad5050a719d7aab1fe56dbb9648d9b991bb3543ce239056e89913388f4c4358a

See more details on using hashes here.

File details

Details for the file freegs4e-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: freegs4e-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 114.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for freegs4e-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 985e4328e23e32033e5fa50c0c83d20d77f1a35876ac66555fcb4cd1fc2cbb2c
MD5 702b77993f5a371409619ad9d05206d2
BLAKE2b-256 cafdef327a9a482159885641d2ebef9aead3ebdfbb0de1d18ba9df5224903ca3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page