Hi,
I’m trying to implement boundary condition at micron scale, I mean μm, like 2μm.
The standard ways to define BC are working only at the millimeter scale mm, like 2mm.
Are there any other strategies to define BC to overcome this issue?
As I mentioned, for millimeter, the code works well. The meshes are the same, but the dimensions (scale).
Here are my attempts to define the BC
class top(SubDomain):
def inside(self, x, on_boundary):
return x[2] >= 0.002 and on_boundary # near(x[2], 0.002, DOLFIN_EPS)
top_boundary = top()
#top = CompiledSubDomain(“near(x[2], 0.0019) && on_boundary”)
def piano_top(x, on_boundary):
return x[2] >= 0.0019 and x[0]>=-0.0018 and x[0]<=0.0018 and x[1]>=-0.0018 and x[1]<=0.0018 and on_boundary
bot = CompiledSubDomain(“near(x[2], -0.002) && on_boundary”)
def piano_bot(x, on_boundary):
return x[2] <= -0.002 and x[0]>=-0.0018 and x[0]<=0.0018 and x[1]>=-0.0018 and x[1]<=0.0018 and on_boundary
back = CompiledSubDomain(“near(x[1], -0.0019) && on_boundary”)
front = CompiledSubDomain(“near(x[1], 0.0019) && on_boundary”)
right = CompiledSubDomain(“near(x[0], 0.0019) && on_boundary”)
left = CompiledSubDomain(“near(x[0], -0.0019) && on_boundary”)
load = Expression(“t”, t = 0.0, degree=1)
bctop = DirichletBC(W.sub(2), load, top_boundary )
bcbot= DirichletBC(W.sub(2), Constant(0.0), piano_bot) #W, Constant((0.0,0.0,0.0)),
bcback = DirichletBC(W.sub(1), Constant(0.0), back )
#bcfront= DirichletBC(W.sub(1), Constant(0.0), front)
#bcright = DirichletBC(W.sub(0), Constant(0.0), right )
bcleft= DirichletBC(W.sub(0), Constant(0.0), left)
bc_u = [bcbot, bctop, bcleft, bcback]
Actually, the code works, but it computes nothing at all time steps.
Thank you.