cerfons_equilibrium_m Module

Module containing the implementation of an analytic tokamak equilibrium as described by Cerfon and Freidberg (Phys. Plasmas 2010 https://doi.org/10.1063/1.3328818) N.b. this equilibrium is axisymmetric - phi, when required, is not used



Derived Types

type, public, extends(analytic_divertor_equilibrium_t) ::  cerfons_t

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .false.
real(kind=FP), public :: x0

Magnetic axis x = R/R0 (in normalised units)

real(kind=FP), public :: y0

Magnetic axis y = Z/R0 (in normalised units)

real(kind=FP), public :: phi0 = 0.0_FP

Magnetic axis phi

real(kind=FP), public :: xmin

Box limits

real(kind=FP), public :: xmax

Box limits

real(kind=FP), public :: ymin

Box limits

real(kind=FP), public :: ymax

Box limits

real(kind=FP), public :: rhomax

Global limits for rho (rho = normalised psi, n.b. there may also be region-specific limits defined in equi)

real(kind=FP), public :: rhomin

Global limits for rho (rho = normalised psi, n.b. there may also be region-specific limits defined in equi)

logical, public :: flip_Z = .false.

Inverts the Z direction, which is equivalent to reversing the field direction Default false, use true to flip the equilibrium vertically (magnetic axis position unchanged).

real(kind=FP), public :: poloidal_field_factor = 1.0_FP

Poloidal field factor, which can be used to reverse the helicity

type(closed_polygon2d_t), public :: divertor_polygon

Closed polygon which defines the divertor

type(closed_polygon2d_t), public :: exclusion_polygon

Closed polygon which marks points as being off the grid

Read more…
logical, public :: invert_divertor_polygon

Flips the divertor polygon from being assumed concave to convex.

logical, public :: invert_exclusion_polygon

Flips the exclusion polygon from being assumed concave to convex.

real(kind=FP), public :: axis_Btor

Toroidal field at the the magnetic axis -- used to normalise magnetic field

real(kind=FP), public :: O_point_psi

Poloidal flux of the magnetic axis -- used to define the 0-point of rho

real(kind=FP), public :: X_point_psi

Poloidal flux of the (primary) seperatrix -- used to define the 1-point of rho

character(len=:), public, allocatable :: district_definition

Indicates, how districts are defined 'flux': Based on the limiting flux surface rho_max (default) 'wall': Based on divertor and exclusion polygons

real(kind=FP), public :: R0

Non-normalised magentic axis radius

real(kind=FP), public :: Z0

Non-normalised magentic axis vertical position

real(kind=FP), public :: RX

Normalised primary x-point radius

real(kind=FP), public :: ZX

Normalised primary x-point vertical position

real(kind=FP), public :: rhomin_privflux
real(kind=FP), public :: a
real(kind=FP), public :: rx2
real(kind=FP), public :: zx2
real(kind=FP), public :: normpol
real(kind=FP), public :: normtor
real(kind=FP), public :: c1
real(kind=FP), public :: c2
real(kind=FP), public :: c3
real(kind=FP), public :: c4
real(kind=FP), public :: c5
real(kind=FP), public :: c6
real(kind=FP), public :: c7
real(kind=FP), public :: c8
real(kind=FP), public :: c9
real(kind=FP), public :: c10
real(kind=FP), public :: c11
real(kind=FP), public :: c12

Type-Bound Procedures

procedure, public, pass(self) :: absb
procedure, public, pass(self) :: bpol
procedure, public :: is_axisymmetric
procedure, public :: rho
procedure, public :: jacobian
procedure, public :: epol
procedure, public :: erad
procedure, public, nopass :: make_polygon
procedure, public :: make_polygon_from_params
procedure, public :: polygon_projection
procedure, public :: in_vessel
procedure, public :: mag_axis_loc
procedure, public :: on_grid
procedure, public :: district
procedure, public :: check_privflux_regions
procedure, public :: init
procedure, public :: display
procedure, public :: debug
procedure, public :: psi
procedure, public :: bx
procedure, public :: by
procedure, public :: btor

Functions

public function psi(self, x, y, phi)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(in) :: self
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value real(kind=fp)

public function bx(self, x, y, phi)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(in) :: self
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value real(kind=fp)

public function by(self, x, y, phi)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(in) :: self
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value real(kind=fp)

public function btor(self, x, y, phi)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(in) :: self
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value real(kind=fp)


Subroutines

public subroutine init(self, filename)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(inout) :: self
character(len=*), intent(in), optional :: filename

public subroutine display(self)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(in) :: self

public subroutine debug(self)

Arguments

Type IntentOptional Attributes Name
class(cerfons_t), intent(in) :: self