18 character(len=*),
intent(in) :: files(:)
24 open(
unitpar, file=trim(files(n)), status=
"old")
25 read(
unitpar, kdv_list,
end=111)
44 integer,
intent(in) :: ixI^L, ixO^L
45 double precision,
intent(in) :: qdt, x(ixI^S,1:ndim)
46 double precision,
intent(in) :: wCT(ixI^S,1:nw)
47 double precision,
intent(inout) :: w(ixI^S,1:nw)
48 logical,
intent(in) :: qsourcesplit
49 logical,
intent(inout) :: active
51 integer :: idir, lx^L,kx^L,jx^L,hx^L,gx^L,fx^L
52 double precision :: skdv(ixI^S)
61 kx^l=ixo^l+2*
kr(idir,^
d);
62 jx^l=ixo^l+
kr(idir,^
d);
63 hx^l=ixo^l-
kr(idir,^
d);
64 gx^l=ixo^l-2*
kr(idir,^
d);
67 skdv(ixo^s)=skdv(ixo^s)+(wct(kx^s,iw_rho)-2.0d0*wct(jx^s,iw_rho) &
68 +2.0d0*wct(hx^s,iw_rho)-wct(gx^s,iw_rho)) &
74 lx^l=ixo^l+3*
kr(idir,^
d);
75 kx^l=ixo^l+2*
kr(idir,^
d);
76 jx^l=ixo^l+
kr(idir,^
d);
77 hx^l=ixo^l-
kr(idir,^
d);
78 gx^l=ixo^l-2*
kr(idir,^
d);
79 fx^l=ixo^l-3*
kr(idir,^
d);
82 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) &
83 +13.0d0*wct(hx^s,iw_rho)-8.0d0*wct(gx^s,iw_rho)+wct(fx^s,iw_rho)) &
87 call mpistop(
'undefined kdv_order parameter: see mod_kdv.t')
89 w(ixo^s,iw_rho) = w(ixo^s,iw_rho) - qdt*
kdv_delta**2*skdv(ixo^s)
98 integer,
intent(in) :: ixI^L, ixO^L
99 double precision,
intent(in) :: dx^D, x(ixI^S,1:ndim), w(ixI^S,1:nw)
100 double precision,
intent(inout) :: dtnew
102 double precision :: dxarr(ndim), max_sinefactor
108 max_sinefactor=3.0d0*dsqrt(3.0d0)/2.0d0
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.
integer, dimension(:), allocatable, parameter d
double precision, dimension(ndim) dxlevel
Module for including kdv source term in simulations adds over dimensions i.
subroutine kdv_get_dt(w, ixIL, ixOL, dtnew, dxD, x)
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.
double precision kdv_delta
forefactor of term
logical kdv_split
source split or not
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
Module with all the methods that users can customize in AMRVAC.