numerical_equilibrium_m Module


Defines the numerical equilibrium subclass N.b. this is axisymmetric; phi, when required, is not used.

The object structure is quite large -- it is designed to be fully self-descriptive, such that multiple equilibria may be developed independently, without resulting in conflicts between the equilibria objects. As a result, most variables are stored within the object (i.e. as object%variable) rather than shared across the module.

The numerical equilibrium object develops an equilibrium object from a NetCDF, specified in the params.in file, as "/.nc". This file should define

  • Global attributes "description", "history", "author"
  • A group "Magnetic_geometry" with
    • dimensions "R", "Z"
    • variables "R", "Z" (corresponding dimension values) and "psi" (R,Z grid). The "btor" (R,Z grid) variable is optional (unused) if use_spline_for_btor == .false. (in params.in), required if use_spline_for_btor == .true.
    • attributes "magnetic_axis_R", "magnetic_axis_Z", "x_point_R", "x_point_Z", "axis_Btor"
  • A group "Psi_limits" with
    • attributes "global_min" and "global_min"
    • subgroups (name not used) corresponding to regions (polygons) where a different psi limit should be applied. Each subgroup should have
      • attributes "local_min" and "local_max", which may be NaN (IEEE conformant) if undefined
      • a nc_polygon (see below)
  • A group "Box_limits" with a corresponding nc_polygon
  • A group "FW_and_divertor_polygon" with a corresponding nc_polygon
  • A group "Shadow_polygon" with a corresponding nc_polygon

Groups which contain a nc_polygon should have the following information * dimension "N_points" which gives the number of polygon points * variables "R_points" and "Z_points" which gives the (R, Z) points Note that the R_points and Z_points will be automatically normalised to the magnetic_axis_R

N.b. this module relies on bspline_fortran module from https://github.com/jacobwilliams/bspline-fortran



Used by


Derived Types

type, public, extends(divertor_equilibrium_t) ::  numerical_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

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 :: init

Initialises equilibrium, i.e.~reads any required parameters from file.

procedure, public :: display

Print to console information about the equilibrium

procedure, public :: debug

Print to console extended information about the equilibrium

procedure, public :: psi

Non-normalised poloidal flux function (in Wb=Vs=Tm2)

procedure, public :: bx

Radial field component normalized to on axis field strength.

procedure, public :: by

Vertical field component normalized to on axis field strength.

procedure, public :: btor

Toroidal field component normalized to on axis field strength.

procedure, public :: check_privflux_regions

Returns the equivalent to 'rholimit_privflux' for a given (x,y) point

Read more…