Ejemplo n.º 1
0
        //List<Borehole> b2 = new List<Borehole>();
        //public Borehole b1;

        public void save(WellLog LogType, int count, double startMD, double interval, Double[] array, string name)
        {
            //Borehole b1;
            //int count = LogType.SampleCount;

            List <WellLogSample> TypeLog = new List <WellLogSample>(LogType.Samples);
            Borehole             b1      = LogType.Borehole;

            //List<Borehole> b2 = new List<Borehole>();
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics(name);
                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  = startMD + i2 * interval;
                    float  val = (float)array[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
        }
Ejemplo n.º 2
0
        public void FromSonic()
        {
            int count = dtLog.SampleCount;

            List <WellLogSample> LogDt = new List <WellLogSample>(dtLog.Samples);

            double[] Imp = new double[count];

            for (int i = 0; i < count; i++)
            {
                Imp[i] = 1000.0d * GCoef * Math.Pow(1 / dtLog[i].Value, GExp) / dtLog[i].Value;
            }
            Borehole b1 = dtLog.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  = LogDt[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");
        }
Ejemplo n.º 3
0
        public void save()
        {
            List <WellLogSample> LogDens = new List <WellLogSample>(densLog.Samples);
            Borehole             b1      = densLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Velocity");
                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)vel[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Velocity Log has been created in the same Well");
        }
Ejemplo n.º 4
0
        public void FromDensity()
        {
            //int count = Math.Min(velLog.SampleCount, densLog.SampleCount);

            List <WellLogSample> LogVel  = new List <WellLogSample>(velLog.Samples);
            List <WellLogSample> LogDens = new List <WellLogSample>(densLog.Samples);

            TwoLogCheck c2    = new TwoLogCheck(velLog, densLog);
            int         count = c2.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            double startMD = c2.startMD, endMD = c2.endMD;
            int    startVel = c2.startLog1, startDens = c2.startLog2;

            double[] Imp = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogDens[i + startDens].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogVel[i + startVel].Value.ToString() == "NaN")
                {
                    continue;
                }

                vel    = LogVel[i + startVel].Value;
                rhob   = LogDens[i + startDens].Value;
                Imp[i] = vel * 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  = startMD + i2 * c2.interval2;
                    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");
        }
Ejemplo n.º 5
0
        public void fromimpedance()
        {
            //int count;
            //count = ImpLog.SampleCount;
            List <WellLogSample> LogImp = new List <WellLogSample>(ImpLog.Samples);
            List <WellLogSample> LogVel = new List <WellLogSample>(VelLog.Samples);

            TwoLogCheck C2    = new TwoLogCheck(ImpLog, VelLog);
            int         count = C2.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startImp = C2.startLog1, startVel = C2.startLog2;

            double[] rhob = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogImp[i + startImp].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogVel[i + startVel].Value.ToString() == "NaN")
                {
                    continue;
                }
                rhob[i] = (double)LogImp[i + startImp].Value / LogVel[i + startVel].Value;
            }
            Borehole b1 = ImpLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Density");
                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  = C2.startMD + C2.interval1 * i2;
                    float  val = (float)rhob[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Density Log has been created in the same Well");
        }
Ejemplo n.º 6
0
        public void FromGamma()
        {
            int count;

            count = grLog.SampleCount;
            List <WellLogSample> LogGr = new List <WellLogSample>(grLog.Samples);

            double[] vsh = new double[count];
            double[] Gr  = new double[count];
            for (int i = 0; i < count; i++)
            {
                Gr[i]  = LogGr[i].Value;
                vsh[i] = (LogGr[i].Value - Gr0) / (Gr100 - Gr0);
            }
            double max = 0, min = 0;

            for (int k = 0; k < count; k++)
            {
                max = Math.Max(Gr[k], max);
                min = Math.Min(Gr[k], min);
            }

            Borehole b1 = grLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("VShale");
                PropertyVersion         pv   = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);

                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md  = LogGr[i2].MD;
                    float  val = (float)vsh[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Shale Volume Fraction Log has been created in the same Well");
        }
Ejemplo n.º 7
0
        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");
        }
Ejemplo n.º 8
0
        public void FromGamma()
        {
            int count;
            count = grLog.SampleCount;
            List<WellLogSample> LogGr = new List<WellLogSample>(grLog.Samples);
            double[] vsh = new double[count];
            double[] Gr = new double[count];
            for (int i = 0; i < count; i++)
            {
                Gr[i] = LogGr[i].Value;
                vsh[i] = (LogGr[i].Value - Gr0) / (Gr100 - Gr0);
            }
            double max=0, min=0;
            for (int k = 0; k < count; k++)
            {
                max = Math.Max(Gr[k],max);
                min = Math.Min(Gr[k], min);
            }

            Borehole b1 = grLog.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("VShale");
                PropertyVersion pv = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);

                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md = LogGr[i2].MD;
                    float val = (float)vsh[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Shale Volume Fraction Log has been created in the same Well");
        }
        public void FromAcImp()
        {
            int count;

            count = AcImpLog.SampleCount;
            List <WellLogSample> LogAcImp = new List <WellLogSample>(AcImpLog.Samples);

            double[] RC = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (i != count - 1)
                {
                    RC[i] = (LogAcImp[i + 1].Value - LogAcImp[i].Value) / (LogAcImp[i + 1].Value + LogAcImp[i].Value);
                }
            }
            Borehole b1 = AcImpLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Reflection coefficients");
                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  = LogAcImp[i2].MD;
                    float  val = (float)RC[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Reflection coefficient Log has been created in the same Well");
        }
Ejemplo n.º 10
0
        public void FromSP()
        {
            int count;

            count = spLog.SampleCount;
            List <WellLogSample> LogSp = new List <WellLogSample>(spLog.Samples);

            double[] vsh = new double[count];
            double[] Sp  = new double[count];
            for (int i = 0; i < count; i++)
            {
                Sp[i]  = LogSp[i].Value;
                vsh[i] = (LogSp[i].Value - Sp0) / (Sp100 - Sp0);
            }
            Borehole b1 = spLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("VShale");
                PropertyVersion         pv   = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);

                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md  = LogSp[i2].MD;
                    float  val = (float)vsh[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Shale Volume Fraction Log has been created in the same Well");
        }
Ejemplo n.º 11
0
        public void fromvelocity()
        {
            int count;
            List <WellLogSample> LogVel = new List <WellLogSample>(velLog.Samples);

            count = velLog.SampleCount;

            double[] rhob = new double[count];

            for (int i = 0; i < count; i++)
            {
                vel     = (double)LogVel[i].Value;
                rhob[i] = 1000.0d * gcoef * Math.Pow(vel, gexp);
            }
            Borehole b1 = velLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Density");
                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  = LogVel[i2].MD;
                    float  val = (float)rhob[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Density Log has been created in the same Well");
        }
Ejemplo n.º 12
0
        public void workingFunction()
        {
            List<WellLogSample> den = new List<WellLogSample>(density.Samples);
            List<WellLogSample> dt = new List<WellLogSample>(sonic.Samples);
            if (den.Count == 0||dt.Count==0)
            {
                PetrelLogger.ErrorBox("NULL LOG found");
                return;
            }
            Console.WriteLine(den.Count);
            Console.WriteLine(dt.Count);

            int i;
            double startMD, endMD;
            int startden = 0,
                endden = 0,
                startdt = 0,
                enddt = 0;

            int count = 0;
            double interval1 = den[1].MD - den[0].MD;
            double interval2 = dt[1].MD - dt[0].MD;
            if (Math.Abs(interval1 - interval2) > 10e-4)
            {
                PetrelLogger.ErrorBox("DEPTH INTERVAL MISMATCH");
                return;
            }
            double interval = interval1;
                if (!(Math.Abs(den[0].MD - dt[0].MD) < 10e-4 && Math.Abs(den[den.Count - 1].MD - dt[dt.Count - 1].MD) < 10e-4))
                {
                    if (den[0].MD > dt[0].MD)
                        startMD = den[0].MD;
                    else
                        startMD = dt[0].MD;
                    if (den[den.Count - 1].MD > dt[dt.Count - 1].MD)
                        endMD = dt[dt.Count - 1].MD;
                    else
                        endMD = den[den.Count].MD;
                    for (int xxx = 0; xxx < den.Count; xxx++)
                    {
                        if (Math.Abs(den[xxx].MD - startMD) < 10e-4)
                            startden = xxx;
                        if (Math.Abs(den[xxx].MD - endMD) < 10e-4)
                            endden = xxx;
                    }
                    for (int xxx = 0; xxx < dt.Count; xxx++)
                    {
                        if (Math.Abs(dt[xxx].MD - startMD) < 10e-4)
                            startdt = xxx;
                        if (Math.Abs(dt[xxx].MD - endMD) < 10e-4)
                            enddt = xxx;
                    }
                    count = endden - startden + 1;
                }
                else
                {
                    count = den.Count;
                    startMD = den[0].MD;
                    endMD = den[den.Count - 1].MD;
                }

            float[] C2 = new float[count];
            float[] S2 = new float[count];
            float[] phi2 = new float[count];
            float[] error1 = new float[count];

            using (IProgress i1 = PetrelLogger.NewProgress(1, count))
            {
                for (i = 0; i < count; i++)
                {

                    float ac_imp;
                    if (den[i + startden].Value.ToString() == "NaN")
                    {
                        continue;
                    }
                    if (dt[i + startdt].Value.ToString() == "NaN")
                        continue;
                    float rho = den[i + startden].Value;
                    float son = dt[i + startdt].Value;
                    float Vinv = 1.0f / son;
                    ac_imp = rho * Vinv;
                    error1[i] = 1.0e35f;
                    for (float phi = (float)minPor; phi <= (float)(maxPor+0.1); phi += 0.1f)
                    {
                        for (float S = (float)minWater; S <= (float)(maxWater + 0.1); S += 0.1f)
                        {
                            for (float C = (float)minClay; C <= (float)(maxClay + 0.1); C += 0.1f)
                            {
                                double error = dfunc(ac_imp, rho, Vinv, C, S, phi);
                                if (error1[i] > (float)error)
                                {
                                    C2[i] = C;
                                    S2[i] = S;
                                    phi2[i] = phi;
                                    error1[i] = (float)error;

                                }
                            }
                        }
                    }
                    updateVals(ac_imp, rho, Vinv, ref C2[i], ref S2[i], ref phi2[i]);
                    i1.ProgressStatus = i + 1;
                }
            }
            b1 = density.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("Porosity");
                PropertyVersion pv = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);
                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md = startMD + i2 * interval;
                    float val = phi2[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics(clayLog);
                PropertyVersion pv = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);
                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md = startMD + i2 * interval;
                    float val = C2[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics(waterLog);

                PropertyVersion pv = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);
                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md = startMD + i2 * interval;
                    float val = S2[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
        }
Ejemplo n.º 13
0
        public void FromSP()
        {
            int count;
            count = spLog.SampleCount;
            List<WellLogSample> LogSp = new List<WellLogSample>(spLog.Samples);
            double[] vsh = new double[count];
            double[] Sp = new double[count];
            for (int i = 0; i < count; i++)
            {
                Sp[i] = LogSp[i].Value;
                vsh[i] = (LogSp[i].Value - Sp0) / (Sp100 - Sp0);
            }
            Borehole b1 = spLog.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("VShale");
                PropertyVersion pv = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog log = b1.Logs.CreateWellLog(pv);

                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md = LogSp[i2].MD;
                    float val = (float)vsh[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Shale Volume Fraction Log has been created in the same Well");
        }
Ejemplo n.º 14
0
        public void workingFunction()
        {
            List <WellLogSample> den = new List <WellLogSample>(density.Samples);
            List <WellLogSample> dt  = new List <WellLogSample>(sonic.Samples);

            if (den.Count == 0 || dt.Count == 0)
            {
                PetrelLogger.ErrorBox("NULL LOG found");
                return;
            }
            Console.WriteLine(den.Count);
            Console.WriteLine(dt.Count);

            int    i;
            double startMD, endMD;
            int    startden = 0,
                   endden   = 0,
                   startdt  = 0,
                   enddt    = 0;

            int    count     = 0;
            double interval1 = den[1].MD - den[0].MD;
            double interval2 = dt[1].MD - dt[0].MD;

            if (Math.Abs(interval1 - interval2) > 10e-4)
            {
                PetrelLogger.ErrorBox("DEPTH INTERVAL MISMATCH");
                return;
            }
            double interval = interval1;

            if (!(Math.Abs(den[0].MD - dt[0].MD) < 10e-4 && Math.Abs(den[den.Count - 1].MD - dt[dt.Count - 1].MD) < 10e-4))
            {
                if (den[0].MD > dt[0].MD)
                {
                    startMD = den[0].MD;
                }
                else
                {
                    startMD = dt[0].MD;
                }
                if (den[den.Count - 1].MD > dt[dt.Count - 1].MD)
                {
                    endMD = dt[dt.Count - 1].MD;
                }
                else
                {
                    endMD = den[den.Count].MD;
                }
                for (int xxx = 0; xxx < den.Count; xxx++)
                {
                    if (Math.Abs(den[xxx].MD - startMD) < 10e-4)
                    {
                        startden = xxx;
                    }
                    if (Math.Abs(den[xxx].MD - endMD) < 10e-4)
                    {
                        endden = xxx;
                    }
                }
                for (int xxx = 0; xxx < dt.Count; xxx++)
                {
                    if (Math.Abs(dt[xxx].MD - startMD) < 10e-4)
                    {
                        startdt = xxx;
                    }
                    if (Math.Abs(dt[xxx].MD - endMD) < 10e-4)
                    {
                        enddt = xxx;
                    }
                }
                count = endden - startden + 1;
            }
            else
            {
                count   = den.Count;
                startMD = den[0].MD;
                endMD   = den[den.Count - 1].MD;
            }


            float[] C2     = new float[count];
            float[] S2     = new float[count];
            float[] phi2   = new float[count];
            float[] error1 = new float[count];


            using (IProgress i1 = PetrelLogger.NewProgress(1, count))
            {
                for (i = 0; i < count; i++)
                {
                    float ac_imp;
                    if (den[i + startden].Value.ToString() == "NaN")
                    {
                        continue;
                    }
                    if (dt[i + startdt].Value.ToString() == "NaN")
                    {
                        continue;
                    }
                    float rho  = den[i + startden].Value;
                    float son  = dt[i + startdt].Value;
                    float Vinv = 1.0f / son;
                    ac_imp    = rho * Vinv;
                    error1[i] = 1.0e35f;
                    for (float phi = (float)minPor; phi <= (float)(maxPor + 0.1); phi += 0.1f)
                    {
                        for (float S = (float)minWater; S <= (float)(maxWater + 0.1); S += 0.1f)
                        {
                            for (float C = (float)minClay; C <= (float)(maxClay + 0.1); C += 0.1f)
                            {
                                double error = dfunc(ac_imp, rho, Vinv, C, S, phi);
                                if (error1[i] > (float)error)
                                {
                                    C2[i]     = C;
                                    S2[i]     = S;
                                    phi2[i]   = phi;
                                    error1[i] = (float)error;
                                }
                            }
                        }
                    }
                    updateVals(ac_imp, rho, Vinv, ref C2[i], ref S2[i], ref phi2[i]);
                    i1.ProgressStatus = i + 1;
                }
            }
            b1 = density.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Porosity");
                PropertyVersion         pv   = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog         log      = b1.Logs.CreateWellLog(pv);
                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md  = startMD + i2 * interval;
                    float  val = phi2[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics(clayLog);
                PropertyVersion         pv   = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog         log      = b1.Logs.CreateWellLog(pv);
                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md  = startMD + i2 * interval;
                    float  val = C2[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics(waterLog);

                PropertyVersion pv = pvs.FindOrCreate(glob);
                trans.Lock(b1);
                WellLog         log      = b1.Logs.CreateWellLog(pv);
                WellLogSample[] tsamples = new WellLogSample[count];
                for (int i2 = 0; i2 < count; i2++)
                {
                    double md  = startMD + i2 * interval;
                    float  val = S2[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
        }
Ejemplo n.º 15
0
        public void FromPorosity2()
        {
            //int count;
            //count = Math.Min(porLog.SampleCount, vshLog.SampleCount);
            //count = Math.Min(count, swLog.SampleCount);

            List<WellLogSample> LogPhie = new List<WellLogSample>(porLog.Samples);
            List<WellLogSample> LogSw = new List<WellLogSample>(swLog.Samples);
            List<WellLogSample> LogVsh = new List<WellLogSample>(vshLog.Samples);
            ThreeLogCheck C1 = new ThreeLogCheck(porLog, swLog, vshLog);
            int count = C1.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startPor = C1.startLog1, startSw = C1.startLog2, startVsh = C1.startLog3;

            double[] vel = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogPhie[i + startPor].Value.ToString() == "NaN")
                    continue;

                if (LogSw[i + startSw].Value.ToString() == "NaN")
                    continue;

                if (LogVsh[i + startVsh].Value.ToString() == "NaN")
                    continue;

                phie = (double)LogPhie[i + startPor].Value;
                sw = (double)LogSw[i + startSw].Value;
                vsh = (double)LogVsh[i + startVsh].Value;
                c = vsh / (1 - phie);
                vf = sw / dtw + (1 - sw) / dth;
                vm = c / dtsh + (1 - c) / dtmat;
                vel[i] = Math.Pow((1 - phie), 2) * vm + phie * vf;
                //vel[i] = 1 / dt;

            }

            Borehole b1 = porLog.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("Velocity");
                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 = C1.startMD + C1.interval1 * i2;
                    float val = (float)vel[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Velocity Log has been created in the same Well");
        }
Ejemplo n.º 16
0
        public void FromDensity()
        {
            //int count;
            //count = Math.Min(densLog.SampleCount, vshLog.SampleCount);
            //count = Math.Min(count, swLog.SampleCount);

            List <WellLogSample> LogDens = new List <WellLogSample>(densLog.Samples);
            List <WellLogSample> LogSw   = new List <WellLogSample>(swLog.Samples);
            List <WellLogSample> LogVsh  = new List <WellLogSample>(vshLog.Samples);

            ThreeLogCheck C1    = new ThreeLogCheck(densLog, swLog, vshLog);
            int           count = C1.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startDens = C1.startLog1, startSw = C1.startLog2, startVsh = C1.startLog3;

            double[] phie = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogDens[i + startDens].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogSw[i + startSw].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogVsh[i + startVsh].Value.ToString() == "NaN")
                {
                    continue;
                }

                dens    = (double)LogDens[i + startDens].Value;
                sw      = (double)LogSw[i + startSw].Value;
                vsh     = (double)LogVsh[i + startVsh].Value;
                rhof    = sw * rhow + (1 - sw) * rhoh;
                phie[i] = (dens - (1 - vsh) * rhomat - vsh * rhosh) / (rhof - rhomat - vsh * rhosh);
            }

            Borehole b1 = densLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Porosity");
                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  = C1.startMD + i2 * C1.interval1;
                    float  val = (float)phie[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Porosity Log has been created in the same Well");
        }
Ejemplo n.º 17
0
        public void FromPorosity2()
        {
            //int count;
            //count = Math.Min(porLog.SampleCount, vshLog.SampleCount);
            //count = Math.Min(count, swLog.SampleCount);

            List <WellLogSample> LogPhie = new List <WellLogSample>(porLog.Samples);
            List <WellLogSample> LogSw   = new List <WellLogSample>(swLog.Samples);
            List <WellLogSample> LogVsh  = new List <WellLogSample>(vshLog.Samples);
            ThreeLogCheck        C1      = new ThreeLogCheck(porLog, swLog, vshLog);
            int count = C1.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startPor = C1.startLog1, startSw = C1.startLog2, startVsh = C1.startLog3;

            double[] vel = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogPhie[i + startPor].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogSw[i + startSw].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogVsh[i + startVsh].Value.ToString() == "NaN")
                {
                    continue;
                }

                phie   = (double)LogPhie[i + startPor].Value;
                sw     = (double)LogSw[i + startSw].Value;
                vsh    = (double)LogVsh[i + startVsh].Value;
                c      = vsh / (1 - phie);
                vf     = sw / dtw + (1 - sw) / dth;
                vm     = c / dtsh + (1 - c) / dtmat;
                vel[i] = Math.Pow((1 - phie), 2) * vm + phie * vf;
                //vel[i] = 1 / dt;
            }

            Borehole b1 = porLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Velocity");
                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  = C1.startMD + C1.interval1 * i2;
                    float  val = (float)vel[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Velocity Log has been created in the same Well");
        }
Ejemplo n.º 18
0
        public void fromvelocity()
        {
            int count;
            List<WellLogSample> LogVel = new List<WellLogSample>(velLog.Samples);
            count = velLog.SampleCount;

            double[] rhob=new double[count];

            for (int i = 0; i < count; i++)
            {
                vel = (double)LogVel[i].Value;
                rhob[i] = 1000.0d*gcoef * Math.Pow(vel, gexp);
            }
            Borehole b1 = velLog.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("Density");
                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 = LogVel[i2].MD;
                    float val = (float)rhob[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Density Log has been created in the same Well");
        }
Ejemplo n.º 19
0
        //double[] LogPhie, LogSw, LogVsh;
        //WellLog LogType4;
        public void fromporosity()
        {
            //int count;
            //count = porLog.SampleCount;
            List<WellLogSample> LogPhie = new List<WellLogSample>(porLog.Samples);
            List<WellLogSample> LogSw = new List<WellLogSample>(swLog.Samples);
            List<WellLogSample> LogVsh = new List<WellLogSample>(vshLog.Samples);
            //List<WellLogSample> LogRhob = new List<WellLogSample>(LogType4.Samples);

            ThreeLogCheck C1 = new ThreeLogCheck(porLog, swLog, vshLog);
            int count = C1.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startPor = C1.startLog1, startSw = C1.startLog2, startVsh = C1.startLog3;

            double[] rhob = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogPhie[i + startPor].Value.ToString() == "NaN")
                    continue;

                if (LogSw[i + startSw].Value.ToString() == "NaN")
                    continue;

                if (LogVsh[i + startVsh].Value.ToString() == "NaN")
                    continue;

                phie = (double)LogPhie[i + startPor].Value;
                sw = (double)LogSw[i + startSw].Value;
                vsh = (double)LogVsh[i + startVsh].Value;
                rhof = sw * rhow + (1 - sw) * rhoh;
                rhom = vsh * rhosh + (1 - vsh - phie) * rhomat;
                rhob[i] = phie * rhof + rhom;
                //PetrelLogger.InfoOutputWindow(rhob.ToString());
                //LogRhob[count].Value = (float)rhob;

            }
            Borehole b1 = porLog.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("Density");
                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 = C1.startMD + C1.interval1 * i2;
                    float val = (float)rhob[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Density Log has been created in the same Well");
        }
Ejemplo n.º 20
0
        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");
        }
Ejemplo n.º 21
0
        public void fromimpedance()
        {
            //int count;
            //count = ImpLog.SampleCount;
            List<WellLogSample> LogImp = new List<WellLogSample>(ImpLog.Samples);
            List<WellLogSample> LogVel = new List<WellLogSample>(VelLog.Samples);

            TwoLogCheck C2 = new TwoLogCheck(ImpLog, VelLog);
            int count = C2.count;
            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startImp = C2.startLog1, startVel = C2.startLog2;
            double[] rhob = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogImp[i + startImp].Value.ToString() == "NaN")
                    continue;

                if (LogVel[i + startVel].Value.ToString() == "NaN")
                    continue;
                rhob[i] = (double)LogImp[i + startImp].Value / LogVel[i + startVel].Value;

            }
            Borehole b1 = ImpLog.Borehole;
            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
                ILogTemplate glob = pvs.FindTemplateByMnemonics("Density");
                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 = C2.startMD + C2.interval1 * i2;
                    float val = (float)rhob[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Density Log has been created in the same Well");
        }
Ejemplo n.º 22
0
        public void FromSonic()
        {
            int count = dtLog.SampleCount;

             List<WellLogSample> LogDt = new List<WellLogSample>(dtLog.Samples);

             double[] Imp = new double[count];

             for (int i = 0; i < count; i++)
             {
                 Imp[i] = 1000.0d*GCoef * Math.Pow(1 / dtLog[i].Value, GExp) / dtLog[i].Value;
             }
             Borehole b1 = dtLog.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 = LogDt[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");
        }
Ejemplo n.º 23
0
        public void FromDensity()
        {
            //int count = Math.Min(velLog.SampleCount, densLog.SampleCount);

            List<WellLogSample> LogVel = new List<WellLogSample>(velLog.Samples);
            List<WellLogSample> LogDens = new List<WellLogSample>(densLog.Samples);

            TwoLogCheck c2 = new TwoLogCheck(velLog, densLog);
            int count = c2.count;
            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            double startMD = c2.startMD, endMD = c2.endMD;
            int startVel = c2.startLog1, startDens = c2.startLog2;

            double[] Imp = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogDens[i + startDens].Value.ToString() == "NaN")
                    continue;

                if (LogVel[i + startVel].Value.ToString() == "NaN")
                    continue;

                vel = LogVel[i + startVel].Value;
                rhob = LogDens[i + startDens].Value;
                Imp[i] = vel * 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 = startMD + i2 * c2.interval2;
                    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");
        }
Ejemplo n.º 24
0
 public void save()
 {
     List<WellLogSample> LogDens = new List<WellLogSample>(densLog.Samples);
        Borehole b1 = densLog.Borehole;
        using (ITransaction trans = DataManager.NewTransaction())
        {
        IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
        ILogTemplate glob = pvs.FindTemplateByMnemonics("Velocity");
        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)vel[i2];
            tsamples[i2] = new WellLogSample(md, val);
        }
        log.Samples = tsamples;
        trans.Commit();
        }
        PetrelLogger.InfoBox("The Velocity Log has been created in the same Well");
 }
Ejemplo n.º 25
0
        //double[] LogPhie, LogSw, LogVsh;
        //WellLog LogType4;

        public void fromporosity()
        {
            //int count;
            //count = porLog.SampleCount;
            List <WellLogSample> LogPhie = new List <WellLogSample>(porLog.Samples);
            List <WellLogSample> LogSw   = new List <WellLogSample>(swLog.Samples);
            List <WellLogSample> LogVsh  = new List <WellLogSample>(vshLog.Samples);
            //List<WellLogSample> LogRhob = new List<WellLogSample>(LogType4.Samples);

            ThreeLogCheck C1    = new ThreeLogCheck(porLog, swLog, vshLog);
            int           count = C1.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startPor = C1.startLog1, startSw = C1.startLog2, startVsh = C1.startLog3;

            double[] rhob = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogPhie[i + startPor].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogSw[i + startSw].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogVsh[i + startVsh].Value.ToString() == "NaN")
                {
                    continue;
                }

                phie    = (double)LogPhie[i + startPor].Value;
                sw      = (double)LogSw[i + startSw].Value;
                vsh     = (double)LogVsh[i + startVsh].Value;
                rhof    = sw * rhow + (1 - sw) * rhoh;
                rhom    = vsh * rhosh + (1 - vsh - phie) * rhomat;
                rhob[i] = phie * rhof + rhom;
                //PetrelLogger.InfoOutputWindow(rhob.ToString());
                //LogRhob[count].Value = (float)rhob;
            }
            Borehole b1 = porLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Density");
                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  = C1.startMD + C1.interval1 * i2;
                    float  val = (float)rhob[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Density Log has been created in the same Well");
        }
Ejemplo n.º 26
0
        public void FromNeutron()
        {
            //int count;
            //count = GnLog.SampleCount;

            //count=Math.Min(GnLog.SampleCount, vshLog.SampleCount);

            List <WellLogSample> LogGn  = new List <WellLogSample>(GnLog.Samples);
            List <WellLogSample> LogVsh = new List <WellLogSample>(vshLog.Samples);

            TwoLogCheck C4    = new TwoLogCheck(GnLog, vshLog);
            int         count = C4.count;

            if (count == 0)
            {
                PetrelLogger.ErrorBox("INPUT LOGS DO NOT HAVE SAME DEPTH SPACING");
                return;
            }
            int startGn = C4.startLog1, startVsh = C4.startLog2;

            double[] phie = new double[count];

            for (int i = 0; i < count; i++)
            {
                if (LogGn[i + startGn].Value.ToString() == "NaN")
                {
                    continue;
                }

                if (LogVsh[i + startVsh].Value.ToString() == "NaN")
                {
                    continue;
                }

                Gn      = (double)LogGn[i + startGn].Value;
                vsh     = (double)LogVsh[i + startVsh].Value;
                phie[i] = Gn - vsh * Gnsh * 100;
            }

            Borehole b1 = vshLog.Borehole;

            using (ITransaction trans = DataManager.NewTransaction())
            {
                IPropertyVersionService pvs  = PetrelSystem.PropertyVersionService;
                ILogTemplate            glob = pvs.FindTemplateByMnemonics("Porosity");
                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  = C4.startMD + i2 * C4.interval1;
                    float  val = (float)phie[i2];
                    tsamples[i2] = new WellLogSample(md, val);
                }
                log.Samples = tsamples;
                trans.Commit();
            }
            PetrelLogger.InfoBox("The Porosity Log has been created in the same Well");
        }