Solving permeability on an open access binary image - GeoChemFoam/GeoChemFoam GitHub Wiki

** Not updated for latest version GeoChemFoam-5.0 **

In this tutorial we are going to solve permeability with water as the fluid using the on a segmented image downloaded from the digital rocks portal.

  1. Download this image from the digital rocks portal. Note down the resolution. In this case the resolution is 2.25 microns as stated in the image information on the digital rocks portal. Also note down the dimensions of the image. In this case the dimensions are 1000 x 1000 x 1000 voxels as written on the digital rocks portal.

  2. Open the image in Fiji. Do not skip this step! It is very important to confirm the image dimensions, resolution, and the value of the segmented phases. If you get these values wrong, GeoChemFoam will either crash or the results will be incorrect. In order to look at the image you will have to input the dimensions and the type of image. The type of image is 8-bit in this case and the dimensions are 1000x1000x1000. However, these values are not always recorded correctly and if you open the image and it looks odd, either the dimensions or the image type is probably wrong. You will need to figure out the correct ones before continuing.

  1. At first the image may appear blank. Go to Image->Adjust->Brightness&Contrast and set the maximum to 1 to view the image.

  2. Note down the value of the pores and the value of the grains. These can be found by mousing over each phase and looking at the value displayed in the dialog box. In this case the value of the pores is 0 and the value of the grains is 1. *Note: This must be a binary image - if there are more than 2 values in the image it cannot be used with this solver as is and you will have to segment it further.

  1. Close the image and open the GeoChemFoam Docker. Copy the image into your $GCFOAM_RUNS directory. *Note: All images used in this tutorial must be 8-bit. If your image was not 8-bit, you can convert it using fiji by Image->Type->8-bit. Then repeat steps 2-4 on the 8-bit image.

  2. Compress the image into .tar.gz using the command tar -czf Bentheimer_2d25um_binary.raw.tar.gz Bentheimer_2d25um_binary.raw. Then copy the tarball into the $GCFOAM_IMG/raw/ directory. cp Bentheimer_2d25um_binary.raw.tar.gz $GCFOAM_IMG/raw/

  3. Navigate to the tutorial 1 directory. cd $GCFOAM_TUTORIALS/transport/multiSpeciesTransportFoam/Ketton and open the initCase.sh script vi initCase.sh. Here there are several values that we need to change: the image name, dimensions, resolution, and value of the pores and grains.

  1. Press i to go into insertion mode and edit these values to the ones you have noted down previously. Then press esc to leave insert mode and then :wq enter to save the changes and quit the editor.
  1. Run ./initCase.sh to initialise the image mesh. If it ran the output should be:
  1. Make a new directory for these simulations in your runs folder mkdir $GCFOAM_RUNS/Bentheimer/ and then copy in your results cp -r ../Ketton/* $GCFOAM_RUNS/Bentheimer/ and open them in Paraview. Do not skip this step! If the mesh is incorrect or incomplete, the flow will also be incorrect.
  1. Open the runCaseFlow.sh script vi runCaseFlow.sh. Here we need to change the viscosity value to that of water. Press i to go into insertion mode and edit the Visc value to 1e-6. Then press esc to leave insert mode and :wq enter to save the changes and quit the editor.

  2. Run ./runCaseFlow.sh to compute the flow fields and permeability.

  1. Check that the flow solver has converged. tail simpleFoamFlow.out. In my case, it converged in 373 iterations.
  1. Look at the poroPerm.csv results file cat poroPerm.csv. Note that the reynolds number is great than 1. This means that the permeability results are invalid! To fix this we must decrease the pressure drop and rerun the flow.
  1. First delete the flow results ./deleteFlow.sh.

  2. Edit runCaseFlow.sh and change the deltaP to a lower value. I have chose 0.1.

  3. Check that the flow solver has converged tail simpleFoamFlow.out and look at the poroPerm file cat poroPerm.csv. In this case the flow solver converged in 194 iterations and the Reynolds number is much less than 1. These permeability results are valid.

  1. Copy your results into your runs folder cp -r ../Ketton/* $GCFOAM_RUNS/Bentheimer/ and plot the flow streamlines in Paraview.