porepy.fracs.wells_3d module

Module for well representation in Well and WellNetworks.

A well is a polyline of at least nsegs=1 segment defined through a list of npts=nsegs+1 points. Wells are connected in a network.

After defining and meshing a fracture network, the wells may be added to the mdg by

compute_well_fracture_intersections(well_network, fracture_network) well_network.mesh(mdg)

class Well(points, index=None, tags=None)[source]

Bases: object

Class representing a single well as a polyline embedded in 3D space.

The fracture is defined by its vertexes. It contains various utility methods, mainly intended for use together with the WellNetwork3d class.

Parameters
  • points (np.ndarray) –

  • index (Optional[int]) –

  • tags (Optional[dict]) –

p

Fracture vertices. Will be stored in a CCW order (or CW, depending on which side it is viewed from).

Type

np.ndarray, 3 x npt

orig_p

Original fracture vertices, kept in case the fracture geometry for some reason is modified.

Type

np.ndarray, 3 x npt

index

Index of well. Intended used in WellNetwork3d.

Type

int

tags
add_point(point, ind=None)[source]

Add new pts (3 x 1) to self.pts. If ind is not specified, the point is appended at the end of self.pts. Otherwise, it is inserted between the old points number ind and ind + 1.

Parameters
Return type

None

copy()[source]

Return a deep copy of the fracture.

Note that the original points (as given when the fracture was initialized) will not be preserved.

Returns

Fracture with the same points.

num_points()[source]
Return type

int

num_segments()[source]
Return type

int

segments()[source]

Iterate over the segments defined through segment indices and endpoints.

Return type

Iterator[tuple[list[int], numpy.ndarray]]

set_index(i)[source]

Set index of this fracture.

Parameters

i (int) – Index.

Return type

None

class WellNetwork3d(wells=None, domain=None, tol=1e-8, parameters=None)[source]

Bases: object

Collection of Wells with geometrical information.

Facilitates meshing of all wells in the network and their addition to a mixed-dimensional grid, see mesh method.

Parameters
_wells

All fractures forming the network.

Type

list of Fracture

tol

Geometric tolerance used in computations.

Type

double

domain

External bounding box. See impose_external_boundary() for details.

Type

dictionary

tags

Tags used on Wells.

Type

dictionary

add(w)[source]

Add a well to the network.

The well will be assigned a new index, higher than the maximum value currently found in the network.

Parameters

w (Well) – Well to be added.

Return type

None

mesh(mdg)[source]

Produce grids for the network’s wells and add to existing mixed-dimensional grid.

One grid is constructed for each subline extending between two fracture intersections. In the simplest case, the well is a (poly)line with two end points, and a single grid is produced. Intersection grids are added for all intersection points between wells and fractures. Finally, edges are added between intersection points and both fractures and well segments. Example topology for well intersecting two fractures, terminating at the lowermost:


sd_well_0 |

  • e(sd_isec_0, sd_well_0)

sd_isec_0 . * e(sd_isec_0, sd_frac_0) ___________ sd_frac_0 (2d)
  • e(sd_isec_0, sd_well_1)


sd_well_1 |

  • e(sd_isec_1, sd_well_1)

sd_isec_1 . * e(sd_isec_1, sd_frac_1) ____________ sd_frac_1 (2d)

Note that all edge grids (*) are zero-dimensional, and that those connected with the fracture have co-dimension 2!

Each point defining the well polyline is assumed to have a tag list stored in w.tags[“intersecting_fractures”]. An empty tag means the point does not correspond to a fracture intersection. An integer entry i identifies an intersection with the fracture with g.frac_num = i. If the list contains multiple tags, the interpretation would be an intersection between the well and a fracture intersection line or point. This is not implemented. Points not corresponding to a fracture intersection, but merely representing a kink in the polyline, will not be represented by a 0d grid. Rather, the two neighbouring segments are joined and a single _piecewise_ linear grid is produced.

This function may be split/restructured in the future. One possibility is to let gmsh do the actual meshing as done in the FractureNetwork classes. For now, this simplified approach is deemed sufficient.

Parameters

mdg (MixedDimensionalGrid) –

Return type

None

compute_well_fracture_intersections(well_network, fracture_network)[source]

Compute intersections and store tags identifying which fracture and well segments each intersection corresponds.

Parameters
  • wells (well_network containing the) – two points each (in well.pts). Intersection points and tags are added and updated in-place.

  • least (which are assumed to have at) – two points each (in well.pts). Intersection points and tags are added and updated in-place.

  • the (fracture_network containing) –

  • well_network (WellNetwork3d) –

  • fracture_network (FractureNetwork3d) –

Return type

None

A new set of points will be computed for each well, with original points and new intersection points. Note that original points may also correspond to an intersection with a fracture. Each well’s tags are updated with the list “intersecting_fractures”, with one list for each point in the new set. The entries of the inner list are the indices of the fractures intersecting the well at the corresponding point. Multiple fractures may intersect in any given point, but this might require special treatment elsewhere. The tags are crucial to the meshing of the well network.

compute_well_rock_matrix_intersections(mdg, cells=None, min_length=1e-10, tol=1e-5)[source]

Compute intersections and add edge coupling between the well and the rock matrix. To be called after the well grids are constructed. We are assuming convex cells and a single high dimensional grid. To speed up the geometrical computation we construct an ADTree.

Parameters
  • mdg (pp.MixedDimensionalGrid) – the mixed-dimensional grid containing all the elements

  • cells (np.ndarray, optional) – a set of cells that might be considered to construct the ADTree. If it is not given the tree is constructed by using all the higher dimensional grid cells

  • min_length (float, optional) – minimum length a segment that intersect a cell needs to have to be considered in the mapping

  • tol (float, optional) – geometric tolerance, default 1e-5

Return type

None