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

This module defines the procedures of a physics module. It contains function pointers for the various supported routines. An actual physics module has to set these pointers to its implementation of these routines. More...

Data Types

interface  sub_check_params
 
interface  sub_set_mg_bounds
 
interface  sub_boundary_adjust
 
interface  sub_convert
 
interface  sub_modify_wLR
 
interface  sub_get_cmax
 
interface  sub_get_a2max
 
interface  sub_get_tcutoff
 
interface  sub_get_v
 
interface  sub_get_H_speed
 
interface  sub_get_cbounds
 
interface  sub_get_flux
 
interface  sub_energy_synchro
 
interface  sub_add_source_geom
 
interface  sub_add_source
 
interface  sub_global_source
 Add global source terms on complete domain (potentially implicit) More...
 
interface  sub_clean_divb
 clean initial divb More...
 
interface  sub_set_equi_vars
 set equilibrium variables other than b0 (e.g. p0 and rho0) More...
 
interface  sub_special_advance
 Add special advance in each advect step. More...
 
interface  sub_get_dt
 
interface  sub_check_w
 
interface  sub_get_pthermal
 
interface  sub_get_tgas
 
interface  sub_get_trad
 
interface  sub_write_info
 
interface  sub_angmomfix
 
interface  sub_small_values
 
interface  sub_get_var
 
interface  sub_get_ct_velocity
 
interface  sub_update_faces
 
interface  sub_face_to_center
 
interface  sub_evaluate_implicit
 
interface  sub_implicit_update
 

Functions/Subroutines

subroutine phys_check ()
 
subroutine dummy_init_params
 
subroutine dummy_check_params
 
subroutine dummy_modify_wlr (ixIL, ixOL, qt, wLC, wRC, wLp, wRp, s, idir)
 
subroutine dummy_get_h_speed (wprim, x, ixIL, ixOL, idim, Hspeed)
 
subroutine dummy_get_a2max (w, x, ixIL, ixOL, a2max)
 
subroutine dummy_add_source_geom (qdt, ixIL, ixOL, wCT, w, x)
 
subroutine dummy_add_source (qdt, ixIL, ixOL, wCT, w, x, qsourcesplit, active, wCTprim)
 
subroutine dummy_check_w (primitive, ixIL, ixOL, w, w_flag)
 
subroutine dummy_get_pthermal (w, x, ixIL, ixOL, pth)
 
subroutine dummy_boundary_adjust (igrid, psb)
 
subroutine dummy_write_info (fh)
 
subroutine dummy_angmomfix (fC, x, wnew, ixIL, ixOL, idim)
 
subroutine dummy_small_values (primitive, w, x, ixIL, ixOL, subname)
 
subroutine dummy_get_ct_velocity (vcts, wLp, wRp, ixIL, ixOL, idim, cmax, cmin)
 
subroutine dummy_update_faces (ixIL, ixOL, qt, qdt, wprim, fC, fE, sCT, s, vcts)
 
subroutine dummy_face_to_center (ixOL, s)
 
subroutine dummy_evaluate_implicit (qtC, psa)
 
subroutine dummy_implicit_update (dtfactor, qdt, qtC, psa, psb)
 

Variables

double precision phys_gamma =5.0/3
 
character(len=name_len) physics_type = ""
 String describing the physics type of the simulation. More...
 
integer phys_wider_stencil = 0
 To use wider stencils in flux calculations. A value of 1 will extend it by one cell in both directions, in any dimension. More...
 
logical phys_req_diagonal = .true.
 Whether the physics routines require diagonal ghost cells, for example for computing a curl. More...
 
logical phys_energy =.false.
 Solve energy equation or not. More...
 
logical phys_total_energy =.false.
 Solve total energy equation or not. More...
 
logical phys_internal_e =.false.
 Solve internal enery instead of total energy. More...
 
logical phys_solve_eaux =.false.
 Solve internal energy and total energy equations. More...
 
integer, dimension(:, :), allocatable flux_type
 Array per direction per variable, which can be used to specify that certain fluxes have to be treated differently. More...
 
integer, parameter flux_default = 0
 Indicates a normal flux. More...
 
integer, parameter flux_tvdlf = 1
 Indicates the flux should be treated with tvdlf. More...
 
integer, parameter flux_no_dissipation = 2
 Indicates dissipation should be omitted. More...
 
integer, parameter flux_special = 3
 Indicates the flux should be specially treated. More...
 
integer, parameter flux_hll = 4
 Indicates the flux should be treated with hll. More...
 
procedure(sub_check_params), pointer phys_check_params => null()
 
procedure(sub_set_mg_bounds), pointer phys_set_mg_bounds => null()
 
procedure(sub_convert), pointer phys_to_conserved => null()
 
procedure(sub_convert), pointer phys_to_primitive => null()
 
procedure(sub_modify_wlr), pointer phys_modify_wlr => null()
 
procedure(sub_get_cmax), pointer phys_get_cmax => null()
 
procedure(sub_get_a2max), pointer phys_get_a2max => null()
 
procedure(sub_get_tcutoff), pointer phys_get_tcutoff => null()
 
procedure(sub_get_h_speed), pointer phys_get_h_speed => null()
 
procedure(sub_get_cbounds), pointer phys_get_cbounds => null()
 
procedure(sub_get_flux), pointer phys_get_flux => null()
 
procedure(sub_energy_synchro), pointer phys_energy_synchro => null()
 
procedure(sub_get_v), pointer phys_get_v => null()
 
procedure(sub_get_dt), pointer phys_get_dt => null()
 
procedure(sub_add_source_geom), pointer phys_add_source_geom => null()
 
procedure(sub_add_source), pointer phys_add_source => null()
 
procedure(sub_global_source), pointer phys_global_source_after => null()
 
procedure(sub_special_advance), pointer phys_special_advance => null()
 
procedure(sub_check_w), pointer phys_check_w => null()
 
procedure(sub_get_pthermal), pointer phys_get_pthermal => null()
 
procedure(sub_get_tgas), pointer phys_get_tgas => null()
 
procedure(sub_get_trad), pointer phys_get_trad => null()
 
procedure(sub_boundary_adjust), pointer phys_boundary_adjust => null()
 
procedure(sub_write_info), pointer phys_write_info => null()
 
procedure(sub_angmomfix), pointer phys_angmomfix => null()
 
procedure(sub_small_values), pointer phys_handle_small_values => null()
 
procedure(sub_get_ct_velocity), pointer phys_get_ct_velocity => null()
 
procedure(sub_update_faces), pointer phys_update_faces => null()
 
procedure(sub_face_to_center), pointer phys_face_to_center => null()
 
procedure(sub_implicit_update), pointer phys_implicit_update => null()
 
procedure(sub_evaluate_implicit), pointer phys_evaluate_implicit => null()
 
procedure(sub_clean_divb), pointer phys_clean_divb => null()
 
procedure(sub_set_equi_vars), pointer phys_set_equi_vars => null()
 
procedure(sub_check_params), pointer phys_te_images => null()
 

Detailed Description

This module defines the procedures of a physics module. It contains function pointers for the various supported routines. An actual physics module has to set these pointers to its implementation of these routines.

Function/Subroutine Documentation

◆ dummy_add_source()

subroutine mod_physics::dummy_add_source ( 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,
logical, intent(in)  qsourcesplit,
logical, intent(inout)  active,
double precision, dimension(ixi^s,1:nw), intent(in), optional  wCTprim 
)

Definition at line 480 of file mod_physics.t.

◆ dummy_add_source_geom()

subroutine mod_physics::dummy_add_source_geom ( 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:^nd), intent(in)  x 
)

Definition at line 473 of file mod_physics.t.

◆ dummy_angmomfix()

subroutine mod_physics::dummy_angmomfix ( double precision, dimension(ixi^s,1:nwflux,1:ndim), intent(inout)  fC,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
double precision, dimension(ixi^s,1:nw), intent(inout)  wnew,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idim 
)

Definition at line 532 of file mod_physics.t.

◆ dummy_boundary_adjust()

subroutine mod_physics::dummy_boundary_adjust ( integer, intent(in)  igrid,
type(state), dimension(max_blocks), target  psb 
)

Definition at line 514 of file mod_physics.t.

◆ dummy_check_params()

subroutine mod_physics::dummy_check_params

Definition at line 445 of file mod_physics.t.

◆ dummy_check_w()

subroutine mod_physics::dummy_check_w ( logical, intent(in)  primitive,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,1:nw), intent(in)  w,
logical, dimension(ixi^s,1:nw), intent(inout)  w_flag 
)

Definition at line 493 of file mod_physics.t.

◆ dummy_evaluate_implicit()

subroutine mod_physics::dummy_evaluate_implicit ( double precision, intent(in)  qtC,
type(state), dimension(max_blocks), target  psa 
)

Definition at line 577 of file mod_physics.t.

◆ dummy_face_to_center()

subroutine mod_physics::dummy_face_to_center ( integer, intent(in)  ixO,
integer, intent(in)  L,
type(state s 
)

Definition at line 571 of file mod_physics.t.

◆ dummy_get_a2max()

subroutine mod_physics::dummy_get_a2max ( double precision, dimension(ixi^s, nw), intent(in)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ndim), intent(inout)  a2max 
)

Definition at line 465 of file mod_physics.t.

Here is the call graph for this function:

◆ dummy_get_ct_velocity()

subroutine mod_physics::dummy_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 
)

Definition at line 549 of file mod_physics.t.

◆ dummy_get_h_speed()

subroutine mod_physics::dummy_get_h_speed ( double precision, dimension(ixi^s, nw), intent(in)  wprim,
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(out)  Hspeed 
)

Definition at line 457 of file mod_physics.t.

◆ dummy_get_pthermal()

subroutine mod_physics::dummy_get_pthermal ( 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)  pth 
)

Definition at line 503 of file mod_physics.t.

Here is the call graph for this function:

◆ dummy_implicit_update()

subroutine mod_physics::dummy_implicit_update ( double precision, intent(in)  dtfactor,
double precision, intent(in)  qdt,
double precision, intent(in)  qtC,
type(state), dimension(max_blocks), target  psa,
type(state), dimension(max_blocks), target  psb 
)

Definition at line 593 of file mod_physics.t.

◆ dummy_init_params()

subroutine mod_physics::dummy_init_params

Definition at line 442 of file mod_physics.t.

◆ dummy_modify_wlr()

subroutine mod_physics::dummy_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 448 of file mod_physics.t.

◆ dummy_small_values()

subroutine mod_physics::dummy_small_values ( logical, intent(in)  primitive,
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,
character(len=*), intent(in)  subname 
)

Definition at line 540 of file mod_physics.t.

◆ dummy_update_faces()

subroutine mod_physics::dummy_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,7-2*ndim:3), intent(inout)  fE,
type(state sCT,
type(state s,
type(ct_velocity vcts 
)

Definition at line 559 of file mod_physics.t.

◆ dummy_write_info()

subroutine mod_physics::dummy_write_info ( integer, intent(in)  fh)
Parameters
[in]fhFile handle

Definition at line 520 of file mod_physics.t.

◆ phys_check()

subroutine mod_physics::phys_check

Definition at line 357 of file mod_physics.t.

Here is the call graph for this function:

Variable Documentation

◆ flux_default

integer, parameter mod_physics::flux_default = 0

Indicates a normal flux.

Definition at line 46 of file mod_physics.t.

◆ flux_hll

integer, parameter mod_physics::flux_hll = 4

Indicates the flux should be treated with hll.

Definition at line 54 of file mod_physics.t.

◆ flux_no_dissipation

integer, parameter mod_physics::flux_no_dissipation = 2

Indicates dissipation should be omitted.

Definition at line 50 of file mod_physics.t.

◆ flux_special

integer, parameter mod_physics::flux_special = 3

Indicates the flux should be specially treated.

Definition at line 52 of file mod_physics.t.

◆ flux_tvdlf

integer, parameter mod_physics::flux_tvdlf = 1

Indicates the flux should be treated with tvdlf.

Definition at line 48 of file mod_physics.t.

◆ flux_type

integer, dimension(:, :), allocatable mod_physics::flux_type

Array per direction per variable, which can be used to specify that certain fluxes have to be treated differently.

Definition at line 43 of file mod_physics.t.

◆ phys_add_source

procedure(sub_add_source), pointer mod_physics::phys_add_source => null()

Definition at line 71 of file mod_physics.t.

◆ phys_add_source_geom

procedure(sub_add_source_geom), pointer mod_physics::phys_add_source_geom => null()

Definition at line 70 of file mod_physics.t.

◆ phys_angmomfix

procedure(sub_angmomfix), pointer mod_physics::phys_angmomfix => null()

Definition at line 80 of file mod_physics.t.

◆ phys_boundary_adjust

procedure(sub_boundary_adjust), pointer mod_physics::phys_boundary_adjust => null()

Definition at line 78 of file mod_physics.t.

◆ phys_check_params

procedure(sub_check_params), pointer mod_physics::phys_check_params => null()

Definition at line 56 of file mod_physics.t.

◆ phys_check_w

procedure(sub_check_w), pointer mod_physics::phys_check_w => null()

Definition at line 74 of file mod_physics.t.

◆ phys_clean_divb

procedure(sub_clean_divb), pointer mod_physics::phys_clean_divb => null()

Definition at line 87 of file mod_physics.t.

◆ phys_energy

logical mod_physics::phys_energy =.false.

Solve energy equation or not.

Definition at line 30 of file mod_physics.t.

◆ phys_energy_synchro

procedure(sub_energy_synchro), pointer mod_physics::phys_energy_synchro => null()

Definition at line 67 of file mod_physics.t.

◆ phys_evaluate_implicit

procedure(sub_evaluate_implicit), pointer mod_physics::phys_evaluate_implicit => null()

Definition at line 86 of file mod_physics.t.

◆ phys_face_to_center

procedure(sub_face_to_center), pointer mod_physics::phys_face_to_center => null()

Definition at line 84 of file mod_physics.t.

◆ phys_gamma

double precision mod_physics::phys_gamma =5.0/3

Definition at line 16 of file mod_physics.t.

◆ phys_get_a2max

procedure(sub_get_a2max), pointer mod_physics::phys_get_a2max => null()

Definition at line 62 of file mod_physics.t.

◆ phys_get_cbounds

procedure(sub_get_cbounds), pointer mod_physics::phys_get_cbounds => null()

Definition at line 65 of file mod_physics.t.

◆ phys_get_cmax

procedure(sub_get_cmax), pointer mod_physics::phys_get_cmax => null()

Definition at line 61 of file mod_physics.t.

◆ phys_get_ct_velocity

procedure(sub_get_ct_velocity), pointer mod_physics::phys_get_ct_velocity => null()

Definition at line 82 of file mod_physics.t.

◆ phys_get_dt

procedure(sub_get_dt), pointer mod_physics::phys_get_dt => null()

Definition at line 69 of file mod_physics.t.

◆ phys_get_flux

procedure(sub_get_flux), pointer mod_physics::phys_get_flux => null()

Definition at line 66 of file mod_physics.t.

◆ phys_get_h_speed

procedure(sub_get_h_speed), pointer mod_physics::phys_get_h_speed => null()

Definition at line 64 of file mod_physics.t.

◆ phys_get_pthermal

procedure(sub_get_pthermal), pointer mod_physics::phys_get_pthermal => null()

Definition at line 75 of file mod_physics.t.

◆ phys_get_tcutoff

procedure(sub_get_tcutoff), pointer mod_physics::phys_get_tcutoff => null()

Definition at line 63 of file mod_physics.t.

◆ phys_get_tgas

procedure(sub_get_tgas), pointer mod_physics::phys_get_tgas => null()

Definition at line 76 of file mod_physics.t.

◆ phys_get_trad

procedure(sub_get_trad), pointer mod_physics::phys_get_trad => null()

Definition at line 77 of file mod_physics.t.

◆ phys_get_v

procedure(sub_get_v), pointer mod_physics::phys_get_v => null()

Definition at line 68 of file mod_physics.t.

◆ phys_global_source_after

procedure(sub_global_source), pointer mod_physics::phys_global_source_after => null()

Definition at line 72 of file mod_physics.t.

◆ phys_handle_small_values

procedure(sub_small_values), pointer mod_physics::phys_handle_small_values => null()

Definition at line 81 of file mod_physics.t.

◆ phys_implicit_update

procedure(sub_implicit_update), pointer mod_physics::phys_implicit_update => null()

Definition at line 85 of file mod_physics.t.

◆ phys_internal_e

logical mod_physics::phys_internal_e =.false.

Solve internal enery instead of total energy.

Definition at line 36 of file mod_physics.t.

◆ phys_modify_wlr

procedure(sub_modify_wlr), pointer mod_physics::phys_modify_wlr => null()

Definition at line 60 of file mod_physics.t.

◆ phys_req_diagonal

logical mod_physics::phys_req_diagonal = .true.

Whether the physics routines require diagonal ghost cells, for example for computing a curl.

Definition at line 27 of file mod_physics.t.

◆ phys_set_equi_vars

procedure(sub_set_equi_vars), pointer mod_physics::phys_set_equi_vars => null()

Definition at line 89 of file mod_physics.t.

◆ phys_set_mg_bounds

procedure(sub_set_mg_bounds), pointer mod_physics::phys_set_mg_bounds => null()

Definition at line 57 of file mod_physics.t.

◆ phys_solve_eaux

logical mod_physics::phys_solve_eaux =.false.

Solve internal energy and total energy equations.

Definition at line 39 of file mod_physics.t.

◆ phys_special_advance

procedure(sub_special_advance), pointer mod_physics::phys_special_advance => null()

Definition at line 73 of file mod_physics.t.

◆ phys_te_images

procedure(sub_check_params), pointer mod_physics::phys_te_images => null()

Definition at line 91 of file mod_physics.t.

◆ phys_to_conserved

procedure(sub_convert), pointer mod_physics::phys_to_conserved => null()

Definition at line 58 of file mod_physics.t.

◆ phys_to_primitive

procedure(sub_convert), pointer mod_physics::phys_to_primitive => null()

Definition at line 59 of file mod_physics.t.

◆ phys_total_energy

logical mod_physics::phys_total_energy =.false.

Solve total energy equation or not.

Definition at line 33 of file mod_physics.t.

◆ phys_update_faces

procedure(sub_update_faces), pointer mod_physics::phys_update_faces => null()

Definition at line 83 of file mod_physics.t.

◆ phys_wider_stencil

integer mod_physics::phys_wider_stencil = 0

To use wider stencils in flux calculations. A value of 1 will extend it by one cell in both directions, in any dimension.

Definition at line 23 of file mod_physics.t.

◆ phys_write_info

procedure(sub_write_info), pointer mod_physics::phys_write_info => null()

Definition at line 79 of file mod_physics.t.

◆ physics_type

character(len=name_len) mod_physics::physics_type = ""

String describing the physics type of the simulation.

Definition at line 19 of file mod_physics.t.