-
Notifications
You must be signed in to change notification settings - Fork 5
Add Postprocessor-based Foam boundary conditions #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mattfalcone1997
merged 52 commits into
aurora-multiphysics:main
from
mattfalcone1997:Add-postprocessor-based-FoamBCs
Jun 5, 2026
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
2b4ae44
Create working side average postprocessor
mattfalcone1997 6fa9116
Updated FoamProcessor so it computes with FoamProblem
mattfalcone1997 7fbd7de
Add initial implementation of mass flow rate inlet BC
mattfalcone1997 a21f346
Simplify mass flow rate BC
mattfalcone1997 a99aa41
Add initial makeshift test for mass flow rate BC
mattfalcone1997 fe6e08e
Fix bugs in mass flow rate inlet implementation
mattfalcone1997 03b801c
Remove unnecessary headers
mattfalcone1997 0747b18
Add initial implementation of mapped inlet mass flow rate boundary co…
mattfalcone1997 660baf8
Add initial implementation of the mapped inlet test solver
mattfalcone1997 55ab1e3
Simplify mapped inlet test solver
mattfalcone1997 c31a3dd
Fix basic mapped inlet implementation
mattfalcone1997 a5b8233
Change mapped inlet test solver to use a rank independent test function
mattfalcone1997 38d803c
Add test for mapped inlet mass flow rate BC
mattfalcone1997 1595c22
Fix error in mapped inlet test
mattfalcone1997 1586e43
Use BBox to reduce communication for mapped inlet
mattfalcone1997 cb052b9
Add mapped inlet base class
mattfalcone1997 f62cb3e
Add scalar bulk mapped inlet BC
mattfalcone1997 71179dc
Rename mapped inlet test case
mattfalcone1997 aac3e4d
Correct gold file reference for mass flow rate BC
mattfalcone1997 0d79474
Implement new FoamVariableBCBase class and propagate changes
mattfalcone1997 0e62203
Implement new FoamPostprocessorBCBase class and propagate
mattfalcone1997 692cfaa
Add default creation of Receiver for Postprocessor-based BCs
mattfalcone1997 691b270
Implement different scaling approaches for the scalar bulk mapped inlet
mattfalcone1997 27b0974
Implement fixed value and fixed gradient postprocessor BCs
mattfalcone1997 8d64df2
Clean up code and register postprocessor BC objects
mattfalcone1997 abe149d
Add tests for postprocessor BCs
mattfalcone1997 fc57ab2
Improve mapped inlet tests, in particular the different bounding box …
mattfalcone1997 336a514
Add test for the mapped inlet subtract scaling method
mattfalcone1997 91d5a71
Improve tests and code after review
mattfalcone1997 6b7e9ae
Implement initial fix to edge case where offset is on the cell face
mattfalcone1997 80275f7
Fix bugs causing seg faults
mattfalcone1997 e5ba3e6
Add option of not scaling the bulk when using mapped inlet
mattfalcone1997 ae88262
Add scale factor to mass flow rate BCs
mattfalcone1997 eab6a09
Fix bugs after rebase
mattfalcone1997 5d0377f
Add integrated value foam postprocessor
mattfalcone1997 66d9c34
Fix errors associated with rebase
mattfalcone1997 1a6a302
Remove mapped inlet classes to separate branch
mattfalcone1997 700655a
Remove thermal hydraulics from modules
mattfalcone1997 af9690f
Remove unnecessary verify test from mass flow rate BC
mattfalcone1997 0b06067
Remove unnecessary parameters from BCs
mattfalcone1997 78a8aba
Minor refactor after review
mattfalcone1997 734057c
Move listFromVector to internals namespace
mattfalcone1997 d96ddaf
Remove FoamControlledTimeStepper after rebase
mattfalcone1997 8e327fb
Update after code review
mattfalcone1997 91e2450
Separate flux and neumann boundary conditions
mattfalcone1997 6b6fe3d
Add postprocessor diffusion flux BCs
mattfalcone1997 3673b1f
Add tests for diffusion flux
mattfalcone1997 3518bb2
Update documentation changes with the boundary condition update
mattfalcone1997 7d8fec5
Update postprocessor-based BCs on code review
mattfalcone1997 0e4f71d
Remove whitespace from tests
mattfalcone1997 96f0629
Remove allow_warnings
mattfalcone1997 41d1689
Update tests using np.testing and adding clarifying comments
mattfalcone1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #pragma once | ||
|
|
||
| #include "FoamVariableBCBase.h" | ||
|
|
||
| class FoamDiffusionFluxBC : public FoamVariableBCBase | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
| explicit FoamDiffusionFluxBC(const InputParameters & params); | ||
|
|
||
| // Impose boundary conditions (to be called from FoamProblem class) | ||
| virtual void imposeBoundaryCondition() override; | ||
|
|
||
| protected: | ||
| // diffusivity name for flux condition | ||
| const std::string _diffusivity; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #pragma once | ||
|
|
||
| #include "FoamPostprocessorBCBase.h" | ||
| #include "InputParameters.h" | ||
|
|
||
| class FoamDiffusionFluxPostprocessorBC : public FoamPostprocessorBCBase | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
|
|
||
| FoamDiffusionFluxPostprocessorBC(const InputParameters & params); | ||
|
|
||
| // impose boundary condition | ||
| virtual void imposeBoundaryCondition() override; | ||
|
|
||
| protected: | ||
| // name of diffusivity coefficient used to divide flux | ||
| std::string _diffusivity; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #pragma once | ||
|
|
||
| #include "FoamPostprocessorBCBase.h" | ||
| #include "InputParameters.h" | ||
|
|
||
| class FoamFixedGradientPostprocessorBC : public FoamPostprocessorBCBase | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
|
|
||
| FoamFixedGradientPostprocessorBC(const InputParameters & params); | ||
|
|
||
| // impose boundary condition | ||
| virtual void imposeBoundaryCondition() override; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #pragma once | ||
|
|
||
| #include "FoamPostprocessorBCBase.h" | ||
|
|
||
| class FoamFixedValuePostprocessorBC : public FoamPostprocessorBCBase | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
|
|
||
| FoamFixedValuePostprocessorBC(const InputParameters & params); | ||
|
|
||
| // Impose boundary conditions (to be called from FoamProblem class) | ||
| virtual void imposeBoundaryCondition() override; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #include "FoamPostprocessorBCBase.h" | ||
| #include "InputParameters.h" | ||
| #include "MooseTypes.h" | ||
| #include "PostprocessorInterface.h" | ||
|
|
||
| class FoamMassFlowRateInletBC : public FoamPostprocessorBCBase | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
|
|
||
| FoamMassFlowRateInletBC(const InputParameters & params); | ||
|
|
||
| virtual void imposeBoundaryCondition() override; | ||
|
|
||
| protected: | ||
| const Real _scale_factor; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #pragma once | ||
|
|
||
| #include "FoamBCBase.h" | ||
| #include "InputParameters.h" | ||
| #include "MooseTypes.h" | ||
| #include "PostprocessorInterface.h" | ||
|
|
||
| class FoamPostprocessorBCBase : public FoamBCBase, public PostprocessorInterface | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
|
|
||
| explicit FoamPostprocessorBCBase(const InputParameters & params); | ||
|
|
||
| // returns the moose Postprocessor imposed on OpenFOAM | ||
| VariableName moosePostprocessor() const { return _pp_name; } | ||
|
|
||
| virtual void initialSetup() override {}; | ||
|
|
||
| virtual BCInfoTableRow getInfoRow() const override; | ||
|
|
||
| protected: | ||
| const PostprocessorName _pp_name; | ||
|
|
||
| // Reference to Moose PostprocessorValue used to impose BC | ||
| const PostprocessorValue & _pp_value; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #pragma once | ||
|
|
||
| #include "FoamBCBase.h" | ||
| #include "InputParameters.h" | ||
| #include <functional> | ||
|
|
||
| class FoamVariableBCBase : public FoamBCBase | ||
| { | ||
| public: | ||
| static InputParameters validParams(); | ||
|
|
||
| explicit FoamVariableBCBase(const InputParameters & params); | ||
|
|
||
| // returns the moose AuxVariable imposed on OpenFOAM | ||
| VariableName mooseVariable() const { return _moose_var->get().name(); } | ||
|
|
||
| virtual void initialSetup() override; | ||
|
|
||
| virtual BCInfoTableRow getInfoRow() const override; | ||
|
|
||
| protected: | ||
| // Get the value of the MOOSE variable at an element | ||
| Real variableValueAtElement(const libMesh::Elem & elem) const; | ||
|
|
||
| // Get the data vector of the MOOSE field on a subdomain | ||
| std::vector<Real> getMooseVariableArray(int subdomainId) const; | ||
|
|
||
| // Pointer to Moose variable used to impose BC | ||
| std::optional<std::reference_wrapper<MooseVariableFieldBase>> _moose_var; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.