MPI-AMRVAC 3.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Loading...
Searching...
No Matches
Functions/Subroutines | Variables
mod_magnetofriction Module Reference

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
 
character(len=16) mf_log_mode
 How to open the MF diagnostics CSV: auto, append, or replace.
 
character(len=256) mf_log_filename
 Optional diagnostics filename; empty uses <base_filename>_mflog.csv.
 
logical mf_advance
 
logical fix_conserve_at_step = .true.
 
logical mf_continue_run = .false.
 Whether this run continues an existing MF diagnostics series.
 

Detailed Description

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 /

Function/Subroutine Documentation

◆ addgeometrymf()

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 1380 of file mod_magnetofriction.t.

◆ advect1mf()

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 
)

Definition at line 726 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ advectmf()

subroutine mod_magnetofriction::advectmf ( integer, intent(in)  idim,
integer, intent(in)  lim,
double precision, intent(in)  qt,
double precision, intent(in)  qdt 
)

Definition at line 669 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ centdiff4mf()

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 
)

Definition at line 1203 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ divbclean()

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 1341 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ fdmf()

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 
)

Definition at line 1065 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ frictional_velocity()

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 599 of file mod_magnetofriction.t.

◆ get_current()

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 1442 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ get_divb()

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 1466 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ getcmaxfff()

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 1322 of file mod_magnetofriction.t.

◆ getdtfff_courant()

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 
)

Definition at line 1290 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ getfluxmf()

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 882 of file mod_magnetofriction.t.

◆ hancockmf()

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 
)

Definition at line 1004 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ magnetofriction()

subroutine mod_magnetofriction::magnetofriction

Definition at line 123 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ magnetofriction_init()

subroutine mod_magnetofriction::magnetofriction_init

Initialize the module.

Definition at line 88 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ mf_params_read()

subroutine mod_magnetofriction::mf_params_read ( character(len=*), dimension(:), intent(in)  files)

Read this module"s parameters from a file.

Definition at line 70 of file mod_magnetofriction.t.

◆ mf_velocity_update()

subroutine mod_magnetofriction::mf_velocity_update ( double precision, intent(in)  dtfff)

Definition at line 521 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ process1_gridmf()

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 
)

Definition at line 787 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ reconstructlmf()

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 
)

Definition at line 1122 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ reconstructrmf()

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 
)

Definition at line 1163 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ tvdlfmf()

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 
)

Definition at line 906 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ upwindlrmf()

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 
)

Definition at line 834 of file mod_magnetofriction.t.

Here is the call graph for this function:

◆ vhat()

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 
)

Definition at line 546 of file mod_magnetofriction.t.

Here is the call graph for this function:

Variable Documentation

◆ cmax_global

double precision mod_magnetofriction::cmax_global

maximal speed for fd scheme

Definition at line 42 of file mod_magnetofriction.t.

◆ cmax_mype

double precision mod_magnetofriction::cmax_mype

maximal speed for fd scheme

Definition at line 40 of file mod_magnetofriction.t.

◆ fix_conserve_at_step

logical mod_magnetofriction::fix_conserve_at_step = .true.

Definition at line 63 of file mod_magnetofriction.t.

◆ mf_advance

logical mod_magnetofriction::mf_advance

Definition at line 62 of file mod_magnetofriction.t.

◆ mf_cc

double precision mod_magnetofriction::mf_cc

stability coefficient controls numerical stability

Definition at line 30 of file mod_magnetofriction.t.

◆ mf_cdivb

double precision mod_magnetofriction::mf_cdivb

divb cleaning coefficient controls diffusion speed of divb

Definition at line 34 of file mod_magnetofriction.t.

◆ mf_cdivb_max

double precision mod_magnetofriction::mf_cdivb_max

Definition at line 34 of file mod_magnetofriction.t.

◆ mf_continue_run

logical mod_magnetofriction::mf_continue_run = .false.

Whether this run continues an existing MF diagnostics series.

Definition at line 66 of file mod_magnetofriction.t.

◆ mf_cy

double precision mod_magnetofriction::mf_cy

frictional velocity coefficient

Definition at line 32 of file mod_magnetofriction.t.

◆ mf_cy_max

double precision mod_magnetofriction::mf_cy_max

Definition at line 32 of file mod_magnetofriction.t.

◆ mf_ditsave

integer mod_magnetofriction::mf_ditsave

Definition at line 55 of file mod_magnetofriction.t.

◆ mf_it

integer mod_magnetofriction::mf_it

Definition at line 57 of file mod_magnetofriction.t.

◆ mf_it_max

integer mod_magnetofriction::mf_it_max

Definition at line 56 of file mod_magnetofriction.t.

◆ mf_log_filename

character(len=256) mod_magnetofriction::mf_log_filename

Optional diagnostics filename; empty uses <base_filename>_mflog.csv.

Definition at line 61 of file mod_magnetofriction.t.

◆ mf_log_mode

character(len=16) mod_magnetofriction::mf_log_mode

How to open the MF diagnostics CSV: auto, append, or replace.

Definition at line 59 of file mod_magnetofriction.t.

◆ mf_tvdlfeps

double precision mod_magnetofriction::mf_tvdlfeps

TVDLF dissipation coefficient controls the dissipation term.

Definition at line 36 of file mod_magnetofriction.t.

◆ mf_tvdlfeps_min

double precision mod_magnetofriction::mf_tvdlfeps_min

Definition at line 36 of file mod_magnetofriction.t.

◆ mf_vmax

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.

◆ tmf

double precision mod_magnetofriction::tmf

time in magnetofriction process

Definition at line 38 of file mod_magnetofriction.t.