18 character(len=*),
intent(in) :: files(:)
24 open(
unitpar, file=trim(files(n)), status=
"old")
25 read(
unitpar, kdv_list,
end=111)
45 integer,
intent(in) :: ixI^L, ixO^L
46 double precision,
intent(in) :: qdt, x(ixI^S,1:ndim)
47 double precision,
intent(in) :: wCT(ixI^S,1:nw)
48 double precision,
intent(inout) :: w(ixI^S,1:nw)
49 logical,
intent(in) :: qsourcesplit
50 logical,
intent(inout) :: active
52 integer :: idir, lx^L,kx^L,jx^L,hx^L,gx^L,fx^L
53 double precision :: skdv(ixI^S)
62 kx^l=ixo^l+2*
kr(idir,^
d);
63 jx^l=ixo^l+
kr(idir,^
d);
64 hx^l=ixo^l-
kr(idir,^
d);
65 gx^l=ixo^l-2*
kr(idir,^
d);
68 skdv(ixo^s)=skdv(ixo^s)+(wct(kx^s,iw_rho)-2.0d0*wct(jx^s,iw_rho) &
69 +2.0d0*wct(hx^s,iw_rho)-wct(gx^s,iw_rho)) &
75 lx^l=ixo^l+3*
kr(idir,^
d);
76 kx^l=ixo^l+2*
kr(idir,^
d);
77 jx^l=ixo^l+
kr(idir,^
d);
78 hx^l=ixo^l-
kr(idir,^
d);
79 gx^l=ixo^l-2*
kr(idir,^
d);
80 fx^l=ixo^l-3*
kr(idir,^
d);
83 skdv(ixo^s)=skdv(ixo^s)+(-wct(lx^s,iw_rho)+8.0d0*wct(kx^s,iw_rho)-13.0d0*wct(jx^s,iw_rho) &
84 +13.0d0*wct(hx^s,iw_rho)-8.0d0*wct(gx^s,iw_rho)+wct(fx^s,iw_rho)) &
88 call mpistop(
'undefined kdv_order parameter: see mod_kdv.t')
90 w(ixo^s,iw_rho) = w(ixo^s,iw_rho) - qdt*
kdv_delta**2*skdv(ixo^s)
99 integer,
intent(in) :: ixI^L, ixO^L
100 double precision,
intent(in) :: dx^D, x(ixI^S,1:ndim), w(ixI^S,1:nw)
101 double precision,
intent(inout) :: dtnew
103 double precision :: dxarr(ndim), max_sinefactor
109 max_sinefactor=3.0d0*dsqrt(3.0d0)/2.0d0
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
This module contains definitions of global parameters and variables and some generic functions/subrou...
double precision dtdiffpar
For resistive MHD, the time step is also limited by the diffusion time: .
integer, parameter unitpar
file handle for IO
integer, dimension(3, 3) kr
Kronecker delta tensor.
character(len=std_len), dimension(:), allocatable par_files
Which par files are used as input.
double precision, dimension(:), allocatable, parameter d
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
Module for including kdv source term in simulations adds over dimensions i.
subroutine kdv_add_source(qdt, ixil, ixol, wct, w, x, qsourcesplit, active)
w[iw]=w[iw]+qdt*S[wCT,qtC,x] where S is the source based on wCT within ixO
subroutine kdv_init()
Initialize the module.
integer kdv_order
switch for second order [1] or fourth order [2] central FD for Note: fourth order needs 3 nghostcell...
subroutine kdv_params_read(files)
Read this module's parameters from a file.
subroutine kdv_get_dt(w, ixil, ixol, dtnew, dxd, x)
double precision kdv_delta
forefactor of term
logical kdv_split
source split or not
Module with all the methods that users can customize in AMRVAC.