diff --git a/src/common/m_phase_change.fpp b/src/common/m_phase_change.fpp index 83b4801d3b..df0e4cf656 100644 --- a/src/common/m_phase_change.fpp +++ b/src/common/m_phase_change.fpp @@ -579,7 +579,8 @@ contains InvJac = InvJac/(Jac(1, 1)*Jac(2, 2) - Jac(1, 2)*Jac(2, 1)) ! calculating correction array for Newton's method - DeltamP = -1.0_wp*(matmul(InvJac, R2D)) + DeltamP(1) = -1.0_wp*(InvJac(1, 1)*R2D(1) + InvJac(1, 2)*R2D(2)) + DeltamP(2) = -1.0_wp*(InvJac(2, 1)*R2D(1) + InvJac(2, 2)*R2D(2)) ! updating two reacting 'masses'. Recall that inert 'masses' do not change during the phase change ! liquid @@ -716,7 +717,7 @@ contains ! underrelaxation factor Om = 1.0e-3_wp - do while ((abs(FT) > ptgalpha_eps) .or. (ns == 0)) + do ! increasing counter ns = ns + 1 @@ -737,6 +738,7 @@ contains ! updating saturation temperature TSat = TSat - Om*FT/dFdT + if (abs(FT) <= ptgalpha_eps) exit end do end if diff --git a/src/simulation/m_viscous.fpp b/src/simulation/m_viscous.fpp index 6b1d9dbdf2..9c6e4ad4d8 100644 --- a/src/simulation/m_viscous.fpp +++ b/src/simulation/m_viscous.fpp @@ -102,7 +102,7 @@ contains #:if not MFC_CASE_OPTIMIZATION or num_dims > 1 if (shear_stress) then ! Shear stresses - $:GPU_PARALLEL_LOOP(collapse=3, private='[i,j,k,l,rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum ,alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') + $:GPU_PARALLEL_LOOP(collapse=3, private='[i,j,k,l,q,rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum, alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') do l = is3_viscous%beg, is3_viscous%end do k = -1, 1 do j = is1_viscous%beg, is1_viscous%end @@ -212,7 +212,7 @@ contains #:if not MFC_CASE_OPTIMIZATION or num_dims > 1 if (bulk_stress) then ! Bulk stresses - $:GPU_PARALLEL_LOOP(collapse=3, private='[i,j,k,l,rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum ,alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') + $:GPU_PARALLEL_LOOP(collapse=3, private='[i,j,k,l,q,rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum, alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') do l = is3_viscous%beg, is3_viscous%end do k = -1, 1 do j = is1_viscous%beg, is1_viscous%end @@ -319,7 +319,7 @@ contains #:if not MFC_CASE_OPTIMIZATION or num_dims > 2 if (shear_stress) then ! Shear stresses - $:GPU_PARALLEL_LOOP(collapse=3, private='[alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') + $:GPU_PARALLEL_LOOP(collapse=3, private='[i,j,k,l,q,rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum, alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') do l = is3_viscous%beg, is3_viscous%end do k = -1, 1 do j = is1_viscous%beg, is1_viscous%end @@ -428,7 +428,7 @@ contains end if if (bulk_stress) then ! Bulk stresses - $:GPU_PARALLEL_LOOP(collapse=3, private='[alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') + $:GPU_PARALLEL_LOOP(collapse=3, private='[i,j,k,l,q,rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum, alpha_visc, alpha_rho_visc, Re_visc, tau_Re]') do l = is3_viscous%beg, is3_viscous%end do k = -1, 1 do j = is1_viscous%beg, is1_viscous%end @@ -1564,12 +1564,12 @@ contains real(wp) :: divergence integer :: l, q ! iterators - ! zero the viscous stress, collection of velocity diriviatives, and spacial finite differences + ! zero the viscous stress, collection of velocity derivatives, and spatial finite differences viscous_stress_tensor = 0._wp velocity_gradient_tensor = 0._wp dx = 0._wp - ! get the change in x used in the finite difference equaiont + ! get the change in x used in the finite difference equation dx(1) = 0.5_wp*(x_cc(i + 1) - x_cc(i - 1)) dx(2) = 0.5_wp*(y_cc(j + 1) - y_cc(j - 1)) if (num_dims == 3) then