Applying neumann boundary condition on top surface
I want to model a plate with a load on top of it and the displacement at the bottom of the plate is zero.
I am not sure how I can specify where to apply the load since I have my Neuman BC inside my weak formulation.I wrote modify my code but the result doesn't seems right. any suggestion?
Here is my code:
The PDE is Helmholtz type PDE. I just simplify the problem by fixing the frequency of the load.
the equation is :
Divergence(
BC: Stress(vec(x),w) n(x)=T(x,w)
u(x,w)=U0
po=2700
w=100
Magnitude=-200
# Create mesh and define function space
mesh = UnitCubeMesh(30, 4, 30)
V = VectorFunctionS
# Defining Domain
class Left(SubDomain):
def inside(self, x, on_boundary):
return near(x[0], 0.0)
class Right(SubDomain):
def inside(self, x, on_boundary):
return near(x[0], 1.0)
class Bottom(SubDomain):
def inside(self, x, on_boundary):
return near(x[1], 0.0)
class Top(SubDomain):
def inside(self, x, on_boundary):
return near(x[1], 1.0)
# Initialize sub-domain instances
left = Left()
top = Top()
right = Right()
bottom = Bottom()
# Initialize mesh function for interior domains
domains = CellFunction(
domains.set_all(0)
# Initialize mesh function for boundary domains
boundaries = FacetFunction(
boundaries.
left.mark(
top.mark(
right.mark(
bottom.
bc = DirichletBC(V, (0.0, 0.0, 0.0), boundaries,4)
# Define new measures associated with the interior domains and exterior boundaries
#dx = Measure(
ds = Measure(
#bottom = compile_
#top = compile_
# Define Dirichlet boundary (x = 0 or x = 1)
#c = Expression(("0.0", "0.0", "0.0"))
#bc = DirichletBC(V, c, bottom)
# Define trial and test functions
u = TrialFunction(V)
v = TestFunction(V)
f = Expression(("0.0", "scale*
# Elasticity parameters
E, nu = 10.0, 0.3
mu = E / (2.0*(1.0 + nu))
lmbda = E*nu / ((1.0 + nu)*(1.0 - 2.0*nu))
def sigma(v):
return 2.0*mu*sym(grad(v)) + lmbda*tr(
a = inner(sigma(u), sym(grad(v)))*dx -po*w*w *inner(v,u)*dx
L = inner(f,v)*ds(2)
# Compute solution
u = Function(V)
solve(a == L, u, bc)
# Save solution in VTK format
file = File("Elastic.pvd")
file << u
# Plot solution
plot(mesh)
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Bahram for more information if necessary.