porepy.grids.standard_grids.md_grids_2d module

This file contains utility functions for setting up grid buckets for 2d networks. The default is simplex grids, but Cartesian grids are also possible for the simplest geometries. The provided geometries are:

Simple unit square geometries

single_horizontal: Single horizontal line at y=0.5 two_intersecting: Two lines intersecting at (0.5, 0.5)

More complex geometries

seven_fractures_one_L: Seven fractures with one L intersection benchmark_regular: Six fractures intersecting in 3 X and 6 Y intersections

benchmark_regular(mesh_args, is_coarse=False)[source]

Create a grid bucket for a domain containing the network introduced as example 2 of Berre et al. 2018: Benchmarks for single-phase flow in fractured porous media.

Parameters
  • mesh_args (dict) – Dictionary containing at least “mesh_size_frac”. If the optional values of “mesh_size_bound” and “mesh_size_min” are not provided, these are set by utils.set_mesh_sizes.

  • is_coarse (bool) –

Returns

Mixed-dimensional grid and domain.

seven_fractures_one_L_intersection(mesh_args)[source]

Create a grid bucket for a domain containing the network introduced as example 1 of Berge et al. 2019: Finite volume discretization for poroelastic media with fractures modeled by contact mechanics.

Parameters

mesh_args (dict) – Dictionary containing at least “mesh_size_frac”. If the optional values of “mesh_size_bound” and “mesh_size_min” are not provided, these are set by utils.set_mesh_sizes.

Returns

Mixed-dimensional grid and domain.

single_horizontal(mesh_args=None, x_endpoints=None, simplex=True)[source]

Create a grid bucket for a domain containing a single horizontal fracture at y=0.5.

Parameters
  • mesh_args (Optional[dict | np.ndarray]) –

    For triangular grids: Dictionary containing at least “mesh_size_frac”. If

    the optional values of “mesh_size_bound” and “mesh_size_min” are not provided, these are set by utils.set_mesh_sizes.

    For cartesian grids: np.array containing number of cells in x and y

    direction.

  • x_endpoints (list) – Contains the x coordinates of the two endpoints. If not provided, the endpoints will be set to [0, 1]

  • simplex (bool) –

Returns

Mixed-dimensional grid and domain.

single_vertical(mesh_args=None, y_endpoints=None, simplex=True)[source]

Create a grid bucket for a domain containing a single vertical fracture at x=0.5.

Parameters
  • mesh_args (Optional[np.ndarray | dict]) –

    For triangular grids: Dictionary containing at least “mesh_size_frac”. If

    the optional values of “mesh_size_bound” and “mesh_size_min” are not provided, these are set by utils.set_mesh_sizes.

    For cartesian grids: Array containing number of cells in x and y

    direction.

  • y_endpoints (Optional[np.ndarray]) – Contains the y coordinates of the two endpoints. If not provided, the endpoints will be set to [0, 1]

  • simplex (Optional[bool]) – Grid type. If False, a Cartesian grid is returned.

Returns

Mixed-dimensional grid and domain.

two_intersecting(mesh_args=None, x_endpoints=None, y_endpoints=None, simplex=True)[source]

Create a grid bucket for a domain containing fractures, one horizontal and one vertical at y=0.5 and x=0.5 respectively.

Parameters
  • mesh_args (Optional[dict | np.ndarray]) –

    For triangular grids: Dictionary containing at least “mesh_size_frac”. If

    the optional values of “mesh_size_bound” and “mesh_size_min” are not provided, these are set by utils.set_mesh_sizes.

    For cartesian grids: List containing number of cells in x and y

    direction.

  • x_endpoints (list) – containing the x coordinates of the two endpoints of the horizontal fracture. If not provided, the endpoints will be set to [0, 1].

  • y_endpoints (list) – Contains the y coordinates of the two endpoints of the vertical fracture. If not provided, the endpoints will be set to [0, 1].

  • simplex (bool) – Whether to use triangular or Cartesian 2d grid.

Returns

Mixed-dimensional grid and domain.