BUG: isoAdvection not conserving volume of fluid across cyclic boundaries
Summary
isoAdvection not conserving volume of fluid across cyclic boundaries.
Steps to reproduce
-
Execute the
Allrun
script in$FOAM_TUTORIALS/multiphase/interIsoFoam/discInConstantFlowCyclicBCs
-
Extract "Phase-1" volume from log:
grep "Phase-1" log.interIsoFoam | cut -d' ' -f5 > Phase1
-
Run gnuplot in the terminal and show data:
plot "Phase1"
In the figure you will see the Phase-1 content in the domain change when the blob travels through the cyclic boundaries
Possible fixes
Reason for wrong behaviour: IsoAdvection creates a surfaceScalarField dVf which is the Phase-1 volume crosing a face in the time deltaT. dVf on a face uses the isoface information in its UPWIND cell. This also goes for boundary faces where fluid flows OUT of the domain. For boundary faces on which fluid flows INTO the domain isoAdvection does nothing because it assumes that the alpha1 boundary condition specifies how much of the incoming fluid that is Phase-1 and Phase-2, respectively.
Solution: At this point in the code - i.e. after havng set dVf on a downwind boundary face - check if the face is on a cyclic patch. If it is, set the same dVf value on the corresponding face of the coupled patch.
To solve this, I need to do a little digging into the functionality of cyclic related code. I will definitely do this before v2206. But if someone is up for fixing it before then, be my guest.