Free-slip boundary conditions on Darcy Flow

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

See for instance dolfin_dg by @nate : Bitbucket
Note that as long as your boundary aligns with the axis you should be able to set Dirichlet conditions on the sub-space. I am note sure how easy this is to do with BDM however, as they are integral moments.

2 Likes

I’m not sure the Taylor-Hood type discretisation of the Stokes system is a fair comparison. So i don’t think applying a Nitsche condition as the dolfin_dg example shows is relevant.

I’m not very well versed in BDM elements, but don’t they belong to H(\Omega; \mathrm{div})? And doesn’t this mean that applying homogeneous boundary data to the underlying linear system yields \boldsymbol{u} \cdot \boldsymbol{n} = 0 on \partial\Omega?

@jpdean may have much better insight.

3 Likes

I agree with @nate. The degrees of freedom for the BDM element are integral moments of normal traces. Hence, setting the degrees of freedom on the boundary to zero will enforce u \cdot n = 0. You might find this demo helpful: Mixed formulation for Poisson equation — DOLFIN documentation

4 Likes