InvasionPercolation#
- class InvasionPercolation(*args, **kwargs)[source]#
A classic invasion percolation algorithm optimized for speed with numba
- Parameters:
network (Network) – The Network upon which the invasion will occur
Notes
This algorithm uses a binary heap to store a list of all accessible throats, sorted according to entry pressure. This means that item [0] in the heap is the most easily invaded throat that is currently accessible by the invading fluid, so looking up which throat to invade next is computationally trivial. In order to keep the list sorted, adding new throats to the list takes more time; however, the heap data structure is very efficient at this.
- Attributes:
Np
Shortcut to retrieve the number of pores in the domain
Nt
Shortcut to retrieve the number of throats in the domain
Ps
Shortcut to retrieve the indices of all pores
Ts
Shortcut to retrieve the indices of all throats
iterative_props
Finds and returns properties that need to be iterated while running the algorithm.
- name
network
Shortcut to retrieve a handle to the network object associated with the
params
This attribute stores ‘scalar’ data that can be used by pore-scale models.
- project
- settings
Methods
Adjusts the invasion sequence of pores and throats that are trapped.
clear_BCs
([bctype])Clear all BCs of the given type(s)
filter_by_label
([pores, throats, labels, mode])Returns which of the supplied pores (or throats) has the specified label(s)
get_conduit_data
(propname)Fetches an Nt-by-3 array of the requested property
interpolate_data
(propname[, mode])Generates an array of the requested pore/throat data by interpolating the neighboring throat/pore data.
labels
([pores, throats, element, mode])Returns a list of labels present on the object
num_pores
([labels, mode])Returns the number of pores of the specified labels
num_throats
([labels, mode])Return the number of throats of the specified labels
pc_curve
()Get the percolation data as the non-wetting phase saturation vs the capillary pressure.
pores
([labels, mode, asmask])Returns pore indicies where given labels exist, according to the logic specified by the
mode
argument.props
([element])Retrieves a list of keys that contain numerical data (i.e. "properties").
run
()Performs the algorithm for the given number of steps
set_BC
([pores, bctype, bcvalues, mode])The main method for setting and adjusting boundary conditions.
set_inlet_BC
([pores, mode])Specifies which pores are treated as inlets for the invading phase
set_label
(label[, pores, throats, mode])Creates or updates a label array
set_outlet_BC
([pores, mode])Specifies which pores are treated as outlets for the defending phase
throats
([labels, mode, asmask])Returns throat locations where given labels exist, according to the logic specified by the
mode
argument.to_indices
(mask)Converts a boolean mask to pore or throat indices
to_mask
([pores, throats])Generates a boolean mask with True values in the given locations
reset