Test Case 02 Injection of water through oil a 2D micromodel - GeoChemFoam/GeoChemFoam GitHub Wiki

This test case considers multiphase flow in a 2D micromodel. The image can be found in the $GCFOAM_IMG/raw directory with the name HM12_2_4. The domain is of size 1.8cm by 1.8 cm. The two fluids are water (density = 1000 kg/m^3, viscosity = 1 mPa.s) and oil (density = 750 kg/m^3, viscosity=1.5 mPa.s). The surface tension is set to 30 mN/m. The pore walls are set to be oil-wet with a contact angle of 45 degrees. The domain is initially filled with 25% water and 75% oil and we inject water from the left boundary with a flow rate of 3.5e-8 m3/s, which corresponds to a capillary number of ~ 10-3.

  1. Copy the tutorial into the runs directory. cp -r $GCFOAM_TUTORIALS/multiphase/interFoam/micromodel $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/micromodel. If you are using Docker, it is recommended that you run the test case directly in its tutorial directory (for performance). cd $GCFOAM_TUTORIALS/multiphase/interFoam/micromodel. You will then need to copy the case in the result in the runs directory after each step for visualisation.

  3. We first need to define the domain, unpack the image and create a mesh by running the ./createMesh.sh script. This is a similar script than the one use in Test case 1, but this test case is defined in 2D. The image is a A 2000x2000x10 voxel raw image with a resolution of 30 microns. A 600x600x5 box is meshed using a 300x300 2D mesh, (making the resolution 60 microns). First the image is unpacked and converted from a raw file to an stl using the 'raw2stl.py' script. A 300x300 background cartesian mesh is created and decomposed if using more than 1 processor. You can visualise the stl image ('constant/triSurface/Image_meshed.stl') using paraview and check that the outline of the blockMesh matches the image boundary (Fig. 1). If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../micromodel/* $GCFOAM_RUNS/micromodel/.

Micromodel STL

Figure 1: STL image and mesh outline of HM12_2_4 micromodel

  1. Then the ./runSnappyHexMesh.sh 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 ../micromodel/* $GCFOAM_RUNS/micromodel/.

Micromodel Mesh

Figure 2: The meshed pore space of HM12_2_4 micromodel.

Micromodel mesh zoom

Figure 3: The meshed pore space of HM12_2_4 micromodel.

  1. The next step is to prepare the flow field calculation using the ./initCaseSPFlow.sh script. A constant flow rate (3.5e-8 m3/s) and fluid viscosity (1e-6 m^2/s) are defined. If the mesh was created in parallel, the mesh is reconstructed and the velocity and pressure fields are decomposed on the processors.

  2. The ./runCaseSPFlow.sh runs a single-phase flow simulation. SimpleFoam is run to compute the flow in the pore space from the constant flow rate and viscosity defined in the './initCaseSPFlow.sh' script. If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../micromodel/* $GCFOAM_RUNS/micromodel/.

Micromodel velocity

Figure 4: Streamlines in HM12_2_4 micromodel

  1. The script ./processSPFlow.sh move the results of simpleFoam to the '0' folder and calculate permeability using 'processPoroPerm'.
cat poroPerm.csv
time poro perm Lpore Re UD
0 0.427063 1.47315e-09 0.00016612 5.01433 0.0128909
  1. The ./initCaseTPFlow.sh prepares the case for two-phase flow simulation. This script defines the fluid properties and flow conditions. The 'setFields' utility is used to fill 25% of the domain from the inlet in the direction of the flow with oil to avoid capillary end effect. If more than one processor is used, the mesh is decomposed using 'decomposePar'.

Micromodel 0

Figure 5: Initial phase volume fraction in HM12_2_4 micromodel.

  1. The script ./runCaseTPFlow.sh simulate two-phase flow (oil drainage) in the domain with the fluid properties and flow conditions defined in the 'initCaseTPflow.sh' script. The two-phase flow is run using 'interGCFoam'. The process can be visualized using paraview. If you are using Docker, you need to copy the results in the runs folder to visualise them. cp -r ../micromodel/* $GCFOAM_RUNS/micromodel/.

Micromodel two-phase flow

Figure 6: Multiphase flow in HM12_2_4 micromodel.

  1. Finally, the script ./processTPFlow.sh calculates the relative permeability using the 'processRelPerm' utility.
cat relperm.csv
poro 0.427063 
perm 1.47315e-09 m2
Ca1 0.0010385 Ca2 0.0148048
Sw krw kwo 
0.959307 0.844567 0.0691922 
0.921809 0.75983 0.149957 
0.883564 0.738252 0.220144 
0.844295 0.599248 0.362069 
0.805749 0.566116 0.411392 
0.767937 0.466014 0.515282 
0.733278 0.42268 0.620667 
0.697546 0.313546 0.616037 
0.661387 0.371392 0.644819 
0.628166 0.317848 0.732641  

Micromodel relative permeability

Figure 7: Water-oil relative permeability in HM12_2_4 micromodel (Ca~1e-3).

Note that this relative permeability is strongly viscous dominated due to the large capillary number. Divide the flow rate by a factor 10 or 100 and increase the total time by the same to obtain a less viscous dominated relative permeability.

⚠️ **GitHub.com Fallback** ⚠️