Helmholtz equation Neumann and divergence

Click For Summary
SUMMARY

The discussion focuses on solving the Helmholtz equation with Neumann boundary conditions and ensuring the divergence of the vector field B remains zero. The user employs a finite difference method using a centered second-order scheme on a grid with periodic boundaries in the x-direction and specific boundary conditions in the y-direction. Despite achieving zero divergence in the middle of the domain, anomalies arise near the y-boundaries, indicating potential issues with the boundary conditions or discretization methods. References to compatibility conditions and boundary conditions are provided for further clarification.

PREREQUISITES
  • Understanding of the Helmholtz equation and its applications in vector calculus.
  • Familiarity with finite difference methods for numerical solutions of partial differential equations.
  • Knowledge of Neumann and Dirichlet boundary conditions in the context of elliptic problems.
  • Experience with discretization techniques and error analysis in numerical simulations.
NEXT STEPS
  • Review the compatibility conditions for boundary value problems in vector fields.
  • Explore advanced finite difference methods for improved accuracy in solving elliptic equations.
  • Investigate the implications of boundary conditions on the divergence of vector fields in numerical simulations.
  • Examine the Gauss-Seidel iterative method for solving linear systems arising from discretized equations.
USEFUL FOR

Researchers and practitioners in computational physics, applied mathematics, and engineering who are working on numerical solutions of elliptic partial differential equations, particularly those involving vector fields and boundary conditions.

Heimdall
Messages
38
Reaction score
0
"Helmholtz equation" Neumann and divergence

Hello, I'm trying to solve the following elliptic problem :

S = B - \mu\nabla^2 B

Where S(x,y) and B(x,y) are 3 component vectors.

I have \nabla\cdot S = 0 and I want B such that \nabla\cdot B = 0 everywhere.

I'm using finite differences on a grid with nx+1 in the x direction and ny+1 points in the y direction. The x=0 and x=nx boundaries are periodic, so we have :

Bx(0,y) = Bx(nx,y)
By(0,y) = By(nx,y)
Bz(0,y) = Bz(nx,y)I thought that maybe the following boundary conditions would ensure \nabla\cdot B=0 : Bx(x,0) = B_1
Bx(x,ny) = B_2

\frac{\partial B_y}{\partial y}\left(x,ny\right)= \frac{\partial B_y}{\partial y}\left(x,0\right) = 0

(this make the divergence of B equal to zero on the y=0 and y=ny boundaries)

and homogenous dirichlet conditions for Bz at y=0 and y=ny.

Do you so far agree with that ?

I'm using centered second order scheme to discretize my equation (standard 5 point laplacien). And for the Neumann BC I'm doing :

By(x,-1) = By(x,1) for the y=0 border
By(x,ny+1) = By(x,ny-1) for the y=ny border.

This is supposed to be second order first derivative. Thanks to this, I can replace the "ghost" point in my Laplacian when I'm on the top or bottom border.

But I have a problem, when I look at \nabla\cdot B, it is 0 in the middle of my domain but on a small length from the y=constant borders, the divergence of B is starting to raise anormally.

example :
http://nico.aunai.free.fr/divB.png

another one (del dot B versus y-direction) :
http://nico.aunai.free.fr/divb.png

you can see that there is no problem at all on the periodic boundaries :-sWhen I'm solving the equation for an analytical source term for which I know the analytical solution, I can notice that there is a small error (but definitely bigger than everywhere else in the domain) on the Y boundary regarding to the Neumann BC.

Please, would you know where I should look at to fix this problem ?
Is my boundary conditions are bad to satisfy \nabla\cdot B=0 ?
Is my discretisation not correct ? I've checked the local truncation error which seems to be second order consistent, and eigenvalues of my linear operator looks pretty much the same that those of the Laplacian (1- L), and if I'm correct it should be stable and so converge towards the solution with second order accuracy everywhere, no ?

I can post my gauss-seidel routine if needed.

Thanks a lot !
Please tell me if something's not clear.
 
Last edited by a moderator:
Physics news on Phys.org


When \nabla \cdot B =0 your equation can be written,

\mu\nabla\times\nabla\times B + B = S.

The correct boundary conditions for this equation are discussed in http://dx.doi.org" , reference number doi:10.1016/j.jcp.2008.03.046.

There it is shown that with \hat{n} \times B=0 on the boundary,
a compatibility condition,

\int_{\partial D} \hat{n} \cdot [ B-S] \mathrm{d} \mathcal S=0

must be satisfied,
or with

\hat{n} \times \nabla \times B=0

on the boundary, the boundary condition,

\hat{n} \cdot [B-S]=0

must be imposed.
 
Last edited by a moderator:

Similar threads

  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 1 ·
Replies
1
Views
537
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K