31 integer,
intent(in) :: ixI^L,ixO^L,idim
32 double precision,
dimension(ixI^S,1:nw),
intent(in) :: wRC,wLC
33 double precision,
dimension(ixI^S,1:nwflux),
intent(in) :: fLC, fRC
34 integer ,
dimension(ixI^S),
intent(inout) :: patchf
36 integer :: ixOO^D,TxOO^L
40 {
do ixoo^d= ixo^lim^d\}
45 if(abs(patchf(ixoo^d)) == 1 .or. abs(patchf(ixoo^d)) == 4)
Then
46 if(any(frc(ixoo^d,1:nwflux)*flc(ixoo^d,1:nwflux)<-smalldouble))
Then
47 where(abs(patchf(txoo^s))==1)
56 subroutine hd_get_lcd(wLC,wRC,fLC,fRC,cmin,cmax,idim,ixI^L,ixO^L, &
57 whll,Fhll,lambdaCD,patchf)
65 integer,
intent(in) :: ixI^L,ixO^L,idim
66 double precision,
dimension(ixI^S,1:nw),
intent(in) :: wLC,wRC
67 double precision,
dimension(ixI^S,1:nwflux),
intent(in) :: fLC,fRC
68 double precision,
dimension(ixI^S),
intent(in) :: cmax,cmin
69 integer ,
dimension(ixI^S),
intent(inout) :: patchf
70 double precision,
dimension(ixI^S,1:nwflux),
intent(out) :: Fhll,whll
71 double precision,
dimension(ixI^S),
intent(out) :: lambdaCD
73 logical ,
dimension(ixI^S) :: Cond_patchf
74 double precision :: Epsilon
84 cond_patchf(ixo^s)=(abs(patchf(ixo^s))==1)
88 where(cond_patchf(ixo^s))
90 fhll(ixo^s,iw)= (cmax(ixo^s)*flc(ixo^s,iw)-cmin(ixo^s)*frc(ixo^s,iw) &
91 + cmin(ixo^s)*cmax(ixo^s)*(wrc(ixo^s,iw)-wlc(ixo^s,iw)))&
92 /(cmax(ixo^s)-cmin(ixo^s))
94 whll(ixo^s,iw) = (cmax(ixo^s)*wrc(ixo^s,iw)-cmin(ixo^s)*wlc(ixo^s,iw)&
95 +flc(ixo^s,iw)-frc(ixo^s,iw))/(cmax(ixo^s)-cmin(ixo^s))
100 where(cond_patchf(ixo^s))
101 lambdacd(ixo^s)=whll(ixo^s,
mom(idim))/whll(ixo^s,
rho_)
104 {
do ix^db=ixomin^db,ixomax^db\}
105 if(cond_patchf(ix^d))
then
108 if(cmin(ix^d) < zero .and. lambdacd(ix^d)>zero&
109 .and.lambdacd(ix^d)<cmax(ix^d))
then
111 else if(cmax(ix^d) > zero .and. lambdacd(ix^d) < zero&
112 .and.lambdacd(ix^d)>cmin(ix^d))
then
114 else if(lambdacd(ix^d) >= cmax(ix^d) .or. &
115 lambdacd(ix^d) <= cmin(ix^d))
then
116 lambdacd(ix^d) = zero
123 where(patchf(ixo^s)== 3)
124 cond_patchf(ixo^s)=.false.
128 if(any(cond_patchf(ixo^s).and.lambdacd(ixo^s)==zero))
then
131 {
do ix^db=ixomin^db,ixomax^db\}
132 if(lambdacd(ix^d)==zero.and.cond_patchf(ix^d))
then
133 if(-cmin(ix^d)>=cmax(ix^d))
then
145 where(cond_patchf(ixo^s).and. &
146 dabs(lambdacd(ixo^s))/max(cmax(ixo^s),epsilon)< epsilon .and. &
147 dabs(lambdacd(ixo^s))/max(dabs(cmin(ixo^s)),epsilon)< epsilon)
148 lambdacd(ixo^s) = zero
154 subroutine hd_get_wcd(wLC,wRC,whll,fRC,fLC,Fhll,patchf,lambdaCD,cmin,cmax,&
165 integer,
intent(in) :: ixI^L,ixO^L,idim
166 double precision,
dimension(ixI^S,1:nw),
intent(in) :: wRC,wLC
167 double precision,
dimension(ixI^S,1:nwflux),
intent(in):: whll, Fhll
168 double precision,
dimension(ixI^S),
intent(in) :: lambdaCD
169 double precision,
dimension(ixI^S),
intent(in) :: cmax,cmin
170 double precision,
dimension(ixI^S,1:nwflux),
intent(in):: fRC,fLC
171 double precision,
dimension(ixI^S,1:nwflux),
intent(out):: f
172 double precision,
dimension(ixI^S,1:nw) :: wCD,wSub
173 double precision,
dimension(ixI^S,1:nwflux) :: fSub
174 double precision,
dimension(ixI^S) :: vSub,cspeed,pCD
175 integer ,
dimension(ixI^S),
intent(in) :: patchf
177 double precision :: csmls
178 integer :: n, iw, ix^D
181 {
do ix^db=ixomin^db,ixomax^db\}
182 if(patchf(ix^d)==1)
then
183 cspeed(ix^d)=cmax(ix^d)
184 vsub(ix^d)=wrc(ix^d,mom(idim))/wrc(ix^d,rho_)
185 wsub(ix^d,:)=wrc(ix^d,:)
186 fsub(ix^d,:)=frc(ix^d,:)
187 else if(patchf(ix^d)==-1)
then
188 cspeed(ix^d)=cmin(ix^d)
189 vsub(ix^d)=wlc(ix^d,mom(idim))/wlc(ix^d,rho_)
190 wsub(ix^d,:)=wlc(ix^d,:)
191 fsub(ix^d,:)=flc(ix^d,:)
195 {
do ix^db=ixomin^db,ixomax^db\}
196 if(abs(patchf(ix^d))==1)
then
197 csmls=one/(cspeed(ix^d)-lambdacd(ix^d))
198 wcd(ix^d,rho_) = wsub(ix^d,rho_)&
199 *(cspeed(ix^d)-vsub(ix^d))*csmls
202 wcd(ix^d,iw) = wsub(ix^d,iw)*(cspeed(ix^d)-vsub(ix^d))*csmls
209 wcd(ix^d,mom(iw))=(cspeed(ix^d)*wsub(ix^d,mom(iw))-fsub(ix^d,mom(iw)))*csmls
212 wcd(ix^d,mom(iw)) = wcd(ix^d,rho_) * lambdacd(ix^d)
216 pcd(ix^d) = wsub(ix^d,rho_)*(cspeed(ix^d)-vsub(ix^d))&
217 *(lambdacd(ix^d)-vsub(ix^d))&
218 +fsub(ix^d,mom(idim))-wsub(ix^d,mom(idim))*vsub(ix^d)
220 wcd(ix^d,e_) = (cspeed(ix^d)*wsub(ix^d,e_) &
221 -fsub(ix^d,e_)+lambdacd(ix^d)*pcd(ix^d))*csmls
240 if(iw>=dust_rho(1).and.iw<=dust_mom(ndir,dust_n_species))
then
242 f(ix^d,iw)=fhll(ix^d,iw)
245 f(ix^d,iw)=fsub(ix^d,iw)+cspeed(ix^d)*(wcd(ix^d,iw)-wsub(ix^d,iw))
251 f(ix^d,iw)=fsub(ix^d,iw)+cspeed(ix^d)*(wcd(ix^d,iw)-wsub(ix^d,iw))
Module for including dust species, which interact with the gas through a drag force.
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
Hydrodynamics HLLC module.
subroutine, public hd_hllc_init()
subroutine hd_get_wcd(wLC, wRC, whll, fRC, fLC, Fhll, patchf, lambdaCD, cmin, cmax, ixIL, ixOL, idim, f)
subroutine hd_get_lcd(wLC, wRC, fLC, fRC, cmin, cmax, idim, ixIL, ixOL, whll, Fhll, lambdaCD, patchf)
subroutine hd_diffuse_hllcd(ixIL, ixOL, idim, wLC, wRC, fLC, fRC, patchf)
Hydrodynamics physics module.
integer, dimension(:), allocatable, public, protected mom
Indices of the momentum density.
integer, public, protected rho_
Index of the density (in the w array)
procedure(sub_get_wcd), pointer phys_get_wcd
procedure(sub_get_lcd), pointer phys_get_lcd
procedure(sub_diffuse_hllcd), pointer phys_diffuse_hllcd