70 type(CoefficientsType),
target :: phi_face
72 class(UTVDSchemeType),
target :: this
73 integer(I4B),
intent(in) :: n
74 integer(I4B),
intent(in) :: m
75 integer(I4B),
intent(in) :: iposnm
76 real(DP),
intent(in),
dimension(:) :: phi
78 integer(I4B) :: iup, idn, isympos
80 real(DP),
pointer :: coef_up, coef_dn
81 real(DP),
dimension(3) :: grad_c
82 real(DP),
dimension(3) :: dnm
86 real(DP) :: relative_distance
88 real(DP) :: min_phi, max_phi
90 isympos = this%dis%con%jas(iposnm)
91 qnm = this%fmi%gwfflowja(iposnm)
99 cl1 = this%dis%con%cl2(isympos)
100 cl2 = this%dis%con%cl1(isympos)
102 coef_up => phi_face%c_m
103 coef_dn => phi_face%c_n
108 cl1 = this%dis%con%cl1(isympos)
109 cl2 = this%dis%con%cl2(isympos)
111 coef_up => phi_face%c_n
112 coef_dn => phi_face%c_m
121 if (abs(phi(idn) - phi(iup)) < dsame)
return
124 grad_c = this%gradient%get(iup, phi)
127 dnm = node_distance(this%dis, iup, idn)
128 c_virtual = phi(idn) - 2.0_dp * (dot_product(grad_c, dnm))
133 call find_local_extrema(this, iup, phi, min_phi, max_phi)
135 if (c_virtual > max_phi)
then
139 if (c_virtual < max(min_phi, dzero))
then
140 c_virtual = max(min_phi, dzero)
144 smooth = (phi(iup) - c_virtual) / (phi(idn) - phi(iup))
147 alimiter = this%limiter(smooth)
150 relative_distance = cl1 / (cl1 + cl2)
151 phi_face%rhs = -relative_distance * alimiter * (phi(idn) - phi(iup))