### Apply boundary condition Semi-circle

364
views
0
10 months ago by

Hi, I am solving elastiicty problem for that I want to apply displacement on upper half of the semicircle. Figure attached

I am using this syntex to apply boundary condition but throws error: ValueError: math domain error, That is due to sqrt(-1), How to apply this boundary condition correctly.

class top(SubDomain):
def inside(self,x,on_boundary):
tol = 1e-1
return (x[1] - sqrt(r**2 - (x[0]-h)**2) - k ) < tol and on_boundary​

#      (h,k) = center of the circle

FEniCS version 1.6.0

Thanks for the help.
HSK

Community: FEniCS Project

4
10 months ago by
I assume it should be something like

R = 5.0
x0 = 20.
y0 = 10.
return (x[0]-x0)**2.+(x[1]-y0)**2. < (R+tol)**2. and on_boundary​​

Essentially your last bracket in the sqrt expression should be moved left. If you want to add the "upper circle" condition, you should add

... and (x[1] >= y0) ...
This is for the full circle, I want to apply only on upper half of the circle.

Thanks
HSK
written 10 months ago by hirshikesh
see update. Your full condition will be return (circle) and (half part) and on_boundary
written 10 months ago by Corwinpro
Thanks for the help, it works
written 10 months ago by hirshikesh