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

FacetNormal of internal boundary

0 votes

Hi all,

I encountered an problem when I tried to evaluate FacetNormal on the internal boundary, and hope someone could provide more insight to properly evaluate this. Basically, my domain has two parts connecting together, and I need to apply robin boundary condition on this interface.

Here is my previous post (my equation and boundary conditions). In short, my mistake on previous post is that I did not account for the normal vector orientation. Because I would like to work on more generalized geometry, here is my fix to previous problem by defining normal vector, and do a dot product.

n = FacetNormal(flowing_layer_mesh)
...
F = ... + dot(n, local_shear_rate*Epsilon*Lambda*u*(1.0-u))*v*dsTop + dot(n, local_shear_rate*Epsilon*Lambda*u*(1.0-u))*v*dsBottom

This approach appears to work pretty well if I try to evaluate the curve boundary on the outside of my mesh. However, this method appears to fail when I try to evaluate boundary line that is inside my mesh (which in this case, it is a curve interface between two regions). The reason I suspect it is this part fails is that I basically see exactly the same behavior as in my previous post.

Any help would be appreciated! Thanks!

`

asked May 10, 2017 by dengzhekai FEniCS Novice (360 points)
edited May 12, 2017 by dengzhekai

1 Answer

0 votes
 
Best answer

Hi dengzhekai,

Indeed the above paragraph is fairly minimal, so I am not entirely sure this will help.
But one thing you have to change in order to work with internal boundaries is your measure (dS instead of ds).


dSinterface = Measure("dS", subdomain_id=1, subdomain_data=boundary_parts)
answered May 10, 2017 by meron FEniCS User (2,340 points)
selected May 12, 2017 by dengzhekai

Hi meron, I think this might be helpful and I was using "ds" to measure the ds_interface. I change it to "dS", but the program does not run, with error message

Unable to perform just-in-time compilation of form.

Any ideas ? Also, I have edited so that It now has the full code and related gmsh code.

Hi!

Indeed when you run your code you encounter the error "Discontinuous type Argument must be restricted." You have to restrict when integrating over interior facets (*dS) to the positive or negative side of the facet or average (using ('-'), ('+') or avg(), you can check ufl-user-manual or look here

Thanks for the reference. I think this resolves my issue. Thank you.

...