From 9f1f785450c234c7cb39d66683ca4275b48a7c57 Mon Sep 17 00:00:00 2001 From: Thomas Ramstad Date: Mon, 30 Aug 2021 10:07:53 +0200 Subject: [PATCH 1/2] Update grid utility script --- workflows/Util/gridUtil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflows/Util/gridUtil.py b/workflows/Util/gridUtil.py index 16b4e954..35427c59 100644 --- a/workflows/Util/gridUtil.py +++ b/workflows/Util/gridUtil.py @@ -95,6 +95,7 @@ def segmentGrid32to8bit(inputFileName, outputFileName): value_new.tofile(outputFileName) + def addVoidLayers(inputFileName, outputFileName, nx, ny, nz, layers): inputFile=open(inputFileName, 'r') value=np.fromfile(inputFile,dtype=np.uint8) @@ -108,7 +109,7 @@ def addVoidLayers(inputFileName, outputFileName, nx, ny, nz, layers): value_3D.tofile(outputFileName) - +# from and including -- to and including def crop(inputFileName, outputFileName, nx, ny, nz, x1, x2, y1, y2, z1, z2): inputFile=open(inputFileName, 'r') value=np.fromfile(inputFile,dtype=np.uint8) From f3397c9d09f3f2fda86e3d93a75c037c7a0f522a Mon Sep 17 00:00:00 2001 From: Thomas Ramstad Date: Mon, 30 Aug 2021 10:59:52 +0200 Subject: [PATCH 2/2] Update relperm.csv file Added low and high limits for effective permeability based on the effective porosity seen by the decoupled phase. Acts as lower limit --- models/ColorModel.cpp | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/models/ColorModel.cpp b/models/ColorModel.cpp index a71ce0c9..be9ea7a0 100644 --- a/models/ColorModel.cpp +++ b/models/ColorModel.cpp @@ -825,16 +825,29 @@ double ScaLBL_ColorModel::Run(int returntime){ double kAeff_connected = h*h*muA*flow_rate_A_connected/(force_mag); double kBeff_connected = h*h*muB*flow_rate_B_connected/(force_mag); + // Saturation normalized effective permeability to account for decoupled phases and + // effective porosity. + double kAeff_connected_low = (1.0 - current_saturation)*h*h*muA*flow_rate_A_connected/(force_mag); + double kBeff_connected_low = current_saturation*h*h*muB*flow_rate_B_connected/(force_mag); + + double kAeff_disconnected = h*h*muA*flow_rate_A_disconnected/(force_mag); double kBeff_disconnected = h*h*muB*flow_rate_B_disconnected/(force_mag); double kAeff = h*h*muA*(flow_rate_A)/(force_mag); double kBeff = h*h*muB*(flow_rate_B)/(force_mag); + // Saturation normalized effective permeability to account for decoupled phases and + // effective porosity. + double kAeff_low = (1.0 - current_saturation)*h*h*muA*(flow_rate_A)/(force_mag); + double kBeff_low = current_saturation*h*h*muB*(flow_rate_B)/(force_mag); + /* flow rate = [volume of fluid] x [momentum of fluid] / [mass of fluid] */ /* fluid A eats the films */ - double flow_rate_A_filmA = (flow_rate_A*Averages->gnb.M + volA*(vfn_x*dir_x + vfn_y*dir_y + vfn_z*dir_z))/(Averages->gnb.M + Mfn); - double flow_rate_B_filmA = (flow_rate_B*Averages->gwb.M - volB*(vfn_x*dir_x + vfn_y*dir_y + vfn_z*dir_z))/(Averages->gwb.M - (rhoB/rhoA)*Mfn); + double flow_rate_A_filmA = (flow_rate_A*Averages->gnb.M + + volA*(vfn_x*dir_x + vfn_y*dir_y + vfn_z*dir_z))/(Averages->gnb.M + Mfn); + double flow_rate_B_filmA = (flow_rate_B*Averages->gwb.M - + volB*(vfn_x*dir_x + vfn_y*dir_y + vfn_z*dir_z))/(Averages->gwb.M - (rhoB/rhoA)*Mfn); /* fluid B eats the films */ double flow_rate_A_filmB = (flow_rate_A*Averages->gnb.M - volA*(vfw_x*dir_x + vfw_y*dir_y + vfw_z*dir_z))/(Averages->gnb.M - (rhoA/rhoB)*Mfw); double flow_rate_B_filmB = (flow_rate_B*Averages->gwb.M + volB*(vfw_x*dir_x + vfw_y*dir_y + vfw_z*dir_z))/(Averages->gwb.M + Mfw); @@ -855,13 +868,22 @@ double ScaLBL_ColorModel::Run(int returntime){ WriteHeader=true; kr_log_file = fopen("relperm.csv","a"); if (WriteHeader){ - fprintf(kr_log_file,"timesteps sat.water eff.perm.oil eff.perm.water eff.perm.oil.connected eff.perm.water.connected eff.perm.oil.disconnected eff.perm.water.disconnected "); - fprintf(kr_log_file,"eff.perm.oil.upper.bound eff.perm.water.lower.bound eff.perm.oil.lower.bound eff.perm.water.upper.bound "); - fprintf(kr_log_file,"cap.pressure cap.pressure.connected pressure.drop Ca M\n"); + fprintf(kr_log_file, "timesteps sat.water "); + fprintf(kr_log_file, "eff.perm.oil.upper.bound eff.perm.water.upper.bound "); + fprintf(kr_log_file, "eff.perm.oil.lower.bound eff.perm.water.lower.bound "); + fprintf(kr_log_file, "eff.perm.oil.connected.upper.bound eff.perm.water.connected.upper.bound "); + fprintf(kr_log_file, "eff.perm.oil.connected.lower.bound eff.perm.water.connected.lower.bound "); + fprintf(kr_log_file, "eff.perm.oil.disconnected eff.perm.water.disconnected "); + fprintf(kr_log_file, "cap.pressure cap.pressure.connected pressure.drop Ca M\n"); + } - fprintf(kr_log_file,"%i %.5g %.5g %.5g %.5g %.5g %.5g %.5g ",CURRENT_TIMESTEP,current_saturation,kAeff,kBeff,kAeff_connected,kBeff_connected,kAeff_disconnected,kBeff_disconnected); - fprintf(kr_log_file,"%.5g %.5g %.5g %.5g ",kAeff_filmA, kBeff_filmA, kAeff_filmB,kBeff_filmB); - fprintf(kr_log_file,"%.5g %.5g %.5g %.5g %.5g\n",pAB,pAB_connected,viscous_pressure_drop,Ca,Mobility); + fprintf(kr_log_file,"%i %.5g ", CURRENT_TIMESTEP,current_saturation); + fprintf(kr_log_file,"%.5g %.5g ", kAeff, kBeff); + fprintf(kr_log_file,"%.5g %.5g ", kAeff_low, kBeff_low); + fprintf(kr_log_file,"%.5g %.5g ", kAeff_connected, kBeff_connected); + fprintf(kr_log_file,"%.5g %.5g ", kAeff_connected_low, kBeff_connected_low); + fprintf(kr_log_file,"%.5g %.5g ", kAeff_disconnected, kBeff_disconnected); + fprintf(kr_log_file,"%.5g %.5g %.5g %.5g %.5g\n", pAB, pAB_connected, viscous_pressure_drop, Ca, Mobility); fclose(kr_log_file); printf(" Measured capillary number %f \n ",Ca);