MPI-AMRVAC  2.2
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

type  iw_methods
 Type for special methods defined per variable. More...
 
interface  sub_add_source
 
interface  sub_add_source_geom
 
interface  sub_angmomfix
 
interface  sub_boundary_adjust
 
interface  sub_check_params
 
interface  sub_check_w
 
interface  sub_convert
 
interface  sub_energy_synchro
 
interface  sub_evaluate_implicit
 
interface  sub_face_to_center
 
interface  sub_get_a2max
 
interface  sub_get_aux
 
interface  sub_get_cbounds
 
interface  sub_get_cmax
 
interface  sub_get_dt
 
interface  sub_get_flux
 
interface  sub_get_pthermal
 
interface  sub_get_tcutoff
 
interface  sub_get_v_idim
 
interface  sub_get_var
 
interface  sub_global_source
 Add global source terms on complete domain (potentially implicit) More...
 
interface  sub_implicit_update
 
interface  sub_modify_wLR
 
interface  sub_small_values
 
interface  sub_update_faces
 
interface  sub_write_info
 

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_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)
 
subroutine dummy_get_aux (clipping, w, x, ixIL, ixOL, subname)
 
subroutine dummy_check_w (primitive, ixIL, ixOL, w, w_flag)
 
subroutine dummy_get_pthermal (w, x, ixIL, ixOL, pth)
 
subroutine dummy_boundary_adjust
 
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_update_faces (ixIL, ixOL, qt, qdt, wprim, fC, fE, sCT, s)
 
subroutine dummy_face_to_center (ixOL, s)
 
subroutine dummy_evaluate_implicit (qtC, psa)
 
subroutine dummy_implicit_update (dtfactor, qdt, qtC, psa, psb)
 

Variables

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...
 
type(iw_methods), dimension(max_nw) phys_iw_methods
 Special methods defined per variable. More...
 
procedure(sub_check_params), pointer phys_check_params => null()
 
procedure(sub_convert), pointer phys_to_conserved => null()
 
procedure(sub_convert), pointer phys_to_primitive => null()
 
procedure(sub_convert), pointer phys_ei_to_e => null()
 
procedure(sub_convert), pointer phys_e_to_ei => 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_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_idim), pointer phys_get_v_idim => 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_before => null()
 
procedure(sub_global_source), pointer phys_global_source_after => null()
 
procedure(sub_get_aux), pointer phys_get_aux => null()
 
procedure(sub_check_w), pointer phys_check_w => null()
 
procedure(sub_get_pthermal), pointer phys_get_pthermal => 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_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()
 

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 
)

Definition at line 408 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 400 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 464 of file mod_physics.t.

◆ dummy_boundary_adjust()

subroutine mod_physics::dummy_boundary_adjust ( )

Definition at line 449 of file mod_physics.t.

◆ dummy_check_params()

subroutine mod_physics::dummy_check_params ( )

Definition at line 380 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 428 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 498 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 492 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 392 of file mod_physics.t.

Here is the call graph for this function:

◆ dummy_get_aux()

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

Definition at line 419 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 438 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 514 of file mod_physics.t.

◆ dummy_init_params()

subroutine mod_physics::dummy_init_params ( )

Definition at line 377 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 383 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 472 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 
)

Definition at line 481 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 452 of file mod_physics.t.

◆ phys_check()

subroutine mod_physics::phys_check ( )

Definition at line 295 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 41 of file mod_physics.t.

◆ flux_no_dissipation

integer, parameter mod_physics::flux_no_dissipation = 2

Indicates dissipation should be omitted.

Definition at line 45 of file mod_physics.t.

◆ flux_special

integer, parameter mod_physics::flux_special = 3

Indicates the flux should be specially treated.

Definition at line 47 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 43 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 38 of file mod_physics.t.

◆ phys_add_source

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

Definition at line 74 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 73 of file mod_physics.t.

◆ phys_angmomfix

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

Definition at line 82 of file mod_physics.t.

◆ phys_boundary_adjust

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

Definition at line 80 of file mod_physics.t.

◆ phys_check_params

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

Definition at line 59 of file mod_physics.t.

◆ phys_check_w

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

Definition at line 78 of file mod_physics.t.

◆ phys_e_to_ei

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

Definition at line 63 of file mod_physics.t.

◆ phys_ei_to_e

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

Definition at line 62 of file mod_physics.t.

◆ phys_energy

logical mod_physics::phys_energy =.false.

Solve energy equation or not.

Definition at line 25 of file mod_physics.t.

◆ phys_energy_synchro

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

Definition at line 70 of file mod_physics.t.

◆ phys_evaluate_implicit

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

Definition at line 87 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 85 of file mod_physics.t.

◆ phys_get_a2max

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

Definition at line 66 of file mod_physics.t.

◆ phys_get_aux

procedure(sub_get_aux), pointer mod_physics::phys_get_aux => null()

Definition at line 77 of file mod_physics.t.

◆ phys_get_cbounds

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

Definition at line 68 of file mod_physics.t.

◆ phys_get_cmax

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

Definition at line 65 of file mod_physics.t.

◆ phys_get_dt

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

Definition at line 72 of file mod_physics.t.

◆ phys_get_flux

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

Definition at line 69 of file mod_physics.t.

◆ phys_get_pthermal

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

Definition at line 79 of file mod_physics.t.

◆ phys_get_tcutoff

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

Definition at line 67 of file mod_physics.t.

◆ phys_get_v_idim

procedure(sub_get_v_idim), pointer mod_physics::phys_get_v_idim => null()

Definition at line 71 of file mod_physics.t.

◆ phys_global_source_after

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

Definition at line 76 of file mod_physics.t.

◆ phys_global_source_before

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

Definition at line 75 of file mod_physics.t.

◆ phys_handle_small_values

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

Definition at line 83 of file mod_physics.t.

◆ phys_implicit_update

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

Definition at line 86 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 31 of file mod_physics.t.

◆ phys_iw_methods

type(iw_methods), dimension(max_nw) mod_physics::phys_iw_methods

Special methods defined per variable.

Definition at line 57 of file mod_physics.t.

◆ phys_modify_wlr

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

Definition at line 64 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 22 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 34 of file mod_physics.t.

◆ phys_to_conserved

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

Definition at line 60 of file mod_physics.t.

◆ phys_to_primitive

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

Definition at line 61 of file mod_physics.t.

◆ phys_total_energy

logical mod_physics::phys_total_energy =.false.

Solve total energy equation or not.

Definition at line 28 of file mod_physics.t.

◆ phys_update_faces

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

Definition at line 84 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 18 of file mod_physics.t.

◆ phys_write_info

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

Definition at line 81 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 14 of file mod_physics.t.