MPI-AMRVAC 3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
|
module mod_magnetofriction.t Purpose: use magnetofrictional method to relax 3D magnetic field to force-free field 01.04.2016 developed by Chun Xia and Yang Guo 04.10.2017 modulized by Chun Xia Usage: in amrvac.par: &methodlist time_stepper='onestep' ! time marching scheme, or 'twostep','threestep' flux_method=13*'cd4' ! or 'tvdlf', 'fd' limiter= 13*'koren' ! or 'vanleer','cada3','mp5' so on / &meshlist ditregrid=20 ! set iteration interval for adjusting AMR / &mhd_list mhd_magnetofriction=.true. / &mf_list mf_it_max=60000 ! set the maximum iteration number mf_ditsave=20000 ! set iteration interval for data output mf_cc=0.3 ! stability coefficient controls numerical stability mf_cy=0.2 ! frictional velocity coefficient mf_cdivb=0.01 ! divb cleaning coefficient controls diffusion speed of divb / More...
Functions/Subroutines | |
subroutine | mf_params_read (files) |
Read this module"s parameters from a file. | |
subroutine | magnetofriction_init () |
Initialize the module. | |
subroutine | magnetofriction |
subroutine | mf_velocity_update (dtfff) |
subroutine | vhat (w, x, ixil, ixol, vhatmaxgrid) |
subroutine | frictional_velocity (w, x, ixil, ixol, qvmax, qdt) |
subroutine | advectmf (idimlim, qt, qdt) |
subroutine | advect1mf (method, dtin, dtfactor, idimlim, qtc, psa, qt, psb) |
subroutine | process1_gridmf (method, igrid, qdt, ixgl, idimlim, qtc, wct, qt, w) |
subroutine | upwindlrmf (ixil, ixll, ixrl, idim, w, wct, wlc, wrc, x) |
subroutine | getfluxmf (w, x, ixil, ixol, idir, idim, f) |
subroutine | tvdlfmf (qdt, ixil, ixol, idimlim, qtc, wct, qt, wnew, fc, dxd, x) |
subroutine | hancockmf (qdt, ixil, ixol, idimlim, qtc, wct, qt, wnew, dxd, x) |
subroutine | fdmf (qdt, ixil, ixol, idimlim, qtc, wct, qt, wnew, fc, dxd, x) |
subroutine | reconstructlmf (ixil, ill, idims, w, wlc) |
subroutine | reconstructrmf (ixil, ill, idims, w, wrc) |
subroutine | centdiff4mf (qdt, ixil, ixol, idimlim, qtc, wct, qt, w, fc, dxd, x) |
subroutine | getdtfff_courant (w, x, ixil, ixol, dtnew) |
subroutine | getcmaxfff (w, ixil, ixol, idims, cmax) |
subroutine | divbclean (qdt, ixil, ixol, wct, w, x) |
Clean divergence of magnetic field by Janhunen's and Linde's source terms. | |
subroutine | addgeometrymf (qdt, ixil, ixol, wct, w, x) |
subroutine | get_current (w, ixil, ixol, idirmin, current) |
Calculate idirmin and the idirmin:3 components of the common current array make sure that dxlevel(^D) is set correctly. | |
subroutine | get_divb (w, ixil, ixol, divb) |
Calculate div B within ixO. | |
Variables | |
double precision | mf_cc |
stability coefficient controls numerical stability | |
double precision | mf_cy |
frictional velocity coefficient | |
double precision | mf_cy_max |
double precision | mf_cdivb |
divb cleaning coefficient controls diffusion speed of divb | |
double precision | mf_cdivb_max |
double precision | mf_tvdlfeps |
TVDLF dissipation coefficient controls the dissipation term. | |
double precision | mf_tvdlfeps_min |
double precision | tmf |
time in magnetofriction process | |
double precision | cmax_mype |
maximal speed for fd scheme | |
double precision | cmax_global |
maximal speed for fd scheme | |
double precision, public | mf_vmax = 3.d6 |
maximal limit of magnetofrictional velocity in cm s^-1 (Pomoell 2019 A&A) | |
integer | mf_ditsave |
integer | mf_it_max |
integer | mf_it |
logical | mf_advance |
logical | fix_conserve_at_step = .true. |
module mod_magnetofriction.t Purpose: use magnetofrictional method to relax 3D magnetic field to force-free field 01.04.2016 developed by Chun Xia and Yang Guo 04.10.2017 modulized by Chun Xia Usage: in amrvac.par: &methodlist time_stepper='onestep' ! time marching scheme, or 'twostep','threestep' flux_method=13*'cd4' ! or 'tvdlf', 'fd' limiter= 13*'koren' ! or 'vanleer','cada3','mp5' so on / &meshlist ditregrid=20 ! set iteration interval for adjusting AMR / &mhd_list mhd_magnetofriction=.true. / &mf_list mf_it_max=60000 ! set the maximum iteration number mf_ditsave=20000 ! set iteration interval for data output mf_cc=0.3 ! stability coefficient controls numerical stability mf_cy=0.2 ! frictional velocity coefficient mf_cdivb=0.01 ! divb cleaning coefficient controls diffusion speed of divb /
subroutine mod_magnetofriction::addgeometrymf | ( | double precision, intent(in) | qdt, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
double precision, dimension(ixi^s,1:nw), intent(inout) | wct, | ||
double precision, dimension(ixi^s,1:nw), intent(inout) | w, | ||
double precision, dimension(ixi^s,1:ndim), intent(in) | x | ||
) |
Definition at line 1335 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::advect1mf | ( | integer, dimension(nlevelshi), intent(in) | method, |
double precision, intent(in) | dtin, | ||
double precision, intent(in) | dtfactor, | ||
integer, intent(in) | idim, | ||
integer, intent(in) | lim, | ||
double precision, intent(in) | qtc, | ||
type(state), dimension(max_blocks) | psa, | ||
double precision, intent(in) | qt, | ||
type(state), dimension(max_blocks) | psb | ||
) |
subroutine mod_magnetofriction::advectmf | ( | integer, intent(in) | idim, |
integer, intent(in) | lim, | ||
double precision, intent(in) | qt, | ||
double precision, intent(in) | qdt | ||
) |
subroutine mod_magnetofriction::centdiff4mf | ( | double precision, intent(in) | qdt, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
integer, intent(in) | idim, | ||
integer, intent(in) | lim, | ||
double precision, intent(in) | qtc, | ||
double precision, dimension(ixi^s,1:nw) | wct, | ||
double precision, intent(in) | qt, | ||
double precision, dimension(ixi^s,1:nw) | w, | ||
double precision, dimension(ixi^s,1:ndir,1:ndim) | fc, | ||
double precision, intent(in) | dx, | ||
integer, intent(in) | d, | ||
double precision, dimension(ixi^s,1:ndim), intent(in) | x | ||
) |
subroutine mod_magnetofriction::divbclean | ( | double precision, intent(in) | qdt, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
double precision, dimension(ixi^s,1:nw), intent(in) | wct, | ||
double precision, dimension(ixi^s,1:nw), intent(inout) | w, | ||
double precision, dimension(ixi^s,1:ndim), intent(in) | x | ||
) |
Clean divergence of magnetic field by Janhunen's and Linde's source terms.
Definition at line 1296 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::fdmf | ( | double precision, intent(in) | qdt, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
integer, intent(in) | idim, | ||
integer, intent(in) | lim, | ||
double precision, intent(in) | qtc, | ||
double precision, dimension(ixi^s,1:nw), intent(inout) | wct, | ||
double precision, intent(in) | qt, | ||
double precision, dimension(ixi^s,1:nw), intent(inout) | wnew, | ||
double precision, dimension(ixi^s,1:ndir,1:ndim), intent(out) | fc, | ||
double precision, intent(in) | dx, | ||
double precision, intent(in) | d, | ||
double precision, dimension(ixi^s,1:ndim), intent(in) | x | ||
) |
subroutine mod_magnetofriction::frictional_velocity | ( | double precision, dimension(ixi^s,1:nw), intent(inout) | w, |
double precision, dimension(ixi^s,1:ndim), intent(in) | x, | ||
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
double precision, intent(in) | qvmax, | ||
double precision, intent(in) | qdt | ||
) |
Definition at line 554 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::get_current | ( | double precision, dimension(ixi^s,1:nw) | w, |
integer | ixi, | ||
integer | l, | ||
integer | ixo, | ||
l, | |||
integer | idirmin, | ||
double precision, dimension(ixi^s,7-2*ndir:3) | current | ||
) |
Calculate idirmin and the idirmin:3 components of the common current array make sure that dxlevel(^D) is set correctly.
Definition at line 1397 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::get_divb | ( | double precision, dimension(ixi^s,1:nw), intent(in) | w, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
double precision, dimension(ixi^s) | divb | ||
) |
Calculate div B within ixO.
Definition at line 1421 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::getcmaxfff | ( | double precision, dimension(ixi^s,1:nw), intent(in) | w, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
integer, intent(in) | idims, | ||
double precision, dimension(ixi^s), intent(out) | cmax | ||
) |
Definition at line 1277 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::getdtfff_courant | ( | double precision, dimension(ixi^s,1:nw), intent(inout) | w, |
double precision, dimension(ixi^s,1:ndim), intent(in) | x, | ||
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
double precision, intent(inout) | dtnew | ||
) |
subroutine mod_magnetofriction::getfluxmf | ( | double precision, dimension(ixi^s,nw), intent(in) | w, |
double precision, dimension(ixi^s,1:ndim), intent(in) | x, | ||
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
integer, intent(in) | idir, | ||
integer, intent(in) | idim, | ||
double precision, dimension(ixi^s), intent(out) | f | ||
) |
Definition at line 837 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::hancockmf | ( | double precision, intent(in) | qdt, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
integer, intent(in) | idim, | ||
integer, intent(in) | lim, | ||
double precision, intent(in) | qtc, | ||
double precision, dimension(ixi^s,1:nw), intent(inout) | wct, | ||
double precision, intent(in) | qt, | ||
double precision, dimension(ixi^s,1:nw), intent(inout) | wnew, | ||
double precision, intent(in) | dx, | ||
double precision, intent(in) | d, | ||
double precision, dimension(ixi^s,1:ndim), intent(in) | x | ||
) |
subroutine mod_magnetofriction::magnetofriction |
subroutine mod_magnetofriction::magnetofriction_init |
Initialize the module.
Definition at line 80 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::mf_params_read | ( | character(len=*), dimension(:), intent(in) | files | ) |
Read this module"s parameters from a file.
Definition at line 63 of file mod_magnetofriction.t.
subroutine mod_magnetofriction::mf_velocity_update | ( | double precision, intent(in) | dtfff | ) |
subroutine mod_magnetofriction::process1_gridmf | ( | integer, intent(in) | method, |
integer, intent(in) | igrid, | ||
double precision, intent(in) | qdt, | ||
integer, intent(in) | ixg, | ||
integer, intent(in) | l, | ||
integer, intent(in) | idim, | ||
integer, intent(in) | lim, | ||
double precision, intent(in) | qtc, | ||
double precision, dimension(ixg^s,1:nw) | wct, | ||
double precision, intent(in) | qt, | ||
double precision, dimension(ixg^s,1:nw) | w | ||
) |
subroutine mod_magnetofriction::reconstructlmf | ( | integer, intent(in) | ixi, |
integer, intent(in) | l, | ||
integer, intent(in) | il, | ||
l, | |||
integer, intent(in) | idims, | ||
double precision, dimension(ixi^s,1:nw), intent(in) | w, | ||
double precision, dimension(ixi^s,1:nw), intent(out) | wlc | ||
) |
subroutine mod_magnetofriction::reconstructrmf | ( | integer, intent(in) | ixi, |
integer, intent(in) | l, | ||
integer, intent(in) | il, | ||
l, | |||
integer, intent(in) | idims, | ||
double precision, dimension(ixi^s,1:nw), intent(in) | w, | ||
double precision, dimension(ixi^s,1:nw), intent(out) | wrc | ||
) |
subroutine mod_magnetofriction::tvdlfmf | ( | double precision, intent(in) | qdt, |
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
integer, intent(in) | idim, | ||
integer, intent(in) | lim, | ||
double precision, intent(in) | qtc, | ||
double precision, dimension(ixi^s,1:nw) | wct, | ||
double precision, intent(in) | qt, | ||
double precision, dimension(ixi^s,1:nw) | wnew, | ||
double precision, dimension(ixi^s,1:ndir,1:ndim) | fc, | ||
double precision, intent(in) | dx, | ||
double precision, intent(in) | d, | ||
double precision, dimension(ixi^s,1:ndim), intent(in) | x | ||
) |
subroutine mod_magnetofriction::upwindlrmf | ( | integer, intent(in) | ixi, |
integer, intent(in) | l, | ||
integer, intent(in) | ixl, | ||
l, | |||
integer, intent(in) | ixr, | ||
l, | |||
integer, intent(in) | idim, | ||
double precision, dimension(ixi^s,1:nw) | w, | ||
double precision, dimension(ixi^s,1:nw) | wct, | ||
double precision, dimension(ixi^s,1:nw) | wlc, | ||
double precision, dimension(ixi^s,1:nw) | wrc, | ||
double precision, dimension(ixi^s,1:ndim) | x | ||
) |
subroutine mod_magnetofriction::vhat | ( | double precision, dimension(ixi^s,nw), intent(inout) | w, |
double precision, dimension(ixi^s,1:ndim), intent(in) | x, | ||
integer, intent(in) | ixi, | ||
integer, intent(in) | l, | ||
integer, intent(in) | ixo, | ||
l, | |||
double precision, intent(out) | vhatmaxgrid | ||
) |
double precision mod_magnetofriction::cmax_global |
maximal speed for fd scheme
Definition at line 42 of file mod_magnetofriction.t.
double precision mod_magnetofriction::cmax_mype |
maximal speed for fd scheme
Definition at line 40 of file mod_magnetofriction.t.
logical mod_magnetofriction::fix_conserve_at_step = .true. |
Definition at line 59 of file mod_magnetofriction.t.
logical mod_magnetofriction::mf_advance |
Definition at line 58 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_cc |
stability coefficient controls numerical stability
Definition at line 30 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_cdivb |
divb cleaning coefficient controls diffusion speed of divb
Definition at line 34 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_cdivb_max |
Definition at line 34 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_cy |
frictional velocity coefficient
Definition at line 32 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_cy_max |
Definition at line 32 of file mod_magnetofriction.t.
integer mod_magnetofriction::mf_ditsave |
Definition at line 55 of file mod_magnetofriction.t.
integer mod_magnetofriction::mf_it |
Definition at line 57 of file mod_magnetofriction.t.
integer mod_magnetofriction::mf_it_max |
Definition at line 56 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_tvdlfeps |
TVDLF dissipation coefficient controls the dissipation term.
Definition at line 36 of file mod_magnetofriction.t.
double precision mod_magnetofriction::mf_tvdlfeps_min |
Definition at line 36 of file mod_magnetofriction.t.
double precision, public mod_magnetofriction::mf_vmax = 3.d6 |
maximal limit of magnetofrictional velocity in cm s^-1 (Pomoell 2019 A&A)
Definition at line 44 of file mod_magnetofriction.t.
double precision mod_magnetofriction::tmf |
time in magnetofriction process
Definition at line 38 of file mod_magnetofriction.t.