108 type(CoefficientsType),
target :: phi_face
110 class(UTVDSchemeType),
target :: this
111 integer(I4B),
intent(in) :: n
112 integer(I4B),
intent(in) :: m
113 integer(I4B),
intent(in) :: iposnm
115 integer(I4B) :: iup, idn, isympos
117 real(DP),
pointer :: coef_up, coef_dn
118 real(DP),
dimension(3) :: grad_c
119 real(DP),
dimension(3) :: dnm
123 real(DP) :: relative_distance
124 real(DP) :: c_virtual
125 real(DP),
pointer :: min_phi, max_phi
127 isympos = this%dis%con%jas(iposnm)
128 qnm = this%fmi%gwfflowja(iposnm)
131 if (qnm > dzero)
then
136 cl1 = this%dis%con%cl2(isympos)
137 cl2 = this%dis%con%cl1(isympos)
139 coef_up => phi_face%c_m
140 coef_dn => phi_face%c_n
145 cl1 = this%dis%con%cl1(isympos)
146 cl2 = this%dis%con%cl2(isympos)
148 coef_up => phi_face%c_n
149 coef_dn => phi_face%c_m
158 dnm = -this%cached_node_distance(isympos, :)
160 dnm = this%cached_node_distance(isympos, :)
169 if (abs(this%phi(idn) - this%phi(iup)) < dsame)
return
172 grad_c = this%gradient%get(iup)
175 c_virtual = this%phi(idn) - 2.0_dp * (dot_product(grad_c, dnm))
180 min_phi => this%min_max_phi%get_min(iup)
181 max_phi => this%min_max_phi%get_max(iup)
183 if (c_virtual > max_phi)
then
187 if (c_virtual < max(min_phi, dzero))
then
188 c_virtual = max(min_phi, dzero)
192 smooth = (this%phi(iup) - c_virtual) / (this%phi(idn) - this%phi(iup))
195 alimiter = this%limiter(smooth)
198 relative_distance = cl1 / (cl1 + cl2)
199 phi_face%rhs = -relative_distance * alimiter * (this%phi(idn) - this%phi(iup))