@@ -255,21 +255,23 @@ VOFAdvectionEdgeAlg::execute()
255255
256256 const DblType inv_axdx = 1.0 / axdx ;
257257
258- const DblType dlhsfac = - velocity_scale * diffusion_coef * asq * inv_axdx ;
258+ const DblType combined_mask = left_mask * right_mask ;
259259
260- smdata .rhs (0 ) -= dlhsfac * (qNp1R - qNp1L ) +
261- inv_axdx * (1.0 - left_mask ) * (qNp1R - qNp1L );
262- smdata .rhs (1 ) += dlhsfac * (qNp1R - qNp1L ) +
263- inv_axdx * (1.0 - right_mask ) * (qNp1R - qNp1L );
260+ const DblType dlhsfac =
261+ - velocity_scale * diffusion_coef * asq * inv_axdx * combined_mask -
262+ (1.0 - combined_mask ) * asq * inv_axdx * diffusion_coef ;
263+
264+ smdata .rhs (0 ) -= dlhsfac * (qNp1R - qNp1L );
265+ smdata .rhs (1 ) += dlhsfac * (qNp1R - qNp1L );
264266
265267 massVofBalancedFlowRate .get (edge , 0 ) =
266268 dlhsfac * (qNp1R - qNp1L ) * (density_liquid - density_gas );
267269
268- smdata .lhs (0 , 0 ) -= dlhsfac + inv_axdx * ( 1.0 - left_mask ) ;
269- smdata .lhs (0 , 1 ) += dlhsfac + inv_axdx * ( 1.0 - left_mask ) ;
270+ smdata .lhs (0 , 0 ) -= dlhsfac ;
271+ smdata .lhs (0 , 1 ) += dlhsfac ;
270272
271- smdata .lhs (1 , 0 ) += dlhsfac + inv_axdx * ( 1.0 - right_mask ) ;
272- smdata .lhs (1 , 1 ) -= dlhsfac + inv_axdx * ( 1.0 - right_mask ) ;
273+ smdata .lhs (1 , 0 ) += dlhsfac ;
274+ smdata .lhs (1 , 1 ) -= dlhsfac ;
273275
274276 const DblType omegaL =
275277 diffusion_coef * stk ::math ::log ((qNp1L + eps ) / (1.0 - qNp1L + eps ));
0 commit comments