MPI-AMRVAC 3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Loading...
Searching...
No Matches
mod_nonlinear_roe.t
Go to the documentation of this file.
1!> Module containing Roe solver for scalar nonlinear equation
5
6 implicit none
7 private
8
9 public :: nonlinear_roe_init
10
11contains
12
13 subroutine nonlinear_roe_init()
15
16 nworkroe = 1
17
18 phys_average => nonlinear_average
19 phys_get_eigenjump => nonlinear_get_eigenjump
20 phys_rtimes => nonlinear_rtimes
21 end subroutine nonlinear_roe_init
22
23 subroutine nonlinear_average(wL, wR, x, ix^L, idim, wroe, workroe)
25 integer, intent(in) :: ix^l, idim
26 double precision, intent(in) :: wl(ixg^t, nw), wr(ixg^t, nw)
27 double precision, intent(inout) :: wroe(ixg^t, nw)
28 double precision, intent(inout) :: workroe(ixg^t, nworkroe)
29 double precision, intent(in) :: x(ixg^t, 1:^nd)
30
31 wroe(ix^s, rho_)=half*(wl(ix^s, rho_)+wr(ix^s, rho_))
32 end subroutine nonlinear_average
33
34 subroutine nonlinear_get_eigenjump(wL, wR, wC, x, ix^L, il, idim, smalla, a, jump, workroe)
35
36 ! Calculate the characteristic speed a and the jump in the
37 ! characteristic variable in the idim direction within ixL.
38 ! For a scalar equation the characteristic and conservative variables coincide
39 ! The characteristic speed is just the velocity, but it should be averaged
40 ! for the cell interfaces
41
43
44 integer, intent(in) :: ix^l, il, idim
45 double precision, dimension(ixG^T, nw) :: wl, wr, wc
46 double precision, dimension(ixG^T) :: smalla, a, jump, v
47 double precision, dimension(ixG^T, nworkroe) :: workroe
48 double precision, intent(in) :: x(ixg^t, 1:^nd)
49 integer :: jx^l, ixc^l
50
51 jx^l=ix^l+kr(idim,^d);
52 ixcmin^d=ixmin^d; ixcmax^d=jxmax^d;
53
54 ! No entropy fix
55 smalla(ix^s)= -one
56 ! The velocity is dependent of w in the nonlinear scalar equation,
57 ! and thus depends on the location
58 !> TODO: check this, for advection added argument to get velocity at cell edge!!!
59 call nonlinear_get_v(wl, x, ixg^ll, ixc^l, idim, v)
60
61 a(ix^s)=(v(jx^s)+v(ix^s))/2
62
63 jump(ix^s)=wr(ix^s, rho_)-wl(ix^s, rho_)
64
65 end subroutine nonlinear_get_eigenjump
66
67 subroutine nonlinear_rtimes(q, w, ix^L, iw, il, idim, rq, workroe)
68
69 ! Multiply q by R(il, iw), where R is the right eigenvalue matrix at wC.
70 ! For a scalar equation the R matrix is unity
71
73 integer, intent(in) :: ix^l, iw, il, idim
74 double precision, intent(in) :: w(ixg^t, nw), q(ixg^t)
75 double precision, intent(inout) :: rq(ixg^t)
76 double precision, intent(inout) :: workroe(ixg^t, nworkroe)
77
78 rq(ix^s)=q(ix^s)
79
80 end subroutine nonlinear_rtimes
81
82end module mod_nonlinear_roe
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
double precision, dimension(:), allocatable, parameter d
Module containing the physics routines for scalar nonlinear equation.
integer, public, protected rho_
index of the single scalar unknown
subroutine, public nonlinear_get_v(w, x, ixil, ixol, idim, v)
Module containing Roe solver for scalar nonlinear equation.
subroutine, public nonlinear_roe_init()
procedure(sub_rtimes), pointer phys_rtimes
procedure(sub_get_eigenjump), pointer phys_get_eigenjump
procedure(sub_average), pointer phys_average