How do I solve a 3D poisson equation with mixed neumann and periodic boundary conditions numerically?

775 Views Asked by At

The PDE is being solved over a cube. Four of the faces are periodic, and one set of opposing faces have no-flow Neumann boundary conditions:

$\nabla^2 u = f(x,y,z)$

$\frac{\partial u}{\partial z} = 0$ at $z = 0$ and $z = h$

I am able to solve a similar problem with full Neumann boundary conditions (assuming the compatibility condition for $f(x,y,z)$ is satisfied) by arbitrarily selecting one node and setting it to $0$ as suggested here How to numerically solve the Poisson equation given Neumann boundary conditions?

So, based on this I have 2 questions:

  1. Would this method also work for mixed periodic/Neumann boundary conditions and if so why? I can't seem to find an answer. I believe periodic boundary conditions also have a family of solutions valid up to an additive constant $C$.

  2. Surely the choice of which node you choose to set to $0$ has an affect on the final solution. Therefore, are there any rules of thumb on how to go about this? Or am I understanding the problem wrong?

I think this is a generally applicable problem, so any answers would be appreciated.