Example #1
0
    def test_ix_case(self):
        intersect_summary = EclSum(
            self.createTestPath("Equinor/ECLIPSE/ix/summary/CREATE_REGION_AROUND_WELL")
        )
        self.assertIsNotNone(intersect_summary)

        self.assertTrue(
            "HWELL_PROD"
            in [
                intersect_summary.smspec_node(key).wgname
                for key in intersect_summary.keys()
            ]
        )

        eclipse_summary = EclSum(
            self.createTestPath(
                "Equinor/ECLIPSE/ix/summary/ECL100/E100_CREATE_REGION_AROUND_WELL"
            )
        )
        self.assertIsNotNone(eclipse_summary)

        hwell_padder = (
            lambda key: key if key.split(":")[-1] != "HWELL_PR" else key + "OD"
        )
        self.assertEqual(
            intersect_summary.keys("WWCT*"),
            list(map(hwell_padder, eclipse_summary.keys("WWCT*"))),
        )
Example #2
0
    def test_restart_mapping(self):
        history = EclSum(
            self.createTestPath(
                "Equinor/ECLIPSE/SummaryRestart/iter-1/NOR-2013A_R007-0"
            )
        )
        total = EclSum(
            self.createTestPath(
                "Equinor/ECLIPSE/SummaryRestart/Prediction/NOR-2013A_R007_PRED-0"
            ),
            include_restart=True,
        )

        history_dates = history.get_dates()
        total_dates = total.get_dates()
        for i in range(len(history_dates)):
            self.assertEqual(history_dates[i], total_dates[i])

        keys = history.keys(pattern="W*")
        for key in keys:
            if key in total:
                self.assertEqual(history.iget(key, 5), total.iget(key, 5))

        self.assertFalse("WGPR:NOT_21_D" in history)
        self.assertTrue("WGPR:NOT_21_D" in total)

        node = total.smspec_node("WGPR:NOT_21_D")
        self.assertEqual(total.iget("WGPR:NOT_21_D", 5), node.default)
Example #3
0
def _create_smry_meta_dict(eclsum: EclSum,
                           column_names: Iterable[str]) -> Dict[str, dict]:
    """Builds dictionary containing metadata for all the specified summary columns"""
    smry_meta = {}

    for col_name in column_names:
        col_meta = {}
        col_meta["unit"] = eclsum.unit(col_name)
        col_meta["is_total"] = eclsum.is_total(col_name)
        col_meta["is_rate"] = eclsum.is_rate(col_name)
        col_meta["is_historical"] = eclsum.smspec_node(
            col_name).is_historical()
        col_meta["keyword"] = eclsum.smspec_node(col_name).keyword
        col_meta["wgname"] = eclsum.smspec_node(col_name).wgname

        num = eclsum.smspec_node(col_name).get_num()
        if num is not None:
            col_meta["get_num"] = num

        smry_meta[col_name] = col_meta

    return smry_meta
Example #4
0
    def test_ix_case(self):
        intersect_summary = EclSum(self.createTestPath("Statoil/ECLIPSE/ix/summary/CREATE_REGION_AROUND_WELL"))
        self.assertIsNotNone(intersect_summary)

        self.assertTrue(
                "HWELL_PROD" in
                [intersect_summary.smspec_node(key).wgname for key in intersect_summary.keys()]
                )

        eclipse_summary = EclSum(self.createTestPath("Statoil/ECLIPSE/ix/summary/ECL100/E100_CREATE_REGION_AROUND_WELL"))
        self.assertIsNotNone(eclipse_summary)

        hwell_padder = lambda key : key if key.split(":")[-1] != "HWELL_PR" else key + "OD"
        self.assertEqual(
                intersect_summary.keys("WWCT*"),
                list(map(hwell_padder, eclipse_summary.keys("WWCT*")))
                )
Example #5
0
    def test_restart_mapping(self):
        history = EclSum( self.createTestPath( "Statoil/ECLIPSE/SummaryRestart/iter-1/NOR-2013A_R007-0") )
        total = EclSum( self.createTestPath( "Statoil/ECLIPSE/SummaryRestart/Prediction/NOR-2013A_R007_PRED-0") , include_restart = True)

        history_dates = history.get_dates( )
        total_dates = total.get_dates( )
        for i in range(len(history_dates)):
            self.assertEqual( history_dates[i] , total_dates[i] )


        keys = history.keys( pattern = "W*")
        for key in keys:
            if key in total:
                self.assertEqual( history.iget( key , 5 ) , total.iget( key , 5 ))

        self.assertFalse( "WGPR:NOT_21_D" in history )
        self.assertTrue( "WGPR:NOT_21_D" in total )

        node = total.smspec_node("WGPR:NOT_21_D")
        self.assertEqual( total.iget( "WGPR:NOT_21_D", 5) , node.default)