Skip to content

Commit

Permalink
Merge pull request #25076 from MengnanLi91/Build_SideAdvectiveFluxPP_…
Browse files Browse the repository at this point in the history
…AdvectiveFluxAux_#24289

Fix parallel test failure in SideAdvectiveFluxIntegral with distributed mesh
  • Loading branch information
loganharbour authored Aug 2, 2023
2 parents d1cf95a + a8cf298 commit 4219f80
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
31 changes: 19 additions & 12 deletions framework/src/postprocessors/SideAdvectiveFluxIntegral.C
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,38 @@ template <bool is_ad>
Real
SideAdvectiveFluxIntegralTempl<is_ad>::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 <bool is_ad>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@
[]

[Outputs]
csv = true
csv = true
[]

0 comments on commit 4219f80

Please sign in to comment.