Hi,
how would I have to implement free-slip boundary conditions on the boundary defined by wall() in the the given mwe?
from dolfin import *
class Bottom(SubDomain):
def inside(self,x, on_boundary):
return near(x[2],0) and on_boundary
class Top(SubDomain):
def inside(self,x, on_boundary):
return near(x[2],1) and on_boundary
def wall(x, on_boundary):
return (near(x[0],0) or near(x[0],1) or near(x[1],0) or near(x[1],1)) and on_boundary
mesh = UnitCubeMesh(5,5,5)
BDM1 = FiniteElement("BDM", mesh.ufl_cell(), 1)
DG0 = FiniteElement("DG", mesh.ufl_cell(), 0)
E = MixedElement(BDM1,DG0)
W = FunctionSpace(mesh, E)
u,p = TrialFunctions(W)
v,q = TestFunctions(W)
n = FacetNormal(mesh)
sub_domains = MeshFunction('size_t', mesh, 2)
sub_domains.set_all(0)
Top().mark(sub_domains, 1)
Bottom().mark(sub_domains, 2)
ds = Measure('ds', domain = mesh, subdomain_data = sub_domains)
a = (dot(u,v) - div(u)*q - div(v)*p)*dx
L = Constant(1)*dot(v,n)*ds(2) - Constant(0)*dot(v,n)*ds(1)
w = Function(W)
solve(a == L, w)
u,p = w.split()
File("sub_domains.pvd") << sub_domains
File("u.pvd") << u
File("p.pvd") << p