Skip to content

lanl/LBM3RT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LBM3RT: Lattice Boltzmann Methods for Multiphase Multicomponent Reactive Transport (O4872)

This repository contains a Fortran 90 code for pore-scale / micromodel simulations of 3D fluid flow–solute transport–geochemical reactions.

The solver uses:

  • D3Q19 Lattice Boltzmann Method (LBM) for single-phase incompressible fluid flow
  • D3Q7 LBM for multi-component solute advection–diffusion
  • A PFLOTRAN-style geochemical kernel (ptran_* files) for equilibrium (homogeneous) + kinetic (heterogeneous) reactions

It can simulate dissolution–precipitation, mineral surface reactions, and related processes.

Directory Layout

Main Programs

  • micromodel.F90 — program micromodel
    Generates a geometry file wallin_small.raw (logical 4D array (nkin, lx, ly, lz) that is reordered and written to file). nkin represents the number of different minerals.

  • lbm3d.F90 — program lbm3d_mpi
    Main 3D LBM + solute + PFLOTRAN chemistry solver with MPI parallelization.

    Handles:

    • ptran_read & ptran_chem to read chemistry input and initialize the geochemical system
    • setupMPI to set up domain decomposition and MPI derived datatypes
    • initialize_flow, initialize_solute to set initial flow and concentration fields
    • Main time loop with calls to collision_*, streaming_*, boundary_*, ptran_speciation, etc.
    • Output through routines in output.F90 as binary .raw files

Key Modules (by function)

LBM: Flow / Solute

  • comvar.F90 — global parameters, D3Q19/D3Q7 velocity sets and weights
  • initialize_flow.F90initialize_flow, sets initial density and velocity
  • equilf.F90, equilg.F90, collision_flow.F90, streaming_flow.F90, boundary_flow.F90 — equilibrium quantities, flow collision, streaming, and BCs
  • concentration.F90, solve.F90, collision_solute.F90, streaming_solute.F90, boundary_solute.F90, init_solute.F90 — multi-component solute advection–diffusion–reaction computation
  • denvel.F90, perind3d.F90, bindex3d.F90 — density/velocity and index utilities

Geochemistry (PFLOTRAN kernel)

  • ptran_global.F90 — global PFLOTRAN-style parameters (number of species/minerals, time stepping, flags like new, iread, etc.)
  • ptran_read.F90, pflow_read_gridsize.F90 — reads ptran.in control file
  • ptran_dbase.F90 — reads geochemical database (e.g., hanford.dat)
  • ptran_init.F90ptran_chem main initialization entry point
  • ptran_speciation.F90, ptran_setbnd.F90, trgamdh.F90, trdynmem.F90, trionexc.F90, etc. — mass balance, activities, reaction kinetics
  • water_eos.F90, co2eos.F90 — EOS modules for water and CO₂

MPI & I/O

  • setup_MPI.F90 — MPI topology (2D MPI grid in y and z), domain reordering, and derived datatypes
  • MPI_comm.F90 — halo exchanges for LBM distribution functions and solute fields
  • fileio.F90 — generic input utilities (PFLOTRAN-style fi* read routines)
  • output.F90 — parallel output/gather routines (gather_out_*, scatter_in_*, oflow_*, etc.)
  • inout.F90 — interfaces between LBM and PFLOTRAN quantities (initialization, variable extraction, unit conversion, etc.)

Support Utilities

  • expand.F90, redistri_bnd.F90 — solid update tools

Input Files

  • ptran.in — PFLOTRAN-style input deck. Key cards:

    • Grid size (must match micromodel.F90 geometry), e.g.:
      GRID  15  585  1440
      
    • MPI domain decomposition, e.g. total MPI ranks = 1 × 13 × 120 = 1560:
      PROC  1   13   120
      
    • Geochemical database (example):
      ./hanford.dat
      
    • Other sections (FLOW, DIFF, TIME, MNRL, AQCX, GAS, etc.) define chemical/mineral properties, initial conditions, boundary conditions.
  • hanford.dat — Geochemical database in PFLOTRAN format (aqueous species, minerals, complexes, etc.).

  • wallin_small.raw — Geometry file generated by micromodel, read by lbm3d_mpi during initialization.

Dependencies

  • Fortran 90 compiler (tested with ifort)
  • MPI library (tested with Intel MPI)
  • Unix-like environment (intended for Linux clusters / HPC systems)

Compilation

Important: there are two independent programs.

  • micromodel (geometry generator):
    ifort -o geo_gen src/micromodel.F90
    

Acknowledgements

This work was supported by LANL's LDRD program and was supported as part of the Center on Geo-process in Mineral Carbon Storage, an Energy Frontier Research Center funded by the U.S. Department of Energy (DOE), Office of Science, Basic Energy Sciences (BES), under Award # DE-SC0023429.

License

© 2025. Triad National Security, LLC. All rights reserved. This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare. derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.

Contact

Dr. Qinjun Kang - qkang@lanl.gov

About

Lattice Boltzmann Methods for Multiphase Multicomponent Reactive Transport

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published