Test Case 12 CO2 dissolution in a cavity - GeoChemFoam/GeoChemFoam GitHub Wiki

In this example, we investigate interface transfer and chemical reactions during dissolution of a CO2 gas bubble in a pore cavity. The geometry is a 6mm x 1mm x 1mm channel, with a 2mm x 2mm x 1mm x cavity in the middle. The domain is meshed using a 2D uniform grid with resolution of 100 microns. Initially, CO2 gas is trapped in the cavity and the rest is filled with water. The system contains 6 species (H2O, H+, OH-, CO2, CO3(2-) and HCO3-). Each species with the exception of H2O is dilute in the aqueous phase. The gas phase is pure CO2. At t=0, we inject pure water at pH=7 from the left boundary at a flow rate of 1 mL/min. In order to save on computational time, this example is done with diffusion coefficient two orders of magnitude larger than is typical for species in water. The script runCase.sh runs the case for 0.5 s with a report interval of 40 microseconds.

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

  2. If you are using the Native version of GeoChemFoam, it is recommended that you run the test case from the runs directory cd $GCFOAM_RUNS/2Dcavity. If you are using Docker, it is recommended that you run the test case directly in its tutorial directory (for performance). cd $GCFOAM_TUTORIALS/multiphaseReactiveTransport/interReactiveTransferFoam/2DCavity/ . You will then need to copy the case and the result to the 'runs' directory after each step for visualisation.

  3. Run the ./createMesh.sh script to define the domain and mesh it. If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../2DCavity/* $GCFOAM_RUNS/2DCavity/

cavity Mesh Fig. 1 Mesh for dissolution of a CO2 bubble in a cavity.

  1. Run the ./initCase0.sh script to define the fluid properties and initialise the bubble. If you are using Docker, you need to copy the results to the runs folder to visualise them. cp -r ../2DCavity/* $GCFOAM_RUNS/2DCavity/

cavity init Fig. 2 Initialisation for dissolution of a CO2 bubble in a cavity.

  1. Run the ./runCase0.sh. This script uses interGCFoam to set the bubble to capillary equilibrium. To check if the bubble is at equilibrium, look up the end of the interGCFoam0.out file tail -n 22 interGCFoam0.out. If the bubble is at capillary equilibrium, the last pc Initial Residual will be lower than 1e-4. cavity tail

If the bubble is not at equilibrium, increase the TotalTime and re-run runCase0.sh until it reaches equilibrium. If you are using Docker, you need to copy the results to the runs folder to visualise them. cp -r ../2DCavity/* $GCFOAM_RUNS/2DCavity/

cavity0 Fig. 4 Equilibrated bubble at T=0 for dissolution of a CO2 bubble in a cavity.

  1. Run the ./initCaseRT.sh script. This script defines the fluid and species properties for the transport simulation. The concentration of CO2 in the bubble is set to rhog/Mw. The concentration of all other species is set to 0. The concentration of species in water are defined in the script.

cavityRT0 Fig. 5 Concentration of CO2 and H+ at T=0 during dissolution of a CO2 bubble in a cavity.

  1. Run the ./runCaseRT.sh script to run the transport simulation up to t=0.2s. If you are using Docker, you need to copy the results to the runs folder to visualise them. cp -r ../2DCavity/* $GCFOAM_RUNS/2DCavity/

cavityRT0.2 Figure 6: Concentration of CO2 and H+ at T=0.2s during dissolution of a CO2 bubble in a cavity.

  1. Modify the script 'runCaseRT.sh' to set TotalTime=0.4 and re-run the ./runCaseRT.sh script to run the transport simulation up to t=0.4s. If you are using Docker, you need to copy the results to the runs folder to visualise them. cp -r ../2DCavity/* $GCFOAM_RUNS/2DCavity/

cavityRT0.4 Figure 7: Concentration of CO2 and H+ at T=0.4s during dissolution of a CO2 bubble in a cavity.

  1. Run the ./processRT.sh script. This script calculate the phase saturation.
cat sat.csv
time sat1 sat2
0 0.62 0.38
0.01 0.621564 0.378436
0.02 0.623013 0.376987
0.03 0.624367 0.375633
0.04 0.625634 0.374366
0.05 0.626833 0.373167
0.06 0.627978 0.372022
0.07 0.629084 0.370916
0.08 0.630164 0.369836
0.09 0.631221 0.368779
0.1 0.632264 0.367736
0.11 0.633291 0.366709
0.12 0.634305 0.365695
0.13 0.635307 0.364693
0.14 0.636303 0.363697
0.15 0.637293 0.362707
0.16 0.638276 0.361724
0.17 0.639247 0.360753
0.18 0.640203 0.359797
0.19 0.641144 0.358856
0.2 0.642065 0.357935
0.21 0.642965 0.357035
0.22 0.643846 0.356154
0.23 0.644703 0.355297
0.24 0.645532 0.354468
0.25 0.646336 0.353664
0.26 0.647119 0.352881
0.27 0.647881 0.352119
0.28 0.648628 0.351372
0.29 0.649363 0.350637
0.3 0.650089 0.349911
0.31 0.650807 0.349193
0.32 0.651519 0.348481
0.33 0.652227 0.347773
0.34 0.652929 0.347071
0.35 0.653627 0.346373
0.36 0.654319 0.345681
0.37 0.655009 0.344991
0.38 0.655695 0.344305
0.39 0.65638 0.34362
0.4 0.657064 0.342936
cat CO2_phaseConc.csv
0 0.000402913 0.0418426
0.01 0.000495046 0.0418556
0.02 0.000577639 0.0418768
0.03 0.000653586 0.0418984
0.04 0.000724558 0.0419184
0.05 0.000790992 0.0419382
0.06 0.000853944 0.0419577
0.07 0.000914436 0.0419769
0.08 0.000972982 0.0419962
0.09 0.00103036 0.0420148
0.1 0.00108701 0.0420329
0.11 0.00114322 0.0420497
0.12 0.00119906 0.0420655
0.13 0.00125467 0.0420803
0.14 0.00131011 0.0420943
0.15 0.00136551 0.0421075
0.16 0.00142083 0.0421199
0.17 0.00147587 0.0421313
0.18 0.00153044 0.0421415
0.19 0.0015844 0.0421509
0.2 0.00163754 0.0421592
0.21 0.00168845 0.0421658
0.22 0.00173956 0.0421729
0.23 0.00178947 0.0421792
0.24 0.00183803 0.0421846
0.25 0.00188518 0.0421895
0.26 0.00193094 0.0421943
0.27 0.00197539 0.0421992
0.28 0.0020187 0.0422041
0.29 0.00206105 0.0422094
0.3 0.00210254 0.042215
0.31 0.00214331 0.0422209
0.32 0.00218359 0.0422269
0.33 0.00222355 0.0422329
0.34 0.00226325 0.0422386
0.35 0.00230275 0.042244
0.36 0.00234207 0.042249
0.37 0.00238126 0.0422538
0.38 0.00242034 0.0422583
0.39 0.00245934 0.0422626
0.4 0.0024983 0.0422668
cat H+_phaseConc.csv
0 9.97413e-08 4.89122e-17
0.01 3.7876e-06 3.27449e-14
0.02 4.53452e-06 3.35506e-14
0.03 5.18123e-06 3.50821e-14
0.04 5.766e-06 3.66026e-14
0.05 6.30595e-06 3.79095e-14
0.06 6.81258e-06 3.94365e-14
0.07 7.29353e-06 4.08283e-14
0.08 7.75318e-06 4.22654e-14
0.09 8.19702e-06 4.3497e-14
0.1 8.62783e-06 4.4634e-14
0.11 9.04802e-06 4.558e-14
0.12 9.459e-06 4.64911e-14
0.13 9.86192e-06 4.76142e-14
0.14 1.02577e-05 4.86242e-14
0.15 1.06472e-05 4.9719e-14
0.16 1.10309e-05 5.0736e-14
0.17 1.14089e-05 5.16482e-14
0.18 1.17812e-05 5.2429e-14
0.19 1.21478e-05 5.3237e-14
0.2 1.25084e-05 5.40052e-14
0.21 1.28598e-05 5.48602e-14
0.22 1.3208e-05 5.57234e-14
0.23 1.35498e-05 5.65757e-14
0.24 1.38852e-05 5.73147e-14
0.25 1.42142e-05 5.79742e-14
0.26 1.45369e-05 5.86849e-14
0.27 1.48537e-05 5.93495e-14
0.28 1.51649e-05 5.99735e-14
0.29 1.54712e-05 6.04801e-14
0.3 1.57729e-05 6.09718e-14
0.31 1.60705e-05 6.14812e-14
0.32 1.63645e-05 6.19681e-14
0.33 1.66554e-05 6.23659e-14
0.34 1.69434e-05 6.28002e-14
0.35 1.72288e-05 6.32803e-14
0.36 1.75116e-05 6.37757e-14
0.37 1.77921e-05 6.42824e-14
0.38 1.80703e-05 6.48114e-14
0.39 1.83464e-05 6.53232e-14
0.4 1.86204e-05 6.57656e-14