Skip to content

Conversation

@mattfalcone1997
Copy link
Collaborator

@mattfalcone1997 mattfalcone1997 commented Oct 10, 2025

Summary

Implements two Postprocessors that create aggregate data directly from OpenFOAM data bypassing UserObject's initialize, execute, finalize methods but still being reported as Postprocessors. Unlike the parent issue, A FoamPostprocessors input syntax block has not been used.

Related Issue

Resolves #75

Checklist

  • Tests have been written for the new/changed behaviour.
  • Documentation/examples have been added/updated for the new changes.
  • Await merge of Variable/BC system (I should have created this from main :(

@mattfalcone1997 mattfalcone1997 force-pushed the implement-foampostprocessor branch from 13a5bf2 to 181c4d9 Compare November 16, 2025 10:08
@mattfalcone1997 mattfalcone1997 force-pushed the implement-foampostprocessor branch from 181c4d9 to efa55c4 Compare January 16, 2026 15:45
@mattfalcone1997 mattfalcone1997 marked this pull request as ready for review January 16, 2026 15:46
}

void
FoamPostprocessorBase::threadJoin(const UserObject & uo)
Copy link
Collaborator

@k-collie k-collie Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[maybe_unused]]

Copy link
Collaborator

@k-collie k-collie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First set of comments to keep you busy

void
FoamPostprocessorBase::threadJoin(const UserObject & uo)
{
(void)uo;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[maybe_unused]]

Comment on lines 28 to 29
Solver module for to test transfers between OpenFOAM and MOOSE. Based on Solid
solver
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update description

foam_scalar = 'rho'
boundary = front
[]
[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since FoamSideAdvectiveFluxIntegral can take multiple boundaries maybe you should add one that does two added together?

boundary = right
component = z
execute_on = TIMESTEP_END
[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - would be good to test one with multiple boundaries

boundary = right
component = x
execute_on = TIMESTEP_END
[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here - multiple boundaries

new Foam::functionObjects::wallShearStress("wallShearStress", _foam_mesh->time(), fo_dict));
}

_function_object->execute();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining with this execute is needed.

}

void
FoamSideIntegratedValue::createFunctionObject()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be cleaner to move the _pp_function_objects check into this method.


static MooseEnum _pp_function_objects("wallHeatFlux wallShearStress");

class FoamSideIntegratedValue : public FoamSidePostprocessor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you think about splitting this class into FoamSideIntegratedFunctionObject and FoamSideIntegratedValue? It feels like this class is doing 2 things - maybe the common functionality could be put into a shared base class or some class you compose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good idea

Comment on lines 29 to 33
// sum over ranks
gatherSum(volume);

// divide by area
_value /= volume;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like how this updates _value computed from FoamSideIntegratedValue::compute, maybe we could design this away.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just trying to match the implementation used in MOOSE, but I agree, I will change it

}
}
// sum over ranks
gatherSum(volume);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call it area instead of volume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement FoamPostprocessor system

2 participants