Skip to content
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

Add phase variable and flux coupling for interFOAM in the FF module #308

Merged
merged 10 commits into from
Jan 24, 2024

Conversation

thesamriel
Copy link
Contributor

@thesamriel thesamriel commented Nov 17, 2023

TODO list:

  • I updated the documentation in docs/

  • I added a changelog entry in changelog-entries/ (create directory if missing)

  • Added coupling variables for Alpha and AlphaGradient, which can be used for coupling of interFoam.

  • Added coupling variable Phi, which couples the face flux on the surface field phi.

Coupling of Alpha:

Coupling of interFoam solvers does not work perfectly. Below screenshots show a very basic test scenario of a laminar flow through a 2-D pipe with the top half being air and the bottom half being incoming water. Gravity is set to 0 to avoid the creation of vortices. The top image always shows the monolithic simulation, the bottom one the coupled simulation.

Time Alpha Pressure
5s Selection_091 Selection_092
9.5s Selection_090 Selection_087
20s Selection_089 Selection_088

Coupling of the phase variable Alpha works with Dirichlet-Neumann coupling, however there are some flow artefacts when the air-water-interface crosses the coupling interface. However, I suspect the problem to be not in the coupling perse, but rather in the interFoam outlet boundary conditions. This is because, the fluid also behaves strange at the outlet of the monolithic version.

Coupling of Phi:

Coupling was tested by adding it to normal FF-coupling. I also used it for better stability in the breaking dam scenario presented at Coupled Conference.
I don't have/know a proper scenario, where coupling of Phi can be demonstrated. Nonetheless, the functionality is there and might be useful to some users.

Test case:

The interfoam pipe test case from above can be found on the interfoam-pipe branch of the tutorials repository.
It also includes the option to additionally couple phi, which will change the results marginally.
Note how the water is held back or reflected at the outlet as well. Figuring out the correct outlet boundary condition might help improve the coupling as well. Found a discussion on this here, but not a proper solution.

@thesamriel thesamriel added the FF Fluid-fluid coupling label Nov 17, 2023
@thesamriel thesamriel changed the title Add phase variable coupling for interFOAM in the FF module Add phase variable and flux coupling for interFOAM in the FF module Nov 20, 2023
@thesamriel thesamriel requested a review from MakisH November 20, 2023 18:48
@MakisH MakisH requested a review from davidscn November 21, 2023 16:16
@MakisH
Copy link
Member

MakisH commented Nov 21, 2023

Thanks for the PR, @thesamriel! Nice to finally have it here!
Could you please also add a testcase in the tutorials?

docs/config.md Show resolved Hide resolved
Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

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

The changes make sense to me, I would just like to try it before merging, which needs a testcase.

Thanks a lot for pushing this, it's still perfectly on time for the release! And thanks a lot for considering volume coupling here.

FF/Alpha.C Show resolved Hide resolved
@thesamriel
Copy link
Contributor Author

I added the test case to the tutorials. See at the bottom of the updated description of the PR here.

Copy link
Member

@davidscn davidscn left a comment

Choose a reason for hiding this comment

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

Not all that much to add from my side. Changes look good and give a couple of more reasons to finally introduce generic readers and writers.

The only thing I don't like is the name of the variables, but from what I understand from the code these are already set by OpenFOAM. Still, it could be helpful to add some code documentation on what these variables are and where to use them. Alpha is a volume fraction for multi-phase flows?

@thesamriel
Copy link
Contributor Author

The only thing I don't like is the name of the variables, but from what I understand from the code these are already set by OpenFOAM. Still, it could be helpful to add some code documentation on what these variables are and where to use them. Alpha is a volume fraction for multi-phase flows?

I'm also not too convinced about the names, these are just the terms used by OpnFOAM. Phi could be renamed to Flux or FaceFlux. Alpha could be renamed to VolumeFraction but I'm not so sure how much I like that.

@MakisH
Copy link
Member

MakisH commented Nov 27, 2023

I added the test case to the tutorials. See at the bottom of the updated description of the PR here.

Please also start a PR, so that I can add comments there (and merge it). It currently seems to only be a branch.

@MakisH MakisH marked this pull request as ready for review January 23, 2024 17:34
@MakisH MakisH marked this pull request as draft January 23, 2024 17:34
@MakisH
Copy link
Member

MakisH commented Jan 23, 2024

The only thing I don't like is the name of the variables, but from what I understand from the code these are already set by OpenFOAM. Still, it could be helpful to add some code documentation on what these variables are and where to use them. Alpha is a volume fraction for multi-phase flows?

I'm also not too convinced about the names, these are just the terms used by OpnFOAM. Phi could be renamed to Flux or FaceFlux. Alpha could be renamed to VolumeFraction but I'm not so sure how much I like that.

This is the first adapter that supports multiphase flows in flow coupling, and these names are clear in the OpenFOAM community. I think we can keep them like this for now, and deprecate them in the future, if a need pops up.

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

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

I updated the README, added a changelog entry, and merged back from develop.
I can run the accompanying test case in < 3 min and get the expected results.

I think this is now ready to merge! 🚀

docs/config.md Show resolved Hide resolved
@MakisH MakisH marked this pull request as ready for review January 23, 2024 17:56
@MakisH MakisH merged commit 1ed787a into develop Jan 24, 2024
8 checks passed
@MakisH MakisH deleted the alpha-coupling branch January 24, 2024 07:42
@MakisH MakisH mentioned this pull request Feb 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FF Fluid-fluid coupling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants