The borehole-to-surface electromagnetic (BSEM) method complements surface and airborne electromagnetic (EM) methods. The borehole is typically filled with conductive media, which significantly impacts the responses. To accurately simulate the responses, the borehole needs to be modeled. However, the size of the borehole is very small compared with the entire computational domain, making it challenging to discretize the borehole accurately. We develop a high-accuracy 3D finite-element forward-modeling algorithm for the BSEM method using octree meshes. The basic idea of octree meshes is to locally refine the mesh by dividing the hexahedral element into eight smaller elements. This approach has the advantage of being able to accurately discretize small geometric features while using coarse meshes in other areas, thus reducing the computational cost. In addition, high-order basis functions are used to improve the accuracy of numerical solutions. We develop a 3D forward-modeling code for BSEM using the C++ programming language. We verify the correctness and accuracy of our implementation by comparing the numerical responses with analytical solutions. Furthermore, we determine the influence of the borehole on the EM responses, showing that the borehole will cause a decrease of several orders of magnitude in the responses when the borehole is filled with highly conductive media. We also use two 3D models to demonstrate the efficacy of octree meshes in the discretization of complex structures and to discuss the effectiveness and sensitivity of BSEM data in the exploration of mineral and oil-gas resources. The code is open source under the Massachusetts Institute of Technology license and can be used as an accurate modeling tool for BSEM responses, providing useful guidance for field exploration. The code is designed with a modular architecture, ensuring ease of maintenance and the ability to extend to other EM methods and serve as the foundation for 3D inversion.

You do not have access to this content, please speak to your institutional administrator if you feel you should have access.