Hi, I’m trying to run a code to simulate the deformation of a liquid droplet under its weight that lies on a surface. I’m having troubles in defining the correct boundary conditions: I’ve tried to clump the bottom of the sphere with the following BC but I’ve obtained nonphysical results (as shown in the figure the deformation undergoes the surface where the sphere lies )
def clamped_boundary(x, on_boundary):
return on_boundary and x[2]<bottom_sphere
bc = DirichletBC(V, Constant((0, 0, 0)), clamped_boundary)
Hi Mat, if I understand well, you are trying to model the problem of some body loaded with its own volume weight, which comes into contact with a rigid plane (which does not deform, only the liquid droplet does). This is so-called contact problem (it is actually a special case - so called Hertz problem, which sometimes has an analytical solution), as (in the deformed configuration), there will be contact between some points of the surface of your deformable sphere and the rigid plane. The problem is, that you do not know in forward, which points will be in contact. This makes the whole problem non-linear, even if you would consider a linear constitutive law for your droplet, small deformation etc.
What you are trying to do in your current code is, that you are imposing Dirichlet boundary conditions - zero valued displacements - on some bottom part of the sphere. This is wrong, because many points will actually change their position, only they cannot go “under” the rigid plane. What you can do, is that you can define some different type of boundary conditions - so-called contact boundary conditions on the part of the boundary you suppose will be in contact. This is basically some special case of Dirichlet boundary conditions. You can find details on the theory of various methods in my masters’ thesis
However, in my opinion, the easiest thing you can do, is to use SNES solver (exactly as dokken suggests), which formulates the contact problem as a variational inequality. This is very easy to set up. I am sending you the link to my github account, where I solved nearly the same problem. But this is only the code for a solver.