Exemplo n.º 1
0
            public PVT.Context.Root GetPvtContext()
            {
                var refP = PVT.Prm.P._(PVT.Arg.P_SC, PVT.Arg.P_RES);
                var refT = PVT.Prm.T._(PVT.Arg.T_SC, PVT.Arg.T_RES);

                var root = PVT.NewCtx()
                           .With(PVT.Arg.GAMMA_O, Oil_Density)
                           .With(PVT.Arg.Rsb, Oil_GasFactor)
                           .With(PVT.Arg.GAMMA_G, Gas_Density)
                           .With(PVT.Arg.GAMMA_G_SEP, 1)
                           .With(PVT.Arg.GAMMA_W, Water_Density)
                           .With(PVT.Arg.S, PVT.WaterSalinity_From_Density(Water_Density))
                           .With(PVT.Arg.P_SC, U.Atm2MPa(1))
                           .With(PVT.Arg.T_SC, U.Cel2Kel(20))
                           .With(PVT.Arg.P_RES, U.Atm2MPa(Reservoir_Pressure__Atm))
                           .With(PVT.Arg.T_RES, U.Cel2Kel(Temperature__C))
                           .With(PVT.Arg.P_SEP, PVT.Arg.P_SC)
                           .With(PVT.Arg.T_SEP, PVT.Arg.T_SC)
                           .With(PVT.Arg.GAMMA_G_CORR, PVT.Gamma_g_corr_Calc)

                           .With(PVT.Prm.Bob, PVT.Bob_STANDING_1947)
                           //.With(PVT.Prm.Pb, PVT.Pb_STANDING_1947)
                           .WithRescale(PVT.Prm.Pb._(PVT.Arg.None, U.Atm2MPa(Bubblpnt_Pressure__Atm)), PVT.Pb_STANDING_1947, refP, refT)
                           .With(PVT.Prm.Rs, PVT.Rs_VELARDE_1996)
                           //.WithRescale(PVT.Prm.Rs._(0d, PVT.Arg.Rsb), PVT.Rs_VELARDE_1996, refP, refT)
                           .With(PVT.Prm.Bg, PVT.Bg_MAT_BALANS)
                           .With(PVT.Prm.Z, PVT.Z_BBS_1974)
                           //.With(PVT.Prm.Bo, PVT.Bo_DEFAULT)
                           .WithRescale(PVT.Prm.Bo._(1, Oil_VolumeFactor), PVT.Bo_DEFAULT, refP, refT)
                           .With(PVT.Prm.Co, PVT.co_VASQUEZ_BEGGS_1980)
                           .With(PVT.Prm.Bw, PVT.Bw_MCCAIN_1990)
                           .With(PVT.Prm.Rho_o, PVT.Rho_o_MAT_BALANS)
                           //.With(PVT.Prm.Rho_w, PVT.Rho_w_MCCAIN_1990)
                           .WithRescale(PVT.Prm.Rho_w._(PVT.Arg.GAMMA_W, PVT.Arg.None), PVT.Rho_w_MCCAIN_1990, refP, refT)
                           .With(PVT.Prm.Rho_g, PVT.Rho_g_DEFAULT)
                           //
                           .With(PVT.Prm.Sigma_og, PVT.Sigma_og_BAKER_SWERDLOFF_1956)
                           .With(PVT.Prm.Sigma_wg, PVT.Sigma_wg_RAMEY_1973)
                           //.With(PVT.Prm.Mu_o, PVT.Mu_o_VASQUEZ_BEGGS_1980)
                           .WithRescale(PVT.Prm.Mu_o._(PVT.Arg.None, Oil_Viscosity), PVT.Mu_o_VASQUEZ_BEGGS_1980, refP, refT)
                           .With(PVT.Prm.Mu_os, PVT.Mu_os_BEGGS_ROBINSON_1975)
                           .With(PVT.Prm.Mu_od, PVT.Mu_od_BEAL_1946)
                           .With(PVT.Prm.Mu_g, PVT.Mu_g_LGE_MCCAIN_1991)
                           .With(PVT.Prm.Tpc, PVT.Tpc_SUTTON_2005)
                           .With(PVT.Prm.Ppc, PVT.Ppc_SUTTON_2005)
                ;

                if (float.IsNaN(Water_Viscosity))
                {
                    root.With(PVT.Prm.Mu_w, PVT.Mu_w_MCCAIN_1990);
                }
                else
                {
                    root.WithRescale(PVT.Prm.Mu_w._(PVT.Arg.None, Water_Viscosity), PVT.Mu_w_MCCAIN_1990, refP, refT);
                }

                return(root.Done());
            }
Exemplo n.º 2
0
        public void PVT()
        {
            PVT pvt = new PVT();

            pvt.Load(Directory.GetCurrentDirectory() + "\\table.csv");
            SingleDoubleSerie serie = pvt.Calculate();

            Assert.IsNotNull(serie);
            Assert.IsTrue(serie.Values.Count > 0);
        }
Exemplo n.º 3
0
        public void PVT()
        {
            PVT pvt = new PVT();

            pvt.Load(OhlcList);
            SingleDoubleSerie serie = pvt.Calculate();

            Assert.IsNotNull(serie);
            Assert.IsTrue(serie.Values.Count > 0);
        }
Exemplo n.º 4
0
        public void PVT()
        {
            PVT pvt = new PVT();

            pvt.Load(csvPath);
            SingleDoubleSerie serie = pvt.Calculate();

            Assert.NotNull(serie);
            Assert.True(serie.Values.Count > 0);
        }
Exemplo n.º 5
0
        public static void test()
        {
            double[][] oil, oil_us, water, water_us, gas;

            oil = new double[5][]; oil_us = new double[5][]; water = new double[5][]; water_us = new double[5][]; gas = new double[4][];

            oil[0] = new double[] { 14.7, 264.7, 514.7, 1014.7, 2014.7, 2514.7, 3014.7, 4014.7, 5014.7, 9014.7 };
            oil[1] = new double[] { 1.062, 1.15, 1.207, 1.295, 1.435, 1.5, 1.565, 1.695, 1.827, 2.357 };
            oil[2] = new double[] { 1.04, 0.975, 0.91, 0.83, 0.695, 0.641, 0.594, 0.51, 0.449, 0.203 };
            oil[3] = new double[] { 46.244, 43.544, 42.287, 41.004, 38.995, 38.304, 37.781, 37.046, 36.424, 34.482 };
            oil[4] = new double[] { 1, 90.5, 180, 371, 636, 775, 930, 1270, 1618, 2984 };

            oil_us[0] = new double[] { 4014.7, 9014.7 };
            oil_us[1] = new double[] { 1.695, 1.579 };
            oil_us[2] = new double[] { 0.51, 0.74 };
            oil_us[3] = new double[] { 37.046, 39.768 };
            oil_us[4] = new double[] { 1270, 1270 };

            water[0] = new double[] { 14.7, 264.7, 514.7, 1014.7, 2014.7, 2514.7, 3014.7, 4014.7, 5014.7, 9014.7 };
            water[1] = new double[] { 1.041, 1.0403, 1.0395, 1.038, 1.035, 1.0335, 1.032, 1.029, 1.0258, 1.013 };
            water[2] = new double[] { 0.31, 0.31, 0.31, 0.31, 0.31, 0.31, 0.31, 0.31, 0.31, 0.31 };
            water[3] = new double[] { 62.238, 62.283, 62.328, 62.418, 62.599, 62.69, 62.781, 62.964, 63.16, 63.959 };
            water[4] = new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            water_us[0] = new double[] { 4014.7, 9014.7 };
            water_us[1] = new double[] { 1.029, 1.013 };
            water_us[2] = new double[] { 0.31, 0.31 };
            water_us[3] = new double[] { 62.964, 63.959 };
            water_us[4] = new double[] { 0, 0 };

            gas[0] = new double[] { 14.7, 264.7, 514.7, 1014.7, 2014.7, 2514.7, 3014.7, 4014.7, 5014.7, 9014.7 };
            gas[1] = new double[] { 0.166666, 0.012093, 0.006274, 0.003197, 0.001614, 0.001294, 0.00108, 0.000811, 0.000649, 0.000386 };
            gas[2] = new double[] { 0.008, 0.0096, 0.0112, 0.014, 0.0189, 0.0208, 0.0228, 0.0268, 0.0309, 0.047 };
            gas[3] = new double[] { 0.0647, 0.8916, 1.7185, 3.3727, 6.8806, 8.3326, 9.9837, 13.2952, 16.6139, 27.948 };

            double[][] Kr_data = new double[4][];
            Kr_data[0] = new double[] { 0, 0.001, 0.02, 0.05, 0.12, 0.2, 0.25, 0.3, 0.4, 0.45, 0.5, 0.6, 0.7, 0.85, 1 };
            Kr_data[1] = new double[] { 0, 0, 0, 0.005, 0.025, 0.075, 0.125, 0.19, 0.41, 0.6, 0.72, 0.87, 0.94, 0.98, 1 };
            Kr_data[2] = new double[] { 1, 1, 0.997, 0.98, 0.7, 0.35, 0.2, 0.09, 0.02, 0.01, 0.001, 0.0001, 0, 0, 0 };
            Kr_data[3] = new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            PVT  pvt = new PVT(oil, oil_us, water, water_us, gas, 4014.7);
            SCAL kr  = new SCAL(Kr_data);

            for (double i = 0; i <= 1; i += 0.01)
            {
                Console.WriteLine(i + ", " + kr.GetKr(Core.Global.Phase.Gas, i));
            }

            Console.ReadKey();
        }
Exemplo n.º 6
0
        private static void InitializePROPS(List <string> section, PVT pvt, SCAL scal, PorosityCalculator porosityCalculator)
        {
            double bubble_point;

            double[][] oil, oil_us, water, water_us, gas;
            oil = new double[5][]; oil_us = new double[5][]; water = new double[5][]; water_us = new double[5][]; gas = new double[4][];
            double[][] Kr_data = new double[4][];


            // rock reference pressure and compressibility
            double[] rock = Helper.GetData("ROCK", section, 2);
            porosityCalculator.pressure_ref = rock[0];
            porosityCalculator.Cf           = rock[1];

            So = Helper.GetData("SO", section, 1)[0];
            Sg = Helper.GetData("SG", section, 1)[0];
            Sw = Helper.GetData("SW", section, 1)[0];
            P  = Helper.GetData("PRESSURE", section, 1)[0];

            bubble_point = Helper.GetData("BUBBLEPOINT", section, 1)[0];

            int index = section.FindIndex(x => x.Contains("PVTO"));

            oil[0] = Helper.GetData(section[index + 1]);
            oil[1] = Helper.GetData(section[index + 2]);
            oil[2] = Helper.GetData(section[index + 3]);
            oil[3] = Helper.GetData(section[index + 4]);
            oil[4] = Helper.GetData(section[index + 5]);

            oil_us[0] = Helper.GetData(section[index + 6]);
            oil_us[1] = Helper.GetData(section[index + 7]);
            oil_us[2] = Helper.GetData(section[index + 8]);
            oil_us[3] = Helper.GetData(section[index + 9]);
            oil_us[4] = Helper.GetData(section[index + 10]);

            index = section.FindIndex(x => x.Contains("PVTW"));

            water[0] = Helper.GetData(section[index + 1]);
            water[1] = Helper.GetData(section[index + 2]);
            water[2] = Helper.GetData(section[index + 3]);
            water[3] = Helper.GetData(section[index + 4]);
            water[4] = Helper.GetData(section[index + 5]);

            water_us[0] = Helper.GetData(section[index + 6]);
            water_us[1] = Helper.GetData(section[index + 7]);
            water_us[2] = Helper.GetData(section[index + 8]);
            water_us[3] = Helper.GetData(section[index + 9]);
            water_us[4] = Helper.GetData(section[index + 10]);


            index = section.FindIndex(x => x.Contains("PVDG"));

            gas[0] = Helper.GetData(section[index + 1]);
            gas[1] = Helper.GetData(section[index + 2]);
            gas[2] = Helper.GetData(section[index + 3]);
            gas[3] = Helper.GetData(section[index + 4]);


            index = section.FindIndex(x => x.Contains("SCAL"));

            Kr_data[0] = Helper.GetData(section[index + 1]);
            Kr_data[1] = Helper.GetData(section[index + 2]);
            Kr_data[2] = Helper.GetData(section[index + 3]);
            Kr_data[3] = Helper.GetData(section[index + 4]);

            pvt.Initialize(oil, oil_us, water, water_us, gas, bubble_point);
            scal.Initialize(Kr_data);
        }