-
Notifications
You must be signed in to change notification settings - Fork 8
/
limiterInit.f90
146 lines (119 loc) · 3.99 KB
/
limiterInit.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
!> @file limiterInit.f90
!!
!! Computation of min./max. values around a node.
!
! *****************************************************************************
!
! (c) J. Blazek, CFD Consulting & Analysis, www.cfd-ca.de
! Created February 25, 2014
! Last modification: June 4, 2014
!
! *****************************************************************************
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License
! as published by the Free Software Foundation; either version 2
! of the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program; if not, write to the Free Software
! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
!
! *****************************************************************************
!> Computes minimum and maximum values of density, u, v, and pressure for
!! all direct neighbors "j" of node "i" (min/max_j U_j in Eq. (5.61)).
!! This is used later in Limiter to evaluate the limiter functions.
!!
!! @param umin minimum of U_i and of min_j U_j (U = rho, u, v, p)
!! @param umax maximum of U_i and of max_j U_j (U = rho, u, v, p)
!!
subroutine LimiterInit( umin,umax )
use ModDataTypes
use ModGeometry
use ModNumerics
use ModPhysics
implicit none
! parameters
real(rtype), intent(out) :: umin(:,:), umax(:,:)
! local variables
integer :: i, j, ib, ibn, ie, ibegn, iendn
real(rtype) :: rl, ul, vl, pl, rr, ur, vr, pr
! *****************************************************************************
! initialize with values at node i
do i=1,nndint
umin(1,i) = cv(1,i)
umin(2,i) = cv(2,i)/cv(1,i)
umin(3,i) = cv(3,i)/cv(1,i)
umin(4,i) = dv(1,i)
umax(1,i) = umin(1,i)
umax(2,i) = umin(2,i)
umax(3,i) = umin(3,i)
umax(4,i) = umin(4,i)
enddo
! loop over interior edges
do ie=1,nedint
i = edge(1,ie)
j = edge(2,ie)
! - left state
rl = cv(1,i)
ul = cv(2,i)/rl
vl = cv(3,i)/rl
pl = dv(1,i)
! - right state
rr = cv(1,j)
ur = cv(2,j)/rr
vr = cv(3,j)/rr
pr = dv(1,j)
! - neighbors of node i
umin(1,i) = Min(umin(1,i),rr)
umin(2,i) = Min(umin(2,i),ur)
umin(3,i) = Min(umin(3,i),vr)
umin(4,i) = Min(umin(4,i),pr)
umax(1,i) = Max(umax(1,i),rr)
umax(2,i) = Max(umax(2,i),ur)
umax(3,i) = Max(umax(3,i),vr)
umax(4,i) = Max(umax(4,i),pr)
! - neighbors of node j
umin(1,j) = Min(umin(1,j),rl)
umin(2,j) = Min(umin(2,j),ul)
umin(3,j) = Min(umin(3,j),vl)
umin(4,j) = Min(umin(4,j),pl)
umax(1,j) = Max(umax(1,j),rl)
umax(2,j) = Max(umax(2,j),ul)
umax(3,j) = Max(umax(3,j),vl)
umax(4,j) = Max(umax(4,j),pl)
enddo
! periodic boundaries
ibegn = 1
do ib=1,nsegs
iendn = ibound(2,ib)
if (btype(ib)>=700 .and. btype(ib)<800) then
do ibn=ibegn,iendn
i = bnode(1,ibn)
j = bnode(2,ibn)
umin(1,i) = Min(umin(1,i),umin(1,j))
umin(2,i) = Min(umin(2,i),umin(2,j))
umin(3,i) = Min(umin(3,i),umin(3,j))
umin(4,i) = Min(umin(4,i),umin(4,j))
umax(1,i) = Max(umax(1,i),umax(1,j))
umax(2,i) = Max(umax(2,i),umax(2,j))
umax(3,i) = Max(umax(3,i),umax(3,j))
umax(4,i) = Max(umax(4,i),umax(4,j))
umin(1,j) = umin(1,i)
umin(2,j) = umin(2,i)
umin(3,j) = umin(3,i)
umin(4,j) = umin(4,i)
umax(1,j) = umax(1,i)
umax(2,j) = umax(2,i)
umax(3,j) = umax(3,i)
umax(4,j) = umax(4,i)
enddo
endif
ibegn = iendn + 1
enddo
end subroutine LimiterInit