The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
oft_xmhd_2d_sim Type Reference

Detailed Description

Main 2D MHD simulation object.

Public Member Functions

procedure rst_load (self, u, filename, path, t, dt)
 Load restart file.
procedure rst_save (self, u, t, dt, filename, path)
 Save restart file.
procedure run_lin_simulation (self)
 Run simulation in linear mode.
procedure run_simulation (self)
 Run simulation.
procedure setup (self, mg_mesh_in, order, fe_rep_in)
 Setup.
procedure setup_bc (self)
 Set default boundary conditions.

Public Attributes

real(r8), dimension(3) b_0 = 0.d0
 background, static magnetic field
logical, dimension(:), pointer, contiguous by_bc => NULL()
 by BC flag
real(r8), dimension(:), allocatable chi
 thermal diffusivity, by region
logical cyl_flag = .FALSE.
real(r8), dimension(:), allocatable d_diff
 diffusivity, by region
real(r8) den_scale = 1.d19
 scale factor used to normalize density
real(r8) dt = -1.d0
 timestep
real(r8), dimension(:, :), allocatable eta
 electrical resistivity, in units of mu0, by region. First column is in plane, second column is out of plane (for anisotropic resistivity)
type(oft_fem_comp_type), pointer fe_rep => NULL()
 Finite element representation for solution field.
real(r8), dimension(:), allocatable gamma
 adiabatic index, by region, by region
logical, dimension(:), allocatable ignore_rmask
 Mask for regions to ignore when populating physics (defaults to false).
logical incomp = .FALSE.
integer(i4) ittarget = 40
 Needs docs.
real(r8) jac_dt = -1.d0
 timestep for computing approximate jacobian
class(oft_matrix), pointer jacobian => NULL()
 approximate jacobian matrix
real(r8) k_boltz = elec_charge
 Boltzmann constant (use elec_charge for T in eV).
real(r8) lin_tol = 1.d-8
 absolute tolerance for linear solver
logical linear = .FALSE.
real(r8), dimension(:), allocatable m_i
 ion mass, by region
type(oft_mf_matrix), pointer mf_mat => NULL()
 Matrix free operator.
logical mfnk = .FALSE.
 Use matrix free method?
type(xmhd_2d_mfun), pointer mfun => NULL()
 mass matrix function
logical, dimension(:), pointer, contiguous n_bc => NULL()
 n BC flag
real(r8) nl_tol = 1.d-5
 absolute tolerance for nonlinear solver
type(xmhd_2d_nlfun), pointer nlfun => NULL()
 Nonlinear function.
integer(i4) nsteps = -1
real(r8), dimension(:), allocatable nu
 kinematic viscosity [m^2/s], by region
integer(i4) pre_freq = 1
 frequency to update preconditioner
logical, dimension(:), pointer, contiguous psi_bc => NULL()
 psi BC flag
class(oft_vector), pointer psi_vac => NULL()
 vacuum poloidal flux offset added to the psi field (matches psi/oft_blagrange space)
integer(i4) rst_base = 0
 starting index of restart files
integer(i4) rst_freq = 10
 frequency to generate restart files
real(r8) t = 0.d0
 current time
logical, dimension(:), pointer, contiguous t_bc => NULL()
 T BC flag.
logical timestep_cn = .FALSE.
class(oft_vector), pointer u => NULL()
 current solution vector
class(oft_vector), pointer u0 => NULL()
 equilibrium solution vector (used for linearization if linear = True)
logical, dimension(:), pointer, contiguous velx_bc => NULL()
 vel BC flag
logical, dimension(:), pointer, contiguous vely_bc => NULL()
 vel BC flag
logical, dimension(:), pointer, contiguous velz_bc => NULL()
 vel BC flag
type(xdmf_plot_file) xdmf_plot
type(xml_node) xml_pre_def
 XML element for preconditioner definition.
type(xml_node) xml_root
 XML root element.

Member Function/Subroutine Documentation

◆ rst_load()

procedure rst_load ( class(oft_xmhd_2d_sim), intent(inout) self,
class(oft_vector), intent(inout), pointer u,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
real(r8), intent(out), optional t,
real(r8), intent(out), optional dt )

Load restart file.

Parameters
[in,out]uSolution to load
[in]filenameName of restart file
[in]pathPath to store solution vector in file
[out]tTime of loaded solution
[out]dtTimestep at loaded time

◆ rst_save()

procedure rst_save ( class(oft_xmhd_2d_sim), intent(inout) self,
class(oft_vector), intent(inout), pointer u,
real(r8), intent(in) t,
real(r8), intent(in) dt,
character(len=*), intent(in) filename,
character(len=*), intent(in) path )

Save restart file.

Parameters
[in,out]uSolution to save
[in]tCurrent solution time
[in]dtCurrent timestep
[in]filenameName of restart file
[in]pathPath to store solution vector in file

◆ run_lin_simulation()

procedure run_lin_simulation ( class(oft_xmhd_2d_sim), intent(inout), target self)

Run simulation in linear mode.

◆ run_simulation()

procedure run_simulation ( class(oft_xmhd_2d_sim), intent(inout), target self)

Run simulation.

◆ setup()

procedure setup ( class(oft_xmhd_2d_sim), intent(inout), target self,
class(multigrid_mesh), intent(in), target mg_mesh_in,
integer(i4), intent(in) order,
class(oft_scalar_bfem), intent(in), optional, target fe_rep_in )

Setup.

◆ setup_bc()

procedure setup_bc ( class(oft_xmhd_2d_sim), intent(inout) self)

Set default boundary conditions.

Member Data Documentation

◆ b_0

real (r8), dimension(3) b_0 = 0.d0

background, static magnetic field

◆ by_bc

logical, dimension(:), pointer, contiguous by_bc => NULL()

by BC flag

◆ chi

real(r8), dimension(:), allocatable chi

thermal diffusivity, by region

◆ cyl_flag

logical cyl_flag = .FALSE.

◆ d_diff

real(r8), dimension(:), allocatable d_diff

diffusivity, by region

◆ den_scale

real(r8) den_scale = 1.d19

scale factor used to normalize density

◆ dt

real(r8) dt = -1.d0

timestep

◆ eta

real(r8), dimension(:, :), allocatable eta

electrical resistivity, in units of mu0, by region. First column is in plane, second column is out of plane (for anisotropic resistivity)

◆ fe_rep

type(oft_fem_comp_type), pointer fe_rep => NULL()

Finite element representation for solution field.

◆ gamma

real(r8), dimension(:), allocatable gamma

adiabatic index, by region, by region

◆ ignore_rmask

logical, dimension(:), allocatable ignore_rmask

Mask for regions to ignore when populating physics (defaults to false).

◆ incomp

logical incomp = .FALSE.

◆ ittarget

integer(i4) ittarget = 40

Needs docs.

◆ jac_dt

real(r8) jac_dt = -1.d0

timestep for computing approximate jacobian

◆ jacobian

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

approximate jacobian matrix

◆ k_boltz

real(r8) k_boltz = elec_charge

Boltzmann constant (use elec_charge for T in eV).

◆ lin_tol

real(r8) lin_tol = 1.d-8

absolute tolerance for linear solver

◆ linear

logical linear = .FALSE.

◆ m_i

real(r8), dimension(:), allocatable m_i

ion mass, by region

◆ mf_mat

type(oft_mf_matrix), pointer mf_mat => NULL()

Matrix free operator.

◆ mfnk

logical mfnk = .FALSE.

Use matrix free method?

◆ mfun

type(xmhd_2d_mfun), pointer mfun => NULL()

mass matrix function

◆ n_bc

logical, dimension(:), pointer, contiguous n_bc => NULL()

n BC flag

◆ nl_tol

real(r8) nl_tol = 1.d-5

absolute tolerance for nonlinear solver

◆ nlfun

type(xmhd_2d_nlfun), pointer nlfun => NULL()

Nonlinear function.

◆ nsteps

integer(i4) nsteps = -1

of timesteps

◆ nu

real(r8), dimension(:), allocatable nu

kinematic viscosity [m^2/s], by region

◆ pre_freq

integer(i4) pre_freq = 1

frequency to update preconditioner

◆ psi_bc

logical, dimension(:), pointer, contiguous psi_bc => NULL()

psi BC flag

◆ psi_vac

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

vacuum poloidal flux offset added to the psi field (matches psi/oft_blagrange space)

◆ rst_base

integer(i4) rst_base = 0

starting index of restart files

◆ rst_freq

integer(i4) rst_freq = 10

frequency to generate restart files

◆ t

real(r8) t = 0.d0

current time

◆ t_bc

logical, dimension(:), pointer, contiguous t_bc => NULL()

T BC flag.

◆ timestep_cn

logical timestep_cn = .FALSE.

◆ u

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

current solution vector

◆ u0

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

equilibrium solution vector (used for linearization if linear = True)

◆ velx_bc

logical, dimension(:), pointer, contiguous velx_bc => NULL()

vel BC flag

◆ vely_bc

logical, dimension(:), pointer, contiguous vely_bc => NULL()

vel BC flag

◆ velz_bc

logical, dimension(:), pointer, contiguous velz_bc => NULL()

vel BC flag

◆ xdmf_plot

type(xdmf_plot_file) xdmf_plot

◆ xml_pre_def

type(xml_node) xml_pre_def

XML element for preconditioner definition.

◆ xml_root

type(xml_node) xml_root

XML root element.


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