24 integer,
intent(in) :: ixi^
l, ix^
l, idims
25 double precision,
intent(in) :: q(ixi^s),qct(ixi^s)
27 double precision,
intent(inout) :: qrc(ixi^s),qlc(ixi^s)
29 double precision,
dimension(ixI^S) :: dqc,d2qc,ldq
30 double precision,
dimension(ixI^S) :: qmin,qmax,tmp
32 integer :: lxc^
l,lxr^
l,lxl^
l
33 integer :: ixl^
l,ixo^
l,ixr^
l,ixol^
l,ixor^
l
34 integer :: hxl^
l,hxc^
l,hxr^
l
35 integer :: kxl^
l,kxc^
l,kxr^
l
37 ixomin^
d=ixmin^
d-
kr(idims,^
d);ixomax^
d=ixmax^
d+
kr(idims,^
d);
38 ixolmin^
d=ixomin^
d-
kr(idims,^
d);ixolmax^
d=ixomax^
d;
39 ixor^
l=ixol^
l+
kr(idims,^
d);
40 ixl^
l=ixo^
l-
kr(idims,^
d);
41 ixr^
l=ixo^
l+
kr(idims,^
d);
43 hxcmin^
d=ixomin^
d;hxcmax^
d=ixmax^
d;
44 hxl^
l=hxc^
l-
kr(idims,^
d);
45 hxr^
l=hxc^
l+
kr(idims,^
d);
47 kxcmin^
d=ixlmin^
d-1; kxcmax^
d=ixrmax^
d;
48 kxr^
l=kxc^
l+
kr(idims,^
d);
50 lxcmin^
d=ixomin^
d-
kr(idims,^
d);lxcmax^
d=ixomax^
d+
kr(idims,^
d);
51 lxl^
l=lxc^
l-
kr(idims,^
d);
52 lxr^
l=lxc^
l+
kr(idims,^
d);
54 dqc(kxc^s)=q(kxr^s)-q(kxc^s)
56 d2qc(kxc^s)=half*(q(lxr^s)-q(lxl^s))
57 where(dqc(lxc^s)*dqc(lxl^s)>zero)
59 qmin(kxc^s)= sign(one,d2qc(lxc^s))
61 ldq(lxc^s)= qmin(lxc^s)*min(dabs(d2qc(lxc^s)),&
62 2.0d0*dabs(dqc(lxl^s)),&
63 2.0d0*dabs(dqc(lxc^s)))
69 qlc(ixol^s)=qlc(ixol^s)+half*dqc(ixol^s)&
70 +(ldq(ixol^s)-ldq(ixor^s))/6.0d0
77 qrc(ixl^s)=max(qmin(ixo^s),min(qmax(ixo^s),qrc(ixl^s)))
78 qlc(ixo^s)=max(qmin(ixo^s),min(qmax(ixo^s),qlc(ixo^s)))
81 where((qrc(ixl^s)-qct(ixo^s))*(qct(ixo^s)-qlc(ixo^s))<=zero)
86 qmax(ixo^s)=(qlc(ixo^s)-qrc(ixl^s))&
87 *(qct(ixo^s)-half*(qlc(ixo^s)+qrc(ixl^s)))
88 qmin(ixo^s)=(qlc(ixo^s)-qrc(ixl^s))**2/6.0d0
92 where(qmax(hxr^s)>qmin(hxr^s))
93 qrc(hxc^s)= 3.0d0*qct(hxr^s)-2.0d0*qlc(hxr^s)
96 where(qmax(hxc^s)<-qmin(hxc^s))
97 qlc(hxc^s)= 3.0d0*qct(hxc^s)-2.0d0*tmp(hxl^s)
114 integer,
intent(in) :: ixi^
l, ix^
l, idims
115 double precision,
intent(in) :: w(ixi^s,1:nw),wct(ixi^s,1:nw)
117 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
119 double precision,
dimension(ixI^S,1:nwflux) :: dwc,d2wc,ldw
120 double precision,
dimension(ixI^S,1:nwflux) :: wmin,wmax,tmp
121 double precision,
dimension(ixI^S) :: aa, ab, ac, ki
123 integer :: lxc^
l,lxl^
l,lxr^
l
124 integer :: ixll^
l,ixl^
l,ixo^
l,ixr^
l,ixrr^
l,ixol^
l,ixor^
l
125 integer :: hxl^
l,hxc^
l,hxr^
l
126 integer :: kxll^
l,kxl^
l,kxc^
l,kxr^
l,kxrr^
l
127 integer :: iw, idimss
129 double precision,
parameter :: betamin=0.75d0, betamax=0.85d0,&
130 zmin=0.25d0, zmax=0.75d0,&
131 eta1=20.0d0,eta2=0.05d0,eps=0.01d0,kappa=0.1d0
133 ixomin^
d=ixmin^
d-
kr(idims,^
d);ixomax^
d=ixmax^
d+
kr(idims,^
d);
134 ixolmin^
d=ixomin^
d-
kr(idims,^
d);ixolmax^
d=ixomax^
d;
135 ixor^
l=ixol^
l+
kr(idims,^
d);
136 ixl^
l=ixo^
l-
kr(idims,^
d);
137 ixr^
l=ixo^
l+
kr(idims,^
d);
139 hxcmin^
d=ixomin^
d;hxcmax^
d=ixmax^
d;
140 hxl^
l=hxc^
l-
kr(idims,^
d);
141 hxr^
l=hxc^
l+
kr(idims,^
d);
143 kxcmin^
d=ixlmin^
d-1; kxcmax^
d=ixrmax^
d;
144 kxr^
l=kxc^
l+
kr(idims,^
d);
146 lxcmin^
d=ixomin^
d-
kr(idims,^
d);lxcmax^
d=ixomax^
d+
kr(idims,^
d);
147 lxl^
l=lxc^
l-
kr(idims,^
d);
148 lxr^
l=lxc^
l+
kr(idims,^
d);
150 dwc(kxc^s,1:nwflux)=w(kxr^s,1:nwflux)-w(kxc^s,1:nwflux)
152 d2wc(lxc^s,1:nwflux)=half*(w(lxr^s,1:nwflux)-w(lxl^s,1:nwflux))
153 where(dwc(lxc^s,1:nwflux)*dwc(lxl^s,1:nwflux)>zero)
155 wmin(lxc^s,1:nwflux)= sign(one,d2wc(lxc^s,1:nwflux))
157 ldw(lxc^s,1:nwflux)= wmin(lxc^s,1:nwflux)*min(dabs(d2wc(lxc^s,1:nwflux)),&
158 2.0d0*dabs(dwc(lxl^s,1:nwflux)),&
159 2.0d0*dabs(dwc(lxc^s,1:nwflux)))
161 ldw(lxc^s,1:nwflux)=zero
165 wlc(ixol^s,1:nwflux)=wlc(ixol^s,1:nwflux)+half*dwc(ixol^s,1:nwflux)&
166 +(ldw(ixol^s,1:nwflux)-ldw(ixor^s,1:nwflux))/6.0d0
167 wrc(ixl^s,1:nwflux)=wlc(ixl^s,1:nwflux)
173 wrc(ixl^s,1:nwflux)=max(wmin(ixo^s,1:nwflux)&
174 ,min(wmax(ixo^s,1:nwflux),wrc(ixl^s,1:nwflux)))
175 wlc(ixo^s,1:nwflux)=max(wmin(ixo^s,1:nwflux)&
176 ,min(wmax(ixo^s,1:nwflux),wlc(ixo^s,1:nwflux)))
179 where((wrc(ixl^s,1:nwflux)-wct(ixo^s,1:nwflux))&
180 *(wct(ixo^s,1:nwflux)-wlc(ixo^s,1:nwflux))<=zero)
181 wrc(ixl^s,1:nwflux)=wct(ixo^s,1:nwflux)
182 wlc(ixo^s,1:nwflux)=wct(ixo^s,1:nwflux)
185 wmax(ixo^s,1:nwflux)=(wlc(ixo^s,1:nwflux)-wrc(ixl^s,1:nwflux))*&
186 (wct(ixo^s,1:nwflux)-half*(wlc(ixo^s,1:nwflux)+wrc(ixl^s,1:nwflux)))
187 wmin(ixo^s,1:nwflux)=(wlc(ixo^s,1:nwflux)-wrc(ixl^s,1:nwflux))**2/6.0d0
188 tmp(hxl^s,1:nwflux)=wrc(hxl^s,1:nwflux)
190 where(wmax(hxr^s,1:nwflux)>wmin(hxr^s,1:nwflux))
191 wrc(hxc^s,1:nwflux)= 3.0d0*wct(hxr^s,1:nwflux)&
192 -2.0d0*wlc(hxr^s,1:nwflux)
195 where(wmax(hxc^s,1:nwflux)<-wmin(hxc^s,1:nwflux))
196 wlc(hxc^s,1:nwflux)= 3.0d0*wct(hxc^s,1:nwflux)&
197 -2.0d0*tmp(hxl^s,1:nwflux)
202 ixrr^
l=ixr^
l+
kr(idims,^
d);
203 kxl^
l=kxc^
l-
kr(idims,^
d);
205 if(any(kappa*aa(kxc^s)>=ab(kxc^s)))
then
207 where(kappa*aa(kxc^s)>=ab(kxc^s).and. dabs(dwc(kxc^s,iw))>smalldouble)
208 wmax(kxc^s,iw) = wct(kxr^s,iw)-2.0d0*wct(kxc^s,iw)+wct(kxl^s,iw)
211 where(wmax(ixr^s,iw)*wmax(ixl^s,iw)<zero .and.&
212 dabs(wct(ixr^s,iw)-wct(ixl^s,iw))&
213 -eps*min(dabs(wct(ixr^s,iw)),dabs(wct(ixl^s,iw)))>zero &
214 .and. kappa*aa(ixo^s)>=ab(ixo^s)&
215 .and. dabs(dwc(ixo^s,iw))>smalldouble)
217 ac(ixo^s)=(wct(ixll^s,iw)-wct(ixrr^s,iw)+4.0d0*dwc(ixo^s,iw))&
218 /(12.0d0*dwc(ixo^s,iw))
219 wmin(ixo^s,iw)=max(zero,min(eta1*(ac(ixo^s)-eta2),one))
224 where(wmin(hxc^s,iw)>zero)
225 wlc(hxc^s,iw) = wlc(hxc^s,iw)*(one-wmin(hxc^s,iw))&
226 +(wct(hxc^s,iw)+half*ldw(hxc^s,iw))*wmin(hxc^s,iw)
228 where(wmin(hxr^s,iw)>zero)
229 wrc(hxc^s,iw) = wrc(hxc^s,iw)*(one-wmin(hxr^s,iw))&
230 +(wct(hxr^s,iw)-half*ldw(hxr^s,iw))*wmin(hxr^s,iw)
239 kxcmin^
d=ixmin^
d-2; kxcmax^
d=ixmax^
d+2;
242 kxl^
l=kxc^
l-
kr(idimss,^
d);
243 kxr^
l=kxc^
l+
kr(idimss,^
d);
244 kxll^
l=kxl^
l-
kr(idimss,^
d);
245 kxrr^
l=kxr^
l+
kr(idimss,^
d);
250 ac(kxc^s) = max(zero,min(one,(betamax-aa(kxc^s))/(betamax-betamin)))
253 where(wct(kxr^s,iw_mom(idimss))<wct(kxl^s,iw_mom(idimss)))
254 aa(kxc^s) = max(ac(kxc^s), min(one,(zmax-ab(kxc^s))/(zmax-zmin)))
258 ixl^
l=ixo^
l-
kr(idimss,^
d);
259 ixr^
l=ixo^
l+
kr(idimss,^
d);
260 ki(ixo^s)=min(ki(ixo^s),aa(ixl^s),aa(ixo^s),aa(ixr^s))
264 where(dabs(ab(ixo^s)-one)>smalldouble)
265 wmax(ixo^s,iw) = (one-ab(ixo^s))*wct(ixo^s,iw)
268 where(dabs(ab(hxc^s)-one)>smalldouble)
269 wlc(hxc^s,iw) = ab(hxc^s)*wlc(hxc^s,iw)+wmax(hxc^s,iw)
272 where(dabs(ab(hxr^s)-one)>smalldouble)
273 wrc(hxc^s,iw) = ab(hxr^s)*wrc(hxc^s,iw)+wmax(hxr^s,iw)
284 integer,
intent(in) :: ixI^L, ixO^L, ixL^L, ixR^L
285 double precision,
intent(in) :: w(ixI^S, nw), d2w(ixG^T, 1:nwflux)
286 double precision,
intent(inout) :: drho(ixG^T), dp(ixG^T)
288 drho(ixo^s) =
phys_gamma*abs(d2w(ixo^s, iw_rho))&
289 /min(w(ixl^s, iw_rho), w(ixr^s, iw_rho))
290 dp(ixo^s) = abs(d2w(ixo^s, iw_e))/min(w(ixl^s, iw_e), w(ixr^s, iw_e))
294 subroutine ppm_flatsh(ixI^L,ixO^L,ixLL^L,ixL^L,ixR^L,ixRR^L,idims,w,drho,dp)
298 integer,
intent(in) :: ixI^L, ixO^L, ixLL^L, ixL^L, ixR^L, ixRR^L
299 integer,
intent(in) :: idims
300 double precision,
intent(in) :: w(ixI^S, nw)
301 double precision,
intent(inout) :: drho(ixI^S), dp(ixI^S)
304 where (abs(w(ixrr^s, iw_e)-w(ixll^s, iw_e))>smalldouble)
305 drho(ixo^s) = abs((w(ixr^s, iw_e)-w(ixl^s, iw_e))&
306 /(w(ixrr^s, iw_e)-w(ixll^s, iw_e)))
312 dp(ixo^s) = abs(w(ixr^s, iw_e)-w(ixl^s, iw_e))&
317 subroutine extremaq(ixI^L,ixO^L,q,nshift,qMax,qMin)
321 integer,
intent(in) :: ixI^L,ixO^L
322 double precision,
intent(in) :: q(ixI^S)
323 integer,
intent(in) :: nshift
325 double precision,
intent(out) :: qMax(ixI^S),qMin(ixI^S)
327 integer :: ixs^L,ixsR^L,ixsL^L,idims,jdims,kdims,ishift,i,j
331 ixsr^l=ixo^l+ishift*
kr(idims,^
d);
332 ixsl^l=ixo^l-ishift*
kr(idims,^
d);
334 qmax(ixo^s)=max(q(ixo^s),q(ixsr^s),q(ixsl^s))
335 qmin(ixo^s)=min(q(ixo^s),q(ixsr^s),q(ixsl^s))
337 qmax(ixo^s)=max(qmax(ixo^s),q(ixsr^s),q(ixsl^s))
338 qmin(ixo^s)=min(qmin(ixo^s),q(ixsr^s),q(ixsl^s))
344 ixs^l=ixo^l+i*ishift*
kr(idims,^
d);
345 ixsr^l=ixs^l+ishift*
kr(jdims,^
d);
346 ixsl^l=ixs^l-ishift*
kr(jdims,^
d);
347 qmax(ixo^s)=max(qmax(ixo^s),q(ixsr^s),q(ixsl^s))
348 qmin(ixo^s)=min(qmin(ixo^s),q(ixsr^s),q(ixsl^s))
356 ixs^l=ixo^l+i*ishift*
kr(idims,^
d);
358 ixs^l=ixo^l+j*ishift*
kr(jdims,^
d);
359 ixsr^l=ixs^l+ishift*
kr(kdims,^
d);
360 ixsl^l=ixs^l-ishift*
kr(kdims,^
d);
361 qmax(ixo^s)=max(qmax(ixo^s),q(ixsr^s),q(ixsl^s))
362 qmin(ixo^s)=min(qmin(ixo^s),q(ixsr^s),q(ixsl^s))
370 subroutine extremaw(ixI^L,ixO^L,w,nshift,wMax,wMin)
373 integer,
intent(in) :: ixI^L,ixO^L
374 double precision,
intent(in) :: w(ixI^S,1:nw)
375 integer,
intent(in) :: nshift
377 double precision,
intent(out) :: wMax(ixI^S,1:nwflux),wMin(ixI^S,1:nwflux)
379 integer :: ixs^L,ixsR^L,ixsL^L,idims,jdims,kdims,ishift,i,j
383 ixsr^l=ixo^l+ishift*
kr(idims,^
d);
384 ixsl^l=ixo^l-ishift*
kr(idims,^
d);
386 wmax(ixo^s,1:nwflux)= &
387 max(w(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
388 wmin(ixo^s,1:nwflux)= &
389 min(w(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
391 wmax(ixo^s,1:nwflux)= &
392 max(wmax(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
393 wmin(ixo^s,1:nwflux)= &
394 min(wmin(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
400 ixs^l=ixo^l+i*ishift*
kr(idims,^
d);
401 ixsr^l=ixs^l+ishift*
kr(jdims,^
d);
402 ixsl^l=ixs^l-ishift*
kr(jdims,^
d);
403 wmax(ixo^s,1:nwflux)= &
404 max(wmax(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
405 wmin(ixo^s,1:nwflux)= &
406 min(wmin(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
414 ixs^l=ixo^l+i*ishift*
kr(idims,^
d);
416 ixs^l=ixo^l+j*ishift*
kr(jdims,^
d);
417 ixsr^l=ixs^l+ishift*
kr(kdims,^
d);
418 ixsl^l=ixs^l-ishift*
kr(kdims,^
d);
419 wmax(ixo^s,1:nwflux)= &
420 max(wmax(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
421 wmin(ixo^s,1:nwflux)= &
422 min(wmin(ixo^s,1:nwflux),w(ixsr^s,1:nwflux),w(ixsl^s,1:nwflux))
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer, dimension(:), allocatable, parameter d
This module defines the procedures of a physics module. It contains function pointers for the various...
double precision phys_gamma
subroutine, public ppmlimitervar(ixIL, ixL, idims, q, qCT, qLC, qRC)
subroutine extremaq(ixIL, ixOL, q, nshift, qMax, qMin)
subroutine extremaw(ixIL, ixOL, w, nshift, wMax, wMin)
subroutine ppm_flatcd(ixIL, ixOL, ixLL, ixRL, w, d2w, drho, dp)
subroutine ppm_flatsh(ixIL, ixOL, ixLLL, ixLL, ixRL, ixRRL, idims, w, drho, dp)
subroutine, public ppmlimiter(ixIL, ixL, idims, w, wCT, wLC, wRC)