Simple and efficient TRANsport Simulation Environment for density-driven fluid flow and coupled transport of heat and chemical species
Authors: Kempka Thomas 
Published: March 2020

&lt;p&gt;Many different scientific open-source and commercial black-box software packages are available for the simulation of fluid flow and transport processes in the geological subsurface. Unfortunately, most of these simulators are limited by tightly integrated chemical modules with insufficient capabilities or the general lack of flexible interfaces applicable for an efficient coupling of third-party chemical libraries. Furthermore, most available open-source numerical frameworks are too complex to be used for educating geosciences students in numerical modelling techniques beyond the general application of ready-for-use simulators to specific modelling challenges. Taking into consideration that the development of a critical perspective of an emerging modeller requires fundamental analysis and understanding of common numerical modelling approaches and pitfalls, scientific source codes written in lower-level programming languages (e.g., FORTRAN, C++ or C) are per se less comprehensible compared to higher-level language implementations (e.g., Python). Hereby, the general lack of proper source code documentation, observed in many scientific open-source numerical codes additionally reduces code readability, and thus hinders code further development by third parties.&lt;br&gt;To overcome many of these limitations, the TRANsport Simulation Environment (TRANSE) has been developed based on the finite difference method. It allows for a highly flexible integration and coupling of arbitrary processes with thermodynamic and chemical libraries to consider chemical reactions and fluid equations of state. To date, TRANSE solves the pressure-based and density-driven formulation of the Darcy flow equation, coupled with the equations for transport of heat and chemical species on structured grids by simple explicit, weighted semi-implicit or fully-implicit numerical schemes, and is composed of less than 1,000 lines of Python code. A flux-corrected advection scheme can be employed in addition to pure upwinding to minimise numerical dispersion in transport problems dominated by high P&amp;#233;clet numbers.&lt;br&gt;Just-in-time compilation by means of the Python Numba library results in computational times in the order of equivalent lower-level language implementations (e.g., FORTRAN, C or C++), while CPU-based parallelisation allows for the realisation of high spatial model discretisations. Chemical libraries coupled to TRANSE can be easily parallelised to increase the overall computational efficiency, whereby the latter is especially relevant as chemistry usually represents the main computational bottleneck in reactive transport simulations. Python&amp;#8217;s numpy library is used to enable fast and efficient model parametrisation as well as simulation runtime control, whereby the Matplotlib library is employed for automated visualisation. More sophisticated visualisation and post-processing are achieved by using the EVTK library for exporting VTK-compatible data to the interactive software packages VisIt, Mayavi or Paraview.&amp;#160;&lt;br&gt;The present contribution demonstrates the basic validity of the code implementation by comparison against standard numerical model benchmarks for heat (1D heat diffusion) and fluid flow (Theis problem), advective transport (rotating cone test), density-driven fluid flow (Henry&amp;#8217;s and Elder&amp;#8217;s problems) as well as available density- and viscosity-driven hydrothermal convection in porous media. A fully coupled application example considering reactive transport of gaseous chemical species at high temperatures is presented.&lt;/p&gt;