public void FromDensity2() { int count = densLog.SampleCount; List<WellLogSample> LogDens = new List<WellLogSample>(densLog.Samples); Velocity V1 = new Velocity(densLog); V1.GCoef = GCoef; V1.GExp = GExp; V1.FromDensity(); double[] Imp = new double[count]; for (int i = 0; i < count; i++) { rhob = LogDens[i].Value; Imp[i] = V1.vel[i] * rhob; } Borehole b1 = densLog.Borehole; using (ITransaction trans = DataManager.NewTransaction()) { IPropertyVersionService pvs = PetrelSystem.PropertyVersionService; ILogTemplate glob = pvs.FindTemplateByMnemonics("Acoustic Impedance"); PropertyVersion pv = pvs.FindOrCreate(glob); trans.Lock(b1); WellLog log = b1.Logs.CreateWellLog(pv); //log.Name = "rhoB"; WellLogSample[] tsamples = new WellLogSample[count]; for (int i2 = 0; i2 < count; i2++) { double md = LogDens[i2].MD; float val = (float)Imp[i2]; tsamples[i2] = new WellLogSample(md, val); } log.Samples = tsamples; trans.Commit(); } PetrelLogger.InfoBox("The Impedance Log has been created in the same Well"); }
public void OK_Click(object sender, EventArgs e) { // if Density from Porosity is calcuated if (comboLogs1.SelectedIndex == 0 && comboLogs2.SelectedIndex == 0) { if (porWell == null || swWell == null || vshWell == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Density D1 = new Density(porWell, swWell, vshWell); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); D1.rhow = (double)DensityWater.Value; D1.rhoh = (double)DensityHydrocarbon.Value; D1.rhosh = (double)DensityShale.Value; D1.rhomat = (double)DensityMatrix.Value; D1.fromporosity(); //PetrelLogger.InfoBox("The Density Log has been created in the same Well"); } // if Density from Velocity using gardner's equation is calcuated if (comboLogs1.SelectedIndex == 0 && comboLogs2.SelectedIndex == 1) { if (velWell == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Density D2 = new Density(velWell); D2.gcoef = (double)GardCoef.Value / 100; D2.gexp = (double)GardExp.Value / 100; D2.fromvelocity(); //PetrelLogger.InfoBox("The Density Log has been created in the same Well"); } //If Density from Impedance is calculated if (comboLogs1.SelectedIndex == 0 && comboLogs2.SelectedIndex == 2) { if (AEImpWell == null || PSVelWell == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Density D2 = new Density(AEImpWell, PSVelWell); D2.fromimpedance(); //PetrelLogger.InfoBox("The Density Log has been created in the same Well"); } //If Porosity from Density is calculated if (comboLogs1.SelectedIndex == 1 && comboLogs2.SelectedIndex == 0) { if (DensWell == null || swWell2 == null || vshWell2 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Porosity P1 = new Porosity(DensWell, swWell2, vshWell2); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); P1.rhow = (double)DensityWater2.Value; P1.rhoh = (double)DensityHydrocarbon2.Value; P1.rhosh = (double)DensityShale2.Value; P1.rhomat = (double)DensityMatrix2.Value; P1.FromDensity(); //PetrelLogger.InfoBox("The Porosity Log has been created in the same Well"); } //If Porosity from Sonic is calculated(Wyllie Method) if (comboLogs1.SelectedIndex == 1 && comboLogs2.SelectedIndex == 1) { if (SdtWell == null || swWell3 == null || vshWell3 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } int no_use = 0; Porosity P2 = new Porosity(SdtWell, swWell3, vshWell3, no_use); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); P2.dtw = (double)SonicWater.Value / 1000000; P2.dth = (double)SonicHydrocarbon.Value / 1000000; P2.dtsh = (double)SonicShale.Value / 1000000; P2.dtmat = (double)SonicMatrix.Value / 1000000; P2.FromSonic(); //PetrelLogger.InfoBox("The Porosity Log has been created in the same Well"); } //Porosity from Sonic is calculated(Hunt-Raymer Method) if (comboLogs1.SelectedIndex == 1 && comboLogs2.SelectedIndex == 2) { if (SdtWell2 == null || vshWell5 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Porosity P3 = new Porosity(SdtWell2, vshWell5); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); P3.dtw = (double)SonicWater.Value / 1000000; P3.dtsh = (double)SonicShale.Value / 1000000; P3.dtmat = (double)SonicMatrix.Value / 1000000; P3.FromSonic2(); //PetrelLogger.InfoBox("The Porosity Log has been created in the same Well"); } //Porosity from neutron density log if (comboLogs1.SelectedIndex == 1 && comboLogs2.SelectedIndex == 3) { if (NporWell == null || vshWell7 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } int no_use = 0; Porosity P4 = new Porosity(NporWell, vshWell7, no_use); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); P4.Gnsh = (double)NDShale.Value / 100; P4.FromNeutron(); //PetrelLogger.InfoBox("The Porosity Log has been created in the same Well"); } //If Reflection coefficient from Acoustic Impedance is calculate if (comboLogs1.SelectedIndex == 2 && comboLogs2.SelectedIndex == 0) { if (AcImpWell == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } ReflectionCoefficient R1 = new ReflectionCoefficient(AcImpWell); R1.FromAcImp(); //PetrelLogger.InfoBox("The Reflection coefficient Log has been created in the same Well"); } //velocity from porosity is calculated using Hunt-Raymer method if (comboLogs1.SelectedIndex == 3 && comboLogs2.SelectedIndex == 0) { if (porWell2 == null || swWell4 == null || vshWell4 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Velocity V1 = new Velocity(porWell2, swWell4, vshWell4); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); V1.dtw = (double)SonicWater3.Value / 1000000; V1.dth = (double)SonicHydrocarbon3.Value / 1000000; V1.dtsh = (double)SonicShale3.Value / 1000000; V1.dtmat = (double)SonicMatrix3.Value / 1000000; V1.FromPorosity2(); //PetrelLogger.InfoBox("The Velocity Log has been created in the same Well"); } //velocity from porosity is calculated using Wyllie Method if (comboLogs1.SelectedIndex == 3 && comboLogs2.SelectedIndex == 1) { if (porWell3 == null || swWell6 == null || vshWell6 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } int no_use = 0; Velocity V2 = new Velocity(porWell3, swWell6, vshWell6, no_use); //PetrelLogger.InfoOutputWindow(DensityWater.Value.ToString()); V2.dtw = (double)SonicWater4.Value / 1000000; V2.dth = (double)SonicHydrocarbon4.Value / 1000000; V2.dtsh = (double)SonicShale4.Value / 1000000; V2.dtmat = (double)SonicMatrix4.Value / 1000000; V2.FromPorosity3(); //PetrelLogger.InfoBox("The Velocity Log has been created in the same Well"); } //Velocity from gardner's relation is calculated here if (comboLogs1.SelectedIndex == 3 && comboLogs2.SelectedIndex == 2) { if (DensWell3 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Velocity V3 = new Velocity(DensWell3); V3.GCoef = (double)GardCoef3.Value / 100; V3.GExp = (double)GardExp3.Value / 100; V3.FromDensity(); V3.save(); //PetrelLogger.InfoBox("The Velocity Log has been created in the same Well"); } //Shale volume from gamma-ray log is calculated here if (comboLogs1.SelectedIndex == 4 && comboLogs2.SelectedIndex == 0) { if (GrWell == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } ShaleVolume SH1 = new ShaleVolume(GrWell); SH1.Gr0 = (double)ShaleGR0.Value; SH1.Gr100 = (double)ShaleGR100.Value; SH1.FromGamma(); //PetrelLogger.InfoBox("The Shale Volume Fraction Log has been created in the same Well"); } //Shale volume from spontaneous potential log is calculated here if (comboLogs1.SelectedIndex == 4 && comboLogs2.SelectedIndex == 1) { if (SpWell == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } int no_use = 0; ShaleVolume SH2 = new ShaleVolume(SpWell, no_use); SH2.Sp0 = (double)SPShale0.Value / 1000; SH2.Sp100 = (double)SPShale100.Value / 1000; SH2.FromSP(); //PetrelLogger.InfoBox("The Shale Volume Fraction Log has been created in the same Well"); } //Impedance using Gardners equation is calculated here if (comboLogs1.SelectedIndex == 5 && comboLogs2.SelectedIndex == 0) { if (SdtWell3 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Impedance I1 = new Impedance(SdtWell3); I1.GCoef = (double)GardCoef2.Value / 100; I1.GExp = (double)GardExp2.Value / 100; I1.FromSonic(); //PetrelLogger.InfoBox("The Impedance Log has been created in the same Well"); } //Impedance from Density and Velocity is calculated if (comboLogs1.SelectedIndex == 5 && comboLogs2.SelectedIndex == 1) { if (DensWell2 == null || PSVelWell2 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } Impedance I2 = new Impedance(PSVelWell2, DensWell2); I2.FromDensity(); //PetrelLogger.InfoBox("The Impedance Log has been created in the same Well"); } //Impedance from density using gardners's method if (comboLogs1.SelectedIndex == 5 && comboLogs2.SelectedIndex == 2) { if (DensWell4 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } int no_use = 0; Impedance I3 = new Impedance(DensWell4, no_use); I3.GCoef = (double)GardCoef4.Value / 100; I3.GExp = (double)GardExp4.Value / 100; I3.FromDensity2(); //PetrelLogger.InfoBox("The Impedance Log has been created in the same Well"); } if (comboLogs1.SelectedIndex == 6 && comboLogs2.SelectedIndex == 0) { if (vshWell8 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } ElasticConstants E1 = new ElasticConstants(vshWell8); E1.FromVsh(); //E1.save(vshWell8, E1.poisn, "Poissons ratio"); //PetrelLogger.InfoBox("The Poisson Ratio Log has been created in the same Well"); } if (comboLogs1.SelectedIndex == 6 && comboLogs2.SelectedIndex == 1) { if (vpvsWell1 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } int no_use = 0; ElasticConstants E2 = new ElasticConstants(vpvsWell1, no_use); E2.FromVpvs(); //PetrelLogger.InfoBox("The Poisson Ratio Log has been created in the same Well"); } if (comboLogs1.SelectedIndex == 6 && comboLogs2.SelectedIndex == 2) { if (DensWell5 == null && SdtWell4 == null && poisWell1 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } ElasticConstants E3 = new ElasticConstants(DensWell5, SdtWell4, poisWell1); E3.FromDensDt1(); //PetrelLogger.InfoBox("The Shear Modulus Log has been created in the same Well"); } if (comboLogs1.SelectedIndex == 6 && comboLogs2.SelectedIndex == 3) { if (DensWell6 == null && SdtWell5 == null && poisWell2 == null) { PetrelLogger.ErrorBox("One or more inputs are not given properly"); return; } ElasticConstants E4 = new ElasticConstants(DensWell6, SdtWell5, poisWell2); E4.FromDensDt2(); //PetrelLogger.InfoBox("The Bulk Modulus Log has been created in the same Well"); } }