This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

interior boundary condition

0 votes

Hi,
I want to combine the Stokes- and the Poisson-equation (Darcy) with the Beaver-Jospeh interface condition. I work in the Unit Square and created two subdomains, one from [0, 0.5] and the other from [0.5, 1].
At the interior boundary i want to use the Beaver-Jospeh condition:

du/dy(x,0+)=c(u(x,0+)-u_D)

where u_D denotes the Darcy-velocity in the porous domain and u(x,0+) the Stokes-velocity in the fluid domain. c is a constant.

Now I don´t know how to create an interior boundary condition.
I found something like this:

 facet_domains = FacetFunction('size_t', mesh)
 facet_domains.set_all(0)
 for f in facets(mesh):
 if any(ff.exterior() for ff in facets(f)):
 facet_domains[f] = 1

u_in = Constant(-1.0)
bc_in = DirichletBC(V, u_in, facet_domains, 0)

But I think i have to use interior facets?
Can anybody help me how to do this please? I don´t know exactly how to start.
Thanks!

asked Nov 19, 2013 by Nicole S. FEniCS Novice (150 points)
du/dy(x,0+)=c(u(x,0+)-u_D)

this seems like a natural (like Neumann) BC rather than essential (like Dirichlet) one.

Regarding definition of facet_domains, just replace line

     if any(ff.exterior() for ff in facets(f)):

with relevant conditions for f where BC should be applied. For example

     if near(f.midpoint().y(), 0.5):

1 Answer

+2 votes

Have a look at Ida's thesis, https://www.duo.uio.no/handle/10852/10872
She did exactly this.

answered Nov 25, 2013 by Kent-Andre Mardal FEniCS Expert (14,380 points)

Thanks for the tip, I needed something similar and it would have taken me ages to figure out for myself!

...