Efficient Acceleration in Solving the 2D Neutron Diffusion Equation with CUDA: Exploring the Collaborative Practicality of Colab
DOI:
https://doi.org/10.15392/2319-0612.2024.2498Keywords:
Neutron Diffusion Equation, CUDA, Google ColabAbstract
This paper explores an approach to accelerate the finite difference method applied to solving the two-dimensional (2D) neutron diffusion equation for two energy groups (2G) independent of time. The main innovation lies in the implementation of a performance optimization method, emphasizing the practicality of development in Python using direct browser collaboration through Google Colaboratory (Colab). Utilizing CUDA (Compute Unified Device Architecture) for GPU acceleration, we achieve significant computational performance improvements. The study compares Python implementations using CuPy and NumPy libraries with traditional FORTRAN implementations utilizing the LAPACK library, highlighting the efficiency and precision of GPU-accelerated calculations. Results show that Python with CuPy significantly outperforms NumPy, both in a Colab environment and on a personal desktop computer. This demonstrates the practicality of cloud-based solutions for intensive computations, as the ability to run code directly in the browser through Colab eliminates the need for extensive local hardware resources. The results emphasize the convenience of executing complex simulations without relying on physical computers, promoting greater flexibility and accessibility in computational research. All computational codes are available on GitHub for transparency and reproducibility.
Downloads
References
[1] Derstine, K.L. DIF3D: a code to solve one-, two-, and three-dimensional finite-difference diffusion theory problems. ANL- Technical Report-82-64. United States, 1984.
[2] Fletcher, J.K. “The solution of the time-independent multi-group neutron transport equation using spherical harmonics”. Annals of Nuclear Energy, vol. 4, pp. 401–405, 1977.
[3] Araujo, L.M.; Carmo, E.G.D.; Silva, F.C. Galerkin partial least-square SN (GpLS - SN) method for fixed source problems in the neutrons transport theory. Annals of Nuclear Energy. vol. 90, pp. 175-190, 2016.
[4] Finnemann, H.; Bennewitz, F.; Wagner, M.R. Interface current techniques for multidimensional reactor calculations. Atomkernenergie. vol. 30, pp. 123-128, 1977.
[5] Silva, A.; Pessoa, P.O.; Silva, F.C.; Martinez, A.S. Two-dimensional analytical solution for nodal calculation of nuclear reactors. Annals of Nuclear Energy, vol. 100, pp. 76-81, 2016.
[6] Pessoa, P.O.; Silva, F.C.; Martinez, A.S. Analytical method of pin-by-pin reconstruction of the nuclear power density distribution. In: INTERNATIONAL NUCLEAR ATLANTIC CONFERENCE – INAC. PE, Brazil, 2013.
[7] Pessoa, P.O.; Silva, F.C.; Martinez, A.S. Methods for reconstruction of the density distribution of nuclear power. Annals of Nuclear Energy, vol. 83, pp. 76–86, 2015.
[8] Pessoa, P.O.; Silva, F.C.; Martinez, A.S. Finite difference applied to the reconstruction method of the nuclear power density distribution. Annals of Nuclear Energy, vol. 92, pp. 378–390, 2016.
[9] Pessoa, P.O.; Araujo, L.M.; Silva, F.C. A strategy for pin power reconstruction based on classic Galerkin variational formulation. Progress in Nuclear Energy, vol. 104, pp. 251–263. 2018.
[10] Pessoa, P.O.; Araujo, L.M.; Silva, F.C. Numerical methods applied to pin power reconstruction based on coarse-mesh nodal calculation. Annals of Nuclear Energy, vol. 118, pp. 291–312, 2018.
[11] Pessoa, P.O. and Henrice, E. J. Efficient Acceleration in Solving the 2D Neutron Diffusion Equation with CUDA: Exploring the Collaborative Practicality of Colab. In: INTERNATIONAL NUCLEAR ATLANTIC CONFERENCE – INAC. RJ, Brazil, 2024.
[12] Okuta, R.; Unno, Y.; Nishino, D.; Hido, S.; Loomis, C. CuPy: A NumPy-Compatible Library for NVIDIA GPU Calculations. In: 31ST CONFERENCE ON NEURAL INFORMATION PROCESSING SYSTEMS (NIPS 2017), Long Beach, CA, USA, 2017.
[13] Harris, C.R.; Millman, K.J.; van der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; Kern, R.; Picus, M.; Hoyer, S.; van Kerkwijk, M.H.; Wieser, E.; Brett, M.; Haldane, A.; Del Rio, J.F.; Wiebe, M.; Peterson, P.; Sheppard, K.; Reddy, T.; Weckesser, W.; Abbasi, H.; Gohlke, C.; Oliphant, T.E. Array programming with NumPy. Nature, vol. 585, pp. 357-362, 2020.
[14] Anderson, E.; Bai, Z.; Bischof, C.; Demmel, J.; Dongarra, J.; Du Croz, J.; Greenbaum, A.; Hammarling, S.; McKenney, A.; Sorensen, D. LAPACK Users’ Guide. Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 1999.
[15] Henrice, E.; Palma, D.A.P.; Gonçalves, A.C. Online identification of trips caused by the external proton source in an ADS reactor. Nuclear Engineering and Design, vol. 383, pp. 111-419, 2021.
[16] Henrice, E.; Palma, D.A.P.; Gonçalves, A.C.; Mesquita, A.Z. Support to the identification of anomalies in an external neutron source using Hurst Exponents. Progress in Nuclear Energy, vol. 99, pp. 119-126, 2017.
Downloads
Published
Issue
Section
Categories
License
Copyright (c) 2025 Paulo Igor de Oliveira Pessoa, Dr. Edson Henrice

This work is licensed under a Creative Commons Attribution 4.0 International License.
Licensing: The BJRS articles are licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/