-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathlimiter.f90
More file actions
71 lines (56 loc) · 1.94 KB
/
Copy pathlimiter.f90
File metadata and controls
71 lines (56 loc) · 1.94 KB
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
70
71
subroutine limiter(ul,ur,um,up,gradi,gradj,icell,jcell,iface)
use globalvar
implicit none
!*************************************************************************************
!
! Function: interpolate variables of UL and UR
! on unstructured grids, the purpose of a limiter is to reduce the gradient
! used to reconstruct the left and right state at the face of the control volume.
! The limiter function must be zero at strong discontinuities, in order to obtain
! a first-order upwind scheme which guarantees monotonicity.
!*************************************************************************************
! Arguments:
real*8 :: ul(nmet),ur(nmet),um(nmet),up(nmet),gradi(ndimn,nmet),gradj(ndimn,nmet)
integer :: icell,jcell,iface
! Local variables
integer :: i
real*8 :: temp1,temp2
do i=1,nmet
call Barth_Jespersen(temp1,gradi(:,i),icell,jcell,iface)
ul(i)=um(i)
end do
return
end subroutine limiter
subroutine Barth_Jespersen(resout,grad,icell,jcell,iface)
use globalvar
implicit none
!*************************************************************************************
!
! Function: Bath and Jespersen limiter
!
!*************************************************************************************
!
! Arguments
real*8 :: resout,grad(2)
integer :: icell,jcell,iface
! Local variables
real*8 :: norm(ndimn),delta2
resout = 0.0D0
norm(:) = cellinfo%cetomid(:,iface,icell)
delta2 = grad(1)*norm(1)+grad(2)*norm(2)
return
end subroutine Barth_Jespersen
subroutine MUSCL(ul,ur,um,up)
use globalvar
implicit none
!*************************************************************************************
!
! Function: Function: MUSCL limiter
!
!*************************************************************************************
! Arguments:
real*8 :: ul(nmet),ur(nmet),um(nmet),up(nmet)
ul = um
ur = up
return
end subroutine MUSCL