-
Notifications
You must be signed in to change notification settings - Fork 1
/
limiter.f
54 lines (54 loc) · 1.5 KB
/
limiter.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
c**********************************************************************
c
c Subroutine: limiter
c
c Object: To evaluate two limiters phi^0 and phi^l from
c theta=dw/dwup
c
c Variables: phi0 Limiter in the least dissipative flux
c phil Limiter in the more dissipative flux
c dw R^{-l}*(U_{j+l}-U_{j})
c dwup R^{-l}*(U_{j+2}-U_{j+l}) if eig<0, or
c R^{-l}*(U_{j}-U_{j-l}) otherwise
c
c**********************************************************************
c
subroutine limiter(dw,dwup,phi0,phil,k)
implicit real*8 (a-h,m-z)
c--------Superbee------------------------------------------------------
phi0=0.0d0
if(dw.eq.0.0d0.and.dwup.gt.0.0d0)phi0=2.0d0
if(dw*dwup.gt.0.0d0)then
theta=dwup/dw
if(theta.le.0.5d0)then
phi0=2.0d0*theta
else if(theta.le.1.0d0.and.theta.gt.0.5d0)then
phi0=1.0d0
else if(theta.le.2.0d0.and.theta.gt.1.0d0)then
phi0=theta
else
phi0=2.0d0
end if
end if
c-------VanLeer--------------------------------------------------------
phi=0.0d0
if(dw.eq.0.0d0.and.dwup.gt.0.0d0)phi=2.0d0
if(dw*dwup.gt.0.0d0)then
theta=dwup/dw
phi=2.0d0*theta/(1.0d0+theta)
end if
c-------MinMod---------------------------------------------------------
phil=0.0d0
if(dw.eq.0.0d0.and.dwup.gt.0.0d0)phil=1.0d0
if(dw*dwup.gt.0.0d0)then
phil=1.0d0
if(dwup/dw.le.1.0d0)then
phil=dwup/dw
end if
end if
c----------------------------------------------------------------------
if(k.eq.1.or.k.eq.4)then
phi0=phi
end if
return
end