Graded material diffusion

Hi all

I’ve looked at several examples using subdomains to define local material properties (e.g., Applying spatially varying material). However, this would be cumbersome for a fully graded material (think linearly varying material properties).

As a test model, I’m looking at a simple diffusion problem

\partial_t u = \nabla\cdot(D\nabla u)

where

D=\left\{\begin{array}{ll}D_L=0.1,\quad x_1<0\\D_H=1.0\quad\mathrm{otherwise}\end{array}\right.

I solved this in two different ways: 1) with the subdomain approach, and 2) by simply defining D as a function space coefficient

D = Expression(‘x[1]<0 ? 0.1:1.0’, degree=2)
D = interpolate(D, V)

Both approaches seemed to yield sensible results, but with slight differences as shown below (ND are the no-subdomain results). The difference is more noticeable for the low diffusivity area (domain lower half).

Why would there be this difference? Is there an inherit disadvantage in using the “ND” approach?

Thanks!

Depending on the function space V, you are interpolating a discontinuous function into a possibly continuous function space.
For the problem in question, V should be a DF-0 space.