12 double precision :: dust_dtpar = 0.5d0
15 double precision :: gas_vtherm_factor = 3.0d0
18 double precision :: dust_temperature = -1.0d0
21 double precision :: dust_K_lineardrag = -1.0d0
25 double precision :: dust_stellar_luminosity = -1.0d0
31 double precision,
allocatable,
public ::
dust_size(:)
39 integer,
protected :: gas_rho_ = -1
40 integer,
allocatable,
protected :: gas_mom(:)
41 integer,
protected :: gas_e_ = -1
44 integer,
allocatable,
public,
protected ::
dust_rho(:)
47 integer,
allocatable,
public,
protected ::
dust_mom(:, :)
53 logical :: dust_source_split = .false.
56 logical :: dust_backreaction = .true.
60 logical :: dust_implicit_second_order = .true.
63 logical :: dust_backreaction_fh = .false.
66 character(len=std_len),
public,
protected ::
dust_method =
'Kwok'
69 character(len=std_len) :: dust_species =
'graphite'
72 character(len=std_len) :: dust_temperature_type =
'constant'
97 integer,
intent(in) :: g_rho
98 integer,
intent(in) :: g_mom(
ndir)
99 integer,
intent(in) :: g_energy
101 character(len=2) :: dim
106 allocate(gas_mom(
ndir))
121 dust_rho(n) = var_set_fluxvar(
"rhod",
"rhod", n)
126 write(dim,
"(I0,A)") idir,
"d"
128 dust_mom(idir, n) = var_set_fluxvar(
"m"//dim,
"v"//dim, n)
135 subroutine dust_read_params(files)
137 character(len=*),
intent(in) :: files(:)
142 dust_temperature_type, dust_backreaction, dust_dtpar, gas_vtherm_factor, dust_stellar_luminosity,&
143 dust_implicit_second_order, dust_backreaction_fh
145 do n = 1,
size(files)
146 open(
unitpar, file=trim(files(n)), status=
"old")
147 read(
unitpar, dust_list,
end=111)
151 end subroutine dust_read_params
158 if (
si_unit)
call mpistop(
"Dust error: sticking assumes cgs units")
159 if (dust_temperature_type ==
"constant")
then
160 if (dust_temperature < 0.0d0)
then
161 call mpistop(
"Dust error: dust_temperature (in K) < 0 or not set")
163 else if (dust_temperature_type ==
"stellar")
then
164 if (dust_stellar_luminosity < 0.0d0)
then
165 call mpistop(
"Dust error: dust_stellar_luminosity (in solar) < 0 or not set")
171 if(dust_k_lineardrag<0.0d0)
then
172 call mpistop(
"With dust_method=='linear', you must set a positive dust_K_lineardrag")
177 call mpistop(
"Dust error: any(dust_size < 0) or not set")
179 call mpistop(
"Dust error: any(dust_density < 0) or not set")
183 call mpistop(
"Dust error:usr_get_3d_dragforce and usr_dust_get_dt not defined")
186 if(.not.
use_imex_scheme .and. ((dust_dtpar .ge. 1d0).or.(dust_dtpar.le.0)))
then
187 if(
mype .eq. 0) print*,
"EXPLICIT source for dust requires 0<dt_dustpar < 1, set to 0.8"
196 integer,
intent(in) :: ixi^
l,ixo^
l
197 double precision,
intent(in):: w(ixi^s,1:nw)
198 logical,
intent(inout) :: flag(ixi^s,1:nw)
210 integer,
intent(in) :: ixi^
l, ixo^
l
211 double precision,
intent(inout) :: w(ixi^s, 1:nw)
212 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
230 integer,
intent(in) :: ixi^
l, ixo^
l
231 double precision,
intent(inout) :: w(ixi^s, 1:nw)
232 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
238 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
254 integer,
intent(in) :: ixi^
l, ixo^
l, idim
255 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
256 double precision,
intent(inout) :: f(ixi^s, nwflux)
260 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
268 get_vdust(w, ixi^
l, ixo^
l, idim, n)
277 integer,
intent(in) :: ixi^
l, ixo^
l, idim
278 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
279 double precision,
intent(inout) :: f(ixi^s, nwflux)
283 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
291 w(ixo^s,
dust_rho(n)) * get_vdust_prim(w, ixi^
l, ixo^
l, idim, n)
297 function get_vdust(w, ixI^L, ixO^L, idim, n)
result(vdust)
299 integer,
intent(in) :: ixi^
l, ixo^
l, idim, n
300 double precision,
intent(in) :: w(ixi^s, nw)
301 double precision :: vdust(ixo^s)
303 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
309 end function get_vdust
311 function get_vdust_prim(w, ixI^L, ixO^L, idim, n)
result(vdust)
313 integer,
intent(in) :: ixi^
l, ixo^
l, idim, n
314 double precision,
intent(in) :: w(ixi^s, nw)
315 double precision :: vdust(ixo^s)
317 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
318 vdust(ixo^s) = w(ixo^s,
dust_mom(idim, n))
323 end function get_vdust_prim
329 integer,
intent(in) :: ixi^
l, ixo^
l
330 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
331 double precision,
intent(inout) :: w(ixi^s, 1:nw)
334 logical :: flag(ixi^s)
352 subroutine get_3d_dragforce(ixI^L, ixO^L, w, x, fdrag, ptherm, vgas)
355 integer,
intent(in) :: ixi^
l, ixo^
l
356 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
357 double precision,
intent(in) :: w(ixi^s, 1:nw)
358 double precision,
intent(out) :: &
360 double precision,
intent(in) :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
362 double precision,
dimension(ixI^S) :: vt2, deltav, fd, vdust
366 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
373 where(w(ixo^s,
dust_rho(n)) > 0.0d0)
375 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
378 fd(ixo^s) = 0.75d0*w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_)*deltav(ixo^s) &
382 fd(ixo^s) = -fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
386 fdrag(ixo^s, idir, n) = fd(ixo^s)
392 call get_sticking(w, x, ixi^
l, ixo^
l, alpha_t, ptherm)
398 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
399 fd(ixo^s) = (one-alpha_t(ixo^s,n)) * w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_) * &
401 fd(ixo^s) = -fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
405 fdrag(ixo^s, idir,n) = fd(ixo^s)
414 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
416 fd(ixo^s) = -dust_k_lineardrag*deltav(ixo^s)
420 fdrag(ixo^s, idir,n) = fd(ixo^s)
427 fdrag(ixo^s, :, :) = 0.0d0
429 call mpistop(
"=== This dust method has not been implemented===" )
432 end subroutine get_3d_dragforce
439 subroutine get_sticking(w, x, ixI^L, ixO^L, alpha_T, ptherm)
441 integer,
intent(in) :: ixi^
l, ixo^
l
442 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
443 double precision,
intent(in) :: w(ixi^s, 1:nw)
445 double precision,
intent(in) :: ptherm(ixi^s)
446 double precision :: tgas(ixi^s)
450 call get_tdust(w, x, ixi^
l, ixo^
l, alpha_t)
456 alpha_t(ixo^s,n) = 0.35d0 * dexp(-dsqrt((tgas(ixo^s) + &
457 alpha_t(ixo^s,n))/5.0d2))+0.1d0
460 end subroutine get_sticking
470 subroutine get_tdust(w, x, ixI^L, ixO^L, Td)
474 integer,
intent(in) :: ixi^
l, ixo^
l
475 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
476 double precision,
intent(in) :: w(ixi^s, 1:nw)
478 double precision :: g0(ixo^s)
481 select case( trim(dust_temperature_type) )
483 td(ixo^s, :) = dust_temperature
485 select case( trim(dust_species) )
495 call mpistop(
"=== Dust species undetermined===" )
500 g0(ixo^s) = max(x(ixo^s, 1)*
unit_length, smalldouble)
505 call mpistop(
'stellar case not available in this coordinate system')
508 g0(ixo^s) = 2.1d4*(dust_stellar_luminosity/1.0d8)*((3.0857d17/g0(ixo^s))**2)
510 select case( trim(dust_species) )
514 *(g0(ixo^s)**(one/5.8d0))
519 *(g0(ixo^s)**(one/6.0d0))
522 call mpistop(
"=== Dust species undetermined===" )
525 call mpistop(
"=== Dust temperature undetermined===" )
528 end subroutine get_tdust
534 integer,
intent(in) :: ixi^
l, ixo^
l
535 double precision,
intent(in) :: qdt
536 double precision,
intent(in) :: wct(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
537 double precision,
intent(inout) :: w(ixi^s, 1:nw)
538 logical,
intent(in) :: qsourcesplit
539 logical,
intent(inout) :: active
541 double precision :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
549 if (qsourcesplit .eqv. dust_source_split)
then
552 call phys_get_pthermal(wct, x, ixi^
l, ixo^
l, ptherm)
554 vgas(ixo^s,idir)=wct(ixo^s,gas_mom(idir))/wct(ixo^s,gas_rho_)
557 call get_3d_dragforce(ixi^
l, ixo^
l, wct, x, fdrag, ptherm, vgas)
563 if (dust_backreaction)
then
564 w(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + &
565 fdrag(ixo^s, idir, n)
567 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + vgas(ixo^s, idir) &
568 * fdrag(ixo^s, idir, n)
574 fdrag(ixo^s, idir, n)
587 double precision,
intent(in) :: qtc
589 integer :: iigrid, igrid, level
594 do iigrid=1,igridstail; igrid=igrids(iigrid);
597 call dust_terms(ixg^
ll,
ixm^
ll,psa(igrid)%w,psa(igrid)%x)
606 subroutine dust_terms(ixI^L,ixO^L,w,x)
608 integer,
intent(in) :: ixi^
l, ixo^
l
609 double precision,
intent(inout) :: w(ixi^s, 1:nw)
610 double precision,
intent(in) :: x(ixi^s,1:
ndim)
612 double precision :: tmp(ixi^s), vgas(ixi^s, 1:
ndir)
617 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
619 call get_alpha_dust(ixi^
l, ixo^
l, w, vgas,x, alpha)
623 w(ixo^s, gas_mom(idir))=0d0
626 tmp(ixo^s) = alpha(ixo^s, idir,n) * ( &
627 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)) - &
628 w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir, n)))
629 w(ixo^s,
dust_mom(idir, n)) = -tmp(ixo^s)
630 if (dust_backreaction)
then
631 w(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + tmp(ixo^s)
633 if(dust_backreaction_fh)
then
635 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + alpha(ixo^s, idir,n) * &
636 (w(ixo^s,gas_rho_) * (w(ixo^s,
dust_mom(idir,n))**2/w(ixo^s,
dust_rho(n))) - &
637 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
639 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + alpha(ixo^s, idir,n) * ( - &
640 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
643 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + vgas(ixo^s, idir) &
650 end subroutine dust_terms
659 double precision,
intent(in) :: qdt
660 double precision,
intent(in) :: qtc
661 double precision,
intent(in) :: dtfactor
663 integer :: iigrid, igrid
667 do iigrid=1,igridstail; igrid=igrids(iigrid);
670 call dust_advance_implicit_grid(ixg^
ll, ixg^
ll, psa(igrid)%w, psb(igrid)%w, psa(igrid)%x, dtfactor,qdt)
676 subroutine dust_advance_implicit_grid(ixI^L, ixO^L, w, wout, x, dtfactor,qdt)
678 integer,
intent(in) :: ixi^
l, ixo^
l
679 double precision,
intent(in) :: qdt
680 double precision,
intent(in) :: dtfactor
681 double precision,
intent(in) :: w(ixi^s,1:nw)
682 double precision,
intent(in) :: x(ixi^s,1:
ndim)
683 double precision,
intent(out) :: wout(ixi^s,1:nw)
685 integer :: n, m, idir
687 double precision :: tmp(ixi^s),tmp2(ixi^s)
688 double precision :: tmp3(ixi^s)
689 double precision :: vgas(ixi^s, 1:
ndir)
693 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
695 call get_alpha_dust(ixi^
l, ixo^
l, w, vgas, x, alpha)
697 wout(ixo^s,1:nw) = w(ixo^s,1:nw)
703 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
704 (w(ixo^s,gas_rho_) + w(ixo^s,
dust_rho(n)))
708 tmp(ixo^s) = 1d0 + tmp2(ixo^s) * qdt
709 if(dust_implicit_second_order)
then
714 tmp2(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) *&
719 tmp(ixo^s) = tmp(ixo^s) + w(ixo^s,gas_rho_)*tmp2(ixo^s) * (qdt**2)
726 tmp2(ixo^s) = alpha(ixo^s, idir,n) * ( &
727 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)) - &
728 w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir, n))) * qdt
730 if(dust_implicit_second_order)
then
734 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
735 ( w(ixo^s,
dust_rho(n)) * (w(ixo^s,
dust_mom(idir, n)) + w(ixo^s, gas_mom(idir))) - &
739 tmp2(ixo^s) = tmp2(ixo^s) + tmp3(ixo^s) * w(ixo^s,gas_rho_)* (qdt**2)
741 tmp2(ixo^s) = tmp2(ixo^s)/tmp(ixo^s)
745 if (dust_backreaction)
then
749 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
750 (w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir,n)) - &
751 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)))
754 tmp2(ixo^s) = qdt * tmp2(ixo^s)
755 if(dust_implicit_second_order)
then
760 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
761 (w(ixo^s,gas_rho_) * (w(ixo^s,
dust_mom(idir, n)) + w(ixo^s,
dust_mom(idir, m))) - &
766 tmp2(ixo^s) = tmp2(ixo^s) + (qdt**2)*tmp3(ixo^s)* w(ixo^s,gas_rho_)
770 tmp2(ixo^s) = tmp2(ixo^s) / tmp(ixo^s)
771 wout(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + tmp2(ixo^s)
775 if(dust_backreaction_fh)
then
785 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
786 (w(ixo^s,gas_rho_) * tmp3(ixo^s) - &
787 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
790 tmp2(ixo^s) = qdt * tmp2(ixo^s)
791 if(dust_implicit_second_order)
then
795 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
797 (w(ixo^s,
dust_rho(n)) + w(ixo^s,
dust_rho(m)))* w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_))
801 tmp2(ixo^s) = tmp2(ixo^s) + (qdt**2)*tmp3(ixo^s)* w(ixo^s,gas_rho_)
803 wout(ixo^s, gas_e_) = wout(ixo^s, gas_e_) + 0.5d0 * tmp2(ixo^s) / tmp(ixo^s)
807 wout(ixo^s, gas_e_) = wout(ixo^s, gas_e_) + vgas(ixo^s, idir) * tmp2(ixo^s)
814 end subroutine dust_advance_implicit_grid
817 subroutine get_alpha_dust(ixI^L, ixO^L, w, vgas,x, alpha)
820 integer,
intent(in) :: ixi^
l, ixo^
l
821 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
822 double precision,
intent(in) :: w(ixi^s, 1:nw)
823 double precision,
intent(in) :: vgas(ixi^s, 1:
ndir)
824 double precision,
intent(out) :: &
827 double precision :: ptherm(ixi^s)
828 double precision,
dimension(ixI^S) :: vt2, deltav, fd, vdust
832 call phys_get_pthermal(w, x, ixi^
l, ixo^
l, ptherm)
834 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
841 where(w(ixo^s,
dust_rho(n)) > 0.0d0)
848 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
849 fd(ixo^s) = fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
853 alpha(ixo^s, idir, n) = fd(ixo^s)
859 call get_sticking(w, x, ixi^
l, ixo^
l, alpha_t, ptherm)
868 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
869 fd(ixo^s) = fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
873 alpha(ixo^s, idir,n) = fd(ixo^s)
881 fd(ixo^s) = dust_k_lineardrag/(w(ixo^s,gas_rho_)*w(ixo^s,
dust_rho(n)))
885 alpha(ixo^s, idir,n) = fd(ixo^s)
890 alpha(ixo^s, :, :) = 0.0d0
892 call mpistop(
"=== This dust method has not been implemented===" )
895 end subroutine get_alpha_dust
903 integer,
intent(in) :: ixi^
l, ixo^
l
904 double precision,
intent(in) ::
dx^
d, x(ixi^s, 1:
ndim)
905 double precision,
intent(in) :: wprim(ixi^s, 1:nw)
906 double precision,
intent(inout) :: dtnew
908 double precision :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
909 double precision,
dimension(1:dust_n_species):: dtdust
910 double precision,
dimension(ixI^S) :: vt2, deltav, tstop, vdust
911 double precision,
dimension(ixI^S, 1:dust_n_species) :: alpha_t
914 if(dust_dtpar .le. 0)
return
918 ptherm(ixo^s)=wprim(ixo^s,gas_e_)
920 call mpistop(
"adjust dust module for no energy for gas")
923 vgas(ixo^s,idir)=wprim(ixo^s,gas_mom(idir))
929 dtdust(:) = bigdouble
931 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/wprim(ixo^s, gas_rho_)
935 where(wprim(ixo^s,
dust_rho(n))>0.0d0)
936 vdust(ixo^s) = wprim(ixo^s,
dust_mom(idir, n))
937 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
939 (3.0d0*(0.75d0)*dsqrt(vt2(ixo^s) + &
940 deltav(ixo^s)**2)*(wprim(ixo^s,
dust_rho(n)) + &
941 wprim(ixo^s, gas_rho_)))
943 tstop(ixo^s) = bigdouble
946 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
950 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
953 dtdust(:) = bigdouble
955 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/wprim(ixo^s, gas_rho_)
958 call get_sticking(wprim, x, ixi^
l, ixo^
l, alpha_t, ptherm)
962 where(wprim(ixo^s,
dust_rho(n))>0.0d0)
963 vdust(ixo^s) = wprim(ixo^s,
dust_mom(idir, n))
964 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
966 (3.0d0*(one-alpha_t(ixo^s,n))*dsqrt(vt2(ixo^s) + &
967 deltav(ixo^s)**2)*(wprim(ixo^s,
dust_rho(n)) + &
968 wprim(ixo^s, gas_rho_)))
970 tstop(ixo^s) = bigdouble
973 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
977 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
980 dtdust(:) = bigdouble
983 where(wprim(ixo^s,
dust_rho(n))>0.0d0)
984 tstop(ixo^s) = (wprim(ixo^s,
dust_rho(n))*wprim(ixo^s, gas_rho_))/ &
985 (dust_k_lineardrag*(wprim(ixo^s,
dust_rho(n)) + wprim(ixo^s, gas_rho_)))
987 tstop(ixo^s) = bigdouble
990 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
993 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
995 dtdust(:) = bigdouble
997 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
1001 call mpistop(
"=== This dust method has not been implemented===" )
1004 if (dtnew <
dtmin)
then
1005 write(
unitterm,*)
"-------------------------------------"
1006 write(
unitterm,*)
"Warning: found DUST related time step too small! dtnew=", dtnew
1009 write(
unitterm,*)
" dtdust =", dtdust(:)
1011 write(
unitterm,*)
"-------------------------------------"
1021 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1022 double precision,
intent(in) :: w(ixi^s, 1:
nw), x(ixi^s, 1:
ndim)
1024 double precision,
intent(inout),
optional :: cmin(ixi^s,1:
number_species)
1025 double precision :: vdust(ixo^s)
1029 vdust(ixo^s) = get_vdust(w, ixi^
l, ixo^
l, idim, n)
1031 if (
present(cmin))
then
1032 cmin(ixo^s,1) = min(cmin(ixo^s,1), vdust(ixo^s))
1033 cmax(ixo^s,1) = max(cmax(ixo^s,1), vdust(ixo^s))
1035 cmax(ixo^s,1) = max(cmax(ixo^s,1), abs(vdust(ixo^s)))
1044 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1045 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
1046 double precision,
intent(inout) :: cmax(ixi^s)
1047 double precision,
intent(inout),
optional :: cmin(ixi^s)
1048 double precision :: vdust(ixo^s)
1052 vdust(ixo^s) = get_vdust_prim(w, ixi^
l, ixo^
l, idim, n)
1054 if (
present(cmin))
then
1055 cmin(ixo^s) = min(cmin(ixo^s), vdust(ixo^s))
1056 cmax(ixo^s) = max(cmax(ixo^s), vdust(ixo^s))
1058 cmax(ixo^s) = max(cmax(ixo^s), abs(vdust(ixo^s)))
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module for including dust species, which interact with the gas through a drag force.
double precision, public, protected dust_min_rho
Minimum dust density as used when dust_small_to_zero=T.
subroutine, public dust_add_source(qdt, ixil, ixol, wct, w, x, qsourcesplit, active)
w[iw]= w[iw]+qdt*S[wCT, x] where S is the source based on wCT within ixO
double precision, dimension(:), allocatable, public dust_size
Size of each dust species, dimensionless expression.
subroutine, public dust_evaluate_implicit(qtc, psa)
inplace update of psa==>F_im(psa)
character(len=std_len), public, protected dust_method
What type of dust drag force to use. Can be 'Kwok', 'sticking', 'linear', 'usr' or 'none'.
subroutine, public dust_to_primitive(ixil, ixol, w, x)
subroutine, public dust_get_flux(w, x, ixil, ixol, idim, f)
integer, dimension(:, :), allocatable, public, protected dust_mom
Indices of the dust momentum densities.
subroutine, public set_dusttozero(ixil, ixol, w, x)
logical, public, protected dust_small_to_zero
Set small dust densities to zero to avoid numerical problems.
subroutine, public dust_to_conserved(ixil, ixol, w, x)
integer, public, protected dust_n_species
The number of dust species.
subroutine, public dust_get_flux_prim(w, x, ixil, ixol, idim, f)
subroutine, public dust_check_w(ixil, ixol, w, flag)
integer, dimension(:), allocatable, public, protected dust_rho
Indices of the dust densities.
subroutine, public dust_get_cmax(w, x, ixil, ixol, idim, cmax, cmin)
subroutine, public dust_check_params()
subroutine, public dust_get_cmax_prim(w, x, ixil, ixol, idim, cmax, cmin)
subroutine, public dust_get_dt(wprim, ixil, ixol, dtnew, dxd, x)
Get dt related to dust and gas stopping time (Laibe 2011)
subroutine, public dust_init(g_rho, g_mom, g_energy)
subroutine, public dust_implicit_update(dtfactor, qdt, qtc, psb, psa)
Implicit solve of psb=psa+dtfactor*dt*F_im(psb)
double precision, dimension(:), allocatable, public dust_density
Internal density of each dust species, dimensionless expression.
Module with geometry-related routines (e.g., divergence, curl)
integer, parameter spherical
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.
integer, parameter unitpar
file handle for IO
logical any_source_split
if any normal source term is added in split fasion
logical use_imex_scheme
whether IMEX in use or not
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer, parameter rpxmin
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
integer ndir
Number of spatial dimensions (components) for vector variables.
integer ixm
the mesh range of a physical block without ghost cells
integer, parameter unitterm
Unit for standard output.
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
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
spatial steps for all dimensions at all levels
logical fix_small_values
fix small values with average or replace methods
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
integer, parameter rpxmax
double precision dtmin
Stop the simulation when the time step becomes smaller than this value.
integer max_blocks
The maximum number of grid blocks in a processor.
This module defines the procedures of a physics module. It contains function pointers for the various...
Module with all the methods that users can customize in AMRVAC.
procedure(phys_dust_get_dt), pointer usr_dust_get_dt
procedure(phys_dust_get_3d_dragforce), pointer usr_get_3d_dragforce
integer nw
Total number of variables.
integer number_species
number of species: each species has different characterictic speeds and should be used accordingly in...