contactAngle BC in contactAngleCavity tutorial is not working as expected
Summary
In the tutorial case contactAngleCavity, the free surface of a cavity is simulated with the interfaceTrackingFvMesh
library. In the simulation a contact angle of 70° is set at the walls via the file 0.orig/contactAngle
. The contact angle after running the tutorial, however, is ~80°.
Steps to reproduce
- Copy the case
$FOAM_TUTORIALS/incompressible/pimpleFoam/laminar/contactAngleCavity
- Add the following function objects for post-processing (this writes out the first two and last two points on the free surface):
pointHistoryLeft1
{
type pointHistory;
refHistoryPoint (0 0.01 0);
fileName leftPoint.txt;
}
pointHistoryLeft2
{
type pointHistory;
refHistoryPoint (0.00025 0.01 0);
fileName leftPointRef.txt;
}
pointHistoryRight1
{
type pointHistory;
refHistoryPoint (0.01 0.01 0);
fileName rightPoint.txt;
}
pointHistoryRight2
{
type pointHistory;
refHistoryPoint (0.00975 0.01 0);
fileName rightPointRef.txt;
}
- Calculate the angle between the first two and the last two points respectively. This can be done by running the accompanied script
postProcessing.py
inside the simulation directory.
Example case
I attached the tutorial case with slight modifications in the functionObjects
, together with the post-processing script.
Run the case using the Allrun
script.
What is the current bug behaviour?
The contact angle at the specified locations is not equal to the set contact angle.
What is the expected correct behavior?
The contact angle should be 70°, as specified in 0.orig/contactAngle
.
Relevant logs and/or images
The Figure below shows the calculated angle between the first two and the last two mesh points. Note that the angle does not change with a longer run time. The tutorial runs only for 0.2s.
Environment information
OpenFOAM version : v2212
Operating system : ubuntu docker container on windows
Possible fixes
The calculations regarding the contact angle can be found in the file
$FOAM_SRC/dynamicFaMesh/interfaceTrackingFvMesh/freeSurfacePointDisplacement.C
in lines 120-197. In this approach, the vector N
is rotated by the value of contactAngle
at the specified boundaries. The patchMirrorPoints
at this boundary are then moved using (line 225f.):
patchMirrorPoints[patchI] =
peCentres + ((I - 2*N*N)&delta);
Maybe the innermost controlPoints
have to be moved as well to satisfy the contact angle.