Ejemplo n.º 1
0
    def test_equivalence_3d(self):
        """
        3d version of previous test.
        This central test checks that certain geometry, connectivity and tags
        are independent of whether the fracture is
        1 premade in its final form
        2-3 grown in a single step (from two different inital fractures)
        4 grown in two steps
        """
        # Make buckets
        gb_1 = setup_gb.grid_3d_2d([4, 2, 2], 0, 0.75)
        gb_2 = setup_gb.grid_3d_2d([4, 2, 2], 0, 0.25)
        gb_3 = setup_gb.grid_3d_2d([4, 2, 2], 0, 0.50)
        gb_4 = setup_gb.grid_3d_2d([4, 2, 2], 0, 0.25)

        # Pick out the 2d grids in each bucket. These will be used to set which faces
        # in the 3d grid to split
        g2 = gb_2.grids_of_dimension(2)[0]
        g3 = gb_3.grids_of_dimension(2)[0]
        g4 = gb_4.grids_of_dimension(2)[0]

        # Do the splitting
        pp.propagate_fracture.propagate_fractures(gb_2, {g2: np.array([53, 54])})
        pp.propagate_fracture.propagate_fractures(gb_3, {g3: np.array([54])})
        # The fourth bucket is split twice
        pp.propagate_fracture.propagate_fractures(gb_4, {g4: np.array([53])})
        pp.propagate_fracture.propagate_fractures(gb_4, {g4: np.array([54])})

        # Check that the four grid buckets are equivalent
        check_equivalent_buckets([gb_1, gb_2, gb_3, gb_4])
Ejemplo n.º 2
0
    def test_two_fractures_2d(self):
        """
        Two fractures growing towards each other, but not meeting.

        Tests simultanous growth of two fractures in multiple steps, and growth
        of one fracture in the presence of an inactive one.
        """
        f_1 = np.array([[0, 0.25], [0.5, 0.5]])
        f_2 = np.array([[1.75, 2], [0.5, 0.5]])
        gb = pp.meshing.cart_grid([f_1, f_2], [8, 2], physdims=[2, 1])

        f_1 = np.array([[0, 0.5], [0.5, 0.5]])
        f_2 = np.array([[1.5, 2], [0.5, 0.5]])
        gb_1 = pp.meshing.cart_grid([f_1, f_2], [8, 2], physdims=[2, 1])

        f_1 = np.array([[0, 0.75], [0.5, 0.5]])
        f_2 = np.array([[1.25, 2], [0.5, 0.5]])
        gb_2 = pp.meshing.cart_grid([f_1, f_2], [8, 2], physdims=[2, 1])

        f_1 = np.array([[0, 1.0], [0.5, 0.5]])
        gb_3 = pp.meshing.cart_grid([f_1, f_2], [8, 2], physdims=[2, 1])

        # Get the fracture grids
        g1 = gb.grids_of_dimension(1)[0]
        g2 = gb.grids_of_dimension(1)[1]

        # First propagation step
        faces = {g1: np.array([27]), g2: np.array([32])}
        pp.propagate_fracture.propagate_fractures(gb, faces)
        check_equivalent_buckets([gb, gb_1])

        # Second step
        faces = {g1: np.array([28]), g2: np.array([31])}
        pp.propagate_fracture.propagate_fractures(gb, faces)
        check_equivalent_buckets([gb, gb_2])

        # Final step - only one of the fractures grow
        faces = {g1: np.array([29]), g2: np.array([], dtype=int)}
        pp.propagate_fracture.propagate_fractures(gb, faces)
        check_equivalent_buckets([gb, gb_3])