diff --git a/framework/src/postprocessors/SideAdvectiveFluxIntegral.C b/framework/src/postprocessors/SideAdvectiveFluxIntegral.C index 39cff2250f72..2696b716008e 100644 --- a/framework/src/postprocessors/SideAdvectiveFluxIntegral.C +++ b/framework/src/postprocessors/SideAdvectiveFluxIntegral.C @@ -77,31 +77,38 @@ template Real SideAdvectiveFluxIntegralTempl::computeFaceInfoIntegral(const FaceInfo * const fi) { - using MetaPhysicL::raw_value; - mooseAssert(fi, "We should have a face info in " + name()); mooseAssert(_adv_quant, "We should have an advected quantity in " + name()); const auto state = determineState(); - const auto adv_quant_face = raw_value((*_adv_quant)( - Moose::FaceArg({fi, Moose::FV::LimiterType::Upwind, true, false, nullptr}), state)); - // Get face value for velocity - const auto vel_x = raw_value( - (_vel_x)(Moose::FaceArg({fi, Moose::FV::LimiterType::Upwind, true, false, nullptr}), state)); + const auto vel_x = + (_vel_x)(Moose::FaceArg( + {fi, Moose::FV::LimiterType::CentralDifference, true, false, nullptr}), + state); const auto vel_y = _vel_y - ? raw_value((*_vel_y)( - Moose::FaceArg({fi, Moose::FV::LimiterType::Upwind, true, false, nullptr}), state)) + ? ((*_vel_y)(Moose::FaceArg( + {fi, Moose::FV::LimiterType::CentralDifference, true, false, nullptr}), + state)) : 0; const auto vel_z = _vel_z - ? raw_value((*_vel_z)( - Moose::FaceArg({fi, Moose::FV::LimiterType::Upwind, true, false, nullptr}), state)) + ? ((*_vel_z)(Moose::FaceArg( + {fi, Moose::FV::LimiterType::CentralDifference, true, false, nullptr}), + state)) : 0; - return fi->normal() * adv_quant_face * RealVectorValue(vel_x, vel_y, vel_z); + auto fi_normal = _current_elem == fi->elemPtr() ? fi->normal() : Point(-fi->normal()); + const bool elem_is_upwind = RealVectorValue(vel_x, vel_y, vel_z) * fi_normal >= 0; + + const auto adv_quant_face = (*_adv_quant)( + Moose::FaceArg( + {fi, Moose::FV::LimiterType::CentralDifference, elem_is_upwind, false, nullptr}), + state); + + return fi_normal * adv_quant_face * RealVectorValue(vel_x, vel_y, vel_z); } template diff --git a/test/tests/postprocessors/side_advection_flux_integral/gold/side_advection_flux_integral_fv_out.csv b/test/tests/postprocessors/side_advection_flux_integral/gold/side_advection_flux_integral_fv_out.csv index 41e81f805c34..75cf33faeeba 100644 --- a/test/tests/postprocessors/side_advection_flux_integral/gold/side_advection_flux_integral_fv_out.csv +++ b/test/tests/postprocessors/side_advection_flux_integral/gold/side_advection_flux_integral_fv_out.csv @@ -1,4 +1,4 @@ time,flux_left_exact,flux_right 0,0,0 -0.01,0.029690344730663,0.00022003434004834 -0.02,0.058801645425301,0.00084521638158382 +0.01,-0.016310130018774,0.00011738468226592 +0.02,-0.033656421815896,0.00045782390748827 diff --git a/test/tests/postprocessors/side_advection_flux_integral/side_advection_flux_integral_fv.i b/test/tests/postprocessors/side_advection_flux_integral/side_advection_flux_integral_fv.i index c1b2ebb50d06..c6215a04c8cb 100644 --- a/test/tests/postprocessors/side_advection_flux_integral/side_advection_flux_integral_fv.i +++ b/test/tests/postprocessors/side_advection_flux_integral/side_advection_flux_integral_fv.i @@ -104,5 +104,5 @@ [] [Outputs] - csv = true + csv = true []