Test Case 11 Multiphase reactive transport in a grainstone micromodel - GeoChemFoam/GeoChemFoam GitHub Wiki

This test case simulate calcite surface complexation in a oil-filled 2D grainstone micromodel. The fluids are oil and water. The solid walls are oil-wet with a contact angle of 135 degrees. The pore space is initially filled with oil and we inject water from the left boundary at a constant flow rate. The surface of the solid has previously been equilibrated with a solution of 1000 mg of CaCl2 in water, and we are injecting a solution with lower concentration of CaCl2. Calcium ions are desorbed from the surface and replaced by hydrogen, which increases the pH near the pore walls.

  1. Navigate to the correct tutorial cd $GCFOAM_TUTORIALS/multiphaseReactiveTransport/interReactiveTransportFoam/2DGrainstonesMultiphaseReactiveTransport/ and copy it into 'runs' cp -r ../2DGrainstonesMultiphaseReactiveTransport/ $GCFOAM_RUNS/..

  2. We first need to define the domain, unpack the image and create a mesh by running the ./createMesh.sh script. The image is given in the stl format and it's total size is 1mmx0.6mmx0.1mm. A 0.4mmx0.25mmx0.01mm subdomain is selected and a cartesian mesh of size 200x125x1 is used to mesh it. If more than 1 processor is used (defined as NP), the mesh is decomposed. You can visualise the stl image ('constant/triSurface/Image_meshed.stl') using paraview and check the outline of the blockMesh (Fig. 1). If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../2DGrainstonesMultiphaseReactiveTransport/ $GCFOAM_RUNS/2DGrainstonesMultiphaseReactiveTransport/.

Grainstones STL Figure 1: STL image and domain boundaries for 2D grainstone multiphase reactive transport.

  1. Run the ./runSnappyHexMesh.sh script. This script is used to extract a mesh of the pore-space. The 'snappyHexMesh' utility is run, which snaps the background mesh to the stl image. First it removes all the cells that have more than 50% of their volume in the solid phase, then replaces the cells that have between 0-50% of volume in the solid by cells that latch the solid boundaries as much as possible, then it morphs the mesh to satisfy threshold quality check. If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../2DGrainstonesMultiphaseReactiveTransport/ $GCFOAM_RUNS/2DGrainstonesMultiphaseReactiveTransport/.

grainstoneMesh Figure 2: Mesh for a 2D grainstone micromodel for multiphase reactive transport.

  1. Run the ./initCaseRT.sh script. This script prepares the case for reactive transport simulation by defining the fluid properties and initial conditions.

  2. Run the script ./runCaseRT.sh to solve the reactive transport problem from 0 to 1.5e-3 s. If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../2DGrainstonesMultiphaseReactiveTransport/ $GCFOAM_RUNS/2DGrainstonesMultiphaseReactiveTransport/.

grainstoneGif

Figure 3: Concentration of H+ at t=1.5e-3 s during multiphase reactive transport in a 2D grainstone model.

  1. Modify the Total time in 'runCaseRT.sh. to 3e-3 and rerun the script ./runCaseRT.sh to solve the reactive transport problem from 1.5e-3 to 3e-3 s. If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../2DGrainstonesMultiphaseReactiveTransport/ $GCFOAM_RUNS/2DGrainstonesMultiphaseReactiveTransport/.

grainstoneGif

Figure 4: Concentration of H+ at t=3e-3 s during multiphase reactive transport in a 2D grainstone micromodel.

  1. Run the script ./processRT.sh this script calculate the concentration of all components. Print the concentration of H+:
cat H+_phaseConc.csv
time T1 T2
0 0 0
0.0001 9.68904e-08 1.52134e-13
0.0002 9.02863e-08 3.61204e-13
0.0003 8.33266e-08 2.69076e-12
0.0004 7.70675e-08 4.50601e-12
0.0005 7.15752e-08 3.85998e-12
0.0006 6.76557e-08 4.25955e-12
0.0007 6.46637e-08 5.62073e-12
0.0008 6.24973e-08 5.80588e-12
0.0009 6.06271e-08 5.39304e-12
0.001 5.9069e-08 5.94973e-12
0.0011 5.7727e-08 6.2774e-12
0.0012 5.63e-08 8.05562e-12
0.0013 5.49436e-08 6.6295e-12
0.0014 5.38422e-08 7.17193e-12
0.0015 5.2967e-08 7.60685e-12
0.0016 5.52243e-08 8.68354e-12
0.0017 5.76619e-08 8.66925e-12
0.0018 5.99441e-08 8.63628e-12
0.0019 6.20088e-08 7.85512e-12
0.002 6.38882e-08 8.09512e-12
0.0021 6.5597e-08 7.16359e-12
0.0022 6.71441e-08 7.19262e-12
0.0023 6.85585e-08 7.18893e-12
0.0024 6.9872e-08 5.87091e-12
0.0025 7.10642e-08 5.67643e-12
0.0026 7.21567e-08 5.76765e-12
0.0027 7.31685e-08 5.92651e-12
0.0028 7.4117e-08 6.07242e-12
0.0029 7.50127e-08 6.20675e-12
0.003 7.58562e-08 5.69859e-12