Exemple #1
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);
        }
Exemple #2
0
        private static void InitializeGRID(SimulationData data, List <string> section, PorosityCalculator porosityCalculator)
        {
            double[] x_dimensionLengths           = new double[data.x];
            double[] y_dimensionLengths           = new double[data.y];
            double[] heights                      = new double[data.z];
            double[] transmissibilitiyMultipliers = new double[data.z];
            double[] layersPermeabilities         = new double[data.z];

            // grid blocks dimensions

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

            x_dimensionLengths = Helper.GetData(section[index + 1], data.x);
            // y
            index = section.FindIndex(x => x.Contains("DY"));
            y_dimensionLengths = Helper.GetData(section[index + 1], data.y);
            // z
            index   = section.FindIndex(x => x.Contains("DZ"));
            heights = Helper.GetData(section[index + 1], data.z);

            // permeabilities

            // permeability in the x direction
            index = section.FindIndex(x => x.Contains("PERMX"));
            layersPermeabilities = Helper.GetData(section[index + 1], data.z);

            // transmissibilities multipliers in the z direction only.
            index = section.FindIndex(x => x.Contains("MULTZ"));
            if (index != -1)
            {
                transmissibilitiyMultipliers = Helper.GetData(section[index + 1], data.z);
            }
            else
            {
                transmissibilitiyMultipliers = Enumerable.Repeat(1.0, data.z).ToArray();
            }

            // porosity
            index = section.FindIndex(x => x.Contains("PORO"));
            // only one value of porosity is initially assigned to the whole model.
            porosityCalculator.porosity_ref = Helper.GetData(section[index + 1], 1)[0];



            CartesianGrid cartesianGrid = new CartesianGrid(data.x, data.y, data.z, layersPermeabilities, x_dimensionLengths, y_dimensionLengths, heights);

            cartesianGrid.transmissibilityMultipliers = transmissibilitiyMultipliers;
            BaseBlock[] grid = cartesianGrid.Initialize();

            data.grid = grid;
        }