poisson's equation in Nek5000

22 views
Skip to first unread message

Bibhas Kumar

unread,
Jul 17, 2025, 1:21:38 PMJul 17
to Nek5000
Hi all,
I want to numerically compute the velocity field of a pipe flow cross section u(r, theta or x,y) in a 2D cross-sectional geometry (figure attached), which basically reduces to a poisson's equation.

d2u / dx2 + d2u/dy2 = -C 

Where u is the velocity in z direction. 

Is there a way to do that in Nek5000? 

Best,

Bibhas


Screenshot 2025-07-17 at 12.18.31 PM.png

YuHsiang Lan

unread,
Jul 17, 2025, 2:21:58 PMJul 17
to Nek5000
Hi Bibhas,

You can manually call subroutines that solve the Helmholtz (or Poisson) equation.
I recommend starting with this example, which solves the stream function via
  - Laplace psi = vorticity

rhs and the boundary condition needs to follow the weak formulation in FEM.
For Dirichlet BC, set tmask(i,1,1,1) = 0 and assign BC to initial guess.
For inhomogenuous Neumann BC, you need to add the surface flux to the rhs following computations in bcneusc.

The iteration number would be large because it simply uses Jacobi preconditioner.
Apply the SEMG preconditioner to arbitrary field is tricky in Nek5000 because many arrays are named and hard coded.
Still, one can use the Poisson solver in the MHD solver to solve extra Poisson equations. I've done that in the past.

Hope this helps,
Yu-Hsiang
--
Reply all
Reply to author
Forward
0 new messages