From f3fa07ac0dd6736f3769fa641bd1f7073f19ad98 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 11 Sep 2024 11:53:12 -0600 Subject: [PATCH] Fix invalid read on GPU. --- src/edge_kernels/VOFAdvectionEdgeAlg.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/edge_kernels/VOFAdvectionEdgeAlg.C b/src/edge_kernels/VOFAdvectionEdgeAlg.C index 510251684..43f526ff5 100644 --- a/src/edge_kernels/VOFAdvectionEdgeAlg.C +++ b/src/edge_kernels/VOFAdvectionEdgeAlg.C @@ -110,6 +110,8 @@ VOFAdvectionEdgeAlg::execute() const auto massVofBalancedFlowRate = fieldMgr.get_field(massVofBalancedFlowRate_); const auto density = fieldMgr.get_field(density_); + const auto density_liquid = density_liquid_; + const auto density_gas = density_gas_; run_algorithm( realm_.bulk_data(), @@ -235,7 +237,7 @@ VOFAdvectionEdgeAlg::execute() smdata.rhs(1) += dlhsfac * (qNp1R - qNp1L); massVofBalancedFlowRate.get(edge, 0) = - dlhsfac * (qNp1R - qNp1L) * (density_liquid_ - density_gas_); + dlhsfac * (qNp1R - qNp1L) * (density_liquid - density_gas); smdata.lhs(0, 0) -= dlhsfac; smdata.lhs(0, 1) += dlhsfac; @@ -287,7 +289,7 @@ VOFAdvectionEdgeAlg::execute() smdata.rhs(1) += compression; massVofBalancedFlowRate.get(edge, 0) += - compression * (density_liquid_ - density_gas_); + compression * (density_liquid - density_gas); // Left node contribution; Lag in iterations except for central 0.5*q term DblType slhsfac = 0.0;