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) :: cl_up, cl_dn
124 real(DP) :: relative_distance
125 real(DP) :: c_virtual
126 real(DP),
pointer :: min_phi, max_phi
128 isympos = this%dis%con%jas(iposnm)
129 qnm = this%fmi%gwfflowja(iposnm)
134 cl1 = this%dis%con%cl1(isympos)
135 cl2 = this%dis%con%cl2(isympos)
137 cl1 = this%dis%con%cl2(isympos)
138 cl2 = this%dis%con%cl1(isympos)
142 if (qnm > dzero)
then
150 coef_up => phi_face%c_m
151 coef_dn => phi_face%c_n
159 coef_up => phi_face%c_n
160 coef_dn => phi_face%c_m
169 dnm = -this%cached_node_distance(isympos, :)
171 dnm = this%cached_node_distance(isympos, :)
180 if (abs(this%phi(idn) - this%phi(iup)) < dsame)
return
183 grad_c = this%gradient%get(iup)
186 c_virtual = this%phi(idn) - 2.0_dp * (dot_product(grad_c, dnm))
191 min_phi => this%min_max_phi%get_min(iup)
192 max_phi => this%min_max_phi%get_max(iup)
194 if (c_virtual > max_phi)
then
198 if (c_virtual < max(min_phi, dzero))
then
199 c_virtual = max(min_phi, dzero)
203 smooth = (this%phi(iup) - c_virtual) / (this%phi(idn) - this%phi(iup))
206 alimiter = this%limiter(smooth)
209 relative_distance = cl_up / (cl_up + cl_dn)
210 phi_face%rhs = -relative_distance * alimiter * (this%phi(idn) - this%phi(iup))