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 double precision,
intent(in):: x(ixi^s, 1:
ndim)
199 logical,
intent(inout) :: flag(ixi^s,1:nw)
211 integer,
intent(in) :: ixi^
l, ixo^
l
212 double precision,
intent(inout) :: w(ixi^s, 1:nw)
213 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
231 integer,
intent(in) :: ixi^
l, ixo^
l
232 double precision,
intent(inout) :: w(ixi^s, 1:nw)
233 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
239 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
255 integer,
intent(in) :: ixi^
l, ixo^
l, idim
256 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
257 double precision,
intent(inout) :: f(ixi^s, nwflux)
261 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
269 get_vdust(w, ixi^
l, ixo^
l, idim, n)
278 integer,
intent(in) :: ixi^
l, ixo^
l, idim
279 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
280 double precision,
intent(inout) :: f(ixi^s, nwflux)
284 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
292 w(ixo^s,
dust_rho(n)) * get_vdust_prim(w, ixi^
l, ixo^
l, idim, n)
298 function get_vdust(w, ixI^L, ixO^L, idim, n)
result(vdust)
300 integer,
intent(in) :: ixi^
l, ixo^
l, idim, n
301 double precision,
intent(in) :: w(ixi^s, nw)
302 double precision :: vdust(ixo^s)
304 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
310 end function get_vdust
312 function get_vdust_prim(w, ixI^L, ixO^L, idim, n)
result(vdust)
314 integer,
intent(in) :: ixi^
l, ixo^
l, idim, n
315 double precision,
intent(in) :: w(ixi^s, nw)
316 double precision :: vdust(ixo^s)
318 where (w(ixo^s,
dust_rho(n)) > 0.0d0)
319 vdust(ixo^s) = w(ixo^s,
dust_mom(idim, n))
324 end function get_vdust_prim
330 integer,
intent(in) :: ixi^
l, ixo^
l
331 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
332 double precision,
intent(inout) :: w(ixi^s, 1:nw)
335 logical :: flag(ixi^s)
353 subroutine get_3d_dragforce(ixI^L, ixO^L, w, x, fdrag, ptherm, vgas)
356 integer,
intent(in) :: ixi^
l, ixo^
l
357 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
358 double precision,
intent(in) :: w(ixi^s, 1:nw)
359 double precision,
intent(out) :: &
361 double precision,
intent(in) :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
363 double precision,
dimension(ixI^S) :: vt2, deltav, fd, vdust
367 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
374 where(w(ixo^s,
dust_rho(n)) > 0.0d0)
376 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
379 fd(ixo^s) = 0.75d0*w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_)*deltav(ixo^s) &
383 fd(ixo^s) = -fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
387 fdrag(ixo^s, idir, n) = fd(ixo^s)
393 call get_sticking(w, x, ixi^
l, ixo^
l, alpha_t, ptherm)
399 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
400 fd(ixo^s) = (one-alpha_t(ixo^s,n)) * w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_) * &
402 fd(ixo^s) = -fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
406 fdrag(ixo^s, idir,n) = fd(ixo^s)
415 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
417 fd(ixo^s) = -dust_k_lineardrag*deltav(ixo^s)
421 fdrag(ixo^s, idir,n) = fd(ixo^s)
428 fdrag(ixo^s, :, :) = 0.0d0
430 call mpistop(
"=== This dust method has not been implemented===" )
433 end subroutine get_3d_dragforce
440 subroutine get_sticking(w, x, ixI^L, ixO^L, alpha_T, ptherm)
442 integer,
intent(in) :: ixi^
l, ixo^
l
443 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
444 double precision,
intent(in) :: w(ixi^s, 1:nw)
446 double precision,
intent(in) :: ptherm(ixi^s)
447 double precision :: tgas(ixi^s)
451 call get_tdust(w, x, ixi^
l, ixo^
l, alpha_t)
457 alpha_t(ixo^s,n) = 0.35d0 * dexp(-dsqrt((tgas(ixo^s) + &
458 alpha_t(ixo^s,n))/5.0d2))+0.1d0
461 end subroutine get_sticking
471 subroutine get_tdust(w, x, ixI^L, ixO^L, Td)
475 integer,
intent(in) :: ixi^
l, ixo^
l
476 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
477 double precision,
intent(in) :: w(ixi^s, 1:nw)
479 double precision :: g0(ixo^s)
482 select case( trim(dust_temperature_type) )
484 td(ixo^s, :) = dust_temperature
486 select case( trim(dust_species) )
496 call mpistop(
"=== Dust species undetermined===" )
501 g0(ixo^s) = max(x(ixo^s, 1)*
unit_length, smalldouble)
506 call mpistop(
'stellar case not available in this coordinate system')
509 g0(ixo^s) = 2.1d4*(dust_stellar_luminosity/1.0d8)*((3.0857d17/g0(ixo^s))**2)
511 select case( trim(dust_species) )
515 *(g0(ixo^s)**(one/5.8d0))
520 *(g0(ixo^s)**(one/6.0d0))
523 call mpistop(
"=== Dust species undetermined===" )
526 call mpistop(
"=== Dust temperature undetermined===" )
529 end subroutine get_tdust
535 integer,
intent(in) :: ixi^
l, ixo^
l
536 double precision,
intent(in) :: qdt
537 double precision,
intent(in) :: wct(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
538 double precision,
intent(inout) :: w(ixi^s, 1:nw)
539 logical,
intent(in) :: qsourcesplit
540 logical,
intent(inout) :: active
542 double precision :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
550 if (qsourcesplit .eqv. dust_source_split)
then
553 call phys_get_pthermal(wct, x, ixi^
l, ixo^
l, ptherm)
555 vgas(ixo^s,idir)=wct(ixo^s,gas_mom(idir))/wct(ixo^s,gas_rho_)
558 call get_3d_dragforce(ixi^
l, ixo^
l, wct, x, fdrag, ptherm, vgas)
564 if (dust_backreaction)
then
565 w(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + &
566 fdrag(ixo^s, idir, n)
568 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + vgas(ixo^s, idir) &
569 * fdrag(ixo^s, idir, n)
575 fdrag(ixo^s, idir, n)
588 double precision,
intent(in) :: qtc
590 integer :: iigrid, igrid, level
595 do iigrid=1,igridstail; igrid=igrids(iigrid);
598 call dust_terms(ixg^
ll,
ixm^
ll,psa(igrid)%w,psa(igrid)%x)
607 subroutine dust_terms(ixI^L,ixO^L,w,x)
609 integer,
intent(in) :: ixi^
l, ixo^
l
610 double precision,
intent(inout) :: w(ixi^s, 1:nw)
611 double precision,
intent(in) :: x(ixi^s,1:
ndim)
613 double precision :: tmp(ixi^s), vgas(ixi^s, 1:
ndir)
618 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
620 call get_alpha_dust(ixi^
l, ixo^
l, w, vgas,x, alpha)
624 w(ixo^s, gas_mom(idir))=0d0
627 tmp(ixo^s) = alpha(ixo^s, idir,n) * ( &
628 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)) - &
629 w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir, n)))
630 w(ixo^s,
dust_mom(idir, n)) = -tmp(ixo^s)
631 if (dust_backreaction)
then
632 w(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + tmp(ixo^s)
634 if(dust_backreaction_fh)
then
636 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + alpha(ixo^s, idir,n) * &
637 (w(ixo^s,gas_rho_) * (w(ixo^s,
dust_mom(idir,n))**2/w(ixo^s,
dust_rho(n))) - &
638 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
640 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + alpha(ixo^s, idir,n) * ( - &
641 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
644 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + vgas(ixo^s, idir) &
651 end subroutine dust_terms
660 double precision,
intent(in) :: qdt
661 double precision,
intent(in) :: qtc
662 double precision,
intent(in) :: dtfactor
664 integer :: iigrid, igrid
668 do iigrid=1,igridstail; igrid=igrids(iigrid);
671 call dust_advance_implicit_grid(ixg^
ll, ixg^
ll, psa(igrid)%w, psb(igrid)%w, psa(igrid)%x, dtfactor,qdt)
677 subroutine dust_advance_implicit_grid(ixI^L, ixO^L, w, wout, x, dtfactor,qdt)
679 integer,
intent(in) :: ixi^
l, ixo^
l
680 double precision,
intent(in) :: qdt
681 double precision,
intent(in) :: dtfactor
682 double precision,
intent(in) :: w(ixi^s,1:nw)
683 double precision,
intent(in) :: x(ixi^s,1:
ndim)
684 double precision,
intent(out) :: wout(ixi^s,1:nw)
686 integer :: n, m, idir
688 double precision :: tmp(ixi^s),tmp2(ixi^s)
689 double precision :: tmp3(ixi^s)
690 double precision :: vgas(ixi^s, 1:
ndir)
694 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
696 call get_alpha_dust(ixi^
l, ixo^
l, w, vgas, x, alpha)
698 wout(ixo^s,1:nw) = w(ixo^s,1:nw)
704 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
705 (w(ixo^s,gas_rho_) + w(ixo^s,
dust_rho(n)))
709 tmp(ixo^s) = 1d0 + tmp2(ixo^s) * qdt
710 if(dust_implicit_second_order)
then
715 tmp2(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) *&
720 tmp(ixo^s) = tmp(ixo^s) + w(ixo^s,gas_rho_)*tmp2(ixo^s) * (qdt**2)
727 tmp2(ixo^s) = alpha(ixo^s, idir,n) * ( &
728 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)) - &
729 w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir, n))) * qdt
731 if(dust_implicit_second_order)
then
735 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
736 ( w(ixo^s,
dust_rho(n)) * (w(ixo^s,
dust_mom(idir, n)) + w(ixo^s, gas_mom(idir))) - &
740 tmp2(ixo^s) = tmp2(ixo^s) + tmp3(ixo^s) * w(ixo^s,gas_rho_)* (qdt**2)
742 tmp2(ixo^s) = tmp2(ixo^s)/tmp(ixo^s)
746 if (dust_backreaction)
then
750 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
751 (w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir,n)) - &
752 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)))
755 tmp2(ixo^s) = qdt * tmp2(ixo^s)
756 if(dust_implicit_second_order)
then
761 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
762 (w(ixo^s,gas_rho_) * (w(ixo^s,
dust_mom(idir, n)) + w(ixo^s,
dust_mom(idir, m))) - &
767 tmp2(ixo^s) = tmp2(ixo^s) + (qdt**2)*tmp3(ixo^s)* w(ixo^s,gas_rho_)
771 tmp2(ixo^s) = tmp2(ixo^s) / tmp(ixo^s)
772 wout(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + tmp2(ixo^s)
776 if(dust_backreaction_fh)
then
786 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
787 (w(ixo^s,gas_rho_) * tmp3(ixo^s) - &
788 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
791 tmp2(ixo^s) = qdt * tmp2(ixo^s)
792 if(dust_implicit_second_order)
then
796 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
798 (w(ixo^s,
dust_rho(n)) + w(ixo^s,
dust_rho(m)))* w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_))
802 tmp2(ixo^s) = tmp2(ixo^s) + (qdt**2)*tmp3(ixo^s)* w(ixo^s,gas_rho_)
804 wout(ixo^s, gas_e_) = wout(ixo^s, gas_e_) + 0.5d0 * tmp2(ixo^s) / tmp(ixo^s)
808 wout(ixo^s, gas_e_) = wout(ixo^s, gas_e_) + vgas(ixo^s, idir) * tmp2(ixo^s)
815 end subroutine dust_advance_implicit_grid
818 subroutine get_alpha_dust(ixI^L, ixO^L, w, vgas,x, alpha)
821 integer,
intent(in) :: ixi^
l, ixo^
l
822 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
823 double precision,
intent(in) :: w(ixi^s, 1:nw)
824 double precision,
intent(in) :: vgas(ixi^s, 1:
ndir)
825 double precision,
intent(out) :: &
828 double precision :: ptherm(ixi^s)
829 double precision,
dimension(ixI^S) :: vt2, deltav, fd, vdust
833 call phys_get_pthermal(w, x, ixi^
l, ixo^
l, ptherm)
835 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
842 where(w(ixo^s,
dust_rho(n)) > 0.0d0)
849 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
850 fd(ixo^s) = fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
854 alpha(ixo^s, idir, n) = fd(ixo^s)
860 call get_sticking(w, x, ixi^
l, ixo^
l, alpha_t, ptherm)
869 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
870 fd(ixo^s) = fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
874 alpha(ixo^s, idir,n) = fd(ixo^s)
882 fd(ixo^s) = dust_k_lineardrag/(w(ixo^s,gas_rho_)*w(ixo^s,
dust_rho(n)))
886 alpha(ixo^s, idir,n) = fd(ixo^s)
891 alpha(ixo^s, :, :) = 0.0d0
893 call mpistop(
"=== This dust method has not been implemented===" )
896 end subroutine get_alpha_dust
904 integer,
intent(in) :: ixi^
l, ixo^
l
905 double precision,
intent(in) ::
dx^
d, x(ixi^s, 1:
ndim)
906 double precision,
intent(in) :: wprim(ixi^s, 1:nw)
907 double precision,
intent(inout) :: dtnew
909 double precision :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
910 double precision,
dimension(1:dust_n_species):: dtdust
911 double precision,
dimension(ixI^S) :: vt2, deltav, tstop, vdust
912 double precision,
dimension(ixI^S, 1:dust_n_species) :: alpha_t
915 if(dust_dtpar .le. 0)
return
919 ptherm(ixo^s)=wprim(ixo^s,gas_e_)
921 call mpistop(
"adjust dust module for no energy for gas")
924 vgas(ixo^s,idir)=wprim(ixo^s,gas_mom(idir))
930 dtdust(:) = bigdouble
932 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/wprim(ixo^s, gas_rho_)
936 where(wprim(ixo^s,
dust_rho(n))>0.0d0)
937 vdust(ixo^s) = wprim(ixo^s,
dust_mom(idir, n))
938 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
940 (3.0d0*(0.75d0)*dsqrt(vt2(ixo^s) + &
941 deltav(ixo^s)**2)*(wprim(ixo^s,
dust_rho(n)) + &
942 wprim(ixo^s, gas_rho_)))
944 tstop(ixo^s) = bigdouble
947 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
951 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
954 dtdust(:) = bigdouble
956 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/wprim(ixo^s, gas_rho_)
959 call get_sticking(wprim, x, ixi^
l, ixo^
l, alpha_t, ptherm)
963 where(wprim(ixo^s,
dust_rho(n))>0.0d0)
964 vdust(ixo^s) = wprim(ixo^s,
dust_mom(idir, n))
965 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
967 (3.0d0*(one-alpha_t(ixo^s,n))*dsqrt(vt2(ixo^s) + &
968 deltav(ixo^s)**2)*(wprim(ixo^s,
dust_rho(n)) + &
969 wprim(ixo^s, gas_rho_)))
971 tstop(ixo^s) = bigdouble
974 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
978 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
981 dtdust(:) = bigdouble
984 where(wprim(ixo^s,
dust_rho(n))>0.0d0)
985 tstop(ixo^s) = (wprim(ixo^s,
dust_rho(n))*wprim(ixo^s, gas_rho_))/ &
986 (dust_k_lineardrag*(wprim(ixo^s,
dust_rho(n)) + wprim(ixo^s, gas_rho_)))
988 tstop(ixo^s) = bigdouble
991 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
994 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
996 dtdust(:) = bigdouble
998 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
1002 call mpistop(
"=== This dust method has not been implemented===" )
1005 if (dtnew <
dtmin)
then
1006 write(
unitterm,*)
"-------------------------------------"
1007 write(
unitterm,*)
"Warning: found DUST related time step too small! dtnew=", dtnew
1010 write(
unitterm,*)
" dtdust =", dtdust(:)
1012 write(
unitterm,*)
"-------------------------------------"
1022 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1023 double precision,
intent(in) :: w(ixi^s, 1:
nw), x(ixi^s, 1:
ndim)
1025 double precision,
intent(inout),
optional :: cmin(ixi^s,1:
number_species)
1026 double precision :: vdust(ixo^s)
1030 vdust(ixo^s) = get_vdust(w, ixi^
l, ixo^
l, idim, n)
1032 if (
present(cmin))
then
1033 cmin(ixo^s,1) = min(cmin(ixo^s,1), vdust(ixo^s))
1034 cmax(ixo^s,1) = max(cmax(ixo^s,1), vdust(ixo^s))
1036 cmax(ixo^s,1) = max(cmax(ixo^s,1), abs(vdust(ixo^s)))
1045 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1046 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
1047 double precision,
intent(inout) :: cmax(ixi^s)
1048 double precision,
intent(inout),
optional :: cmin(ixi^s)
1049 double precision :: vdust(ixo^s)
1053 vdust(ixo^s) = get_vdust_prim(w, ixi^
l, ixo^
l, idim, n)
1055 if (
present(cmin))
then
1056 cmin(ixo^s) = min(cmin(ixo^s), vdust(ixo^s))
1057 cmax(ixo^s) = max(cmax(ixo^s), vdust(ixo^s))
1059 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)
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_w(ixil, ixol, w, x, flag)
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.
integer ndir
Number of spatial dimensions (components) for vector variables.
integer ixm
the mesh range of a physical block without ghost cells
double precision, dimension(:), allocatable, parameter d
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...