One trace value term in the variational formulation

Hello everyone,
Here is the problem:

\begin{align} \partial_t u - \nabla \cdot \nabla u &= f && \text{in} \ \Omega,\\ u &= \phi && \text{on} \ \partial\Omega,\\ u(x,t=0) &= u_0 && \text{in} \ \Omega. \end{align}

Now, \phi is unkown.
To solve the problem, a condition on \partial\Omega is given:

\int_{\partial\Omega} \mathbf{n} \cdot \nabla u = \psi,

where \psi is known and \mathbf{n} is unit outer vector.

The variational formulation is

(\partial_t u,v)_\Omega + (\nabla u, \nabla v)_\Omega = (f,v)_\Omega + \psi v|_{\partial\Omega} \quad \forall v \in V,

where

V = \{v \in H^1(\Omega): v|_{\partial\Omega} = \mathrm{constant} \},\\ \int_\Omega uv = (u,v)_\Omega.

I know how to implement the inner product terms in FEniCS, but I don’t know how to implement the trace value term \psi v|_{\partial\Omega}.

Is there anyone know how to implement \psi v|_{\partial\Omega} in FEniCS?


OK. I post my replay here to describe this problem clearly.

The original problem is ill-posed since the Dirichlet boundary condition is unknown, i.e. \phi is unknown. I cannot use this Dirichlet boundary condition when I solve this problem. That’s why I define the space V as v|_{\partial\Omega} = \mathrm{constant} instead of v|_{\partial\Omega}=0.

The additional boundary condition on the same trace gives one known information \psi. I don’t think it’s a Neumann boundary condition since it uses the integral. The purpose for applying this boundary condition is to construct a well-posed problem with the same solution to the original one. This method is widely used for this kind of ill-posed problem and I only propose a simple example, e.g. 10.1016/j.cam.2014.04.022 and 10.1016/0377-0427(95)00271-5 .

I know the demo. It is convenient to implement the L^2-inner product \int_{\Omega} uv \, \mathrm{d}x as u*v*dx. I wonder how to implement the term \psi v|_{\partial\Omega} in FEniCS. It isn’t a L^2-inner product here.

Thanks.

Unless I’m missing something, everything you need except time discretisation is covered in the poisson demo.

If you really need to prescribe both a Neumann and Dirichlet boundary condition on the same boundary, then things get tricky. See for example here.

Thank you for your answer. I think I need to describe this problem clearly.

The original problem is ill-posed since the Dirichlet boundary condition is unknown, i.e. \phi is unknown. I cannot use this Dirichlet boundary condition when I solve this problem. That’s why I define the space V as v|_{\partial\Omega} = \mathrm{constant} instead of v|_{\partial\Omega}=0.

The additional boundary condition on the same trace gives one known information \psi. I don’t think it’s a Neumann boundary condition since it uses the integral. The purpose for applying this boundary condition is to construct a well-posed problem with the same solution to the original one. This method is widely used for this kind of ill-posed problem and I only propose a simple example.

I know the demo you present. It is convenient to implement the L^2-inner product \int_{\Omega} uv \, \mathrm{d}x as u*v*dx. I wonder how to implement the term \psi v|_{\partial\Omega} in FEniCS. It isn’t a L^2-inner product here.

Thanks all the same.