55 integer,
public,
protected ::
rho_
58 integer,
allocatable,
public,
protected ::
mom(:)
61 integer,
public,
protected ::
e_
64 integer,
public,
protected ::
p_
67 integer,
public,
protected ::
te_
72 integer,
public,
protected ::
q_
81 double precision,
protected :: small_e
90 double precision,
public,
protected ::
h_ion_fr=1d0
93 double precision,
public,
protected ::
he_ion_fr=1d0
100 double precision,
public,
protected ::
rr=1d0
107 double precision :: gamma_1, inv_gamma_1
112 function fun_kin_en(w, ixI^L, ixO^L, inv_rho)
result(ke)
114 integer,
intent(in) :: ixi^
l, ixo^
l
115 double precision,
intent(in) :: w(ixi^s, nw)
116 double precision :: ke(ixo^s)
117 double precision,
intent(in),
optional :: inv_rho(ixo^s)
118 end function fun_kin_en
146 subroutine ffhd_read_params(files)
149 character(len=*),
intent(in) :: files(:)
157 do n = 1,
size(files)
158 open(
unitpar, file=trim(files(n)), status=
"old")
159 read(
unitpar, ffhd_list,
end=111)
162 end subroutine ffhd_read_params
165 subroutine ffhd_write_info(fh)
167 integer,
intent(in) :: fh
168 integer,
parameter :: n_par = 1
169 double precision :: values(n_par)
170 character(len=name_len) :: names(n_par)
171 integer,
dimension(MPI_STATUS_SIZE) :: st
174 call mpi_file_write(fh, n_par, 1, mpi_integer, st, er)
178 call mpi_file_write(fh, values, n_par, mpi_double_precision, st, er)
179 call mpi_file_write(fh, names, n_par * name_len, mpi_character, st, er)
180 end subroutine ffhd_write_info
199 if(
mype==0)
write(*,*)
'WARNING: set ffhd_thermal_conduction=F when ffhd_energy=F'
203 if(
mype==0)
write(*,*)
'WARNING: set ffhd_hyperbolic_thermal_conduction=F when ffhd_energy=F'
207 if(
mype==0)
write(*,*)
'WARNING: set ffhd_radiative_cooling=F when ffhd_energy=F'
211 if(
mype==0)
write(*,*)
'WARNING: set ffhd_trac=F when ffhd_energy=F'
215 if(
mype==0)
write(*,*)
'WARNING: set ffhd_partial_ionization=F when ffhd_energy=F'
221 if(
mype==0)
write(*,*)
'WARNING: set ffhd_partial_ionization=F when eq_state_units=F'
227 if(
mype==0)
write(*,*)
'WARNING: turn off parabolic TC when using hyperbolic TC'
230 physics_type =
"ffhd"
232 phys_internal_e=.false.
244 if(
mype==0)
write(*,*)
'WARNING: reset ffhd_trac_type=1 for 1D simulation'
249 if(
mype==0)
write(*,*)
'WARNING: set ffhd_trac_mask==bigdouble for global TRAC method'
253 allocate(start_indices(number_species),stop_indices(number_species))
260 mom(:) = var_set_momentum(1)
264 e_ = var_set_energy()
282 stop_indices(1)=nwflux
289 te_ = var_set_auxvar(
'Te',
'Te')
310 if(.not.
allocated(flux_type))
then
311 allocate(flux_type(
ndir, nwflux))
312 flux_type = flux_default
313 else if(any(shape(flux_type) /= [
ndir, nwflux]))
then
314 call mpistop(
"phys_check error: flux_type has wrong shape")
317 phys_get_dt => ffhd_get_dt
318 phys_get_cmax => ffhd_get_cmax_origin
319 phys_get_a2max => ffhd_get_a2max
320 phys_get_cs2max => ffhd_get_cs2max
321 phys_get_tcutoff => ffhd_get_tcutoff
322 phys_get_cbounds => ffhd_get_cbounds
323 phys_to_primitive => ffhd_to_primitive_origin
325 phys_to_conserved => ffhd_to_conserved_origin
327 phys_get_flux => ffhd_get_flux
328 phys_get_v => ffhd_get_v_origin
334 phys_add_source => ffhd_add_source
335 phys_check_params => ffhd_check_params
336 phys_write_info => ffhd_write_info
337 phys_handle_small_values => ffhd_handle_small_values_origin
338 ffhd_handle_small_values => ffhd_handle_small_values_origin
339 phys_check_w => ffhd_check_w_origin
342 phys_get_pthermal => ffhd_get_pthermal_iso
345 phys_get_pthermal => ffhd_get_pthermal_origin
351 ffhd_get_rfactor=>rfactor_from_temperature_ionization
352 phys_update_temperature => ffhd_update_temperature
356 ffhd_get_rfactor=>rfactor_from_constant_ionization
366 call ffhd_physical_units()
372 call mpistop(
"thermal conduction needs ffhd_energy=T")
375 call mpistop(
"hyperbolic thermal conduction needs ffhd_energy=T")
378 call mpistop(
"radiative cooling needs ffhd_energy=T")
388 call add_sts_method(ffhd_get_tc_dt_ffhd,ffhd_sts_set_source_tc_ffhd,
e_,1,
e_,1,.false.)
389 tc_fl%get_temperature_from_conserved => ffhd_get_temperature_from_etot
390 tc_fl%get_temperature_from_eint => ffhd_get_temperature_from_eint
405 rc_fl%get_var_Rfactor => ffhd_get_rfactor
408 rc_fl%has_equi = .false.
413 te_fl_ffhd%get_var_Rfactor => ffhd_get_rfactor
415 phys_te_images => ffhd_te_images
430 subroutine ffhd_te_images
435 case(
'EIvtiCCmpi',
'EIvtuCCmpi')
437 case(
'ESvtiCCmpi',
'ESvtuCCmpi')
439 case(
'SIvtiCCmpi',
'SIvtuCCmpi')
441 case(
'WIvtiCCmpi',
'WIvtuCCmpi')
444 call mpistop(
"Error in synthesize emission: Unknown convert_type")
446 end subroutine ffhd_te_images
449 subroutine ffhd_sts_set_source_tc_ffhd(ixI^L,ixO^L,w,x,wres,fix_conserve_at_step,my_dt,igrid,nflux)
453 integer,
intent(in) :: ixi^
l, ixo^
l, igrid, nflux
454 double precision,
intent(in) :: x(ixi^s,1:
ndim)
455 double precision,
intent(inout) :: wres(ixi^s,1:nw), w(ixi^s,1:nw)
456 double precision,
intent(in) :: my_dt
457 logical,
intent(in) :: fix_conserve_at_step
459 end subroutine ffhd_sts_set_source_tc_ffhd
461 function ffhd_get_tc_dt_ffhd(w,ixI^L,ixO^L,dx^D,x)
result(dtnew)
468 integer,
intent(in) :: ixi^
l, ixo^
l
469 double precision,
intent(in) ::
dx^
d, x(ixi^s,1:
ndim)
470 double precision,
intent(in) :: w(ixi^s,1:nw)
471 double precision :: dtnew
474 end function ffhd_get_tc_dt_ffhd
476 subroutine ffhd_tc_handle_small_e(w, x, ixI^L, ixO^L, step)
479 integer,
intent(in) :: ixi^
l,ixo^
l
480 double precision,
intent(inout) :: w(ixi^s,1:nw)
481 double precision,
intent(in) :: x(ixi^s,1:
ndim)
482 integer,
intent(in) :: step
483 character(len=140) :: error_msg
485 write(error_msg,
"(a,i3)")
"Thermal conduction step ", step
486 call ffhd_handle_small_ei(w,x,ixi^
l,ixo^
l,
e_,error_msg)
487 end subroutine ffhd_tc_handle_small_e
489 subroutine tc_params_read_ffhd(fl)
491 type(tc_fluid),
intent(inout) :: fl
494 logical :: tc_saturate=.false.
495 double precision :: tc_k_para=0d0
496 character(len=std_len) :: tc_slope_limiter=
"MC"
498 namelist /tc_list/ tc_saturate, tc_slope_limiter, tc_k_para
502 read(
unitpar, tc_list,
end=111)
506 fl%tc_saturate = tc_saturate
507 fl%tc_k_para = tc_k_para
508 select case(tc_slope_limiter)
510 fl%tc_slope_limiter = 0
513 fl%tc_slope_limiter = 1
516 fl%tc_slope_limiter = 2
519 fl%tc_slope_limiter = 3
522 fl%tc_slope_limiter = 4
524 call mpistop(
"Unknown tc_slope_limiter, choose MC, minmod")
526 end subroutine tc_params_read_ffhd
528 subroutine rc_params_read(fl)
531 type(rc_fluid),
intent(inout) :: fl
533 integer :: ncool = 4000
534 double precision :: cfrac=0.1d0
537 character(len=std_len) :: coolcurve=
'JCcorona'
540 character(len=std_len) :: coolmethod=
'exact'
543 logical :: tfix=.false.
549 logical :: rc_split=.false.
550 logical :: rad_cut=.false.
551 double precision :: rad_cut_hgt=0.5d0
552 double precision :: rad_cut_dey=0.15d0
554 namelist /rc_list/ coolcurve, coolmethod, ncool, cfrac, tlow, tfix, rc_split, rad_cut, rad_cut_hgt, rad_cut_dey
558 read(
unitpar, rc_list,
end=111)
563 fl%coolcurve=coolcurve
564 fl%coolmethod=coolmethod
570 fl%rad_cut_hgt=rad_cut_hgt
571 fl%rad_cut_dey=rad_cut_dey
572 end subroutine rc_params_read
574 subroutine ffhd_check_params
581 if (
ffhd_gamma <= 0.0d0)
call mpistop (
"Error: ffhd_gamma <= 0")
582 if (
ffhd_adiab < 0.0d0)
call mpistop (
"Error: ffhd_adiab < 0")
586 call mpistop (
"Error: ffhd_gamma <= 0 or ffhd_gamma == 1")
587 inv_gamma_1=1.d0/gamma_1
592 call mpistop(
"usr_set_equi_vars has to be implemented in the user file")
594 end subroutine ffhd_check_params
596 subroutine ffhd_physical_units()
598 double precision :: mp,kb
599 double precision :: a,b
642 end subroutine ffhd_physical_units
644 subroutine ffhd_check_w_origin(primitive,ixI^L,ixO^L,w,flag)
646 logical,
intent(in) :: primitive
647 integer,
intent(in) :: ixi^
l, ixo^
l
648 double precision,
intent(in) :: w(ixi^s,nw)
649 double precision :: tmp(ixi^s)
650 logical,
intent(inout) :: flag(ixi^s,1:nw)
660 where(tmp(ixo^s) < small_e) flag(ixo^s,
e_) = .true.
663 end subroutine ffhd_check_w_origin
665 subroutine ffhd_to_conserved_origin(ixI^L,ixO^L,w,x)
667 integer,
intent(in) :: ixi^
l, ixo^
l
668 double precision,
intent(inout) :: w(ixi^s, nw)
669 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
670 double precision :: inv_gamma2(ixo^s)
674 w(ixo^s,
e_)=w(ixo^s,
p_)*inv_gamma_1+half*w(ixo^s,
mom(1))**2*w(ixo^s,
rho_)
677 end subroutine ffhd_to_conserved_origin
679 subroutine ffhd_to_primitive_origin(ixI^L,ixO^L,w,x)
681 integer,
intent(in) :: ixi^
l, ixo^
l
682 double precision,
intent(inout) :: w(ixi^s, nw)
683 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
684 double precision :: inv_rho(ixo^s), gamma2(ixo^s)
688 call ffhd_handle_small_values(.false., w, x, ixi^
l, ixo^
l,
'ffhd_to_primitive_origin')
691 w(ixo^s,
mom(1)) = w(ixo^s,
mom(1))/w(ixo^s,
rho_)
693 w(ixo^s,
p_)=gamma_1*(w(ixo^s,
e_)-half*w(ixo^s,
rho_)*w(ixo^s,
mom(1))**2)
695 end subroutine ffhd_to_primitive_origin
699 integer,
intent(in) :: ixi^
l, ixo^
l
700 double precision,
intent(inout) :: w(ixi^s, nw)
701 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
708 integer,
intent(in) :: ixi^
l, ixo^
l
709 double precision,
intent(inout) :: w(ixi^s, nw)
710 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
714 call ffhd_handle_small_ei(w,x,ixi^
l,ixi^
l,
e_,
'ffhd_e_to_ei')
718 subroutine ffhd_handle_small_values_origin(primitive, w, x, ixI^L, ixO^L, subname)
721 logical,
intent(in) :: primitive
722 integer,
intent(in) :: ixi^
l,ixo^
l
723 double precision,
intent(inout) :: w(ixi^s,1:nw)
724 double precision,
intent(in) :: x(ixi^s,1:
ndim)
725 character(len=*),
intent(in) :: subname
727 logical :: flag(ixi^s,1:nw)
728 double precision :: tmp2(ixi^s)
730 call phys_check_w(primitive, ixi^
l, ixi^
l, w, flag)
737 where(flag(ixo^s,
rho_)) w(ixo^s,
mom(1)) = 0.0d0
743 where(flag(ixo^s,
e_))
760 if(.not.primitive)
then
769 end subroutine ffhd_handle_small_values_origin
771 subroutine ffhd_get_v_origin(w,x,ixI^L,ixO^L,v)
773 integer,
intent(in) :: ixi^
l, ixo^
l
774 double precision,
intent(in) :: w(ixi^s,nw), x(ixi^s,1:
ndim)
775 double precision,
intent(out) :: v(ixi^s,
ndir)
776 double precision :: rho(ixi^s)
780 rho(ixo^s)=1.d0/rho(ixo^s)
782 v(ixo^s,
ndir) = w(ixo^s,
mom(1))*
block%B0(ixo^s,idir,0)*rho(ixo^s)
784 end subroutine ffhd_get_v_origin
788 integer,
intent(in) :: ixi^
l, ixo^
l, idim
789 double precision,
intent(in) :: w(ixi^s,nw), x(ixi^s,1:
ndim)
790 double precision,
intent(out) :: v(ixi^s)
791 double precision :: rho(ixi^s)
794 v(ixo^s) = (w(ixo^s,
mom(1))*
block%B0(ixo^s,idim,0)) / rho(ixo^s)
797 subroutine ffhd_get_cmax_origin(w,x,ixI^L,ixO^L,idim,cmax)
799 integer,
intent(in) :: ixi^
l, ixo^
l, idim
801 double precision,
intent(in) :: w(ixi^s, nw), x(ixi^s,1:
ndim)
802 double precision,
intent(inout) :: cmax(ixi^s)
809 cmax(ixo^s)=abs(w(ixo^s,
mom(1))*
block%B0(ixo^s,idim,0))+cmax(ixo^s)
811 end subroutine ffhd_get_cmax_origin
813 subroutine ffhd_get_cs2max(w,x,ixI^L,ixO^L,cs2max)
815 integer,
intent(in) :: ixi^
l, ixo^
l
816 double precision,
intent(in) :: w(ixi^s, nw), x(ixi^s,1:
ndim)
817 double precision,
intent(inout) :: cs2max
818 double precision :: cs2(ixi^s)
821 cs2max=maxval(cs2(ixo^s))
822 end subroutine ffhd_get_cs2max
824 subroutine ffhd_get_a2max(w,x,ixI^L,ixO^L,a2max)
826 integer,
intent(in) :: ixi^
l, ixo^
l
827 double precision,
intent(in) :: w(ixi^s, nw), x(ixi^s,1:
ndim)
828 double precision,
intent(inout) :: a2max(
ndim)
829 double precision :: a2(ixi^s,
ndim,nw)
830 integer :: gxo^
l,hxo^
l,jxo^
l,kxo^
l,i,j
835 hxo^
l=ixo^
l-
kr(i,^
d);
836 gxo^
l=hxo^
l-
kr(i,^
d);
837 jxo^
l=ixo^
l+
kr(i,^
d);
838 kxo^
l=jxo^
l+
kr(i,^
d);
839 a2(ixo^s,i,1:nw)=abs(-w(kxo^s,1:nw)+16.d0*w(jxo^s,1:nw)&
840 -30.d0*w(ixo^s,1:nw)+16.d0*w(hxo^s,1:nw)-w(gxo^s,1:nw))
841 a2max(i)=maxval(a2(ixo^s,i,1:nw))/12.d0/
dxlevel(i)**2
843 end subroutine ffhd_get_a2max
845 subroutine ffhd_get_tcutoff(ixI^L,ixO^L,w,x,Tco_local,Tmax_local)
848 integer,
intent(in) :: ixi^
l,ixo^
l
849 double precision,
intent(in) :: x(ixi^s,1:
ndim)
850 double precision,
intent(inout) :: w(ixi^s,1:nw)
851 double precision,
intent(out) :: tco_local,tmax_local
852 double precision,
parameter :: trac_delta=0.25d0
853 double precision :: tmp1(ixi^s),te(ixi^s),lts(ixi^s)
854 double precision,
dimension(ixI^S,1:ndir) :: bunitvec
855 double precision,
dimension(ixI^S,1:ndim) :: gradt
856 double precision :: bdir(
ndim)
857 double precision :: ltrc,ltrp,altr(ixi^s)
858 integer :: idims,jxo^
l,hxo^
l,ixa^
d,ixb^
d
859 integer :: jxp^
l,hxp^
l,ixp^
l,ixq^
l
860 logical :: lrlt(ixi^s)
864 tmax_local=maxval(te(ixo^s))
874 lts(ixo^s)=0.5d0*abs(te(jxo^s)-te(hxo^s))/te(ixo^s)
876 where(lts(ixo^s) > trac_delta)
879 if(any(lrlt(ixo^s)))
then
880 tco_local=maxval(te(ixo^s), mask=lrlt(ixo^s))
891 lts(ixp^s)=0.5d0*abs(te(jxp^s)-te(hxp^s))/te(ixp^s)
892 lts(ixp^s)=max(one, (exp(lts(ixp^s))/ltrc)**ltrp)
893 lts(ixo^s)=0.25d0*(lts(jxo^s)+two*lts(ixo^s)+lts(hxo^s))
894 block%wextra(ixo^s,
tcoff_)=te(ixo^s)*lts(ixo^s)**0.4d0
896 call mpistop(
"ffhd_trac_type not allowed for 1D simulation")
912 gradt(ixo^s,idims)=tmp1(ixo^s)
914 bunitvec(ixo^s,:)=
block%B0(ixo^s,:,0)
919 ixb^
d=(ixomin^
d+ixomax^
d-1)/2+ixa^
d;
922 if(sum(bdir(:)**2) .gt. zero)
then
923 bdir(1:ndim)=bdir(1:ndim)/dsqrt(sum(bdir(:)**2))
925 block%special_values(3:ndim+2)=bdir(1:ndim)
927 tmp1(ixo^s)=dsqrt(sum(bunitvec(ixo^s,:)**2,dim=ndim+1))
928 where(tmp1(ixo^s)/=0.d0)
929 tmp1(ixo^s)=1.d0/tmp1(ixo^s)
931 tmp1(ixo^s)=bigdouble
935 bunitvec(ixo^s,idims)=bunitvec(ixo^s,idims)*tmp1(ixo^s)
938 lts(ixo^s)=abs(sum(gradt(ixo^s,1:ndim)*bunitvec(ixo^s,1:ndim),dim=ndim+1))/te(ixo^s)
940 if(slab_uniform)
then
941 lts(ixo^s)=minval(dxlevel)*lts(ixo^s)
943 lts(ixo^s)=minval(block%ds(ixo^s,:),dim=ndim+1)*lts(ixo^s)
946 where(lts(ixo^s) > trac_delta)
949 if(any(lrlt(ixo^s)))
then
950 block%special_values(1)=maxval(te(ixo^s), mask=lrlt(ixo^s))
952 block%special_values(1)=zero
954 block%special_values(2)=tmax_local
972 call gradient(te,ixi^l,ixq^l,idims,gradt(ixi^s,idims))
973 call gradientf(te,x,ixi^l,hxp^l,idims,gradt(ixi^s,idims),nghostcells,.true.)
974 call gradientf(te,x,ixi^l,jxp^l,idims,gradt(ixi^s,idims),nghostcells,.false.)
976 bunitvec(ixp^s,:)=block%B0(ixp^s,:,0)
977 lts(ixp^s)=abs(sum(gradt(ixp^s,1:ndim)*bunitvec(ixp^s,1:ndim),dim=ndim+1))/te(ixp^s)
978 if(slab_uniform)
then
979 lts(ixp^s)=minval(dxlevel)*lts(ixp^s)
981 lts(ixp^s)=minval(block%ds(ixp^s,:),dim=ndim+1)*lts(ixp^s)
983 lts(ixp^s)=max(one, (exp(lts(ixp^s))/ltrc)**ltrp)
988 hxo^l=ixp^l-kr(idims,^d);
989 jxo^l=ixp^l+kr(idims,^d);
990 altr(ixp^s)=altr(ixp^s)+0.25d0*(lts(hxo^s)+two*lts(ixp^s)+lts(jxo^s))*bunitvec(ixp^s,idims)**2
992 block%wextra(ixp^s,
tcoff_)=te(ixp^s)*altr(ixp^s)**0.4d0
996 call mpistop(
"unknown ffhd_trac_type")
999 end subroutine ffhd_get_tcutoff
1001 subroutine ffhd_get_cbounds(wLC,wRC,wLp,wRp,x,ixI^L,ixO^L,idim,Hspeed,cmax,cmin)
1003 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1004 double precision,
intent(in) :: wlc(ixi^s, nw), wrc(ixi^s, nw)
1005 double precision,
intent(in) :: wlp(ixi^s, nw), wrp(ixi^s, nw)
1006 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1007 double precision,
intent(inout) :: cmax(ixi^s,1:number_species)
1008 double precision,
intent(inout),
optional :: cmin(ixi^s,1:number_species)
1009 double precision,
intent(in) :: hspeed(ixi^s,1:number_species)
1010 double precision :: wmean(ixi^s,nw)
1011 double precision,
dimension(ixI^S) :: umean, dmean, csoundl, csoundr, tmp1,tmp2,tmp3
1018 tmp1(ixo^s)=sqrt(wlp(ixo^s,
rho_))
1019 tmp2(ixo^s)=sqrt(wrp(ixo^s,
rho_))
1020 tmp3(ixo^s)=1.d0/(tmp1(ixo^s)+tmp2(ixo^s))
1021 umean(ixo^s)=(wlp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim)*tmp1(ixo^s)&
1022 +wrp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim)*tmp2(ixo^s))*tmp3(ixo^s)
1023 call ffhd_get_csound_prim(wlp,x,ixi^
l,ixo^
l,idim,csoundl)
1024 call ffhd_get_csound_prim(wrp,x,ixi^
l,ixo^
l,idim,csoundr)
1025 dmean(ixo^s)=(tmp1(ixo^s)*csoundl(ixo^s)+tmp2(ixo^s)*csoundr(ixo^s)) * &
1026 tmp3(ixo^s) + 0.5d0*tmp1(ixo^s)*tmp2(ixo^s)*tmp3(ixo^s)**2 * &
1027 (wrp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim)-wlp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim))**2
1028 dmean(ixo^s)=dsqrt(dmean(ixo^s))
1029 if(
present(cmin))
then
1030 cmin(ixo^s,1)=umean(ixo^s)-dmean(ixo^s)
1031 cmax(ixo^s,1)=umean(ixo^s)+dmean(ixo^s)
1033 cmax(ixo^s,1)=abs(umean(ixo^s))+dmean(ixo^s)
1036 wmean(ixo^s,1:nwflux)=0.5d0*(wlc(ixo^s,1:nwflux)+wrc(ixo^s,1:nwflux))
1037 tmp1(ixo^s)=wmean(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim)/wmean(ixo^s,
rho_)
1038 call ffhd_get_csound(wmean,x,ixi^
l,ixo^
l,idim,csoundr)
1039 if(
present(cmin))
then
1040 cmax(ixo^s,1)=max(tmp1(ixo^s)+csoundr(ixo^s),zero)
1041 cmin(ixo^s,1)=min(tmp1(ixo^s)-csoundr(ixo^s),zero)
1043 cmax(ixo^s,1)=abs(tmp1(ixo^s))+csoundr(ixo^s)
1047 call ffhd_get_csound_prim(wlp,x,ixi^
l,ixo^
l,idim,csoundl)
1048 call ffhd_get_csound_prim(wrp,x,ixi^
l,ixo^
l,idim,csoundr)
1049 csoundl(ixo^s)=max(csoundl(ixo^s),csoundr(ixo^s))
1050 if(
present(cmin))
then
1051 cmin(ixo^s,1)=min(wlp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim),&
1052 wrp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim))-csoundl(ixo^s)
1053 cmax(ixo^s,1)=max(wlp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim),&
1054 wrp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim))+csoundl(ixo^s)
1056 cmax(ixo^s,1)=max(wlp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim),&
1057 wrp(ixo^s,
mom(1))*
block%B0(ixo^s,idim,idim))+csoundl(ixo^s)
1060 end subroutine ffhd_get_cbounds
1062 subroutine ffhd_get_csound(w,x,ixI^L,ixO^L,idim,csound)
1064 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1065 double precision,
intent(in) :: w(ixi^s, nw), x(ixi^s,1:
ndim)
1066 double precision,
intent(out):: csound(ixi^s)
1069 csound(ixo^s) = dsqrt(csound(ixo^s))*abs(
block%B0(ixo^s,idim,idim))
1070 end subroutine ffhd_get_csound
1073 subroutine ffhd_get_csound_prim(w,x,ixI^L,ixO^L,idim,csound)
1076 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1077 double precision,
intent(in) :: w(ixi^s, nw), x(ixi^s,1:
ndim)
1078 double precision,
intent(out):: csound(ixi^s)
1085 csound(ixo^s) = dsqrt(csound(ixo^s))
1086 end subroutine ffhd_get_csound_prim
1088 subroutine ffhd_get_pthermal_iso(w,x,ixI^L,ixO^L,pth)
1091 integer,
intent(in) :: ixi^
l, ixo^
l
1092 double precision,
intent(in) :: w(ixi^s,nw)
1093 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1094 double precision,
intent(out):: pth(ixi^s)
1098 end subroutine ffhd_get_pthermal_iso
1100 subroutine ffhd_get_pthermal_origin(w,x,ixI^L,ixO^L,pth)
1103 integer,
intent(in) :: ixi^
l, ixo^
l
1104 double precision,
intent(in) :: w(ixi^s,nw)
1105 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1106 double precision,
intent(out):: pth(ixi^s)
1111 {
do ix^db= ixo^lim^db\}
1116 elseif(check_small_values)
then
1117 {
do ix^db= ixo^lim^db\}
1118 if(pth(ix^d)<small_pressure)
then
1119 write(*,*)
"Error: small value of gas pressure",pth(ix^d),&
1120 " encountered when call ffhd_get_pthermal"
1121 write(*,*)
"Iteration: ", it,
" Time: ", global_time
1122 write(*,*)
"Location: ", x(ix^d,:)
1123 write(*,*)
"Cell number: ", ix^d
1125 write(*,*) trim(cons_wnames(iw)),
": ",w(ix^d,iw)
1128 if(trace_small_values)
write(*,*) sqrt(pth(ix^d)-bigdouble)
1129 write(*,*)
"Saving status at the previous time step"
1134 end subroutine ffhd_get_pthermal_origin
1136 subroutine ffhd_get_temperature_from_te(w, x, ixI^L, ixO^L, res)
1138 integer,
intent(in) :: ixi^
l, ixo^
l
1139 double precision,
intent(in) :: w(ixi^s, 1:nw)
1140 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
1141 double precision,
intent(out):: res(ixi^s)
1143 res(ixo^s) = w(ixo^s,
te_)
1144 end subroutine ffhd_get_temperature_from_te
1146 subroutine ffhd_get_temperature_from_eint(w, x, ixI^L, ixO^L, res)
1148 integer,
intent(in) :: ixi^
l, ixo^
l
1149 double precision,
intent(in) :: w(ixi^s, 1:nw)
1150 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
1151 double precision,
intent(out):: res(ixi^s)
1152 double precision :: r(ixi^s)
1154 call ffhd_get_rfactor(w,x,ixi^
l,ixo^
l,r)
1155 res(ixo^s) = gamma_1 * w(ixo^s,
e_)/(w(ixo^s,
rho_)*r(ixo^s))
1156 end subroutine ffhd_get_temperature_from_eint
1158 subroutine ffhd_get_temperature_from_etot(w, x, ixI^L, ixO^L, res)
1160 integer,
intent(in) :: ixi^
l, ixo^
l
1161 double precision,
intent(in) :: w(ixi^s, 1:nw)
1162 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
1163 double precision,
intent(out):: res(ixi^s)
1165 double precision :: r(ixi^s)
1167 call ffhd_get_rfactor(w,x,ixi^
l,ixo^
l,r)
1169 res(ixo^s)=res(ixo^s)/(r(ixo^s)*w(ixo^s,
rho_))
1170 end subroutine ffhd_get_temperature_from_etot
1174 integer,
intent(in) :: ixi^
l, ixo^
l
1175 double precision,
intent(in) :: w(ixi^s,nw)
1176 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1177 double precision,
intent(out) :: csound2(ixi^s)
1178 double precision :: rho(ixi^s)
1183 csound2(ixo^s)=
ffhd_gamma*csound2(ixo^s)/rho(ixo^s)
1189 subroutine ffhd_get_flux(wC,w,x,ixI^L,ixO^L,idim,f)
1192 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1194 double precision,
intent(in) :: wc(ixi^s,nw)
1196 double precision,
intent(in) :: w(ixi^s,nw)
1197 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1198 double precision,
intent(out) :: f(ixi^s,nwflux)
1199 double precision :: ptotal(ixo^s)
1200 double precision :: tmp(ixi^s)
1201 integer :: idirmin, iw, idir, jdir, kdir
1202 double precision,
dimension(ixI^S) :: te,tau,sigt
1207 ptotal(ixo^s)=w(ixo^s,
p_)
1213 f(ixo^s,
mom(1))=(wc(ixo^s,
mom(1))*w(ixo^s,
mom(1))+ptotal(ixo^s))*
block%B0(ixo^s,idim,idim)
1217 f(ixo^s,
e_)=w(ixo^s,
mom(1))*(wc(ixo^s,
e_)+ptotal(ixo^s))*
block%B0(ixo^s,idim,idim)
1219 f(ixo^s,
e_)=f(ixo^s,
e_)+w(ixo^s,
q_)*
block%B0(ixo^s,idim,idim)
1223 end subroutine ffhd_get_flux
1225 subroutine ffhd_add_source(qdt,dtfactor,ixI^L,ixO^L,wCT,wCTprim,w,x,qsourcesplit,active)
1230 integer,
intent(in) :: ixi^
l, ixo^
l
1231 double precision,
intent(in) :: qdt,dtfactor
1232 double precision,
intent(in) :: wct(ixi^s,1:nw),wctprim(ixi^s,1:nw), x(ixi^s,1:
ndim)
1233 double precision,
intent(inout) :: w(ixi^s,1:nw)
1234 logical,
intent(in) :: qsourcesplit
1235 logical,
intent(inout) :: active
1237 if (.not. qsourcesplit)
then
1239 call add_punitb(qdt,ixi^
l,ixo^
l,wct,w,x,wctprim)
1241 call add_hypertc_source(qdt,ixi^
l,ixo^
l,wct,w,x,wctprim)
1247 w,x,qsourcesplit,active,
rc_fl)
1262 if(.not.qsourcesplit)
then
1264 call ffhd_update_temperature(ixi^
l,ixo^
l,wct,w,x)
1267 end subroutine ffhd_add_source
1269 subroutine add_punitb(qdt,ixI^L,ixO^L,wCT,w,x,wCTprim)
1272 integer,
intent(in) :: ixi^
l,ixo^
l
1273 double precision,
intent(in) :: qdt
1274 double precision,
intent(in) :: wct(ixi^s,1:nw),x(ixi^s,1:
ndim)
1275 double precision,
intent(in) :: wctprim(ixi^s,1:nw)
1276 double precision,
intent(inout) :: w(ixi^s,1:nw)
1278 integer :: idims,hxo^
l
1279 double precision :: divb(ixi^s)
1284 hxo^
l=ixo^
l-
kr(idims,^
d);
1285 divb(ixo^s)=divb(ixo^s)+(
block%B0(ixo^s,idims,idims)-
block%B0(hxo^s,idims,idims))/
dxlevel(idims)
1290 w(ixo^s,
mom(1))=w(ixo^s,
mom(1))+qdt*wctprim(ixo^s,
p_)*divb(ixo^s)
1291 end subroutine add_punitb
1295 integer,
intent(in) :: ixi^
l, ixo^
l
1296 double precision,
intent(in) :: w(ixi^s,1:nw),x(ixi^s,1:
ndim)
1297 double precision,
intent(out) :: rho(ixi^s)
1299 rho(ixo^s) = w(ixo^s,
rho_)
1302 subroutine ffhd_handle_small_ei(w, x, ixI^L, ixO^L, ie, subname)
1305 integer,
intent(in) :: ixi^
l,ixo^
l, ie
1306 double precision,
intent(inout) :: w(ixi^s,1:nw)
1307 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1308 character(len=*),
intent(in) :: subname
1310 logical :: flag(ixi^s,1:nw)
1311 double precision :: rho(ixi^s)
1314 where(w(ixo^s,ie)<small_e) flag(ixo^s,ie)=.true.
1315 if(any(flag(ixo^s,ie)))
then
1318 where(flag(ixo^s,ie)) w(ixo^s,ie)=small_e
1322 w(ixo^s,
e_)=w(ixo^s,
e_)*gamma_1
1324 w(ixo^s,
mom(1)) = w(ixo^s,
mom(1))/rho(ixo^s)
1328 end subroutine ffhd_handle_small_ei
1330 subroutine ffhd_update_temperature(ixI^L,ixO^L,wCT,w,x)
1333 integer,
intent(in) :: ixi^
l, ixo^
l
1334 double precision,
intent(in) :: wct(ixi^s,1:nw), x(ixi^s,1:
ndim)
1335 double precision,
intent(inout) :: w(ixi^s,1:nw)
1336 double precision :: iz_h(ixo^s),iz_he(ixo^s), pth(ixi^s)
1342 end subroutine ffhd_update_temperature
1344 subroutine ffhd_get_dt(w,ixI^L,ixO^L,dtnew,dx^D,x)
1350 integer,
intent(in) :: ixi^
l, ixo^
l
1351 double precision,
intent(inout) :: dtnew
1352 double precision,
intent(in) ::
dx^
d
1353 double precision,
intent(in) :: w(ixi^s,1:nw)
1354 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1355 integer :: idirmin,idim
1356 double precision :: dxarr(
ndim)
1357 double precision :: current(ixi^s,7-2*
ndir:3),eta(ixi^s)
1372 end subroutine ffhd_get_dt
1486 function ffhd_kin_en_origin(w, ixI^L, ixO^L, inv_rho)
result(ke)
1488 integer,
intent(in) :: ixi^
l, ixo^
l
1489 double precision,
intent(in) :: w(ixi^s, nw)
1490 double precision :: ke(ixo^s)
1491 double precision,
intent(in),
optional :: inv_rho(ixo^s)
1493 if(
present(inv_rho))
then
1494 ke(ixo^s)=0.5d0*w(ixo^s,
mom(1))**2*inv_rho(ixo^s)
1496 ke(ixo^s)=0.5d0*w(ixo^s,
mom(1))**2/w(ixo^s,
rho_)
1498 end function ffhd_kin_en_origin
1500 subroutine rfactor_from_temperature_ionization(w,x,ixI^L,ixO^L,Rfactor)
1503 integer,
intent(in) :: ixi^
l, ixo^
l
1504 double precision,
intent(in) :: w(ixi^s,1:nw)
1505 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1506 double precision,
intent(out):: rfactor(ixi^s)
1507 double precision :: iz_h(ixo^s),iz_he(ixo^s)
1510 rfactor(ixo^s)=(1.d0+iz_h(ixo^s)+0.1d0*(1.d0+iz_he(ixo^s)*(1.d0+iz_he(ixo^s))))/(2.d0+3.d0*
he_abundance)
1511 end subroutine rfactor_from_temperature_ionization
1513 subroutine rfactor_from_constant_ionization(w,x,ixI^L,ixO^L,Rfactor)
1515 integer,
intent(in) :: ixi^
l, ixo^
l
1516 double precision,
intent(in) :: w(ixi^s,1:nw)
1517 double precision,
intent(in) :: x(ixi^s,1:
ndim)
1518 double precision,
intent(out):: rfactor(ixi^s)
1521 end subroutine rfactor_from_constant_ionization
1523 subroutine get_tau(ixI^L,ixO^L,w,Te,tau,sigT5)
1525 integer,
intent(in) :: ixi^
l, ixo^
l
1526 double precision,
dimension(ixI^S,1:nw),
intent(in) :: w
1527 double precision,
dimension(ixI^S),
intent(in) :: te
1528 double precision,
dimension(ixI^S),
intent(out) :: tau,sigt5
1530 double precision :: dxmin,taumin
1531 double precision,
dimension(ixI^S) :: sigt7,eint
1538 sigt7(ixo^s)=sigt5(ixo^s)*
block%wextra(ixo^s,
tcoff_)
1541 sigt7(ixo^s)=sigt5(ixo^s)*te(ixo^s)
1545 sigt7(ixo^s)=sigt5(ixo^s)*te(ixo^s)
1549 end subroutine get_tau
1551 subroutine add_hypertc_source(qdt,ixI^L,ixO^L,wCT,w,x,wCTprim)
1553 integer,
intent(in) :: ixi^
l,ixo^
l
1554 double precision,
intent(in) :: qdt
1555 double precision,
dimension(ixI^S,1:ndim),
intent(in) :: x
1556 double precision,
dimension(ixI^S,1:nw),
intent(in) :: wct,wctprim
1557 double precision,
dimension(ixI^S,1:nw),
intent(inout) :: w
1559 integer :: hxc^
l,hxo^
l,ixc^
l,jxc^
l,jxo^
l,kxc^
l
1560 double precision :: invdx
1561 double precision,
dimension(ixI^S) :: te,tau,sigt,htc_qsrc,tface
1562 double precision,
dimension(ixI^S) :: htc_esrc
1564 te(ixi^s)=wctprim(ixi^s,
p_)/wct(ixi^s,
rho_)
1565 call get_tau(ixi^
l,ixo^
l,wctprim,te,tau,sigt)
1570 ixcmin^
d=ixomin^
d-
kr(idims,^
d);ixcmax^
d=ixomax^
d;
1571 jxc^
l=ixc^
l+
kr(idims,^
d);
1572 kxc^
l=jxc^
l+
kr(idims,^
d);
1573 hxc^
l=ixc^
l-
kr(idims,^
d);
1574 hxo^
l=ixo^
l-
kr(idims,^
d);
1575 tface(ixc^s)=(7.d0*(te(ixc^s)+te(jxc^s))-(te(hxc^s)+te(kxc^s)))/12.d0
1576 htc_qsrc(ixo^s)=htc_qsrc(ixo^s)+sigt(ixo^s)*
block%B0(ixo^s,idims,0)*(tface(ixo^s)-tface(hxo^s))*invdx
1578 htc_qsrc(ixo^s)=(htc_qsrc(ixo^s)+wct(ixo^s,
q_))/tau(ixo^s)
1579 w(ixo^s,
q_)=w(ixo^s,
q_)-qdt*htc_qsrc(ixo^s)
1580 end subroutine add_hypertc_source
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module for physical and numeric constants.
double precision, parameter bigdouble
A very large real number.
subroutine add_convert_method(phys_convert_vars, nwc, dataset_names, file_suffix)
Frozen-field hydrodynamics module.
integer, public, protected te_
Indices of temperature.
integer, public, protected ffhd_trac_type
Which TRAC method is used.
double precision, public hypertc_kappa
The thermal conductivity kappa in hyperbolic thermal conduction.
integer, public, protected e_
Index of the energy density (-1 if not present)
double precision, public ffhd_gamma
The adiabatic index.
logical, public, protected eq_state_units
double precision, public ffhd_adiab
The adiabatic constant.
procedure(sub_get_pthermal), pointer, public ffhd_get_temperature
logical, public, protected ffhd_hyperbolic_thermal_conduction
Whether hyperbolic type thermal conduction is used.
type(rc_fluid), allocatable, public rc_fl
type of fluid for radiative cooling
integer, public, protected rho_
Index of the density (in the w array)
integer, public, protected tcoff_
Index of the cutoff temperature for the TRAC method.
procedure(sub_get_pthermal), pointer, public ffhd_get_pthermal
subroutine, public ffhd_get_rho(w, x, ixil, ixol, rho)
logical, public, protected ffhd_partial_ionization
Whether plasma is partially ionized.
procedure(sub_convert), pointer, public ffhd_to_conserved
integer, dimension(:), allocatable, public, protected mom
Indices of the momentum density.
double precision, public, protected h_ion_fr
Ionization fraction of H H_ion_fr = H+/(H+ + H)
procedure(fun_kin_en), pointer, public ffhd_kin_en
subroutine, public ffhd_phys_init()
procedure(sub_get_v), pointer, public ffhd_get_v
subroutine, public ffhd_get_csound2(w, x, ixil, ixol, csound2)
logical, public, protected ffhd_energy
Whether an energy equation is used.
double precision, public, protected rr
type(tc_fluid), allocatable, public tc_fl
type of fluid for thermal conduction
type(te_fluid), allocatable, public te_fl_ffhd
type of fluid for thermal emission synthesis
double precision, public, protected he_abundance
Helium abundance over Hydrogen.
logical, public, protected ffhd_viscosity
Whether viscosity is added.
logical, public, protected ffhd_radiative_cooling
Whether radiative cooling is added.
subroutine, public ffhd_get_v_idim(w, x, ixil, ixol, idim, v)
integer, public, protected q_
procedure(sub_convert), pointer, public ffhd_to_primitive
integer, public, protected tweight_
double precision, public, protected he_ion_fr2
Ratio of number He2+ / number He+ + He2+ He_ion_fr2 = He2+/(He2+ + He+)
logical, public, protected ffhd_trac
Whether TRAC method is used.
logical, public, protected ffhd_thermal_conduction
Whether thermal conduction is used.
subroutine, public ffhd_ei_to_e(ixil, ixol, w, x)
logical, public, protected ffhd_gravity
Whether gravity is added.
integer, public, protected p_
Index of the gas pressure (-1 if not present) should equal e_.
double precision, public, protected ffhd_trac_mask
Height of the mask used in the TRAC method.
double precision, public, protected he_ion_fr
Ionization fraction of He He_ion_fr = (He2+ + He+)/(He2+ + He+ + He)
integer, public, protected ffhd_trac_finegrid
Distance between two adjacent traced magnetic field lines (in finest cell size)
subroutine, public ffhd_e_to_ei(ixil, ixol, w, x)
Module for flux conservation near refinement boundaries.
Module with geometry-related routines (e.g., divergence, curl)
subroutine divvector(qvec, ixil, ixol, divq, nth_in)
subroutine gradient(q, ixil, ixol, idir, gradq, nth_in)
This module contains definitions of global parameters and variables and some generic functions/subrou...
type(state), pointer block
Block pointer for using one block and its previous state.
double precision small_pressure
double precision unit_time
Physical scaling factor for time.
double precision unit_density
Physical scaling factor for density.
integer, parameter unitpar
file handle for IO
double precision unit_mass
Physical scaling factor for mass.
integer, dimension(3, 3) kr
Kronecker delta tensor.
double precision phys_trac_mask
double precision unit_numberdensity
Physical scaling factor for number density.
character(len=std_len) convert_type
Which format to use when converting.
double precision unit_pressure
Physical scaling factor for pressure.
integer, parameter ndim
Number of spatial dimensions for grid variables.
double precision unit_length
Physical scaling factor for length.
character(len=std_len), dimension(:), allocatable par_files
Which par files are used as input.
integer mype
The rank of the current MPI task.
double precision, dimension(:), allocatable, parameter d
double precision dt
global time step
integer ndir
Number of spatial dimensions (components) for vector variables.
double precision unit_velocity
Physical scaling factor for velocity.
logical b0field
split magnetic field as background B0 field
logical need_global_cs2max
global value for csound speed
double precision unit_temperature
Physical scaling factor for temperature.
logical si_unit
Use SI units (.true.) or use cgs units (.false.)
double precision, dimension(:,:), allocatable dx
logical phys_trac
Use TRAC for MHD or 1D HD.
logical fix_small_values
fix small values with average or replace methods
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
double precision cs2max_global
global largest cs2 for hyperbolic thermal conduction
logical slab_uniform
uniform Cartesian geometry or not (stretched Cartesian)
double precision small_density
integer boundspeed
bound (left/min and right.max) speed of Riemann fan
integer phys_trac_finegrid
integer, parameter unitconvert
integer number_equi_vars
number of equilibrium set variables, besides the mag field
Module for including gravity in (magneto)hydrodynamics simulations.
subroutine gravity_get_dt(w, ixil, ixol, dtnew, dxd, x)
subroutine gravity_init()
Initialize the module.
subroutine gravity_add_source(qdt, ixil, ixol, wct, wctprim, w, x, energy, rhov, qsourcesplit, active)
w[iw]=w[iw]+qdt*S[wCT,qtC,x] where S is the source based on wCT within ixO
module ionization degree - get ionization degree for given temperature
subroutine ionization_degree_from_temperature(ixil, ixol, te, iz_h, iz_he)
subroutine ionization_degree_init()
Module containing all the particle routines.
This module defines the procedures of a physics module. It contains function pointers for the various...
module radiative cooling – add optically thin radiative cooling for HD and MHD
subroutine radiative_cooling_init_params(phys_gamma, he_abund)
Radiative cooling initialization.
subroutine cooling_get_dt(w, ixil, ixol, dtnew, dxd, x, fl)
subroutine radiative_cooling_init(fl, read_params)
subroutine radiative_cooling_add_source(qdt, ixil, ixol, wct, wctprim, w, x, qsourcesplit, active, fl)
Module for handling problematic values in simulations, such as negative pressures.
subroutine, public small_values_average(ixil, ixol, w, x, w_flag, windex)
logical, public trace_small_values
trace small values in the source file using traceback flag of compiler
subroutine, public small_values_error(wprim, x, ixil, ixol, w_flag, subname)
logical, dimension(:), allocatable, public small_values_fix_iw
Whether to apply small value fixes to certain variables.
character(len=20), public small_values_method
How to handle small values.
Generic supertimestepping method 1) in amrvac.par in sts_list set the following parameters which have...
subroutine, public add_sts_method(sts_getdt, sts_set_sources, startvar, nflux, startwbc, nwbc, evolve_b)
subroutine which added programatically a term to be calculated using STS Params: sts_getdt function c...
subroutine, public set_conversion_methods_to_head(sts_before_first_cycle, sts_after_last_cycle)
Set the hooks called before the first cycle and after the last cycle in the STS update This method sh...
subroutine, public set_error_handling_to_head(sts_error_handling)
Set the hook of error handling in the STS update. This method is called before updating the BC....
subroutine, public sts_init()
Initialize sts module.
Thermal conduction for HD and MHD or RHD and RMHD or twofl (plasma-neutral) module Adaptation of mod_...
subroutine, public tc_get_hd_params(fl, read_hd_params)
Init TC coefficients: HD case.
double precision function, public get_tc_dt_mhd(w, ixil, ixol, dxd, x, fl)
Get the explicut timestep for the TC (mhd implementation)
subroutine tc_init_params(phys_gamma)
subroutine, public sts_set_source_tc_mhd(ixil, ixol, w, x, wres, fix_conserve_at_step, my_dt, igrid, nflux, fl)
anisotropic thermal conduction with slope limited symmetric scheme Sharma 2007 Journal of Computation...
subroutine get_euv_image(qunit, fl)
subroutine get_sxr_image(qunit, fl)
subroutine get_euv_spectrum(qunit, fl)
subroutine get_whitelight_image(qunit, fl)
Module with all the methods that users can customize in AMRVAC.
procedure(rfactor), pointer usr_rfactor
procedure(set_equi_vars), pointer usr_set_equi_vars
The module add viscous source terms and check time step.
subroutine viscosity_add_source(qdt, ixil, ixol, wct, w, x, energy, qsourcesplit, active)
subroutine viscosity_init(phys_wider_stencil)
Initialize the module.
subroutine viscosity_get_dt(w, ixil, ixol, dtnew, dxd, x)