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

Thermal conduction for HD and MHD or RHD and RMHD or twofl (plasma-neutral) module Adaptation of mod_thermal_conduction for the mod_supertimestepping. More...

Data Types

interface  get_var_subr
 
type  tc_fluid
 

Functions/Subroutines

subroutine tc_init_params (phys_gamma)
 
subroutine, public tc_get_mhd_params (fl, read_mhd_params)
 Init TC coefficients: MHD case.
 
subroutine, public tc_get_hd_params (fl, read_hd_params)
 Init TC coefficients: HD case.
 
double precision function, public get_tc_dt_mhd (w, ixil, ixol, dxd, x, fl)
 Get the explicit timestep for the TC (mhd implementation) Note: for multi-D MHD (1D MHD will use HD fall-back)
 
subroutine, public sts_set_source_tc_mhd (ixil, ixol, w, x, wres, fix_conserve_at_step, my_dt, igrid, nflux, fl)
 anisotropic thermal conduction with slope limited symmetric scheme Sharma 2007 Journal of Computational Physics 227, 123
 
subroutine set_source_tc_mhd (ixil, ixol, w, x, fl, qvec, rho, te, alpha)
 
subroutine set_source_tc_mhd_geo (ixil, ixol, w, x, fl, qvec, rho, te, alpha)
 
double precision function, dimension(ixi^s) slope_limiter (f, ixil, ixol, idims, pm, tc_slope_limiter)
 
double precision function, public get_tc_dt_hd (w, ixil, ixol, dxd, x, fl)
 Get the explicit timestep for the TC (hd implementation) Note: also used in 1D MHD (or for neutrals in twofl)
 
subroutine, public sts_set_source_tc_hd (ixil, ixol, w, x, wres, fix_conserve_at_step, my_dt, igrid, nflux, fl)
 
subroutine set_source_tc_hd (ixil, ixol, w, x, fl, qvec, rho, te)
 get HD thermal conduction source and flux in uniform Cartesian grid
 
subroutine set_source_tc_hd_geo (ixil, ixol, w, x, fl, qvec, rho, te)
 get HD thermal conduction source and flux in non-uniform geometry grid
 

Variables

double precision tc_gamma_1
 The adiabatic index.
 

Detailed Description

Thermal conduction for HD and MHD or RHD and RMHD or twofl (plasma-neutral) module Adaptation of mod_thermal_conduction for the mod_supertimestepping.

The TC is set by calling tc_init_params()

Organized such that it can call either isotropic (HD) or anisotropic (MHD) variants it adds a heat conduction source to each energy equation and can be recycled within a multi-fluid context (such as plasma-neutral twofl module)

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 adapted by Beatrice Popescu to twofluid settings 06.09.2024 cleaned up for use in rhd and rmhd modules (Nishant Narechania and Rony Keppens) 30.11.2025 Minor cleanup (for consistency between hd and mhd)

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 (r)(m)hd_list of amrvac.par add: (r)(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=.true. ! (default .false. ) turn on thermal conduction saturate effect tc_slope_limiter='MC' ! choose limiter for slope-limited anisotropic thermal conduction in MHD note: twofl_list incorporates instances for charges and neutrals

Function/Subroutine Documentation

◆ get_tc_dt_hd()

double precision function, public 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,
double precision, intent(in)  d,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
type(tc_fluid), intent(in)  fl 
)

Get the explicit timestep for the TC (hd implementation) Note: also used in 1D MHD (or for neutrals in twofl)

Definition at line 1527 of file mod_thermal_conduction.t.

◆ get_tc_dt_mhd()

double precision function, public 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,
type(tc_fluid), intent(in)  fl 
)

Get the explicit timestep for the TC (mhd implementation) Note: for multi-D MHD (1D MHD will use HD fall-back)

Definition at line 193 of file mod_thermal_conduction.t.

◆ set_source_tc_hd()

subroutine mod_thermal_conduction::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(in)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
type(tc_fluid), intent(in)  fl,
double precision, dimension(ixi^s,1:ndim), intent(out)  qvec,
double precision, dimension(ixi^s), intent(in)  rho,
double precision, dimension(ixi^s), intent(in)  te 
)

get HD thermal conduction source and flux in uniform Cartesian grid

Definition at line 1659 of file mod_thermal_conduction.t.

◆ set_source_tc_hd_geo()

subroutine mod_thermal_conduction::set_source_tc_hd_geo ( integer, intent(in)  ixi,
integer, intent(in)  l,
integer, intent(in)  ixo,
  l,
double precision, dimension(ixi^s,1:nw), intent(in)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
type(tc_fluid), intent(in)  fl,
double precision, dimension(ixi^s,1:ndim), intent(out)  qvec,
double precision, dimension(ixi^s), intent(in)  rho,
double precision, dimension(ixi^s), intent(in)  te 
)

get HD thermal conduction source and flux in non-uniform geometry grid

Definition at line 1809 of file mod_thermal_conduction.t.

◆ set_source_tc_mhd()

subroutine mod_thermal_conduction::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(in)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
type(tc_fluid), intent(in)  fl,
double precision, dimension(ixi^s,1:ndim), intent(out)  qvec,
double precision, dimension(ixi^s), intent(in)  rho,
double precision, dimension(ixi^s), intent(in)  te,
double precision, intent(in)  alpha 
)

Definition at line 418 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ set_source_tc_mhd_geo()

subroutine mod_thermal_conduction::set_source_tc_mhd_geo ( integer, intent(in)  ixi,
integer, intent(in)  l,
integer, intent(in)  ixo,
  l,
double precision, dimension(ixi^s,1:nw), intent(in)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
type(tc_fluid), intent(in)  fl,
double precision, dimension(ixi^s,1:ndim), intent(out)  qvec,
double precision, dimension(ixi^s), intent(in)  rho,
double precision, dimension(ixi^s), intent(in)  te,
double precision, intent(in)  alpha 
)

Definition at line 941 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,
integer, intent(in)  tc_slope_limiter 
)

Definition at line 1489 of file mod_thermal_conduction.t.

◆ sts_set_source_tc_hd()

subroutine, public 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(in)  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,
type(tc_fluid), intent(in)  fl 
)

Definition at line 1576 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ sts_set_source_tc_mhd()

subroutine, public 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(in)  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,
type(tc_fluid), intent(in)  fl 
)

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

Definition at line 330 of file mod_thermal_conduction.t.

Here is the call graph for this function:

◆ tc_get_hd_params()

subroutine, public mod_thermal_conduction::tc_get_hd_params ( type(tc_fluid), intent(inout)  fl,
external subroutine(type(tc_fluid), intent(inout) fl)  read_hd_params 
)

Init TC coefficients: HD case.

Read tc parameters from par file: HD case

Definition at line 157 of file mod_thermal_conduction.t.

◆ tc_get_mhd_params()

subroutine, public mod_thermal_conduction::tc_get_mhd_params ( type(tc_fluid), intent(inout)  fl,
external subroutine(type(tc_fluid), intent(inout) fl)  read_mhd_params 
)

Init TC coefficients: MHD case.

Read tc module parameters from par file: MHD case

Definition at line 116 of file mod_thermal_conduction.t.

◆ tc_init_params()

subroutine mod_thermal_conduction::tc_init_params ( double precision, intent(in)  phys_gamma)

Definition at line 108 of file mod_thermal_conduction.t.

Variable Documentation

◆ tc_gamma_1

double precision mod_thermal_conduction::tc_gamma_1

The adiabatic index.

Definition at line 52 of file mod_thermal_conduction.t.