flow on inner boundary
I'd like to compute a flow about an inner boundary.
My testproblem is in a unit square. I solve stokes-equation there and want to
compute the flow in the middle of the mesh.
I start with inflow -1 at the upper boundary(y=1).
The flow at the bottom boundary ( y=0) is also
-1, but when I compute the flow at y = 0.5, the flow value becomes very big
and it seems that it depends much on the discretization of the mesh.
Can anybody help me and find my mistake???
Here is the code:
mesh = Rectangle(
mesh.order()
V = VectorFunctionS
W = FunctionSpace(mesh, "CG", 1)
VW = V*W
(u,p) = TrialFunctions(VW)
(phi,psi) = TestFunctions(VW)
# --------------
# boundary conditions
def boundary_noslip(x, on_boundary):
return on_boundary
noslip_const = Constant((0.0, 0.0))
noslip = DirichletBC(
def boundary_in_left(x, on_boundary):
return x[1] == 1.0 and on_boundary
u_in_left = Expression(("0.0", "-1.0"))
inflow_left = DirichletBC(
def boundary_
return x[1] == 0.0 and on_boundary
p_const_down = Constant(0.0)
p_down = DirichletBC(
bcs = [noslip, inflow_left, p_down]
# stokes equation
f = Constant((0, 0))
a = (inner(grad(phi), grad(u)) - div(phi)*p + psi*div(u))*dx
L = inner(phi, f)*dx
problem = VariationalProb
(u,p) = problem.
# inner boundary flow
normal = FacetNormal(mesh)
boundary_parts = MeshFunction(
bc_mid = compile_
bc_mid.
flow = (u('+')
integral_flow = assemble(flow, mesh=mesh, interior_
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Melanie Jahny
- Solved:
- Last query:
- Last reply: