Closed thesamriel closed 8 months ago
Thanks for the PR, @thesamriel! Nice to finally have it here! Could you please also add a testcase in the tutorials?
I added the test case to the tutorials. See at the bottom of the updated description of the PR here.
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.
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.
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 toFlux
orFaceFlux
.Alpha
could be renamed toVolumeFraction
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.
TODO list:
[x] I updated the documentation in
docs/
[x] I added a changelog entry in
changelog-entries/
(create directory if missing)Added coupling variables for
Alpha
andAlphaGradient
, which can be used for coupling ofinterFoam
.Added coupling variable
Phi
, which couples the face flux on the surface fieldphi
.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.
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.