Implicit DirichletBC

Hi everyone,

I would like to solve the following problem

\frac{dc}{dt} = \nabla (D\nabla(c)) + f on \Omega
c=K_H P on \Gamma_\mathrm{bubble}
V \frac{dP}{dt} = \int_{\Gamma_\mathrm{bubble}} D \nabla c \cdot \textbf{n} \, ds

I’ve managed to solve this by explicitely incrementing P after each timestep (and modifying a DirichletBCobject).

The problem is, there are some stability issues when dt is too large.

I believe this would require to be implicit !

Two questions:

  • how can we create a FunctionSpace with a scalar value (P) ?
  • is trying to weakly impose the Dirichlet BC the correct strategy?

Thanks for the help!

Rem

You can add a single scalar degree of freedom to the system by using a mixed function space that includes a FiniteElement of type "Real", as demonstrated here. I haven’t actually tried implementing this, but a suitable weak form might look something like: Find (c,P)\in\mathcal{V}\times\mathbb{R} such that \forall (w,Q)\in\mathcal{V}\times\mathbb{R}

\int_\Omega\left(\frac{dc}{dt}w + D\nabla c\cdot\nabla w - fw\right)~d\Omega\\ -\int_\Gamma wD\nabla c\cdot\mathbf{n}~d\Gamma - \int_\Gamma(c-K_HP)D\nabla w\cdot\mathbf{n}~d\Gamma + \int_\Gamma\frac{\gamma D}{h}(c-K_HP)(w-K_HQ)~d\Gamma\\ +\int_\Gamma\left(\frac{V}{\vert\Gamma\vert}\frac{dP}{dt} - D\nabla c\cdot\mathbf{n}\right)K_HQ~d\Gamma = 0\text{ ,}

where the first line is the standard Galerkin method for the interior equation, the second line is the symmetric Nitsche method for the Dirichlet BC on c, where \gamma > 0 (sufficiently large) is a dimensionless penalty parameter and h is the element diameter, and the third line enforces the integral condition on P.

As a quick sanity check, you can plug in (w,Q) = (c,P) to see that (an implicit time discretization of) this should stay coercive for \gamma large enough to satisfy the usual condition for Nitsche’s method, since the +\int_\Gamma K_HPD\nabla w\cdot\mathbf{n}~d\Gamma term in the second line and the -\int_\Gamma K_HQD\nabla c\cdot\mathbf{n}~d\Gamma term in the third line cancel with that choice of test function. The inclusion of -K_HQ in the penalty term for Nitsche’s method is also motivated by coercivity considerations.

Interesting thank you so much for this

I don’t quite understand what |\Gamma| is?

That is meant to denote the measure of \Gamma, i.e.,

\vert\Gamma\vert = \int_\Gamma 1~d\Gamma\text{ .}