MPI-AMRVAC  2.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
Data Types | Functions/Subroutines | Variables
mod_thermal_conduction Module Reference

Thermal conduction for HD and MHD Adaptation of mod_thermal_conduction for the mod_supertimestepping In order to use it set use_mhd_tc=1 (for the mhd impl) or 2 (for the hd impl) in mhd_list (for the mhd module both hd and mhd impl can be used) or use_new_hd_tc in hd_list parameters to true (for the hd module, hd implementation has to be used) The TC is set by calling one tc_init_hd_for_total_energy and tc_init_mhd_for_total_energy might The second argument: ixArray has to be [rho_,e_,mag(1)] for mhd (Be aware that the other components of the mag field are assumed consecutive) and [rho_,e_] for hd additionally when internal energy equation is solved, an additional element of this array is eaux_: the index of the internal energy variable. More...

Functions/Subroutines

subroutine, public tc_init_mhd_for_total_energy (phys_gamma, ixArray, mhd_get_temperature_from_etot, mhd_get_temperature_from_eint)
 Initialize the module this adds the term in the STS methods linked lists when the total energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_etot, mhd_get_temperature_from_eint subroutines which calculates temperature mhd_ei_to_e, mhd_e_to_ei subroutines which calculates e_tot from e_int and e_int from e_tot. More...
 
subroutine, public tc_init_mhd_for_internal_energy (phys_gamma, ixArray, mhd_get_temperature_from_eint)
 Initialize tc module: MHD case this adds the term in the STS methods linked lists when the internal energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_eint subroutines which calculates temperature. More...
 
subroutine tc_init_hd_params (phys_gamma, ixArray)
 
subroutine, public tc_init_hd_for_total_energy (phys_gamma, ixArray, hd_get_temperature_from_etot, hd_get_temperature_from_eint)
 Initialize the module for the HD this adds the term in the STS methods linked lists when the total energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_etot, mhd_get_temperature_from_eint subroutines which calculates temperature mhd_ei_to_e, mhd_e_to_ei subroutines which calculates e_tot from e_int and e_int from e_tot. More...
 
subroutine, public tc_init_hd_for_internal_energy (phys_gamma, ixArray, hd_get_temperature_from_eint)
 Initialize the module this adds the term in the STS methods linked lists when the internal energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_eint subroutines which calculates temperature. More...
 
double precision function get_tc_dt_mhd (w, ixIL, ixOL, dxD, x)
 Get the explicut timestep for the TC (mhd implementation) More...
 
subroutine sts_set_source_tc_mhd (ixIL, ixOL, w, x, wres, fix_conserve_at_step, my_dt, igrid, nflux)
 anisotropic thermal conduction with slope limited symmetric scheme Sharma 2007 Journal of Computational Physics 227, 123 More...
 
double precision function, dimension(ixi^s) slope_limiter (f, ixIL, ixOL, idims, pm)
 
subroutine gradientc (q, ixIL, ixOL, idir, gradq)
 Calculate gradient of a scalar q at cell interfaces in direction idir. More...
 
double precision function get_tc_dt_hd (w, ixIL, ixOL, dxD, x)
 
subroutine sts_set_source_tc_hd (ixIL, ixOL, w, x, wres, fix_conserve_at_step, my_dt, igrid, nflux)
 
subroutine handle_small_e (w, x, ixIL, ixOL, step)
 

Variables

double precision, public tc_k_para
 Coefficient of thermal conductivity (parallel to magnetic field) More...
 
double precision, public tc_k_perp
 Coefficient of thermal conductivity perpendicular to magnetic field. More...
 
logical, public tc_perpendicular =.false.
 Calculate thermal conduction perpendicular to magnetic field (.true.) or not (.false.) More...
 
procedure(get_temperature_subr), pointer get_temperature_from_eint => null()
 

Detailed Description

Thermal conduction for HD and MHD Adaptation of mod_thermal_conduction for the mod_supertimestepping In order to use it set use_mhd_tc=1 (for the mhd impl) or 2 (for the hd impl) in mhd_list (for the mhd module both hd and mhd impl can be used) or use_new_hd_tc in hd_list parameters to true (for the hd module, hd implementation has to be used) The TC is set by calling one tc_init_hd_for_total_energy and tc_init_mhd_for_total_energy might The second argument: ixArray has to be [rho_,e_,mag(1)] for mhd (Be aware that the other components of the mag field are assumed consecutive) and [rho_,e_] for hd additionally when internal energy equation is solved, an additional element of this array is eaux_: the index of the internal energy variable.

10.07.2011 developed by Chun Xia and Rony Keppens 01.09.2012 moved to modules folder by Oliver Porth 13.10.2013 optimized further by Chun Xia 12.03.2014 implemented RKL2 super timestepping scheme to reduce iterations and improve stability and accuracy up to second order in time by Chun Xia. 23.08.2014 implemented saturation and perpendicular TC by Chun Xia 12.01.2017 modulized by Chun Xia

PURPOSE: IN MHD ADD THE HEAT CONDUCTION SOURCE TO THE ENERGY EQUATION S=DIV(KAPPA_i,j . GRAD_j T) where KAPPA_i,j = tc_k_para b_i b_j + tc_k_perp (I - b_i b_j) b_i b_j = B_i B_j / B**2, I is the unit matrix, and i, j= 1, 2, 3 for 3D IN HD ADD THE HEAT CONDUCTION SOURCE TO THE ENERGY EQUATION S=DIV(tc_k_para . GRAD T) USAGE:

  1. in mod_usr.t -> subroutine usr_init(), add unit_length=your length unit unit_numberdensity=your number density unit unit_velocity=your velocity unit unit_temperature=your temperature unit before call (m)hd_activate()
  2. to switch on thermal conduction in the (m)hd_list of amrvac.par add: (m)hd_thermal_conduction=.true.
  3. in the tc_list of amrvac.par : tc_perpendicular=.true. ! (default .false.) turn on thermal conduction perpendicular to magnetic field tc_saturate=.false. ! (default .true. ) turn off thermal conduction saturate effect tc_slope_limiter='MC' ! choose limiter for slope-limited anisotropic thermal conduction in MHD

Function/Subroutine Documentation

◆ get_tc_dt_hd()

double precision function mod_thermal_conduction::get_tc_dt_hd ( 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(in)  dx,
integer, intent(in)  D,
double precision, dimension(ixi^s,1:ndim), intent(in)  x 
)

Definition at line 780 of file mod_thermal_conduction.t.

◆ get_tc_dt_mhd()

double precision function mod_thermal_conduction::get_tc_dt_mhd ( 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(in)  dx,
integer, intent(in)  D,
double precision, dimension(ixi^s,1:ndim), intent(in)  x 
)

Get the explicut timestep for the TC (mhd implementation)

Definition at line 342 of file mod_thermal_conduction.t.

◆ gradientc()

subroutine mod_thermal_conduction::gradientc ( double precision, dimension(ixi^s), intent(in)  q,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idir,
double precision, dimension(ixi^s), intent(inout)  gradq 
)

Calculate gradient of a scalar q at cell interfaces in direction idir.

Definition at line 738 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ handle_small_e()

subroutine mod_thermal_conduction::handle_small_e ( 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,
integer, intent(in)  step 
)

Definition at line 947 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ slope_limiter()

double precision function, dimension(ixi^s) mod_thermal_conduction::slope_limiter ( double precision, dimension(ixi^s), intent(in)  f,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idims,
integer, intent(in)  pm 
)

Definition at line 701 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ sts_set_source_tc_hd()

subroutine mod_thermal_conduction::sts_set_source_tc_hd ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,1:nw), intent(inout)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
double precision, dimension(ixi^s,1:nw), intent(inout)  wres,
logical, intent(in)  fix_conserve_at_step,
double precision, intent(in)  my_dt,
integer, intent(in)  igrid,
integer, intent(in)  nflux 
)

Definition at line 817 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ sts_set_source_tc_mhd()

subroutine mod_thermal_conduction::sts_set_source_tc_mhd ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,1:nw), intent(inout)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
double precision, dimension(ixi^s,1:nw), intent(inout)  wres,
logical, intent(in)  fix_conserve_at_step,
double precision, intent(in)  my_dt,
integer, intent(in)  igrid,
integer, intent(in)  nflux 
)

anisotropic thermal conduction with slope limited symmetric scheme Sharma 2007 Journal of Computational Physics 227, 123

Definition at line 405 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ tc_init_hd_for_internal_energy()

subroutine, public mod_thermal_conduction::tc_init_hd_for_internal_energy ( double precision, intent(in)  phys_gamma,
integer, dimension(:), intent(in)  ixArray,
  hd_get_temperature_from_eint 
)

Initialize the module this adds the term in the STS methods linked lists when the internal energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_eint subroutines which calculates temperature.

Definition at line 313 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ tc_init_hd_for_total_energy()

subroutine, public mod_thermal_conduction::tc_init_hd_for_total_energy ( double precision, intent(in)  phys_gamma,
integer, dimension(:), intent(in)  ixArray,
  hd_get_temperature_from_etot,
  hd_get_temperature_from_eint 
)

Initialize the module for the HD this adds the term in the STS methods linked lists when the total energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_etot, mhd_get_temperature_from_eint subroutines which calculates temperature mhd_ei_to_e, mhd_e_to_ei subroutines which calculates e_tot from e_int and e_int from e_tot.

Definition at line 269 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ tc_init_hd_params()

subroutine mod_thermal_conduction::tc_init_hd_params ( double precision, intent(in)  phys_gamma,
integer, dimension(:), intent(in)  ixArray 
)

Definition at line 222 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ tc_init_mhd_for_internal_energy()

subroutine, public mod_thermal_conduction::tc_init_mhd_for_internal_energy ( double precision, intent(in)  phys_gamma,
integer, dimension(:), intent(in)  ixArray,
  mhd_get_temperature_from_eint 
)

Initialize tc module: MHD case this adds the term in the STS methods linked lists when the internal energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_eint subroutines which calculates temperature.

Definition at line 197 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ tc_init_mhd_for_total_energy()

subroutine, public mod_thermal_conduction::tc_init_mhd_for_total_energy ( double precision, intent(in)  phys_gamma,
integer, dimension(:), intent(in)  ixArray,
  mhd_get_temperature_from_etot,
  mhd_get_temperature_from_eint 
)

Initialize the module this adds the term in the STS methods linked lists when the total energy equation is used Params: gamma ixArray : an array with the indices of the variables mhd_get_temperature_from_etot, mhd_get_temperature_from_eint subroutines which calculates temperature mhd_ei_to_e, mhd_e_to_ei subroutines which calculates e_tot from e_int and e_int from e_tot.

Definition at line 154 of file mod_thermal_conduction.t.

Here is the call graph for this function:

Variable Documentation

◆ get_temperature_from_eint

procedure(get_temperature_subr), pointer mod_thermal_conduction::get_temperature_from_eint => null()

Definition at line 82 of file mod_thermal_conduction.t.

◆ tc_k_para

double precision, public mod_thermal_conduction::tc_k_para

Coefficient of thermal conductivity (parallel to magnetic field)

Definition at line 46 of file mod_thermal_conduction.t.

◆ tc_k_perp

double precision, public mod_thermal_conduction::tc_k_perp

Coefficient of thermal conductivity perpendicular to magnetic field.

Definition at line 49 of file mod_thermal_conduction.t.

◆ tc_perpendicular

logical, public mod_thermal_conduction::tc_perpendicular =.false.

Calculate thermal conduction perpendicular to magnetic field (.true.) or not (.false.)

Definition at line 64 of file mod_thermal_conduction.t.