![]() |
The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
|
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. | |
| 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.
| [in,out] | u | Solution to load |
| [in] | filename | Name of restart file |
| [in] | path | Path to store solution vector in file |
| [out] | t | Time of loaded solution |
| [out] | dt | Timestep at loaded time |
| 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.
| [in,out] | u | Solution to save |
| [in] | t | Current solution time |
| [in] | dt | Current timestep |
| [in] | filename | Name of restart file |
| [in] | path | Path to store solution vector in file |
| procedure run_lin_simulation | ( | class(oft_xmhd_2d_sim), intent(inout), target | self | ) |
Run simulation in linear mode.
| procedure run_simulation | ( | class(oft_xmhd_2d_sim), intent(inout), target | self | ) |
Run simulation.
| 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.
| procedure setup_bc | ( | class(oft_xmhd_2d_sim), intent(inout) | self | ) |
Set default boundary conditions.
| 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.