Enhanced Efficient 3D Poisson Solver Supporting Dirichlet, Neumann, and Periodic Boundary Conditions
Abstract
:1. Introduction
2. Finite Difference Discretization of Poisson’s Equation
3. Matrix Decomposition Method for 2D Poisson’s Equation
3.1. Two-Dimensional Finite-Difference Discretization
- (i)
- The solutions, , are assumed zeros on grid nodes except for the Dirichlet nodes. Next, for the Dummy nodes outside the Periodic boundaries (e.g., the S and N Dummy nodes in Figure 2b), the nodal values are obtained by copying the Periodic conditions from the opposite side of the domain. Since the solutions are assumed to be zero, this step effectively extends the Dirichlet conditions in the periodic directions. The gradient conditions are copied in the same way if Neumann nodes exist.
- (ii)
- For the Dummy nodes outside the Neumann boundaries (e.g., W- and S-boundaries in Figure 2a and E-boundary in Figure 2b), the nodal values are obtained by extrapolation using a 2nd-order scheme. Since the solutions are zero before this step, this step effectively assigns the gradient source terms to the Dummy nodes.
- (iii)
- Consider the extended grid that includes the Dummy nodes and reset boundary conditions such that fringe nodes of the domain are all Dirichlet. These new Dirichlet nodes have nodal values that are equivalent to the effects of Neumann and Periodic BCs.
- (iv)
- Add the Dirichlet conditions to the RHS source term, , for each solution node. For this step, the routine may first check if the Dirichlet nodes are SW, W, NW, S, N, ES, E, or NE to any solution node, and then the Dirichlet condition is added to the solution node.
3.2. 2D Modal Decomposition Technique for Solution
- Compute the eigenvector matrix, , and diagonal matrices of eigenvalues, and , for matrices and , respectively.
- Compute transformed source vectors, i.e., , for .
- Collect the transformed source of the -th mode to form the vector: , and form the tridiagonal eigenvalue matrix .
- Solve the transformed solution of the -th mode, , for , from the system Equation (17).
- Transform back to the solution by for .
4. Matrix Decomposition Method for 3D Poisson’s Equation
4.1. Linear System of the Discretization
4.2. 3D Modal Decomposition Technique for Solution
- (i)
- Determine the eigenvector matrix, , associated with the boundary conditions in the y-direction, using the results in the Appendix A.
- (ii)
- Apply the first transform of the source field to obtain . This is done through line-wise operation, i.e., for and , where and are the vectors in the format of Equation (6) that are used to store nodal values along the y-direction. Permute the first dimension of to the third so that now becomes .
- (iii)
- Given an i-th mode, is now the vector on the RHS of Equation (25). To solve the LHS vector of the transformed solution, , in Equation (25), apply the 2D modal decomposition technique in Section 3.2 based on the equivalent 2D (non-symmetric) compact stencil shown in Figure 6 and the BCs on the xz-planes. Repeat this step for all of the i-th modes () to complete the solution. Once done, reversely permute to restore its original indexing, for .
- (iv)
- Conduct an inverse transform to obtain the solution using the line-wise operations similar to step (ii), i.e., for and .
5. Numerical Examples
5.1. General Background
5.2. Validation with the 3D Particle Field
5.3. Validation with the 3D Sinusoidal Field
5.4. Discussion on the Applicability of the Efficient Method
5.5. Applications in the 3D Vortex-In-Cell Flow Simulations
6. Conclusions
- (i)
- Extension to various boundary conditions (BCs): The method generalizes previous approaches to effectively handle Dirichlet, Neumann, and Periodic BCs.
- (ii)
- Efficient source term computation: The use of equivalent Dirichlet nodes simplifies implementation and improves accuracy when computing source terms for Dirichlet, Neumann, and Periodic BCs.
- (iii)
- Generalized eigenvalue formulation: The method refines existing eigenvalue formulas to better handle the general 4th-order stencil weights.
- (iv)
- Validation of accuracy: The solver is tested using Gaussian and sinusoidal sources. It achieves 4th-order convergence for Dirichlet and Periodic boundaries. When Neumann boundaries are involved, convergence drops to 2nd-order due to 2nd-order extrapolation but still yields lower mean errors than traditional 2nd-order schemes. More accurate extrapolation methods may be applied in the future to reduce the error for Neumann BCs.
- (v)
- Application in flow simulation: The method is successfully applied to vortex-in-cell (VIC) simulations. While it primarily manages outer boundaries, it can be used with the immersed boundary method to handle internal solid objects. Neumann and Periodic boundaries also help reduce domain size and improve efficiency. Immersed interface methods may be considered in the future to better handle sharp discontinuity.
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Prescription of the Eigenvalues and Eigenvectors for Block Matrices
- (i)
- Periodic South and North BCs
- (ii)
- Dirichlet South and Dirichlet North BCs
- (iii)
- Neumann South and Neumann North BCs
- (iv)
- Dirichlet South and Neumann North BCs
References
- Zhong, Y.; Shirinzadeh, B.; Alici, G.; Smith, J. Deformable object simulation with Poisson equation. In Proceedings of the IEEE, International Conference on Mechatronics & Automation, Niagara Falls, ON, Canada, 29 July–1 August 2005; pp. 187–192. [Google Scholar]
- Nagel, J.R. Numerical solutions to Poisson equations using the finite-difference method. IEEE Antennas Propag. Mag. 2014, 56, 209–224. [Google Scholar] [CrossRef]
- Radhakrishnan, A.; Xu, M.; Shahane, S.; Vanka, S.P. A non-nested multilevel method for meshless solution of the Poisson equation in heat transfer and fluid flow. arXiv 2021, arXiv:2104.13758. [Google Scholar] [CrossRef]
- Versteeg, H.; Malalasekera, W. Introduction to Computational Fluid Dynamics: The Finite Volume Method, 2nd ed.; Pearson: London, UK, 2007. [Google Scholar]
- Smith, G.D. Numerical Solutions of Partial Differential Equations: Finite Difference Methods; Oxford University Press: New York, NY, USA, 1985. [Google Scholar]
- Wang, Y.; Zhang, J. Sixth order compact scheme combined with multigrid method and extrapolation technique for 2D Poisson equation. J. Comput. Phys. 2009, 228, 137–146. [Google Scholar] [CrossRef]
- Ge, Y. Multigrid method and fourth-order compact difference discretization scheme with unequal meshsizes for 3D Poisson equation. J. Comput. Phys. 2010, 229, 6381–6391. [Google Scholar] [CrossRef]
- Hockney, R.W. A fast direct solution of Poisson equation using Fourier analysis. JACM 1965, 12, 95–113. [Google Scholar] [CrossRef]
- Buneman, O. A Compact Non-Iterative Poisson Solver; Rep. SUIPR-294; Institute for Plasma Research, Stanford University: Stanford, CA, USA, 1969. [Google Scholar]
- Buzbee, B.L.; Golub, G.H.; Nielson, C.W. On direct methods for solving Poisson’s equations. SIAM J. Numer. Anal. 1970, 7, 627–655. [Google Scholar] [CrossRef]
- Sweet, R.A. A Generalized Cyclic Reduction Algorithm. SIAM J. Numer. Anal. 1974, 11, 506–520. [Google Scholar] [CrossRef]
- Swarztrauber, P.N. The methods of cyclic reduction, Fourier analysis and the FACR algorithm for the discrete solution of Poisson’s equation on a rectangle. SIAM Rev. 1977, 19, 490–501. [Google Scholar] [CrossRef]
- Cooley, J.W.; Lewis, P.A.W.; Welch, P.D. The fast Fourier transform algorithm: Programming considerations in the calculation of sine, cosine and Laplace transforms. J. Sound Vib. 1970, 12, 315–337. [Google Scholar] [CrossRef]
- Swarztrauber, P.N. Symmetric FFTs. Math. Comput. 1986, 47, 323–346. [Google Scholar] [CrossRef]
- Schumann, U.; Sweet, R.A. A direct method for the solution of Poisson’s equation with Neumann boundary conditions on a staggered grid of arbitrary size. J. Comput. Phys. 1976, 20, 171–182. [Google Scholar] [CrossRef]
- Schumann, U.; Sweet, R.A. Fast Fourier transforms for direct solution of Poisson’s equation with staggered boundary conditions. J. Comput. Phys. 1988, 20, 123–137. [Google Scholar] [CrossRef]
- Sweet, R.A. Direct methods for the solution of Poisson’s equation on a staggered grid. J. Comput. Phys. 1973, 12, 422–428. [Google Scholar] [CrossRef]
- Wilhelmson, R.B.; Ericksen, J.H. Direct Solutions for Poisson’s equation in three dimensions. J. Comput. Phys. 1977, 25, 319–331. [Google Scholar] [CrossRef]
- Shiferaw, A.; Chand Mittal, R. An efficient direct method to solve the three dimensional Poisson’s equation. Am. J. Comput. Math. 2011, 1, 285–293. [Google Scholar] [CrossRef]
- Wang, H.; Zhang, Y.; Ma, X.; Qiu, J.; Liang, Y. An efficient implementation of fourth-order compact finite difference scheme for Poisson equation with Dirichlet boundary conditions. Comput. Math. Appl. 2016, 71, 1843–1860. [Google Scholar] [CrossRef]
- Feng, H.; Zhao, S. FFT-based high order central difference schemes for three-dimensional Poisson’s equation with various types of boundary conditions. J. Comput. Phys. 2020, 410, 109391. [Google Scholar] [CrossRef]
- Adams, J.C.; Swarztrauber, P.N.; Sweet, R. FISHPACK90: Efficient Fortran Subprograms for the Solution of Separable Elliptic Partial Differential Equations. Astrophysics Source Code Library. 2016. Available online: https://ascl.net/1609.005 (accessed on 7 April 2025).
- Hasbestan, J.J.; Senocak, I. PittPack: Open-Source FFT-Based Poisson’s Equation Solver for Computing with Accelerators. In Proceedings of the ASME 2018 International Mechanical Engineering Congress and Exposition IMECE 2018, Pittsburgh, PA, USA, 9–15 November 2018. [Google Scholar]
- Hasbestan, J.J.; Xiao, C.-N.; Senocak, I. PittPack: An open-source Poisson’s equation solver for extreme-scale computing with accelerators. Comput. Phys. Commun. 2020, 254, 107272. [Google Scholar] [CrossRef]
- Kyei, Y.; Roop, J.P.; Tang, G. A family of sixth-order compact finite-difference schemes for the three-dimensional Poisson Equation. Adv. Numer. Anal. 2010, 2010, 352174. [Google Scholar] [CrossRef]
- Deriaz, E. Compact finite difference schemes of arbitrary order for the Poisson equation in arbitrary dimensions. BIT Numer. Math. 2019, 60, 199–233. [Google Scholar] [CrossRef]
- Cohen, S. Cyclic Reduction; Lecture note; Stanford University: Stanford, CA, USA, 1994. [Google Scholar]
- Ploumhans, P.; Winckelmans, G.S.; Salmon, J.K.; Leonard, A.; Warren, M.S. Vortex Methods for Direct Numerical Simulation of Three-Dimensional Bluff Body Flows: Application to the Sphere at Re = 300, 500, and 1000. J. Comput. Phys. 2002, 178, 427–463. [Google Scholar] [CrossRef]
- Sharma, N.; Sengupta, T.K. Vorticity dynamics of the three-dimensional Taylor-Green vortex problem. Phys. Fluids 2019, 31, 3. [Google Scholar] [CrossRef]
- Bialecki, B.; Fairweather, G.; Karageorghis, A. Matrix decomposition algorithms for elliptic boundary value problems: A survey. Numer. Algor. 2011, 56, 253–295. [Google Scholar] [CrossRef]
- Raeli, A.; Bergmann, M.; Iollo, A. A finite-difference method for the variable coefficient Poisson equation on hierarchical Cartesian meshes. J. Comput. Phys. 2018, 355, 59–77. [Google Scholar] [CrossRef]
- Feng, H.; Long, G.; Zhao, S. An augmented matched interface and boundary (MIB) method for solving elliptic interface problem. J. Comput. Appl. Math. 2019, 361, 426–443. [Google Scholar] [CrossRef]
- Ren, Y.; Feng, H.; Zhao, S. A FFT accelerated high order finite difference method for elliptic boundary value problems over irregular domains. J. Comput. Phys. 2022, 448, 110762. [Google Scholar] [CrossRef]
- Ren, Y.; Zhao, S.A. High-order hybrid approach integrating neural networks and fast Poisson solvers for elliptic interface problems. Computation 2025, 13, 83. [Google Scholar] [CrossRef]
- Cocle, R.; Winckelmans, G.; Daeninck, G. Combining the vortex-in-cell and parallel fast multipole methods for efficient domain decomposition simulations. J. Comput. Phys. 2008, 227, 9091–9120. [Google Scholar] [CrossRef]
- Mimeau, C.; Cottet, G.-H.; Mortazavi, I. Direct numerical simulations of 3D flow past obstacles with a vortex penalization method. Comput. Fluids 2016, 136, 331–347. [Google Scholar] [CrossRef]
- Spietz, H.J.; Hejlesen, M.M.; Walther, J.H. Iterative Brinkman penalization for simulation of impulsively started flow past a sphere and a circular disc. J. Comput. Phys. 2017, 336, 261–274. [Google Scholar] [CrossRef]
- Cheng, M.; Loum, J.; Lim, T.T. Numerical simulation of head-on collision of two coaxial vortex rings. Fluid Dyn. Res. 2018, 50, 065513. [Google Scholar] [CrossRef]
- Buzbee, B.L.; Dorr, F.W.; George, J.A.; Golub, G.H. The direct solution of the discrete Poisson equation on irregular regions. SIAM J. Numer. Anal. 1971, 8, 722–736. [Google Scholar] [CrossRef]
Domain Dimension and Field Variables or Source Terms | Order of Accuracy | Type | ||||
---|---|---|---|---|---|---|
3D LHS weights for | 2 | - | ||||
4 | 1 | |||||
4 | 2 | |||||
3D RHS weights for | 2 | - | 1 | 0 | 0 | 0 |
4 | 1 | |||||
4 | 2 | |||||
2D LHS weights for | 2 | - | - | |||
4 | - | - | ||||
2D RHS weights for | 2 | - | - | |||
4 | - | - |
B | Periodic | Dirichlet | Dirichlet | Neumann | Neumann |
S | |||||
W | |||||
T | Periodic | Dirichlet | Neumann | Dirichlet | Neumann |
N | |||||
E | |||||
1 | 1 | 1 | 2 | 2 | |
1 | 1 | 2 | 1 | 2 | |
1 | 0 | 0 | 0 | 0 | |
1 | 0 | 0 | 0 | 0 | |
Example Flow | BCs | |||
---|---|---|---|---|
Heads-on collision of two vortex rings | DDDDDD | |||
Impulsively started sphere | DDDDDD | |||
Impulsively started circular cylinder | DDPDPD | |||
Boundary layer flow passing a cube | DDNDND |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wu, C.-H. Enhanced Efficient 3D Poisson Solver Supporting Dirichlet, Neumann, and Periodic Boundary Conditions. Computation 2025, 13, 99. https://doi.org/10.3390/computation13040099
Wu C-H. Enhanced Efficient 3D Poisson Solver Supporting Dirichlet, Neumann, and Periodic Boundary Conditions. Computation. 2025; 13(4):99. https://doi.org/10.3390/computation13040099
Chicago/Turabian StyleWu, Chieh-Hsun. 2025. "Enhanced Efficient 3D Poisson Solver Supporting Dirichlet, Neumann, and Periodic Boundary Conditions" Computation 13, no. 4: 99. https://doi.org/10.3390/computation13040099
APA StyleWu, C.-H. (2025). Enhanced Efficient 3D Poisson Solver Supporting Dirichlet, Neumann, and Periodic Boundary Conditions. Computation, 13(4), 99. https://doi.org/10.3390/computation13040099