How to formulate Dirichlet boundary problem with traction free surfaces on the rest of the boundaries?

I have a BVP where I have to solve for compressing a solid . I created a solver to do this. If I give Zero boundary condition on left and bottom boundary and just run the solver , there should be no deformation. But the material deforms any way. How can we create a Dirichlet Problem with traction free boundaries on the rest of the boundary?

def eps(v):
   return df.sym(df.grad(v))
def sigmaE(v, lmbda, mu):
   sigE = lmbda * df.tr(eps(v)) * df.Identity(2) + 2.0 * mu * eps(v)
   return sigE
def resolution_1(V, lmbda, mu,bcs):
   # Problem defintion
   du = df.TrialFunction(V)
   u_ = df.TestFunction(V)
   a = df.inner(sigmaE(du, lmbda, mu), eps(u_)) * df.dx
   T = df.Constant((0.0,0.0))
   l = df.inner(T, u_)*df.ds
   
   # problem solving
   u = df.Function(V, name="Displacement")
   df.solve(a == l, u, bcs)
   
   return u`

there should be no deformation. But the material deforms any way.

I can’t reproduce the issue. The following gives me a zero displacement field:

# Define mesh, function space, BCs, constants for runnable example:
import dolfin as df
N = 16
mesh = df.UnitSquareMesh(N,N)
V = df.VectorFunctionSpace(mesh,"CG",1)
bcs = [df.DirichletBC(V,df.Constant((0,0)),"x[0]<DOLFIN_EPS"), # (left side)
       df.DirichletBC(V,df.Constant((0,0)),"x[1]<DOLFIN_EPS")] # (bottom side)
lmbda = df.Constant(1)
mu = df.Constant(1)

####### From post #######

def eps(v):
   return df.sym(df.grad(v))
def sigmaE(v, lmbda, mu):
   sigE = lmbda * df.tr(eps(v)) * df.Identity(2) + 2.0 * mu * eps(v)
   return sigE
def resolution_1(V, lmbda, mu,bcs):
   # Problem defintion
   du = df.TrialFunction(V)
   u_ = df.TestFunction(V)
   a = df.inner(sigmaE(du, lmbda, mu), eps(u_)) * df.dx
   T = df.Constant((0.0,0.0))
   l = df.inner(T, u_)*df.ds
   
   # problem solving
   u = df.Function(V, name="Displacement")
   df.solve(a == l, u, bcs)
   
   return u

#########################

# Verify that displacement solution is zero:
u = resolution_1(V, lmbda, mu,bcs)
import math
print(math.sqrt(df.assemble(df.dot(u,u)*df.dx)))

How can we create a Dirichlet Problem with traction free boundaries on the rest of the boundary?

Traction-free boundary conditions on non-Dirichlet boundaries are already built into the variational form, by omitting the boundary terms that one would obtain when integrating by parts to go from the strong problem (Navier’s equations) to the weak problem.

1 Like