7 - MHD equilibria#
This tutorial provides access to the Struphy MHD equilibrium interface. We shall plot some available equilibria, in particular:
ScrewPinchAdhocTorusEQDSKequilibriumGVECequilibriumDESCequilibrium
The first three are sub-classes of CartesianMHDequilibrium, where the developer has to provide Cartesian components of equilibrium variables like \(\mathbf B(x, y, z)\) and \(\mathbf J(x, y, z)\). Such equilibria work with any of the available Struphy domains, and the user has to specify the particular domain (mapping) he intends to use.
The last two are sub-classes of LogicalMHDequilibrium, where the developer has to provide the covariant components \(\hat{\mathbf B}^1(\eta_1, \eta_2, \eta_3)\), \(\hat{\mathbf J}^1(\eta_1, \eta_2, \eta_3)\), as well as the mapping to Cartesian coordinates. These equilibria work only with the provided mapping, hence the mapping cannot be set by the user.
[1]:
import numpy as np
from struphy import equils
from struphy import domains
ScrewPinch#
[2]:
mhd_equil = equils.ScrewPinch(R0=1.0)
mhd_equil.domain = domains.HollowCylinder(a1=1e-8, a2=1, Lz=2 * np.pi)
mhd_equil.show()
AdHocTorus#
[3]:
mhd_equil = equils.AdhocTorus()
mhd_equil.domain = domains.HollowTorus(a1=1e-8, tor_period=1)
mhd_equil.show()
EQDSK#
[4]:
mhd_equil = equils.EQDSKequilibrium()
mhd_equil.domain = domains.Tokamak(equilibrium=mhd_equil)
mhd_equil.show()
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/struphy/fields_background/equils.py:1766: UserWarning: self.units =<struphy.physics.physics.Units object at 0x7f82c41d2b30>, no rescaling performed in EQDSK output.
warnings.warn(
GVEC#
[5]:
mhd_equil = equils.GVECequilibrium(use_nfp=False)
mhd_equil.show()
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/struphy/fields_background/equils.py:2136: UserWarning: self.units =<struphy.physics.physics.Units object at 0x7f825614b6d0>, no rescaling performed in GVEC output.
warnings.warn(
DESC#
[6]:
%%capture
mhd_equil = equils.DESCequilibrium(use_nfp=False)
[7]:
mhd_equil.show()