MPI-AMRVAC  2.0
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
mod_usr_template.t
Go to the documentation of this file.
1 !> This is a template for a new user problem
2 module mod_usr
3 
4  ! Include a physics module
5  use mod_hd
6 
7  implicit none
8 
9  ! Custom variables can be defined here
10  ! ...
11 
12 contains
13 
14  !> This routine should set user methods, and activate the physics module
15  subroutine usr_init()
16 
17  ! Choose coordinate system as 2D Cartesian with three components for vectors
18  call set_coordinate_system("Cartesian_2.5D")
19 
20  ! A routine for initial conditions is always required
21  usr_init_one_grid => initial_conditions
22 
23  ! Specify other user routines, for a list see mod_usr_methods.t
24  ! ...
25 
26  ! Choose independent normalization units if using dimensionless variables.
27  unit_length = 1.d9 ! cm
28  unit_temperature = 1.d6 ! K
29  unit_numberdensity = 1.d9 ! cm^-3
30 
31  ! Active the physics module
32  call hd_activate()
33 
34  end subroutine usr_init
35 
36  !> A routine for specifying initial conditions
37  subroutine initial_conditions(ixI^L, ixO^L, w, x)
38 
39  integer, intent(in) :: ixI^L, ixO^L
40  double precision, intent(in) :: x(ixi^s,1:ndim)
41  double precision, intent(inout) :: w(ixi^s,1:nw)
42 
43  ! Set initial values for w
44  ! w(ixO^S, rho_) = ...
45 
46  end subroutine initial_conditions
47 
48  ! Extra routines can be placed here
49  ! ...
50 
51 end module mod_usr
Module containing all hydrodynamics.
Definition: mod_hd.t:2
This is a template for a new user problem.
subroutine hd_activate()
Definition: mod_hd.t:16
subroutine initial_conditions(ixIL, ixOL, w, x)
A routine for specifying initial conditions.
subroutine usr_init()
This routine should set user methods, and activate the physics module.