14 integer,
protected :: gas_rho_ = -1
15 integer,
allocatable,
protected :: gas_mom(:)
16 integer,
protected :: gas_e_ = -1
19 integer,
allocatable,
public,
protected ::
dust_rho(:)
22 integer,
allocatable,
public,
protected ::
dust_mom(:, :)
25 double precision,
allocatable,
public ::
dust_size(:)
31 double precision :: dust_dtpar = 0.5d0
34 double precision :: gas_vtherm_factor = 3.0d0
37 double precision :: dust_temperature = -1.0d0
40 double precision :: dust_k_lineardrag = -1.0d0
44 double precision :: dust_stellar_luminosity = -1.0d0
53 logical :: dust_source_split = .false.
56 logical :: dust_backreaction = .true.
59 character(len=std_len),
public,
protected ::
dust_method =
'Kwok'
62 character(len=std_len) :: dust_species =
'graphite'
65 character(len=std_len) :: dust_temperature_type =
'constant'
69 logical :: dust_implicit_second_order = .true.
72 logical :: dust_backreaction_fh = .false.
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)
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)
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)
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)
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)
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))
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)
332 logical :: flag(ixi^s)
354 integer,
intent(in) :: ixI^L, ixO^L
355 double precision,
intent(in) :: x(ixI^S, 1:ndim)
356 double precision,
intent(in) :: w(ixI^S, 1:nw)
357 double precision,
intent(out) :: &
358 fdrag(ixI^S, 1:ndir, 1:dust_n_species)
359 double precision,
intent(in) :: ptherm(ixI^S), vgas(ixI^S, 1:ndir)
361 double precision,
dimension(ixI^S) :: vt2, deltav, fd, vdust
362 double precision :: alpha_T(ixI^S, 1:dust_n_species)
365 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
371 do n = 1, dust_n_species
372 where(w(ixo^s,
dust_rho(n)) > 0.0d0)
374 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
377 fd(ixo^s) = 0.75d0*w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_)*deltav(ixo^s) &
381 fd(ixo^s) = -fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
385 fdrag(ixo^s, idir, n) = fd(ixo^s)
394 do n = 1, dust_n_species
397 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
398 fd(ixo^s) = (one-alpha_t(ixo^s,n)) * w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_) * &
400 fd(ixo^s) = -fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
404 fdrag(ixo^s, idir,n) = fd(ixo^s)
410 do n = 1, dust_n_species
413 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
415 fd(ixo^s) = -dust_k_lineardrag*deltav(ixo^s)
419 fdrag(ixo^s, idir,n) = fd(ixo^s)
426 fdrag(ixo^s, :, :) = 0.0d0
428 call mpistop(
"=== This dust method has not been implemented===" )
439 integer,
intent(in) :: ixI^L, ixO^L
440 double precision,
intent(in) :: x(ixI^S, 1:ndim)
441 double precision,
intent(in) :: w(ixI^S, 1:nw)
442 double precision,
intent(out) :: alpha_T(ixI^S, 1:dust_n_species)
443 double precision,
intent(in) :: ptherm(ixI^S)
444 double precision :: Tgas(ixI^S)
448 call get_tdust(w, x, ixi^l, ixo^l, alpha_t)
453 do n = 1, dust_n_species
454 alpha_t(ixo^s,n) = 0.35d0 * dexp(-dsqrt((tgas(ixo^s) + &
455 alpha_t(ixo^s,n))/5.0d2))+0.1d0
471 integer,
intent(in) :: ixI^L, ixO^L
472 double precision,
intent(in) :: x(ixI^S, 1:ndim)
473 double precision,
intent(in) :: w(ixI^S, 1:nw)
474 double precision,
intent(out) :: Td(ixI^S, 1:dust_n_species)
475 double precision :: G0(ixO^S)
478 select case( trim(dust_temperature_type) )
480 td(ixo^s, :) = dust_temperature
482 select case( trim(dust_species) )
484 do n = 1, dust_n_species
488 do n = 1, dust_n_species
492 call mpistop(
"=== Dust species undetermined===" )
497 g0(ixo^s) = max(x(ixo^s, 1)*
unit_length, smalldouble)
502 call mpistop(
'stellar case not available in this coordinate system')
505 g0(ixo^s) = 2.1d4*(dust_stellar_luminosity/1.0d8)*((3.0857d17/g0(ixo^s))**2)
507 select case( trim(dust_species) )
509 do n = 1, dust_n_species
511 *(g0(ixo^s)**(one/5.8d0))
514 do n = 1, dust_n_species
516 *(g0(ixo^s)**(one/6.0d0))
519 call mpistop(
"=== Dust species undetermined===" )
522 call mpistop(
"=== Dust temperature undetermined===" )
531 integer,
intent(in) :: ixi^
l, ixo^
l
532 double precision,
intent(in) :: qdt
533 double precision,
intent(in) :: wct(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
534 double precision,
intent(inout) :: w(ixi^s, 1:nw)
535 logical,
intent(in) :: qsourcesplit
536 logical,
intent(inout) :: active
538 double precision :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
546 if (qsourcesplit .eqv. dust_source_split)
then
549 call phys_get_pthermal(wct, x, ixi^
l, ixo^
l, ptherm)
551 vgas(ixo^s,idir)=wct(ixo^s,gas_mom(idir))/wct(ixo^s,gas_rho_)
560 if (dust_backreaction)
then
561 w(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + &
562 fdrag(ixo^s, idir, n)
564 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + vgas(ixo^s, idir) &
565 * fdrag(ixo^s, idir, n)
571 fdrag(ixo^s, idir, n)
584 double precision,
intent(in) :: qtc
586 integer :: iigrid, igrid, level
591 do iigrid=1,igridstail; igrid=igrids(iigrid);
605 integer,
intent(in) :: ixI^L, ixO^L
606 double precision,
intent(inout) :: w(ixI^S, 1:nw)
607 double precision,
intent(in) :: x(ixI^S,1:ndim)
609 double precision :: tmp(ixI^S), vgas(ixI^S, 1:ndir)
610 double precision :: alpha(ixI^S, 1:ndir, 1:dust_n_species)
614 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
620 w(ixo^s, gas_mom(idir))=0d0
621 do n = 1, dust_n_species
623 tmp(ixo^s) = alpha(ixo^s, idir,n) * ( &
624 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)) - &
625 w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir, n)))
626 w(ixo^s,
dust_mom(idir, n)) = -tmp(ixo^s)
627 if (dust_backreaction)
then
628 w(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + tmp(ixo^s)
630 if(dust_backreaction_fh)
then
632 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + alpha(ixo^s, idir,n) * &
633 (w(ixo^s,gas_rho_) * (w(ixo^s,
dust_mom(idir,n))**2/w(ixo^s,
dust_rho(n))) - &
634 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
636 w(ixo^s, gas_e_) = w(ixo^s, gas_e_) + alpha(ixo^s, idir,n) * ( - &
637 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_) + vgas(ixo^s, idir) &
656 double precision,
intent(in) :: qdt
657 double precision,
intent(in) :: qtc
658 double precision,
intent(in) :: dtfactor
660 integer :: iigrid, igrid
664 do iigrid=1,igridstail; igrid=igrids(iigrid);
675 integer,
intent(in) :: ixI^L, ixO^L
676 double precision,
intent(in) :: qdt
677 double precision,
intent(in) :: dtfactor
678 double precision,
intent(in) :: w(ixI^S,1:nw)
679 double precision,
intent(in) :: x(ixI^S,1:ndim)
680 double precision,
intent(out) :: wout(ixI^S,1:nw)
682 integer :: n, m, idir
683 double precision :: alpha(ixI^S, 1:ndir, 1:dust_n_species)
684 double precision :: tmp(ixI^S),tmp2(ixI^S)
685 double precision :: tmp3(ixI^S)
686 double precision :: vgas(ixI^S, 1:ndir)
690 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
694 wout(ixo^s,1:nw) = w(ixo^s,1:nw)
699 do n = 1, dust_n_species
700 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
701 (w(ixo^s,gas_rho_) + w(ixo^s,
dust_rho(n)))
705 tmp(ixo^s) = 1d0 + tmp2(ixo^s) * qdt
706 if(dust_implicit_second_order)
then
709 do n = 1, dust_n_species
710 do m = n+1, dust_n_species
711 tmp2(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) *&
716 tmp(ixo^s) = tmp(ixo^s) + w(ixo^s,gas_rho_)*tmp2(ixo^s) * (qdt**2)
721 do n = 1, dust_n_species
723 tmp2(ixo^s) = alpha(ixo^s, idir,n) * ( &
724 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)) - &
725 w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir, n))) * qdt
727 if(dust_implicit_second_order)
then
730 do m = n+1, dust_n_species
731 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
732 ( w(ixo^s,
dust_rho(n)) * (w(ixo^s,
dust_mom(idir, n)) + w(ixo^s, gas_mom(idir))) - &
736 tmp2(ixo^s) = tmp2(ixo^s) + tmp3(ixo^s) * w(ixo^s,gas_rho_)* (qdt**2)
738 tmp2(ixo^s) = tmp2(ixo^s)/tmp(ixo^s)
742 if (dust_backreaction)
then
745 do n = 1, dust_n_species
746 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
747 (w(ixo^s,gas_rho_) * w(ixo^s,
dust_mom(idir,n)) - &
748 w(ixo^s,
dust_rho(n)) * w(ixo^s, gas_mom(idir)))
751 tmp2(ixo^s) = qdt * tmp2(ixo^s)
752 if(dust_implicit_second_order)
then
755 do n = 1, dust_n_species
756 do m = n+1, dust_n_species
757 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
758 (w(ixo^s,gas_rho_) * (w(ixo^s,
dust_mom(idir, n)) + w(ixo^s,
dust_mom(idir, m))) - &
763 tmp2(ixo^s) = tmp2(ixo^s) + (qdt**2)*tmp3(ixo^s)* w(ixo^s,gas_rho_)
767 tmp2(ixo^s) = tmp2(ixo^s) / tmp(ixo^s)
768 wout(ixo^s, gas_mom(idir)) = w(ixo^s, gas_mom(idir)) + tmp2(ixo^s)
772 if(dust_backreaction_fh)
then
775 do n = 1, dust_n_species
782 tmp2(ixo^s) = tmp2(ixo^s) + alpha(ixo^s, idir,n) * &
783 (w(ixo^s,gas_rho_) * tmp3(ixo^s) - &
784 w(ixo^s,
dust_rho(n)) * (w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_)))
787 tmp2(ixo^s) = qdt * tmp2(ixo^s)
788 if(dust_implicit_second_order)
then
790 do n = 1, dust_n_species
791 do m = n+1, dust_n_species
792 tmp3(ixo^s) = tmp3(ixo^s) + alpha(ixo^s, idir,n) * alpha(ixo^s, idir,m) * &
794 (w(ixo^s,
dust_rho(n)) + w(ixo^s,
dust_rho(m)))* w(ixo^s, gas_mom(idir))**2/w(ixo^s,gas_rho_))
798 tmp2(ixo^s) = tmp2(ixo^s) + (qdt**2)*tmp3(ixo^s)* w(ixo^s,gas_rho_)
800 wout(ixo^s, gas_e_) = wout(ixo^s, gas_e_) + 0.5d0 * tmp2(ixo^s) / tmp(ixo^s)
804 wout(ixo^s, gas_e_) = wout(ixo^s, gas_e_) + vgas(ixo^s, idir) * tmp2(ixo^s)
817 integer,
intent(in) :: ixI^L, ixO^L
818 double precision,
intent(in) :: x(ixI^S, 1:ndim)
819 double precision,
intent(in) :: w(ixI^S, 1:nw)
820 double precision,
intent(in) :: vgas(ixI^S, 1:ndir)
821 double precision,
intent(out) :: &
822 alpha(ixI^S, 1:ndir, 1:dust_n_species)
824 double precision :: ptherm(ixI^S)
825 double precision,
dimension(ixI^S) :: vt2, deltav, fd, vdust
826 double precision :: alpha_T(ixI^S, 1:dust_n_species)
829 call phys_get_pthermal(w, x, ixi^l, ixo^l, ptherm)
831 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
837 do n = 1, dust_n_species
838 where(w(ixo^s,
dust_rho(n)) > 0.0d0)
845 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
846 fd(ixo^s) = fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
850 alpha(ixo^s, idir, n) = fd(ixo^s)
859 do n = 1, dust_n_species
865 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
866 fd(ixo^s) = fd(ixo^s)*0.75d0*dsqrt(vt2(ixo^s) + deltav(ixo^s)**2)
870 alpha(ixo^s, idir,n) = fd(ixo^s)
876 do n = 1, dust_n_species
878 fd(ixo^s) = dust_k_lineardrag/(w(ixo^s,gas_rho_)*w(ixo^s,
dust_rho(n)))
882 alpha(ixo^s, idir,n) = fd(ixo^s)
887 alpha(ixo^s, :, :) = 0.0d0
889 call mpistop(
"=== This dust method has not been implemented===" )
900 integer,
intent(in) :: ixi^
l, ixo^
l
901 double precision,
intent(in) ::
dx^
d, x(ixi^s, 1:
ndim)
902 double precision,
intent(in) :: w(ixi^s, 1:nw)
903 double precision,
intent(inout) :: dtnew
905 double precision :: ptherm(ixi^s), vgas(ixi^s, 1:
ndir)
906 double precision,
dimension(1:dust_n_species):: dtdust
907 double precision,
dimension(ixI^S) :: vt2, deltav, tstop, vdust
908 double precision,
dimension(ixI^S, 1:dust_n_species) :: alpha_t
911 if(dust_dtpar .le. 0)
return
913 call phys_get_pthermal(w, x, ixi^
l, ixo^
l, ptherm)
915 vgas(ixo^s,idir)=w(ixo^s,gas_mom(idir))/w(ixo^s,gas_rho_)
921 dtdust(:) = bigdouble
923 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
929 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
931 (3.0d0*(0.75d0)*dsqrt(vt2(ixo^s) + &
932 deltav(ixo^s)**2)*(w(ixo^s,
dust_rho(n)) + &
935 tstop(ixo^s) = bigdouble
938 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
942 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
945 dtdust(:) = bigdouble
947 vt2(ixo^s) = gas_vtherm_factor*ptherm(ixo^s)/w(ixo^s, gas_rho_)
956 deltav(ixo^s) = vgas(ixo^s, idir)-vdust(ixo^s)
958 (3.0d0*(one-alpha_t(ixo^s,n))*dsqrt(vt2(ixo^s) + &
959 deltav(ixo^s)**2)*(w(ixo^s,
dust_rho(n)) + &
962 tstop(ixo^s) = bigdouble
965 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
969 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
972 dtdust(:) = bigdouble
976 tstop(ixo^s) = (w(ixo^s,
dust_rho(n))*w(ixo^s, gas_rho_))/ &
977 (dust_k_lineardrag*(w(ixo^s,
dust_rho(n)) + w(ixo^s, gas_rho_)))
979 tstop(ixo^s) = bigdouble
982 dtdust(n) = min(minval(tstop(ixo^s)), dtdust(n))
985 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
987 dtdust(:) = bigdouble
989 dtnew = min(minval(dust_dtpar*dtdust(:)), dtnew)
993 call mpistop(
"=== This dust method has not been implemented===" )
996 if (dtnew <
dtmin)
then
997 write(
unitterm,*)
"-------------------------------------"
998 write(
unitterm,*)
"Warning: found DUST related time step too small! dtnew=", dtnew
1001 write(
unitterm,*)
" dtdust =", dtdust(:)
1003 write(
unitterm,*)
"-------------------------------------"
1013 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1014 double precision,
intent(in) :: w(ixi^s, 1:
nw), x(ixi^s, 1:
ndim)
1016 double precision,
intent(inout),
optional :: cmin(ixi^s,1:
number_species)
1017 double precision :: vdust(ixo^s)
1021 vdust(ixo^s) =
get_vdust(w, ixi^
l, ixo^
l, idim, n)
1023 if (
present(cmin))
then
1024 cmin(ixo^s,1) = min(cmin(ixo^s,1), vdust(ixo^s))
1025 cmax(ixo^s,1) = max(cmax(ixo^s,1), vdust(ixo^s))
1027 cmax(ixo^s,1) = max(cmax(ixo^s,1), abs(vdust(ixo^s)))
1036 integer,
intent(in) :: ixi^
l, ixo^
l, idim
1037 double precision,
intent(in) :: w(ixi^s, 1:nw), x(ixi^s, 1:
ndim)
1038 double precision,
intent(inout) :: cmax(ixi^s)
1039 double precision,
intent(inout),
optional :: cmin(ixi^s)
1040 double precision :: vdust(ixo^s)
1046 if (
present(cmin))
then
1047 cmin(ixo^s) = min(cmin(ixo^s), vdust(ixo^s))
1048 cmax(ixo^s) = max(cmax(ixo^s), vdust(ixo^s))
1050 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 function, dimension(ixo^s) get_vdust_prim(w, ixIL, ixOL, idim, n)
double precision, public, protected dust_min_rho
Minimum dust density as used when dust_small_to_zero=T.
subroutine, public dust_check_w(ixIL, ixOL, w, flag)
subroutine dust_advance_implicit_grid(ixIL, ixOL, w, wout, x, dtfactor, qdt)
subroutine, public dust_get_flux(w, x, ixIL, ixOL, idim, f)
subroutine get_3d_dragforce(ixIL, ixOL, w, x, fdrag, ptherm, vgas)
subroutine, public dust_implicit_update(dtfactor, qdt, qtC, psb, psa)
Implicit solve of psb=psa+dtfactor*dt*F_im(psb)
subroutine, public dust_get_dt(w, ixIL, ixOL, dtnew, dxD, x)
Get dt related to dust and gas stopping time (Laibe 2011)
double precision, dimension(:), allocatable, public dust_size
Size of each dust species, dimensionless expression.
subroutine get_tdust(w, x, ixIL, ixOL, Td)
Returns dust temperature (in K), either as constant or based on equ. 5.41, 5.42 and 5....
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 dust_read_params(files)
Read dust_list module parameters from a file.
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
subroutine, public set_dusttozero(ixIL, ixOL, w, x)
subroutine, public dust_to_primitive(ixIL, ixOL, w, x)
subroutine get_sticking(w, x, ixIL, ixOL, alpha_T, ptherm)
Get sticking coefficient alpha_T (always between 0 and 1)
integer, dimension(:, :), allocatable, public, protected dust_mom
Indices of the dust momentum densities.
subroutine, public dust_get_cmax(w, x, ixIL, ixOL, idim, cmax, cmin)
logical, public, protected dust_small_to_zero
Set small dust densities to zero to avoid numerical problems.
integer, public, protected dust_n_species
The number of dust species.
subroutine get_alpha_dust(ixIL, ixOL, w, vgas, x, alpha)
integer, dimension(:), allocatable, public, protected dust_rho
Indices of the dust densities.
double precision function, dimension(ixo^s) get_vdust(w, ixIL, ixOL, idim, n)
subroutine, public dust_get_flux_prim(w, x, ixIL, ixOL, idim, f)
subroutine, public dust_check_params()
subroutine, public dust_evaluate_implicit(qtC, psa)
inplace update of psa==>F_im(psa)
subroutine dust_terms(ixIL, ixOL, w, x)
subroutine, public dust_init(g_rho, g_mom, g_energy)
subroutine, public dust_get_cmax_prim(w, x, ixIL, ixOL, idim, cmax, cmin)
double precision, dimension(:), allocatable, public dust_density
Internal density of each dust species, dimensionless expression.
subroutine, public dust_to_conserved(ixIL, ixOL, w, x)
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, 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
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.
double precision, dimension(ndim) dxlevel
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...