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

How can I implement Dirichlet and Neumann boundary conditions in a mixed space in a dependent-time problem?

0 votes

I'm finshing my thesis and my research is about single-phase flow in porous media with a scheme of mixed spaces. I need to implement in a cylinder, Neumman boundary condition in the bottom and Dirichlet condition on top.

My mathematical model is the next:

enter image description here

My question is:

How could I implement Dirichlet and Neumann boundary conditions in a mixed formulation in a dependent-time problem?

asked Sep 25, 2016 by Eduardo Linares FEniCS Novice (140 points)

1 Answer

0 votes

So the exact implementation will depend on how you choose to set up the domain, but the idea is this:

For dirichlet conditions on pressure you can do

# Define north boundary
def north(x):
    return x[0] > 1.0 - DOLFIN_EPS
# Define south boundary
def south(x):
    return x[0] < DOLFIN_EPS

# Define boundary condition
P0 = Constant(80)
bcnorthp = DirichletBC(U.sub(1), P0, north)

Where I assume that the pressure is the second component in the mixed space.

I'm fairly sure that since you have split the second order equation into two first order equations you can impose the flux strongly as above:

# Define boundary condition
g = Constant(1.39*10^-9)
bcsouthu = DirichletBC(U.sub(0), g, south)

If you wanted to impose this weakly you would need to mark the boundaries following the method in the ninth documented demo - https://fenicsproject.org/documentation/dolfin/1.1.0/python/demo/pde/subdomains-poisson/python/documentation.html

answered Oct 10, 2016 by varnis FEniCS Novice (390 points)
How can I implement a single-phase flow model in mixed spaces?
...