MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Functions/Subroutines | Variables
mod_mf_phys Module Reference

Magnetofriction module. More...

Functions/Subroutines

subroutine mf_write_info (fh)
 Write this module's parameters to a snapsoht. More...
 
subroutine, public mf_phys_init ()
 
subroutine mf_check_params
 
subroutine mf_physical_units ()
 
subroutine, public mf_to_conserved (ixIL, ixOL, w, x)
 Transform primitive variables into conservative ones. More...
 
subroutine, public mf_to_primitive (ixIL, ixOL, w, x)
 Transform conservative variables into primitive ones. More...
 
subroutine, public mf_get_v (w, x, ixIL, ixOL, v)
 Calculate v vector. More...
 
subroutine, public mf_get_v_idim (w, x, ixIL, ixOL, idim, v)
 Calculate v component. More...
 
subroutine mf_get_cmax (w, x, ixIL, ixOL, idim, cmax)
 Calculate cmax_idim=csound+abs(v_idim) within ixO^L. More...
 
subroutine mf_get_cbounds (wLC, wRC, wLp, wRp, x, ixIL, ixOL, idim, Hspeed, cmax, cmin)
 Estimating bounds for the minimum and maximum signal velocities. More...
 
subroutine mf_get_ct_velocity (vcts, wLp, wRp, ixIL, ixOL, idim, cmax, cmin)
 prepare velocities for ct methods More...
 
subroutine mf_get_p_total (w, x, ixIL, ixOL, p)
 Calculate total pressure within ixO^L including magnetic pressure. More...
 
subroutine mf_get_flux (wC, w, x, ixIL, ixOL, idim, f)
 Calculate fluxes within ixO^L. More...
 
subroutine mf_velocity_update (qt, psa)
 Add global source terms to update frictional velocity on complete domain. More...
 
subroutine mf_add_source (qdt, dtfactor, ixIL, ixOL, wCT, wCTprim, w, x, qsourcesplit, active)
 w[iws]=w[iws]+qdt*S[iws,wCT] where S is the source based on wCT within ixO More...
 
subroutine frictional_velocity (w, x, ixIL, ixOL)
 
subroutine add_source_res1 (qdt, ixIL, ixOL, wCT, w, x)
 Add resistive source to w within ixO Uses 3 point stencil (1 neighbour) in each direction, non-conservative. If the fourthorder precompiler flag is set, uses fourth order central difference for the laplacian. Then the stencil is 5 (2 neighbours). More...
 
subroutine add_source_res2 (qdt, ixIL, ixOL, wCT, w, x)
 Add resistive source to w within ixO Uses 5 point stencil (2 neighbours) in each direction, conservative. More...
 
subroutine add_source_hyperres (qdt, ixIL, ixOL, wCT, w, x)
 Add Hyper-resistive source to w within ixO Uses 9 point stencil (4 neighbours) in each direction. More...
 
subroutine add_source_glm (qdt, ixIL, ixOL, wCT, w, x)
 
subroutine add_source_powel (qdt, ixIL, ixOL, wCT, w, x)
 Add divB related sources to w within ixO corresponding to Powel. More...
 
subroutine add_source_janhunen (qdt, ixIL, ixOL, wCT, w, x)
 
subroutine add_source_linde (qdt, ixIL, ixOL, wCT, w, x)
 
subroutine, public get_normalized_divb (w, ixIL, ixOL, divb)
 get dimensionless div B = |divB| * volume / area / |B| More...
 
subroutine, public get_current (w, ixIL, ixOL, idirmin, current, fourthorder)
 Calculate idirmin and the idirmin:3 components of the common current array make sure that dxlevel(^D) is set correctly. More...
 
subroutine mf_get_dt (w, ixIL, ixOL, dtnew, dxD, x)
 If resistivity is not zero, check diffusion time limit for dt. More...
 
subroutine mf_add_source_geom (qdt, dtfactor, ixIL, ixOL, wCT, wprim, w, x)
 
double precision function, dimension(ixo^s), public mf_mag_en_all (w, ixIL, ixOL)
 Compute 2 times total magnetic energy. More...
 
double precision function, dimension(ixo^s) mf_mag_i_all (w, ixIL, ixOL, idir)
 Compute full magnetic field by direction. More...
 
double precision function, dimension(ixo^s) mf_mag_en (w, ixIL, ixOL)
 Compute evolving magnetic energy. More...
 
subroutine mf_modify_wlr (ixIL, ixOL, qt, wLC, wRC, wLp, wRp, s, idir)
 
subroutine mf_boundary_adjust (igrid, psb)
 
subroutine fixdivb_boundary (ixGL, ixOL, w, x, iB)
 
subroutine, public mf_clean_divb_multigrid (qdt, qt, active)
 
subroutine mf_update_faces (ixIL, ixOL, qt, qdt, wprim, fC, fE, sCT, s, vcts)
 
subroutine update_faces_average (ixIL, ixOL, qt, qdt, fC, fE, sCT, s)
 get electric field though averaging neighors to update faces in CT More...
 
subroutine update_faces_contact (ixIL, ixOL, qt, qdt, wp, fC, fE, sCT, s, vcts)
 update faces using UCT contact mode by Gardiner and Stone 2005 JCP 205, 509 More...
 
subroutine update_faces_hll (ixIL, ixOL, qt, qdt, fE, sCT, s, vcts)
 update faces More...
 
subroutine get_resistive_electric_field (ixIL, ixOL, sCT, s, jce)
 calculate eta J at cell edges More...
 
subroutine, public mf_face_to_center (ixOL, s)
 calculate cell-center values from face-center values More...
 
subroutine, public b_from_vector_potential (ixIsL, ixIL, ixOL, ws, x)
 calculate magnetic field from vector potential More...
 
subroutine, public record_force_free_metrics ()
 
subroutine mask_inner (ixIL, ixOL, w, x, patchwi, volume_pe)
 
double precision function integral_grid_mf (ixIL, ixOL, w, x, iw, patchwi)
 

Variables

double precision, public mf_nu = 1.d-15
 viscosity coefficient in s cm^-2 for solar corona (Cheung 2012 ApJ) More...
 
double precision, public mf_vmax = 3.d6
 maximal limit of magnetofrictional velocity in cm s^-1 (Pomoell 2019 A&A) More...
 
double precision, dimension(2 *^nd), public mf_decay_scale =0.d0
 decay scale of frictional velocity near boundaries More...
 
double precision, public mf_glm_alpha = 0.5d0
 GLM-MHD parameter: ratio of the diffusive and advective time scales for div b taking values within [0, 1]. More...
 
double precision, public mf_eta = 0.0d0
 The resistivity. More...
 
double precision, public mf_eta_hyper = 0.0d0
 The hyper-resistivity. More...
 
double precision, public, protected he_abundance =0.1d0
 Helium abundance over Hydrogen. More...
 
integer, dimension(:), allocatable, public, protected mom
 Indices of the momentum density. More...
 
integer, public, protected psi_
 Indices of the GLM psi. More...
 
integer, dimension(2 *^nd), public, protected boundary_divbfix_skip =0
 To skip * layer of ghost cells during divB=0 fix for boundary. More...
 
logical, public, protected mf_particles = .false.
 Whether particles module is added. More...
 
logical, public, protected mf_glm = .false.
 Whether GLM-MHD is used. More...
 
logical, public, protected source_split_divb = .false.
 Whether divB cleaning sources are added splitting from fluid solver. More...
 
logical, public, protected mf_4th_order = .false.
 MHD fourth order. More...
 
logical, public, protected mf_record_electric_field = .false.
 set to true if need to record electric field on cell edges More...
 
logical, public, protected mf_divb_4thorder = .false.
 Whether divB is computed with a fourth order approximation. More...
 
logical, dimension(2 *^nd), public, protected boundary_divbfix =.true.
 To control divB=0 fix for boundary. More...
 
logical, public divbwave = .true.
 Add divB wave in Roe solver. More...
 
logical, public, protected clean_initial_divb =.false.
 clean divb in the initial condition More...
 
character(len=std_len), public, protected typedivbfix = 'ct'
 Method type to clean divergence of B. More...
 
character(len=std_len), public, protected type_ct = 'average'
 Method type of constrained transport. More...
 

Detailed Description

Magnetofriction module.

Function/Subroutine Documentation

◆ add_source_glm()

subroutine mod_mf_phys::add_source_glm ( 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 
)

Definition at line 949 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ add_source_hyperres()

subroutine mod_mf_phys::add_source_hyperres ( 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 
)

Add Hyper-resistive source to w within ixO Uses 9 point stencil (4 neighbours) in each direction.

Definition at line 908 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ add_source_janhunen()

subroutine mod_mf_phys::add_source_janhunen ( 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 
)

Definition at line 1014 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ add_source_linde()

subroutine mod_mf_phys::add_source_linde ( 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 
)

Definition at line 1038 of file mod_mf_phys.t.

◆ add_source_powel()

subroutine mod_mf_phys::add_source_powel ( 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 
)

Add divB related sources to w within ixO corresponding to Powel.

Definition at line 992 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ add_source_res1()

subroutine mod_mf_phys::add_source_res1 ( 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 
)

Add resistive source to w within ixO Uses 3 point stencil (1 neighbour) in each direction, non-conservative. If the fourthorder precompiler flag is set, uses fourth order central difference for the laplacian. Then the stencil is 5 (2 neighbours).

Definition at line 760 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ add_source_res2()

subroutine mod_mf_phys::add_source_res2 ( 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 
)

Add resistive source to w within ixO Uses 5 point stencil (2 neighbours) in each direction, conservative.

Definition at line 854 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ b_from_vector_potential()

subroutine, public mod_mf_phys::b_from_vector_potential ( integer, intent(in)  ixIs,
integer, intent(in)  L,
integer, intent(in)  ixI,
  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixis^s,1:nws), intent(inout)  ws,
double precision, dimension(ixi^s,1:ndim), intent(in)  x 
)

calculate magnetic field from vector potential

Definition at line 2442 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ fixdivb_boundary()

subroutine mod_mf_phys::fixdivb_boundary ( integer, intent(in)  ixG,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixg^s,1:nw), intent(inout)  w,
double precision, dimension(ixg^s,1:ndim), intent(in)  x,
integer, intent(in)  iB 
)

Definition at line 1383 of file mod_mf_phys.t.

◆ frictional_velocity()

subroutine mod_mf_phys::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 
)

Definition at line 680 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ get_current()

subroutine, public mod_mf_phys::get_current ( 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(out)  idirmin,
double precision, dimension(ixi^s,7-2*ndir:3)  current,
logical, intent(in), optional  fourthorder 
)

Calculate idirmin and the idirmin:3 components of the common current array make sure that dxlevel(^D) is set correctly.

Definition at line 1141 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ get_normalized_divb()

subroutine, public mod_mf_phys::get_normalized_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 
)

get dimensionless div B = |divB| * volume / area / |B|

Definition at line 1107 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ get_resistive_electric_field()

subroutine mod_mf_phys::get_resistive_electric_field ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
type(state), intent(in)  sCT,
type(state), intent(in)  s,
double precision, dimension(ixi^s,sdim:3)  jce 
)

calculate eta J at cell edges

Definition at line 2313 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ integral_grid_mf()

double precision function mod_mf_phys::integral_grid_mf ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,nw+nwauxio)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
integer, intent(in)  iw,
logical, dimension(ixi^s), intent(in)  patchwi 
)

Definition at line 2580 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mask_inner()

subroutine mod_mf_phys::mask_inner ( integer, intent(in)  ixI,
double precision, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,nw), intent(in)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
logical, dimension(ixi^s), intent(out)  patchwi,
double precision, intent(inout)  volume_pe 
)

Definition at line 2550 of file mod_mf_phys.t.

◆ mf_add_source()

subroutine mod_mf_phys::mf_add_source ( double precision, intent(in)  qdt,
double precision, intent(in)  dtfactor,
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(in)  wCTprim,
double precision, dimension(ixi^s,1:nw), intent(inout)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
logical, intent(in)  qsourcesplit,
logical, intent(inout)  active 
)

w[iws]=w[iws]+qdt*S[iws,wCT] where S is the source based on wCT within ixO

Definition at line 613 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_add_source_geom()

subroutine mod_mf_phys::mf_add_source_geom ( double precision, intent(in)  qdt,
double precision, intent(in)  dtfactor,
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)  wprim,
double precision, dimension(ixi^s,1:nw), intent(inout)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x 
)

Definition at line 1209 of file mod_mf_phys.t.

◆ mf_boundary_adjust()

subroutine mod_mf_phys::mf_boundary_adjust ( integer, intent(in)  igrid,
type(state), dimension(max_blocks), target  psb 
)

Definition at line 1342 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_check_params()

subroutine mod_mf_phys::mf_check_params

Definition at line 312 of file mod_mf_phys.t.

◆ mf_clean_divb_multigrid()

subroutine, public mod_mf_phys::mf_clean_divb_multigrid ( double precision, intent(in)  qdt,
double precision, intent(in)  qt,
logical, intent(inout)  active 
)
Parameters
[in]qdtCurrent time step
[in]qtCurrent time
[in,out]activeOutput if the source is active

Definition at line 1748 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_face_to_center()

subroutine, public mod_mf_phys::mf_face_to_center ( integer, intent(in)  ixO,
integer, intent(in)  L,
type(state s 
)

calculate cell-center values from face-center values

Definition at line 2382 of file mod_mf_phys.t.

◆ mf_get_cbounds()

subroutine mod_mf_phys::mf_get_cbounds ( double precision, dimension(ixi^s, nw), intent(in)  wLC,
double precision, dimension(ixi^s, nw), intent(in)  wRC,
double precision, dimension(ixi^s, nw), intent(in)  wLp,
double precision, dimension(ixi^s, nw), intent(in)  wRp,
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)  idim,
double precision, dimension(ixi^s,1:number_species), intent(in)  Hspeed,
double precision, dimension(ixi^s,1:number_species), intent(inout)  cmax,
double precision, dimension(ixi^s,1:number_species), intent(inout), optional  cmin 
)

Estimating bounds for the minimum and maximum signal velocities.

Definition at line 437 of file mod_mf_phys.t.

◆ mf_get_cmax()

subroutine mod_mf_phys::mf_get_cmax ( 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)  idim,
double precision, dimension(ixi^s), intent(inout)  cmax 
)

Calculate cmax_idim=csound+abs(v_idim) within ixO^L.

Definition at line 425 of file mod_mf_phys.t.

◆ mf_get_ct_velocity()

subroutine mod_mf_phys::mf_get_ct_velocity ( type(ct_velocity), intent(inout)  vcts,
double precision, dimension(ixi^s, nw), intent(in)  wLp,
double precision, dimension(ixi^s, nw), intent(in)  wRp,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idim,
double precision, dimension(ixi^s), intent(in)  cmax,
double precision, dimension(ixi^s), intent(in), optional  cmin 
)

prepare velocities for ct methods

Definition at line 462 of file mod_mf_phys.t.

◆ mf_get_dt()

subroutine mod_mf_phys::mf_get_dt ( 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, intent(inout)  dtnew,
double precision, intent(in)  dx,
double precision, intent(in)  D,
double precision, dimension(ixi^s,1:ndim), intent(in)  x 
)

If resistivity is not zero, check diffusion time limit for dt.

Definition at line 1165 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_get_flux()

subroutine mod_mf_phys::mf_get_flux ( double precision, dimension(ixi^s,nw), intent(in)  wC,
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)  idim,
double precision, dimension(ixi^s,nwflux), intent(out)  f 
)

Calculate fluxes within ixO^L.

Definition at line 528 of file mod_mf_phys.t.

◆ mf_get_p_total()

subroutine mod_mf_phys::mf_get_p_total ( 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,
double precision, dimension(ixi^s), intent(out)  p 
)

Calculate total pressure within ixO^L including magnetic pressure.

Definition at line 515 of file mod_mf_phys.t.

◆ mf_get_v()

subroutine, public mod_mf_phys::mf_get_v ( 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,
double precision, dimension(ixi^s,ndir), intent(out)  v 
)

Calculate v vector.

Definition at line 397 of file mod_mf_phys.t.

◆ mf_get_v_idim()

subroutine, public mod_mf_phys::mf_get_v_idim ( 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)  idim,
double precision, dimension(ixi^s), intent(out)  v 
)

Calculate v component.

Definition at line 413 of file mod_mf_phys.t.

◆ mf_mag_en()

double precision function, dimension(ixo^s) mod_mf_phys::mf_mag_en ( double precision, dimension(ixi^s, nw), intent(in)  w,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L 
)

Compute evolving magnetic energy.

Definition at line 1304 of file mod_mf_phys.t.

◆ mf_mag_en_all()

double precision function, dimension(ixo^s), public mod_mf_phys::mf_mag_en_all ( double precision, dimension(ixi^s, nw), intent(in)  w,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L 
)

Compute 2 times total magnetic energy.

Definition at line 1284 of file mod_mf_phys.t.

◆ mf_mag_i_all()

double precision function, dimension(ixo^s) mod_mf_phys::mf_mag_i_all ( double precision, dimension(ixi^s, nw), intent(in)  w,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idir 
)

Compute full magnetic field by direction.

Definition at line 1294 of file mod_mf_phys.t.

◆ mf_modify_wlr()

subroutine mod_mf_phys::mf_modify_wlr ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(in)  qt,
double precision, dimension(ixi^s,1:nw), intent(inout)  wLC,
double precision, dimension(ixi^s,1:nw), intent(inout)  wRC,
double precision, dimension(ixi^s,1:nw), intent(inout)  wLp,
double precision, dimension(ixi^s,1:nw), intent(inout)  wRp,
type(state s,
integer, intent(in)  idir 
)

Definition at line 1313 of file mod_mf_phys.t.

◆ mf_phys_init()

subroutine, public mod_mf_phys::mf_phys_init

Definition at line 160 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_physical_units()

subroutine mod_mf_phys::mf_physical_units

Definition at line 317 of file mod_mf_phys.t.

◆ mf_to_conserved()

subroutine, public mod_mf_phys::mf_to_conserved ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:ndim), intent(in)  x 
)

Transform primitive variables into conservative ones.

Definition at line 377 of file mod_mf_phys.t.

◆ mf_to_primitive()

subroutine, public mod_mf_phys::mf_to_primitive ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:ndim), intent(in)  x 
)

Transform conservative variables into primitive ones.

Definition at line 387 of file mod_mf_phys.t.

◆ mf_update_faces()

subroutine mod_mf_phys::mf_update_faces ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(in)  qt,
double precision, intent(in)  qdt,
double precision, dimension(ixi^s,1:nw), intent(in)  wprim,
double precision, dimension(ixi^s,1:nwflux,1:ndim), intent(in)  fC,
double precision, dimension(ixi^s,sdim:3), intent(inout)  fE,
type(state sCT,
type(state s,
type(ct_velocity vcts 
)

Definition at line 1888 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_velocity_update()

subroutine mod_mf_phys::mf_velocity_update ( double precision, intent(in)  qt,
type(state), dimension(max_blocks), target  psa 
)

Add global source terms to update frictional velocity on complete domain.

Parameters
[in]qtCurrent time
psaCompute based on this state

Definition at line 561 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ mf_write_info()

subroutine mod_mf_phys::mf_write_info ( integer, intent(in)  fh)

Write this module's parameters to a snapsoht.

Definition at line 143 of file mod_mf_phys.t.

◆ record_force_free_metrics()

subroutine, public mod_mf_phys::record_force_free_metrics

Definition at line 2456 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ update_faces_average()

subroutine mod_mf_phys::update_faces_average ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(in)  qt,
double precision, intent(in)  qdt,
double precision, dimension(ixi^s,1:nwflux,1:ndim), intent(in)  fC,
double precision, dimension(ixi^s,sdim:3), intent(inout)  fE,
type(state sCT,
type(state s 
)

get electric field though averaging neighors to update faces in CT

Definition at line 1914 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ update_faces_contact()

subroutine mod_mf_phys::update_faces_contact ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(in)  qt,
double precision, intent(in)  qdt,
double precision, dimension(ixi^s,1:nw), intent(in)  wp,
double precision, dimension(ixi^s,1:nwflux,1:ndim), intent(in)  fC,
double precision, dimension(ixi^s,sdim:3), intent(inout)  fE,
type(state sCT,
type(state s,
type(ct_velocity vcts 
)

update faces using UCT contact mode by Gardiner and Stone 2005 JCP 205, 509

Definition at line 2004 of file mod_mf_phys.t.

Here is the call graph for this function:

◆ update_faces_hll()

subroutine mod_mf_phys::update_faces_hll ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(in)  qt,
double precision, intent(in)  qdt,
double precision, dimension(ixi^s,sdim:3), intent(inout)  fE,
type(state sCT,
type(state s,
type(ct_velocity vcts 
)

update faces

Definition at line 2166 of file mod_mf_phys.t.

Here is the call graph for this function:

Variable Documentation

◆ boundary_divbfix

logical, dimension(2*^nd), public, protected mod_mf_phys::boundary_divbfix =.true.

To control divB=0 fix for boundary.

Definition at line 79 of file mod_mf_phys.t.

◆ boundary_divbfix_skip

integer, dimension(2*^nd), public, protected mod_mf_phys::boundary_divbfix_skip =0

To skip * layer of ghost cells during divB=0 fix for boundary.

Definition at line 46 of file mod_mf_phys.t.

◆ clean_initial_divb

logical, public, protected mod_mf_phys::clean_initial_divb =.false.

clean divb in the initial condition

Definition at line 88 of file mod_mf_phys.t.

◆ divbwave

logical, public mod_mf_phys::divbwave = .true.

Add divB wave in Roe solver.

Definition at line 85 of file mod_mf_phys.t.

◆ he_abundance

double precision, public, protected mod_mf_phys::he_abundance =0.1d0

Helium abundance over Hydrogen.

Definition at line 34 of file mod_mf_phys.t.

◆ mf_4th_order

logical, public, protected mod_mf_phys::mf_4th_order = .false.

MHD fourth order.

Definition at line 70 of file mod_mf_phys.t.

◆ mf_decay_scale

double precision, dimension(2*^nd), public mod_mf_phys::mf_decay_scale =0.d0

decay scale of frictional velocity near boundaries

Definition at line 18 of file mod_mf_phys.t.

◆ mf_divb_4thorder

logical, public, protected mod_mf_phys::mf_divb_4thorder = .false.

Whether divB is computed with a fourth order approximation.

Definition at line 76 of file mod_mf_phys.t.

◆ mf_eta

double precision, public mod_mf_phys::mf_eta = 0.0d0

The resistivity.

Definition at line 25 of file mod_mf_phys.t.

◆ mf_eta_hyper

double precision, public mod_mf_phys::mf_eta_hyper = 0.0d0

The hyper-resistivity.

Definition at line 28 of file mod_mf_phys.t.

◆ mf_glm

logical, public, protected mod_mf_phys::mf_glm = .false.

Whether GLM-MHD is used.

Definition at line 64 of file mod_mf_phys.t.

◆ mf_glm_alpha

double precision, public mod_mf_phys::mf_glm_alpha = 0.5d0

GLM-MHD parameter: ratio of the diffusive and advective time scales for div b taking values within [0, 1].

Definition at line 22 of file mod_mf_phys.t.

◆ mf_nu

double precision, public mod_mf_phys::mf_nu = 1.d-15

viscosity coefficient in s cm^-2 for solar corona (Cheung 2012 ApJ)

Definition at line 12 of file mod_mf_phys.t.

◆ mf_particles

logical, public, protected mod_mf_phys::mf_particles = .false.

Whether particles module is added.

Definition at line 61 of file mod_mf_phys.t.

◆ mf_record_electric_field

logical, public, protected mod_mf_phys::mf_record_electric_field = .false.

set to true if need to record electric field on cell edges

Definition at line 73 of file mod_mf_phys.t.

◆ mf_vmax

double precision, public mod_mf_phys::mf_vmax = 3.d6

maximal limit of magnetofrictional velocity in cm s^-1 (Pomoell 2019 A&A)

Definition at line 15 of file mod_mf_phys.t.

◆ mom

integer, dimension(:), allocatable, public, protected mod_mf_phys::mom

Indices of the momentum density.

Definition at line 40 of file mod_mf_phys.t.

◆ psi_

integer, public, protected mod_mf_phys::psi_

Indices of the GLM psi.

Definition at line 43 of file mod_mf_phys.t.

◆ source_split_divb

logical, public, protected mod_mf_phys::source_split_divb = .false.

Whether divB cleaning sources are added splitting from fluid solver.

Definition at line 67 of file mod_mf_phys.t.

◆ type_ct

character(len=std_len), public, protected mod_mf_phys::type_ct = 'average'

Method type of constrained transport.

Definition at line 94 of file mod_mf_phys.t.

◆ typedivbfix

character(len=std_len), public, protected mod_mf_phys::typedivbfix = 'ct'

Method type to clean divergence of B.

Definition at line 91 of file mod_mf_phys.t.