The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
|
Grad-Shafranov equilibrium object.
Public Member Functions | |
procedure | delete (self) |
Destory G-S object. | |
procedure | get_chi (self) |
Compute toroidal field potential. | |
procedure | init (self) |
Build operators and allocate storage. | |
procedure | init_psi (self, ierr, r0, a, kappa, delta, curr_source) |
Initialize \( \psi \) using simple definition. | |
procedure | itor (self, psi_vec) |
Compute approximate toroidal current as \( \int \Delta^* \psi dA \). | |
procedure | lin_solve (self, 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, ierr) |
Solve nonlinear G-S system. | |
procedure | vac_solve (self, psi_sol, rhs_source, ierr) |
Solve vacuum field for given \( J_{\phi} \). | |
Public Attributes | |
real(r8) | alam = 1.d0 |
Scale factor for F*F' or F' profile (see mode) | |
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(i4) | bc_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. | |
class(oft_vector), pointer | chi => NULL() |
Toroidal field potential (if computed) | |
real(r8), dimension(:,:), pointer | coil_bounds => NULL() |
Coil current bounds. | |
real(r8), dimension(:), pointer | coil_currs => NULL() |
Coil currents. | |
character(len=oft_path_slen) | coil_file = 'none' |
File containing coil definitions. | |
real(r8), dimension(:,:), pointer | coil_nturns => NULL() |
Number of turns for each coil in each region. | |
real(r8), dimension(:,:), pointer | coil_reg_mat => NULL() |
Coil regularization terms. | |
real(r8), dimension(:), pointer | coil_reg_targets => NULL() |
Targets for coil regularization terms. | |
type(coil_region), dimension(:), pointer | coil_regions => NULL() |
Meshed coil regions. | |
real(r8), dimension(:), pointer | coil_vcont => NULL() |
Virtual VSC definition as weighted sum of other coils. | |
type(axi_coil_set), dimension(:), pointer | coils_ext => NULL() |
External coil definitions. | |
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 | |
real(r8) | dipole_a = 0.d0 |
Anisotropy exponent for dipole pressure profiles. | |
class(flux_func), pointer | dipole_b0 => NULL() |
Dipole minimum B profile. | |
logical | dipole_mode = .FALSE. |
Needs docs. | |
logical | diverted = .FALSE. |
Equilibrium is diverted? | |
real(r8) | dt = -1.d0 |
Timestep size for time-dependent and quasi-static solves. | |
real(r8) | dt_last = -1.d0 |
Timestep size for current LHS matrix. | |
real(r8) | estore_target = -1.d0 |
Stored energy target. | |
class(flux_func), pointer | eta => NULL() |
Resistivity flux function. | |
logical, dimension(:), pointer | fe_flag => NULL() |
FE boundary flag. | |
class(oft_scalar_bfem), pointer | fe_rep => NULL() |
Lagrange FE representation. | |
integer(i4) | flux_ntargets = 0 |
Number of \( \psi \) target locations. | |
real(r8), dimension(:,:), pointer | flux_targets => NULL() |
Flux target locations and values. | |
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. | |
logical | has_plasma = .TRUE. |
Solve with plasma? (otherwise vacuum) | |
class(flux_func), pointer | i => NULL() |
F*F' flux function. | |
class(flux_func), pointer | i_ni => NULL() |
Non-inductive F*F' flux function. | |
integer(i4) | ierr = 0 |
Error flag from most recent solve. | |
real(r8) | ip_ratio_target = -1.d99 |
Ip ratio target. | |
real(r8) | isoflux_grad_wt_lim = -1.d0 |
Limit for isoflux inverse gradient weighting (negative to disable) | |
integer(i4) | isoflux_ntargets = 0 |
Number of isoflux target locations. | |
real(r8), dimension(:,:), pointer | isoflux_targets => NULL() |
Isoflux target locations. | |
real(r8) | itor_target = -1.d0 |
Toroidal current target. | |
real(r8), dimension(:,:), pointer | lcoils => NULL() |
Coil mutual inductance matrix. | |
real(r8) | lim_area = -1.d0 |
Area inside the limiter. | |
integer(i4), dimension(:), pointer | lim_con => NULL() |
Limiter contour list (contains all limiters) | |
integer(i4) | lim_nloops = 0 |
Number of limiter loops. | |
real(r8), dimension(2) | lim_point = [-1.d0,1.d99] |
Location of limiting point or active X-point. | |
integer(i4), dimension(:), pointer | lim_ptr => NULL() |
Pointer to start of each. | |
real(r8) | lim_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_lusolver) | lu_solver |
\( \frac{1}{R} \Delta^* \) inverse solver | |
type(oft_lusolver) | lu_solver_dt |
LHS inverse solver with time dependence. | |
integer(i4) | maxits = 30 |
Maximum number of iterations for nonlinear solve. | |
class(oft_bmesh), pointer | mesh => NULL() |
Mesh. | |
type(oft_ml_fem_type), pointer | ml_fe_rep => NULL() |
Multi-level Lagrange FE representation (only top level used) | |
integer(i4) | mode = 0 |
RHS source mode (0 -> F*F', 1 -> F') | |
class(oft_matrix), pointer | mop => NULL() |
Lagrange FE mass matrix. | |
class(oft_matrix), pointer | mrop => NULL() |
1/R-scaled Lagrange FE mass matrix | |
integer(i4) | ncoil_regs = 0 |
Number of meshed coil regions in device. | |
integer(i4) | ncoils = 0 |
Number of coils in device. | |
integer(i4) | ncoils_ext = 0 |
Number of external (non-meshed) coils in device. | |
integer(i4) | ncond_eigs = 0 |
Number of total fixed-shape current modes for conducting regions. | |
integer(i4) | ncond_regs = 0 |
Number of conducting regions. | |
integer(i4) | ninner_limiter_nds = 0 |
Needs docs. | |
real(r8) | nl_tol = 1.d-8 |
Tolerance for nonlinear solve. | |
integer(i4) | nlim_con = 0 |
Number of node points in limiter contour list. | |
integer(i4) | nlimiter_nds = 0 |
Number of grid nodes used as limiter points. | |
integer(i4) | nlimiter_pts = 0 |
Number of non-node limiter points. | |
integer(i4) | nr0_ramp = 6 |
Number of iterations for R0 ramp if R0 target is used. | |
integer(i4) | nregularize = 0 |
Number of regularization terms. | |
integer(i4) | nx_points = 0 |
Number of X-points in current solution. | |
real(r8), dimension(2) | o_point = [-1.d0,1.d99] |
Location of magnetic axis. | |
integer(i4), dimension(:), pointer | olbp => NULL() |
Oriented list of boundary points. | |
class(flux_func), pointer | p => NULL() |
Pressure flux function. | |
real(r8) | pax_target = -1.d0 |
On-axis pressure target. | |
real(r8), dimension(2) | plasma_bounds = [-1.d99,1.d99] |
Boundaing \( \psi \) values on [LCFS, axis]. | |
logical | plot_final = .TRUE. |
Save solver result for plotting. | |
logical | plot_step = .TRUE. |
Save solver steps for plotting. | |
real(r8) | pnorm = 1.d0 |
Scale factor for P' profile. | |
class(oft_vector), pointer | psi => NULL() |
Current \( \psi \) solution. | |
class(oft_vector_ptr), dimension(:), pointer | psi_coil => NULL() |
\( \psi \) for each coil | |
class(oft_vector), pointer | psi_dt => NULL() |
Time-dependent contribution to \( \psi \) from eddy currents. | |
real(r8) | psimax = 1.d0 |
Maximum \( \psi \) value for homogeneous equilibria. | |
real(r8) | psiscale = 1.d0 |
Solution scale factor for homogeneous equilibria. | |
real(r8) | r0_target = -1.d0 |
Magnetic axis radial target. | |
type(gs_region_info) | region_info |
Region information for non-continuous conductors. | |
real(r8), dimension(:,:), pointer | rlimiter_nds => NULL() |
Location of limiter nodes. | |
real(r8) | rmax = 0.d0 |
Maximum radial coordinate in model. | |
real(r8) | rmin = 0.d0 |
Minimum radial coordinate in model. | |
logical, dimension(:), pointer | saddle_cmask => NULL() |
Cell mask for saddle search. | |
integer(i4) | saddle_ntargets = 0 |
Number of saddle target locations. | |
logical, dimension(:), pointer | saddle_pmask => NULL() |
Point mask for saddle search. | |
logical, dimension(:), pointer | saddle_rmask => NULL() |
Region mask for saddle search. | |
real(r8), dimension(:,:), pointer | saddle_targets => NULL() |
Saddle target locations. | |
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(r8) | urf = .2d0 |
Under-relaxation factor for Picard iteration. | |
real(r8) | v0_target = -1.d99 |
Magnetic axis vertical target. | |
real(r8) | vcontrol_val = 0.d0 |
Amplitude of virtual VSC "current". | |
real(r8), dimension(2, max_xpoints) | x_points = 0.d0 |
Location of tracked X-points. | |
real(r8), dimension(2, max_xpoints) | x_vecs = 0.d0 |
Vectors point from X-points to O-point. | |
type(xdmf_plot_file) | xdmf |
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) | |
procedure delete | ( | class(gs_eq), intent(inout) | self | ) |
Destory G-S object.
[in,out] | self | G-S object |
procedure get_chi | ( | class(gs_eq), intent(inout) | self | ) |
Compute toroidal field potential.
[in,out] | self | G-S object |
procedure init | ( | class(gs_eq), intent(inout) | self | ) |
Build operators and allocate storage.
[in,out] | self | G-S object |
procedure init_psi | ( | class(gs_eq), intent(inout) | self, |
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:
r0 < 0.0
is passed a uniform current across the entire plasma region is usedr0
and a
, and optionally kappa
and delta
, are passed then a uniform current across a cross-section defined by those parameters is usedcurr_source
is passed then the source defined by those values is usedIn all cases the solution is scaled to match the target Ip value
[in,out] | self | G-S object |
[out] | ierr | Error flag |
[in] | r0 | Center for cross-section initialization |
[in] | a | Minor radius for cross-section initialization |
[in] | kappa | Elongation for cross-section initialization |
[in] | delta | Triangularity for cross-section initialization |
[in] | curr_source | Explicit current source |
procedure itor | ( | class(gs_eq), intent(inout) | self, |
class(oft_vector), intent(inout), optional | psi_vec | ||
) |
Compute approximate toroidal current as \( \int \Delta^* \psi dA \).
[in,out] | self | G-S object |
[in,out] | psi_vec | Needs docs |
procedure lin_solve | ( | class(gs_eq), intent(inout) | self, |
logical, intent(in) | adjust_r0, | ||
integer(4), intent(out), optional | ierr | ||
) |
Solve linearized version of G-S system (fixed RHS)
[in,out] | self | G-S object |
[in] | adjust_r0 | Needs docs |
[out] | ierr | Error flag |
procedure load_limiters | ( | class(gs_eq), intent(inout) | self | ) |
Load non-node limiter points.
[in,out] | self | G-S object |
procedure setup | ( | class(gs_eq), intent(inout) | self, |
class(oft_ml_fem_type), intent(inout), target | ml_lag_2d | ||
) |
Setup G-S object from FE representation.
[in,out] | self | G-S object |
procedure solve | ( | class(gs_eq), intent(inout) | self, |
integer(4), intent(out), optional | ierr | ||
) |
Solve nonlinear G-S system.
[in,out] | self | G-S object |
[out] | ierr | Error flag |
procedure vac_solve | ( | class(gs_eq), intent(inout) | self, |
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} \).
[in,out] | self | G-S object |
[in,out] | psi_sol | Input: BCs for \( \psi \), Output: solution |
[in,out] | rhs_source | Specified current source (optional) |
[out] | ierr | Error flag |
real(r8) alam = 1.d0 |
Scale factor for F*F' or F' profile (see mode)
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(i4) bc_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.
class(oft_vector), pointer chi => NULL() |
Toroidal field potential (if computed)
real(r8), dimension(:,:), pointer coil_bounds => NULL() |
Coil current bounds.
real(r8), dimension(:), pointer coil_currs => NULL() |
Coil currents.
character(len=oft_path_slen) coil_file = 'none' |
File containing coil definitions.
real(r8), dimension(:,:), pointer coil_nturns => NULL() |
Number of turns for each coil in each region.
real(r8), dimension(:,:), pointer coil_reg_mat => NULL() |
Coil regularization terms.
real(r8), dimension(:), pointer coil_reg_targets => NULL() |
Targets for coil regularization terms.
type(coil_region), dimension(:), pointer coil_regions => NULL() |
Meshed coil regions.
real(r8), dimension(:), pointer coil_vcont => NULL() |
Virtual VSC definition as weighted sum of other coils.
type(axi_coil_set), dimension(:), pointer coils_ext => NULL() |
External coil definitions.
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
real(r8) dipole_a = 0.d0 |
Anisotropy exponent for dipole pressure profiles.
class(flux_func), pointer dipole_b0 => NULL() |
Dipole minimum B profile.
logical dipole_mode = .FALSE. |
Needs docs.
logical diverted = .FALSE. |
Equilibrium is diverted?
real(r8) dt = -1.d0 |
Timestep size for time-dependent and quasi-static solves.
real(r8) dt_last = -1.d0 |
Timestep size for current LHS matrix.
real(r8) estore_target = -1.d0 |
Stored energy target.
class(flux_func), pointer eta => NULL() |
Resistivity flux function.
logical, dimension(:), pointer fe_flag => NULL() |
FE boundary flag.
class(oft_scalar_bfem), pointer fe_rep => NULL() |
Lagrange FE representation.
integer(i4) flux_ntargets = 0 |
Number of \( \psi \) target locations.
real(r8), dimension(:,:), pointer flux_targets => NULL() |
Flux target locations and values.
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.
logical has_plasma = .TRUE. |
Solve with plasma? (otherwise vacuum)
class(flux_func), pointer i => NULL() |
F*F' flux function.
class(flux_func), pointer i_ni => NULL() |
Non-inductive F*F' flux function.
integer(i4) ierr = 0 |
Error flag from most recent solve.
real(r8) ip_ratio_target = -1.d99 |
Ip ratio target.
real(r8) isoflux_grad_wt_lim = -1.d0 |
Limit for isoflux inverse gradient weighting (negative to disable)
integer(i4) isoflux_ntargets = 0 |
Number of isoflux target locations.
real(r8), dimension(:,:), pointer isoflux_targets => NULL() |
Isoflux target locations.
real(r8) itor_target = -1.d0 |
Toroidal current target.
real(r8), dimension(:,:), pointer lcoils => NULL() |
Coil mutual inductance matrix.
real(r8) lim_area = -1.d0 |
Area inside the limiter.
integer(i4), dimension(:), pointer lim_con => NULL() |
Limiter contour list (contains all limiters)
integer(i4) lim_nloops = 0 |
Number of limiter loops.
real(r8), dimension(2) lim_point = [-1.d0,1.d99] |
Location of limiting point or active X-point.
integer(i4), dimension(:), pointer lim_ptr => NULL() |
Pointer to start of each.
real(r8) lim_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_lusolver) lu_solver |
\( \frac{1}{R} \Delta^* \) inverse solver
type(oft_lusolver) lu_solver_dt |
LHS inverse solver with time dependence.
integer(i4) maxits = 30 |
Maximum number of iterations for nonlinear solve.
class(oft_bmesh), pointer mesh => NULL() |
Mesh.
type(oft_ml_fem_type), pointer ml_fe_rep => NULL() |
Multi-level Lagrange FE representation (only top level used)
integer(i4) mode = 0 |
RHS source mode (0 -> F*F', 1 -> F')
class(oft_matrix), pointer mop => NULL() |
Lagrange FE mass matrix.
class(oft_matrix), pointer mrop => NULL() |
1/R-scaled Lagrange FE mass matrix
integer(i4) ncoil_regs = 0 |
Number of meshed coil regions in device.
integer(i4) ncoils = 0 |
Number of coils in device.
integer(i4) ncoils_ext = 0 |
Number of external (non-meshed) coils in device.
integer(i4) ncond_eigs = 0 |
Number of total fixed-shape current modes for conducting regions.
integer(i4) ncond_regs = 0 |
Number of conducting regions.
integer(i4) ninner_limiter_nds = 0 |
Needs docs.
real(r8) nl_tol = 1.d-8 |
Tolerance for nonlinear solve.
integer(i4) nlim_con = 0 |
Number of node points in limiter contour list.
integer(i4) nlimiter_nds = 0 |
Number of grid nodes used as limiter points.
integer(i4) nlimiter_pts = 0 |
Number of non-node limiter points.
integer(i4) nr0_ramp = 6 |
Number of iterations for R0 ramp if R0 target is used.
integer(i4) nregularize = 0 |
Number of regularization terms.
integer(i4) nx_points = 0 |
Number of X-points in current solution.
real(r8), dimension(2) o_point = [-1.d0,1.d99] |
Location of magnetic axis.
integer(i4), dimension(:), pointer olbp => NULL() |
Oriented list of boundary points.
class(flux_func), pointer p => NULL() |
Pressure flux function.
real(r8) pax_target = -1.d0 |
On-axis pressure target.
real(r8), dimension(2) plasma_bounds = [-1.d99,1.d99] |
Boundaing \( \psi \) values on [LCFS, axis].
logical plot_final = .TRUE. |
Save solver result for plotting.
logical plot_step = .TRUE. |
Save solver steps for plotting.
real(r8) pnorm = 1.d0 |
Scale factor for P' profile.
class(oft_vector), pointer psi => NULL() |
Current \( \psi \) solution.
class(oft_vector_ptr), dimension(:), pointer psi_coil => NULL() |
\( \psi \) for each coil
class(oft_vector), pointer psi_dt => NULL() |
Time-dependent contribution to \( \psi \) from eddy currents.
real(r8) psimax = 1.d0 |
Maximum \( \psi \) value for homogeneous equilibria.
real(r8) psiscale = 1.d0 |
Solution scale factor for homogeneous equilibria.
real(r8) r0_target = -1.d0 |
Magnetic axis radial target.
type(gs_region_info) region_info |
Region information for non-continuous conductors.
real(r8), dimension(:,:), pointer rlimiter_nds => NULL() |
Location of limiter nodes.
real(r8) rmax = 0.d0 |
Maximum radial coordinate in model.
real(r8) rmin = 0.d0 |
Minimum radial coordinate in model.
logical, dimension(:), pointer saddle_cmask => NULL() |
Cell mask for saddle search.
integer(i4) saddle_ntargets = 0 |
Number of saddle target locations.
logical, dimension(:), pointer saddle_pmask => NULL() |
Point mask for saddle search.
logical, dimension(:), pointer saddle_rmask => NULL() |
Region mask for saddle search.
real(r8), dimension(:,:), pointer saddle_targets => NULL() |
Saddle target locations.
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(r8) urf = .2d0 |
Under-relaxation factor for Picard iteration.
real(r8) v0_target = -1.d99 |
Magnetic axis vertical target.
real(r8) vcontrol_val = 0.d0 |
Amplitude of virtual VSC "current".
real(r8), dimension(2,max_xpoints) x_points = 0.d0 |
Location of tracked X-points.
real(r8), dimension(2,max_xpoints) x_vecs = 0.d0 |
Vectors point from X-points to O-point.
type(xdmf_plot_file) xdmf |
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)