flownet.network_model._network_model module

class flownet.network_model._network_model.NetworkModel(df_entity_connections: pandas.core.frame.DataFrame, df_well_connections: pandas.core.frame.DataFrame, cell_length: float, area: float, fault_planes: Optional[pandas.core.frame.DataFrame] = None, fault_tolerance: float = 1e-05, volume_layering: Optional[List[float]] = None)

Bases: object

_calculate_connections_at_nodes() List[List[int]]

Calculates None-Neighbouring-connections (NNCs) using the following approach:

  1. Get connections at a node

  2. Create a list of tube indices of connected nodes

Returns

List of lists with tube indices connected to a node

_calculate_faults(fault_tolerance: float = 1e-05) Optional[Dict[str, List[int]]]

Calculates fault definitions using the following approach:

  1. Loop through all faults

  2. Perform a triangulation of all points belonging to a fault plane and store the triangles

  3. For each connection, find all triangles in its bounding box, perform ray tracing using the Möller-Trumbore intersection algorithm.

  4. If an intersection is found, identify the grid blocks that are associated with the intersection.

Parameters

fault_tolerance – minimum distance between corners of a triangle. This value should be set as low as possible to ensure a high resolution fault plane generation. However, this might lead to a very slow fault tracing process therefore one might want to increase the tolerance. Always check that the resulting lower resolution fault plane still is what you expected.

Returns

Listing of tuples of FAULTS entries with zero-offset i-coordinates, or None if no faults are present.

_calculate_grid_corner_points() pandas.core.frame.DataFrame

Reads the FlowNet connections, generates the 1D-models and returns a DataFrame with grid corner points.

Returns

DataFrame of all corner-points needed to generate the grid.

_calculate_nncs() List[Tuple[int, int]]

Calculates None-Neighbouring-connections (NNCs) using the following approach:

  1. Get connections at a node

  2. Calculate all possible combinations of NNCs for the group and iterate over them.

  3. The last step is to look up which grid cell indices the two identified NNCs correspond to.

Returns

Listing of tuples of NCC connected zero-offset i-coordinates.

_create_connection_groups() pandas.core.frame.DataFrame

Create groups of connections at a node.

  1. The input dataframe is stacked such that all start and end points are in the same columns. The information regarding if it is a start or end point is saved in an extra column called ‘source’.

  2. The start and end dataframes are concatenated in one dataframe.

  3. Binning of (x,y,z) and casting result into floats

  4. Group rows based on equal (x,y,z) bin assignments.

Returns:

_get_aquifer_i() List[List[int]]

Helper function to get the aquifer i’s with zero-offset.

Returns

List of lists of zero-offset i’s of aquifers.

active_mask(model_index) List[bool]

Helper function to get out active grid cell indices of the one dimensional model in the network with index model_index.

Parameters

model_index – zero-offset model index

Returns

booleans representing the active cells in the model with model index model_index. Again, with zero-offset.

property aquifers_i: List[List[int]]

Property that returns a list of list of zero-offset i coordinates for all aquifers in the model.

Returns

List of lists of zero-offset i’s of aquifers.

property aquifers_xyz: List[Union[Tuple[float, float, float], List[float], Tuple[Any, ...]]]

Returns a list of zero-offset i,j,k coordinates for all aquifers in the model

Returns

List of coordinates for the aquifers

property area: float

surface area between to grid cells

bulk_volume_per_flownet_cell_based_on_tube_length() numpy.ndarray

Generate bulk volume per flownet grid cell based on the total length of the active cells in each tube in the FlowNet and the convex hull on the FlowNet network.

Parameters

network – FlowNet network instance.

Returns

A list with bulk volumes for each flownet tube cell.

property cell_length: float

Desired length of all cells

property cell_midpoints: Tuple[Any, Any, Any]

Returns a tuple with the midpoint of each cell in the network

Returns

Tuple with connection midpoint coordinates.

property connection_at_nodes: List[List[int]]

List is lists with tube indices belonging to a node

property connection_midpoints: numpy.ndarray

Returns a numpy array with the midpoint of each connection in the network

Returns

(Nx3) np.ndarray with connection midpoint coordinates.

property convexhull: scipy.spatial.qhull.ConvexHull

Return the convex hull of the FlowNet network.

Returns

Convex hull of the network.

property df_entity_connections: pandas.core.frame.DataFrame

DataFrame containing all connections between entities

property faults: Optional[Dict[Any, Any]]

Dictionary of fault names containing a list of integer zero-offset I-coordinates belonging to a fault

get_connection_midpoints(i: Optional[int] = None) numpy.ndarray

Returns a numpy array with the midpoint of each connection in the network or, in case the optional i parameter is specified, the midpoint of the i’th connection.

Parameters

i – specific zero-offset element to calculate the midpoint for

Returns

(Nx3) np.ndarray with connection midpoint coordinates.

property grid: pandas.core.frame.DataFrame

DataFrame of all corner-points needed to generate the grid

property initial_cell_volumes: numpy.ndarray

Initial cell volume for each grid cell in the flownet.

Returns

An np.ndarray with multiplier for each FlowNet grid cell’s volume.

property nncs: List[Tuple[int, int]]

List of tuples of NNC I-coordinates of connections

property total_bulkvolume

Returns the bulk volume of the network, i.e. the volume of the convex hull of the FlowNet network. The calculation is done by finding the convex hull of the network (using the end points of the input tubes) and then calculating the volume of this hull.

Returns

Bulk volume of the convex hull.

property volume_layering: List[float]

Depths defining volume layering