The Open FUSION Toolkit 1.0.0-6f445ef
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
gs_factory Type Reference

Detailed Description

Grad-Shafranov equilibrium object.

Public Member Functions

procedure delete (self)
 Destory G-S object.
 
procedure init (self)
 Build operators and allocate storage.
 
procedure init_psi (self, equil, ierr, r0, a, kappa, delta, curr_source)
 Initialize \( \psi \) using simple definition.
 
procedure lin_solve (self, equil, adjust_r0, ierr)
 Solve linearized version of G-S system (fixed RHS)
 
procedure load_limiters (self)
 Load non-node limiter points.
 
procedure setup (self, ml_lag_2d)
 Setup G-S object from FE representation.
 
procedure solve (self, equil, ierr)
 Solve nonlinear G-S system.
 
procedure vac_solve (self, equil, psi_sol, rhs_source, ierr)
 Solve vacuum field for given \( J_{\phi} \).
 

Public Attributes

class(oft_vector), pointer aug_vec => NULL()
 Augmented space (psi + coils) vector template.
 
logical, dimension(:), pointer axis_flag => NULL()
 FE boundary flag for on-axis nodes.
 
real(r8), dimension(:,:), pointer bc_bmat => NULL()
 Second part of free-boundary BC matrix.
 
real(r8), dimension(:,:), pointer bc_lmat => NULL()
 First part of free-boundary BC matrix.
 
integer(i4bc_nrhs = 0
 Number of terms in free-boundary BC.
 
integer(i4), dimension(:), pointer bc_rhs_list => NULL()
 List of terms interacting with free-boundary BC.
 
real(r8), dimension(:,:), pointer coil_bounds => NULL()
 Coil current bounds.
 
character(len=oft_path_slen) coil_file = 'none'
 File containing coil definitions.
 
type(oft_map), pointer coil_map => NULL()
 Coil vector map information.
 
real(r8), dimension(:,:), pointer coil_nturns => NULL()
 Number of turns for each coil in each region.
 
type(coil_region), dimension(:), pointer coil_regions => NULL()
 Meshed coil regions.
 
type(oft_seam), pointer coil_stitch => NULL()
 Coil vector stitching information.
 
real(r8), dimension(:), pointer coil_vcont => NULL()
 Virtual VSC definition as weighted sum of other coils.
 
class(oft_vector), pointer coil_vec => NULL()
 Coil vector template.
 
real(r8), dimension(:), pointer coils_dt => NULL()
 Coil currents at start of step for quasi-static calculations.
 
type(axi_coil_set), dimension(:), pointer coils_ext => NULL()
 External coil definitions.
 
real(r8), dimension(:), pointer coils_volt => NULL()
 Coil voltages for (valid for Vcoils only)
 
logical compute_chi = .FALSE.
 Compute toroidal field potential?
 
type(cond_region), dimension(:), pointer cond_regions => NULL()
 Meshed conducting regions.
 
real(r8), dimension(:), pointer cond_weights => NULL()
 Needs docs.
 
class(oft_matrix), pointer dels => NULL()
 \( \frac{1}{R} \Delta^* \) matrix
 
class(oft_matrix), pointer dels_dt => NULL()
 LHS matrix with time dependence.
 
class(oft_matrix), pointer dels_full => NULL()
 \( \frac{1}{R} \Delta^* \) matrix with no BC
 
logical dipole_mode = .FALSE.
 Include modifications for Dipole geometry.
 
type(oft_1d_real), dimension(:), pointer dist_coil => NULL()
 Current distribution for each coil (if defined)
 
real(r8dt = -1.d0
 Timestep size for time-dependent and quasi-static solves.
 
real(r8dt_last = -1.d0
 Timestep size for current LHS matrix.
 
class(oft_scalar_bfem), pointer fe_rep => NULL()
 Lagrange FE representation.
 
logical free = .FALSE.
 Computing free-boundary equilibrium?
 
logical full_domain = .FALSE.
 Solve across full domain (for Solov'ev test cases)
 
type(oft_gs_zerob), pointer gs_zerob_bc => NULL()
 BC object for zeroing nodes outside plasma region.
 
integer(i4ierr = 0
 Error flag from most recent solve.
 
real(r8isoflux_grad_wt_lim = -1.d0
 Limit for isoflux inverse gradient weighting (negative to disable)
 
real(r8), dimension(:,:), pointer lcoils => NULL()
 Coil mutual inductance matrix.
 
real(r8lim_area = -1.d0
 Area inside the limiter.
 
integer(i4), dimension(:), pointer lim_con => NULL()
 Limiter contour list (contains all limiters)
 
integer(i4lim_nloops = 0
 Number of limiter loops.
 
integer(i4), dimension(:), pointer lim_ptr => NULL()
 Pointer to start of each.
 
real(r8lim_zmax = 1.d99
 Vertical position cutoff for limiter points.
 
character(len=oft_path_slen) limiter_file = 'none'
 File non-node limiter points.
 
integer(i4), dimension(:), pointer limiter_nds => NULL()
 List of limiter nodes.
 
real(r8), dimension(:,:), pointer limiter_pts => NULL()
 Location of non-node limiter points.
 
type(oft_lusolverlu_solver
 \( \frac{1}{R} \Delta^* \) inverse solver
 
type(oft_lusolverlu_solver_dt
 LHS inverse solver with time dependence.
 
integer(i4maxits = 30
 Maximum number of iterations for nonlinear solve.
 
class(oft_bmesh), pointer mesh => NULL()
 Mesh.
 
logical mirror_mode = .FALSE.
 Include modifications for Mirror/FRC geometry.
 
type(oft_ml_fem_type), pointer ml_fe_rep => NULL()
 Multi-level Lagrange FE representation (only top level used)
 
class(oft_matrix), pointer mop => NULL()
 Lagrange FE mass matrix.
 
class(oft_matrix), pointer mop_axis => NULL()
 Lagrange FE mass matrix with Dirichlet BCs on axis.
 
class(oft_matrix), pointer mrop => NULL()
 1/R-scaled Lagrange FE mass matrix
 
integer(i4ncoil_regs = 0
 Number of meshed coil regions in device.
 
integer(i4ncoils = 0
 Number of coils in device.
 
integer(i4ncoils_ext = 0
 Number of external (non-meshed) coils in device.
 
integer(i4ncond_eigs = 0
 Number of total fixed-shape current modes for conducting regions.
 
integer(i4ncond_regs = 0
 Number of conducting regions.
 
integer(i4ninner_limiter_nds = 0
 Needs docs.
 
real(r8nl_tol = 1.d-8
 Tolerance for nonlinear solve.
 
integer(i4nlim_con = 0
 Number of node points in limiter contour list.
 
integer(i4nlimiter_nds = 0
 Number of grid nodes used as limiter points.
 
integer(i4nlimiter_pts = 0
 Number of non-node limiter points.
 
integer(i4nr0_ramp = 6
 Number of iterations for R0 ramp if R0 target is used.
 
integer(i4), dimension(:), pointer olbp => NULL()
 Oriented list of boundary points.
 
logical plot_final = .TRUE.
 Save solver result for plotting.
 
logical plot_step = .TRUE.
 Save solver steps for plotting.
 
class(oft_vector_ptr), dimension(:), pointer psi_coil => NULL()
 \( \psi \) for each coil
 
class(oft_vector), pointer psi_dt => NULL()
 \( \psi \) at start of step for quasi-static calculations
 
real(r8), dimension(:), pointer rcoils => NULL()
 Lumped resistance [Ohms] of each coil (negative for Icoils)
 
type(gs_region_inforegion_info
 Region information for non-continuous conductors.
 
real(r8), dimension(:,:), pointer rlimiter_nds => NULL()
 Location of limiter nodes.
 
real(r8rmax = 0.d0
 Maximum radial coordinate in model.
 
real(r8rmin = 0.d0
 Minimum radial coordinate in model.
 
logical, dimension(:), pointer saddle_cmask => NULL()
 Cell mask for saddle search.
 
logical, dimension(:), pointer saddle_pmask => NULL()
 Point mask for saddle search.
 
logical, dimension(:), pointer saddle_rmask => NULL()
 Region mask for saddle search.
 
logical save_visit = .TRUE.
 Save information for plotting?
 
real(r8), dimension(2, 2) spatial_bounds = RESHAPE([-1.d99,1.d99,-1.d99,1.d99], [2,2])
 Maximum R,Z extents of plasma.
 
real(r8), dimension(4) timing = 0.d0
 Timing for each phase of solve.
 
real(r8urf = .2d0
 Under-relaxation factor for Picard iteration.
 
type(xdmf_plot_filexdmf
 XDMF plotting object.
 
type(oft_blag_zerob), pointer zerob_bc => NULL()
 BC object for zeroing boundary nodes.
 
type(oft_blag_zerogrnd), pointer zerogrnd_bc => NULL()
 BC object for zeroing grounding node(s)
 

Member Function/Subroutine Documentation

◆ delete()

procedure delete ( class(gs_factory), intent(inout)  self)

Destory G-S object.

Parameters
[in,out]selfG-S object

◆ init()

procedure init ( class(gs_factory), intent(inout)  self)

Build operators and allocate storage.

Parameters
[in,out]selfG-S object

◆ init_psi()

procedure init_psi ( class(gs_factory), intent(inout)  self,
class(gs_equil), intent(inout)  equil,
integer(4), intent(out)  ierr,
real(8), dimension(2), intent(in), optional  r0,
real(8), intent(in), optional  a,
real(8), intent(in), optional  kappa,
real(8), intent(in), optional  delta,
real(8), dimension(:), intent(in), optional  curr_source 
)

Initialize \( \psi \) using simple definition.

\( \psi \) can be initialized in one of four ways:

  1. If no optional arguments are passed a Taylor state is computed and used
  2. If r0 < 0.0 is passed a uniform current across the entire plasma region is used
  3. If r0 and a, and optionally kappa and delta, are passed then a uniform current across a cross-section defined by those parameters is used
  4. If curr_source is passed then the source defined by those values is used

In all cases the solution is scaled to match the target Ip value

Parameters
[in,out]selfG-S device/factory object
[in,out]equilG-S equilibrium object
[out]ierrError flag
[in]r0Center for cross-section initialization
[in]aMinor radius for cross-section initialization
[in]kappaElongation for cross-section initialization
[in]deltaTriangularity for cross-section initialization
[in]curr_sourceExplicit current source

◆ lin_solve()

procedure lin_solve ( class(gs_factory), intent(inout)  self,
class(gs_equil), intent(inout)  equil,
logical, intent(in)  adjust_r0,
integer(4), intent(out), optional  ierr 
)

Solve linearized version of G-S system (fixed RHS)

Parameters
[in,out]selfG-S factory/device object
[in,out]equilG-S equilibrium object
[in]adjust_r0Needs docs
[out]ierrError flag

◆ load_limiters()

procedure load_limiters ( class(gs_factory), intent(inout)  self)

Load non-node limiter points.

Parameters
[in,out]selfG-S object

◆ setup()

procedure setup ( class(gs_factory), intent(inout)  self,
class(oft_ml_fem_type), intent(inout), target  ml_lag_2d 
)

Setup G-S object from FE representation.

Parameters
[in,out]selfG-S object

◆ solve()

procedure solve ( class(gs_factory), intent(inout)  self,
class(gs_equil), intent(inout)  equil,
integer(4), intent(out), optional  ierr 
)

Solve nonlinear G-S system.

Parameters
[in,out]selfG-S factory/device object
[in,out]equilG-S equilibrium object
[out]ierrError flag

◆ vac_solve()

procedure vac_solve ( class(gs_factory), intent(inout)  self,
class(gs_equil), intent(inout)  equil,
class(oft_vector), intent(inout)  psi_sol,
class(bfem_interp), intent(inout), optional  rhs_source,
integer(4), intent(out), optional  ierr 
)

Solve vacuum field for given \( J_{\phi} \).

Parameters
[in,out]selfG-S object
[in,out]equilVacuum field
[in,out]psi_solInput: BCs for \( \psi \), Output: solution
[in,out]rhs_sourceSpecified current source (optional)
[out]ierrError flag

Member Data Documentation

◆ aug_vec

class(oft_vector), pointer aug_vec => NULL()

Augmented space (psi + coils) vector template.

◆ axis_flag

logical, dimension(:), pointer axis_flag => NULL()

FE boundary flag for on-axis nodes.

◆ bc_bmat

real(r8), dimension(:,:), pointer bc_bmat => NULL()

Second part of free-boundary BC matrix.

◆ bc_lmat

real(r8), dimension(:,:), pointer bc_lmat => NULL()

First part of free-boundary BC matrix.

◆ bc_nrhs

integer(i4) bc_nrhs = 0

Number of terms in free-boundary BC.

◆ bc_rhs_list

integer(i4), dimension(:), pointer bc_rhs_list => NULL()

List of terms interacting with free-boundary BC.

◆ coil_bounds

real(r8), dimension(:,:), pointer coil_bounds => NULL()

Coil current bounds.

◆ coil_file

character(len=oft_path_slen) coil_file = 'none'

File containing coil definitions.

◆ coil_map

type(oft_map), pointer coil_map => NULL()

Coil vector map information.

◆ coil_nturns

real(r8), dimension(:,:), pointer coil_nturns => NULL()

Number of turns for each coil in each region.

◆ coil_regions

type(coil_region), dimension(:), pointer coil_regions => NULL()

Meshed coil regions.

◆ coil_stitch

type(oft_seam), pointer coil_stitch => NULL()

Coil vector stitching information.

◆ coil_vcont

real(r8), dimension(:), pointer coil_vcont => NULL()

Virtual VSC definition as weighted sum of other coils.

◆ coil_vec

class(oft_vector), pointer coil_vec => NULL()

Coil vector template.

◆ coils_dt

real(r8), dimension(:), pointer coils_dt => NULL()

Coil currents at start of step for quasi-static calculations.

◆ coils_ext

type(axi_coil_set), dimension(:), pointer coils_ext => NULL()

External coil definitions.

◆ coils_volt

real(r8), dimension(:), pointer coils_volt => NULL()

Coil voltages for (valid for Vcoils only)

◆ compute_chi

logical compute_chi = .FALSE.

Compute toroidal field potential?

◆ cond_regions

type(cond_region), dimension(:), pointer cond_regions => NULL()

Meshed conducting regions.

◆ cond_weights

real(r8), dimension(:), pointer cond_weights => NULL()

Needs docs.

◆ dels

class(oft_matrix), pointer dels => NULL()

\( \frac{1}{R} \Delta^* \) matrix

◆ dels_dt

class(oft_matrix), pointer dels_dt => NULL()

LHS matrix with time dependence.

◆ dels_full

class(oft_matrix), pointer dels_full => NULL()

\( \frac{1}{R} \Delta^* \) matrix with no BC

◆ dipole_mode

logical dipole_mode = .FALSE.

Include modifications for Dipole geometry.

◆ dist_coil

type(oft_1d_real), dimension(:), pointer dist_coil => NULL()

Current distribution for each coil (if defined)

◆ dt

real(r8) dt = -1.d0

Timestep size for time-dependent and quasi-static solves.

◆ dt_last

real(r8) dt_last = -1.d0

Timestep size for current LHS matrix.

◆ fe_rep

class(oft_scalar_bfem), pointer fe_rep => NULL()

Lagrange FE representation.

◆ free

logical free = .FALSE.

Computing free-boundary equilibrium?

◆ full_domain

logical full_domain = .FALSE.

Solve across full domain (for Solov'ev test cases)

◆ gs_zerob_bc

type(oft_gs_zerob), pointer gs_zerob_bc => NULL()

BC object for zeroing nodes outside plasma region.

◆ ierr

integer(i4) ierr = 0

Error flag from most recent solve.

◆ isoflux_grad_wt_lim

real(r8) isoflux_grad_wt_lim = -1.d0

Limit for isoflux inverse gradient weighting (negative to disable)

◆ lcoils

real(r8), dimension(:,:), pointer lcoils => NULL()

Coil mutual inductance matrix.

◆ lim_area

real(r8) lim_area = -1.d0

Area inside the limiter.

◆ lim_con

integer(i4), dimension(:), pointer lim_con => NULL()

Limiter contour list (contains all limiters)

◆ lim_nloops

integer(i4) lim_nloops = 0

Number of limiter loops.

◆ lim_ptr

integer(i4), dimension(:), pointer lim_ptr => NULL()

Pointer to start of each.

◆ lim_zmax

real(r8) lim_zmax = 1.d99

Vertical position cutoff for limiter points.

◆ limiter_file

character(len=oft_path_slen) limiter_file = 'none'

File non-node limiter points.

◆ limiter_nds

integer(i4), dimension(:), pointer limiter_nds => NULL()

List of limiter nodes.

◆ limiter_pts

real(r8), dimension(:,:), pointer limiter_pts => NULL()

Location of non-node limiter points.

◆ lu_solver

type(oft_lusolver) lu_solver

\( \frac{1}{R} \Delta^* \) inverse solver

◆ lu_solver_dt

type(oft_lusolver) lu_solver_dt

LHS inverse solver with time dependence.

◆ maxits

integer(i4) maxits = 30

Maximum number of iterations for nonlinear solve.

◆ mesh

class(oft_bmesh), pointer mesh => NULL()

Mesh.

◆ mirror_mode

logical mirror_mode = .FALSE.

Include modifications for Mirror/FRC geometry.

◆ ml_fe_rep

type(oft_ml_fem_type), pointer ml_fe_rep => NULL()

Multi-level Lagrange FE representation (only top level used)

◆ mop

class(oft_matrix), pointer mop => NULL()

Lagrange FE mass matrix.

◆ mop_axis

class(oft_matrix), pointer mop_axis => NULL()

Lagrange FE mass matrix with Dirichlet BCs on axis.

◆ mrop

class(oft_matrix), pointer mrop => NULL()

1/R-scaled Lagrange FE mass matrix

◆ ncoil_regs

integer(i4) ncoil_regs = 0

Number of meshed coil regions in device.

◆ ncoils

integer(i4) ncoils = 0

Number of coils in device.

◆ ncoils_ext

integer(i4) ncoils_ext = 0

Number of external (non-meshed) coils in device.

◆ ncond_eigs

integer(i4) ncond_eigs = 0

Number of total fixed-shape current modes for conducting regions.

◆ ncond_regs

integer(i4) ncond_regs = 0

Number of conducting regions.

◆ ninner_limiter_nds

integer(i4) ninner_limiter_nds = 0

Needs docs.

◆ nl_tol

real(r8) nl_tol = 1.d-8

Tolerance for nonlinear solve.

◆ nlim_con

integer(i4) nlim_con = 0

Number of node points in limiter contour list.

◆ nlimiter_nds

integer(i4) nlimiter_nds = 0

Number of grid nodes used as limiter points.

◆ nlimiter_pts

integer(i4) nlimiter_pts = 0

Number of non-node limiter points.

◆ nr0_ramp

integer(i4) nr0_ramp = 6

Number of iterations for R0 ramp if R0 target is used.

◆ olbp

integer(i4), dimension(:), pointer olbp => NULL()

Oriented list of boundary points.

◆ plot_final

logical plot_final = .TRUE.

Save solver result for plotting.

◆ plot_step

logical plot_step = .TRUE.

Save solver steps for plotting.

◆ psi_coil

class(oft_vector_ptr), dimension(:), pointer psi_coil => NULL()

\( \psi \) for each coil

◆ psi_dt

class(oft_vector), pointer psi_dt => NULL()

\( \psi \) at start of step for quasi-static calculations

◆ rcoils

real(r8), dimension(:), pointer rcoils => NULL()

Lumped resistance [Ohms] of each coil (negative for Icoils)

◆ region_info

type(gs_region_info) region_info

Region information for non-continuous conductors.

◆ rlimiter_nds

real(r8), dimension(:,:), pointer rlimiter_nds => NULL()

Location of limiter nodes.

◆ rmax

real(r8) rmax = 0.d0

Maximum radial coordinate in model.

◆ rmin

real(r8) rmin = 0.d0

Minimum radial coordinate in model.

◆ saddle_cmask

logical, dimension(:), pointer saddle_cmask => NULL()

Cell mask for saddle search.

◆ saddle_pmask

logical, dimension(:), pointer saddle_pmask => NULL()

Point mask for saddle search.

◆ saddle_rmask

logical, dimension(:), pointer saddle_rmask => NULL()

Region mask for saddle search.

◆ save_visit

logical save_visit = .TRUE.

Save information for plotting?

◆ spatial_bounds

real(r8), dimension(2,2) spatial_bounds = RESHAPE([-1.d99,1.d99,-1.d99,1.d99], [2,2])

Maximum R,Z extents of plasma.

◆ timing

real(r8), dimension(4) timing = 0.d0

Timing for each phase of solve.

◆ urf

real(r8) urf = .2d0

Under-relaxation factor for Picard iteration.

◆ xdmf

type(xdmf_plot_file) xdmf

XDMF plotting object.

◆ zerob_bc

type(oft_blag_zerob), pointer zerob_bc => NULL()

BC object for zeroing boundary nodes.

◆ zerogrnd_bc

type(oft_blag_zerogrnd), pointer zerogrnd_bc => NULL()

BC object for zeroing grounding node(s)


The documentation for this type was generated from the following file: