Scale Correction is essential step when we dealing with Reservoir Simulation because the data we get from core samples is in few inches and in Reservoir Simulation we deal with grids that have minimum dimensions(10 X 10 X 10 meters).
So let’s start and upload some Data.
data<-read.csv("C:/Users/hp/Desktop/karpur.csv",header=T)
summary(data)## depth caliper ind.deep ind.med
## Min. :5667 Min. :8.487 Min. : 6.532 Min. : 9.386
## 1st Qu.:5769 1st Qu.:8.556 1st Qu.: 32.977 1st Qu.: 25.485
## Median :5872 Median :8.588 Median :217.849 Median :254.383
## Mean :5872 Mean :8.622 Mean :276.168 Mean :273.025
## 3rd Qu.:5977 3rd Qu.:8.686 3rd Qu.:566.793 3rd Qu.:544.232
## Max. :6083 Max. :8.886 Max. :769.484 Max. :746.028
## gamma phi.N R.deep R.med
## Min. : 16.74 Min. :0.0150 Min. : 1.300 Min. : 1.340
## 1st Qu.: 40.89 1st Qu.:0.2030 1st Qu.: 1.764 1st Qu.: 1.837
## Median : 52.24 Median :0.2450 Median : 4.590 Median : 3.931
## Mean : 53.42 Mean :0.2195 Mean : 23.048 Mean : 21.858
## 3rd Qu.: 62.24 3rd Qu.:0.2640 3rd Qu.: 30.324 3rd Qu.: 39.239
## Max. :112.40 Max. :0.4100 Max. :153.085 Max. :106.542
## SP density.corr density phi.core
## Min. :-73.95 Min. :-0.067000 Min. :1.758 Min. :15.70
## 1st Qu.:-42.83 1st Qu.:-0.016000 1st Qu.:2.023 1st Qu.:23.90
## Median :-32.32 Median :-0.007000 Median :2.099 Median :27.62
## Mean :-30.89 Mean :-0.008899 Mean :2.099 Mean :27.03
## 3rd Qu.:-19.48 3rd Qu.: 0.002000 3rd Qu.:2.181 3rd Qu.:30.80
## Max. : 25.13 Max. : 0.089000 Max. :2.387 Max. :35.60
## k.core Facies
## Min. : 0.42 Length:819
## 1st Qu.: 661.34 Class :character
## Median : 1628.75 Mode :character
## Mean : 2277.23
## 3rd Qu.: 3020.02
## Max. :15600.00
At First , we should find the correlation between phi.core and phi.log
model1 <- lm(phi.core/100 ~ phi.N+Facies-1, data = data)
summary(model1)##
## Call:
## lm(formula = phi.core/100 ~ phi.N + Facies - 1, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.093409 -0.012249 0.000000 0.009485 0.133157
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## phi.N -0.046544 0.018402 -2.529 0.0116 *
## FaciesF1 0.312773 0.003763 83.119 <2e-16 ***
## FaciesF10 0.224114 0.005176 43.296 <2e-16 ***
## FaciesF11 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF12 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF13 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF14 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF15 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF16 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF17 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF18 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF19 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF2 0.206915 0.009290 22.273 <2e-16 ***
## FaciesF20 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF21 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF22 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF23 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF24 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF25 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF26 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF27 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF28 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF29 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF3 0.246369 0.005088 48.424 <2e-16 ***
## FaciesF30 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF31 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF32 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF33 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF34 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF35 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF36 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF37 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF38 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF39 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF4 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF40 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF41 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF42 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF43 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF44 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF45 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF46 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF47 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF48 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF49 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF5 0.284140 0.004027 70.556 <2e-16 ***
## FaciesF50 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF51 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF52 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF53 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF54 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF55 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF56 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF57 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF6 0.340072 0.024826 13.698 <2e-16 ***
## FaciesF7 0.248637 0.008714 28.532 <2e-16 ***
## FaciesF8 0.321633 0.005123 62.785 <2e-16 ***
## FaciesF9 0.279685 0.004928 56.756 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0248 on 761 degrees of freedom
## Multiple R-squared: 0.9924, Adjusted R-squared: 0.9918
## F-statistic: 1714 on 58 and 761 DF, p-value: < 2.2e-16
par(mfrow=c(2,2))
plot(model1, col="red")## Warning: not plotting observations with leverage one:
## 12, 14, 19, 20, 21, 22, 23, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 38, 39, 40, 41, 42, 43, 44, 47, 48, 49, 50, 52, 53, 55, 56, 57, 59, 60, 61, 62, 63, 64
## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
Predict the core porosity corrected to the log scale by using phi.core and phi.log
phi.corel<-predict(model1,data)To Compare between core porosity and core porosity corrected to the log scale
#cbind(data$phi.core/100,phi.corel)Construction a relationship between permeability calculated from core and core porosity corrected to the log scale in order to get core premeability corrected to the log scale
model2<-lm(k.core~phi.corel+Facies-1,data=data)
summary(model2)##
## Call:
## lm(formula = k.core ~ phi.corel + Facies - 1, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5579.1 -593.0 -101.8 462.7 10477.4
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## phi.corel 117709 25443 4.626 4.37e-06 ***
## FaciesF1 -33993 7850 -4.330 1.69e-05 ***
## FaciesF10 -24151 5393 -4.478 8.69e-06 ***
## FaciesF11 -36938 8721 -4.235 2.56e-05 ***
## FaciesF12 -36938 8721 -4.235 2.56e-05 ***
## FaciesF13 -36938 8721 -4.235 2.56e-05 ***
## FaciesF14 -36938 8721 -4.235 2.56e-05 ***
## FaciesF15 -36938 8721 -4.235 2.56e-05 ***
## FaciesF16 -36938 8721 -4.235 2.56e-05 ***
## FaciesF17 -36938 8721 -4.235 2.56e-05 ***
## FaciesF18 -36938 8721 -4.235 2.56e-05 ***
## FaciesF19 -36938 8721 -4.235 2.56e-05 ***
## FaciesF2 -22489 5020 -4.480 8.61e-06 ***
## FaciesF20 -36938 8721 -4.235 2.56e-05 ***
## FaciesF21 -36938 8721 -4.235 2.56e-05 ***
## FaciesF22 -36938 8721 -4.235 2.56e-05 ***
## FaciesF23 -36938 8721 -4.235 2.56e-05 ***
## FaciesF24 -36938 8721 -4.235 2.56e-05 ***
## FaciesF25 -36938 8721 -4.235 2.56e-05 ***
## FaciesF26 -36938 8721 -4.235 2.56e-05 ***
## FaciesF27 -36938 8721 -4.235 2.56e-05 ***
## FaciesF28 -36938 8721 -4.235 2.56e-05 ***
## FaciesF29 -36938 8721 -4.235 2.56e-05 ***
## FaciesF3 -26723 6024 -4.436 1.05e-05 ***
## FaciesF30 -36938 8721 -4.235 2.56e-05 ***
## FaciesF31 -36938 8721 -4.235 2.56e-05 ***
## FaciesF32 -36938 8721 -4.235 2.56e-05 ***
## FaciesF33 -36938 8721 -4.235 2.56e-05 ***
## FaciesF34 -36938 8721 -4.235 2.56e-05 ***
## FaciesF35 -36938 8721 -4.235 2.56e-05 ***
## FaciesF36 -36938 8721 -4.235 2.56e-05 ***
## FaciesF37 -36938 8721 -4.235 2.56e-05 ***
## FaciesF38 -36938 8721 -4.235 2.56e-05 ***
## FaciesF39 -36938 8721 -4.235 2.56e-05 ***
## FaciesF4 -36938 8721 -4.235 2.56e-05 ***
## FaciesF40 -36938 8721 -4.235 2.56e-05 ***
## FaciesF41 -36938 8721 -4.235 2.56e-05 ***
## FaciesF42 -36938 8721 -4.235 2.56e-05 ***
## FaciesF43 -36938 8721 -4.235 2.56e-05 ***
## FaciesF44 -36938 8721 -4.235 2.56e-05 ***
## FaciesF45 -36938 8721 -4.235 2.56e-05 ***
## FaciesF46 -36938 8721 -4.235 2.56e-05 ***
## FaciesF47 -36938 8721 -4.235 2.56e-05 ***
## FaciesF48 -36938 8721 -4.235 2.56e-05 ***
## FaciesF49 -36938 8721 -4.235 2.56e-05 ***
## FaciesF5 -27118 7021 -3.862 0.000122 ***
## FaciesF50 -36938 8721 -4.235 2.56e-05 ***
## FaciesF51 -36938 8721 -4.235 2.56e-05 ***
## FaciesF52 -36938 8721 -4.235 2.56e-05 ***
## FaciesF53 -36938 8721 -4.235 2.56e-05 ***
## FaciesF54 -36938 8721 -4.235 2.56e-05 ***
## FaciesF55 -36938 8721 -4.235 2.56e-05 ***
## FaciesF56 -36938 8721 -4.235 2.56e-05 ***
## FaciesF57 -36938 8721 -4.235 2.56e-05 ***
## FaciesF6 -36938 8721 -4.235 2.56e-05 ***
## FaciesF7 -26245 6102 -4.301 1.92e-05 ***
## FaciesF8 -33018 7876 -4.192 3.09e-05 ***
## FaciesF9 -30646 6824 -4.491 8.19e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1596 on 761 degrees of freedom
## Multiple R-squared: 0.7674, Adjusted R-squared: 0.7497
## F-statistic: 43.29 on 58 and 761 DF, p-value: < 2.2e-16
par(mfrow=c(2,2))
plot(model2, col="red")## Warning: not plotting observations with leverage one:
## 12, 14, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 37, 38, 39, 41, 44, 45, 46, 47, 49, 51, 52, 53, 54, 55, 56, 57, 58, 61, 63, 64, 65
## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
Predict and plot the core permeability corrected to the log scale
k.corel<-predict(model2,data)
plot(k.corel, col="red",ylab="K.corel (md)",xlab="Samples (n)")To Compare between core permeability and core permeability corrected to the log scale
#cbind(data$k.core,k.corel)Combine the new column of corrected permeability to the file
karpur2<-cbind(data,k.corel)
write.csv(karpur2,"karpur2.csv")
head(karpur2)## depth caliper ind.deep ind.med gamma phi.N R.deep R.med SP
## 1 5667.0 8.685 618.005 569.781 98.823 0.410 1.618 1.755 -56.587
## 2 5667.5 8.686 497.547 419.494 90.640 0.307 2.010 2.384 -61.916
## 3 5668.0 8.686 384.935 300.155 78.087 0.203 2.598 3.332 -55.861
## 4 5668.5 8.686 278.324 205.224 66.232 0.119 3.593 4.873 -41.860
## 5 5669.0 8.686 183.743 131.155 59.807 0.069 5.442 7.625 -34.934
## 6 5669.5 8.686 109.512 75.633 57.109 0.048 9.131 13.222 -39.769
## density.corr density phi.core k.core Facies k.corel
## 1 -0.033 2.205 33.9000 2442.590 F1 577.0803
## 2 -0.067 2.040 33.4131 3006.989 F1 1141.3830
## 3 -0.064 1.888 33.1000 3370.000 F1 1711.1644
## 4 -0.053 1.794 34.9000 2270.000 F1 2171.3725
## 5 -0.054 1.758 35.0644 2530.758 F1 2445.3059
## 6 -0.058 1.759 35.3152 2928.314 F1 2560.3579
#plot histigram
par(mfrow=c(1,2))
hist(phi.corel,col='red',main='')
hist(k.corel,col='gold',main='')#plot graph
par(mfrow=c(1,5))
plot(y=y<-(data$depth),ylim=rev(range(data$depth)),x=x<-(data$phi.core/100),type="l", col="darkgreen", lwd = 5, pch=17, xlab='phi.core',
ylab='Depth, m', xlim=c(0.14,0.38), cex=1.5, cex.lab=1.5, cex.axis=1.2)
grid()
plot(y=y<-(data$depth),ylim=rev(range(data$depth)),x=x<-(data$ k.core),type="l", col="red", lwd = 5, pch=17, xlab='k.core',
ylab='Depth, m', xlim=c(0.22,15800.00), cex=1.5, cex.lab=1.5, cex.axis=1.2)
grid()
plot(y=y<-(data$depth),ylim=rev(range(data$depth)),x=x<-(data$ phi.N),type="l", col="yellow", lwd = 5, pch=17, xlab='phi.N',
ylab='Depth, m', xlim=c(0.012,0.510), cex=1.5, cex.lab=1.5, cex.axis=1.2)
grid()
plot(y=y<-(data$depth),ylim=rev(range(data$depth)),x=x<-(phi.corel),type="l", col="pink", lwd = 5, pch=17, xlab='phi.corel',
ylab='Depth, m', xlim=c(0.16,0.38), cex=1.5, cex.lab=1.5, cex.axis=1.2)
grid()
plot(y=y<-(data$depth),ylim=rev(range(data$depth)),x=x<-(k.corel),type="l", col="blue", lwd = 5, pch=17, xlab='k.corel',
ylab='Depth, m', xlim=c(10,6400), cex=1.5, cex.lab=1.5, cex.axis=1.2)
grid()