-
Notifications
You must be signed in to change notification settings - Fork 0
/
TVB_Limiter.f90
69 lines (47 loc) · 1.85 KB
/
TVB_Limiter.f90
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
subroutine TVB_Limiter
include 'com.txt'
uhmod = uh
do i = 1,Nx
do j = 1,Ny
change = 0
! x-direction
DeltaUR(:,1) = uh(i + 1,j,1,:) - uh(i,j,1,:)
DeltaUL(:,1) = uh(i,j,1,:) - uh(i - 1,j,1,:)
DeltaU(:,1) = uh(i,j,2,:)
call dimtodim1(DeltaUR,DeltaUR1)
call dimtodim1(DeltaUL,DeltaUL1)
call dimtodim1(DeltaU,DeltaU1)
direction = 1
call minmod
call dim1todim(DeltaUmod1,DeltaUxmod)
do d = 1,NumEq
if (DeltaUxmod(d,1) /= DeltaU(d,1)) then
change(d) = 1
end if
end do
! y-direction
DeltaUR(:,1) = uh(i,j + 1,1,:) - uh(i,j,1,:)
DeltaUL(:,1) = uh(i,j,1,:) - uh(i,j - 1,1,:)
DeltaU(:,1) = uh(i,j,3,:)
call dimtodim1(DeltaUR,DeltaUR1)
call dimtodim1(DeltaUL,DeltaUL1)
call dimtodim1(DeltaU,DeltaU1)
direction = 2
call minmod
call dim1todim(DeltaUmod1,DeltaUymod)
do d = 1,NumEq
if (DeltaUymod(d,1) /= DeltaU(d,1)) then
change(d) = 1
end if
end do
do d = 1,NumEq
if (change(d) == 1) then
uhmod(i,j,4:dimPk,d) = 0
uhmod(i,j,2,d) = DeltaUxmod(d,1)
uhmod(i,j,3,d) = DeltaUymod(d,1)
end if
end do
end do
end do
uh = uhmod
end subroutine TVB_Limiter