code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def _validate_x0(self): """Ensures x0 doesn't contain any nans/infs.""" x0 = self["pore.initial_guess"] if not np.isfinite(x0).all(): raise Exception("x0 contains inf/nan values")
Ensures x0 doesn't contain any nans/infs.
_validate_x0
python
PMEAL/OpenPNM
openpnm/algorithms/_transport.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/algorithms/_transport.py
MIT
def _validate_topology_health(self): """ Ensures the network is not clustered, and if it is, they're at least connected to a boundary condition pore. """ Ps = ~np.isnan(self['pore.bc.rate']) + ~np.isnan(self['pore.bc.value']) if not is_fully_connected(network=self.network...
Ensures the network is not clustered, and if it is, they're at least connected to a boundary condition pore.
_validate_topology_health
python
PMEAL/OpenPNM
openpnm/algorithms/_transport.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/algorithms/_transport.py
MIT
def _validate_linear_system(self): """Ensures the linear system Ax = b doesn't contain any nans/infs.""" if np.isfinite(self.A.data).all() and np.isfinite(self.b).all(): return raise Exception("A or b contains inf/nan values")
Ensures the linear system Ax = b doesn't contain any nans/infs.
_validate_linear_system
python
PMEAL/OpenPNM
openpnm/algorithms/_transport.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/algorithms/_transport.py
MIT
def rate(self, pores=[], throats=[], mode='group'): """ Calculates the net rate of material moving into a given set of pores or throats Parameters ---------- pores : array_like The pores for which the rate should be calculated throats : array_like ...
Calculates the net rate of material moving into a given set of pores or throats Parameters ---------- pores : array_like The pores for which the rate should be calculated throats : array_like The throats through which the rate should be calculate...
rate
python
PMEAL/OpenPNM
openpnm/algorithms/_transport.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/algorithms/_transport.py
MIT
def add_phases(self, phases): """ Adds supplied phases to MultiPhase object and sets occupancy to 0. Parameters ---------- phases : list[Phase] or Phase """ phases = np.array(phases, ndmin=1) for phase in phases: if phase.name in self.setting...
Adds supplied phases to MultiPhase object and sets occupancy to 0. Parameters ---------- phases : list[Phase] or Phase
add_phases
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def set_occupancy(self, phase, *, pores=[], throats=[], values=1): r""" Specifies occupancy of a phase in each pore or throat. This method doesn't return any value. Parameters ---------- phase : Phase The phase whose occupancy is being specified. pore...
Specifies occupancy of a phase in each pore or throat. This method doesn't return any value. Parameters ---------- phase : Phase The phase whose occupancy is being specified. pores : ndarray The location of pores whose occupancy is to be set. ...
set_occupancy
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def regenerate_models(self, propnames=None, exclude=[]): r""" Regenerate models associated with the Multiphase object This method works by first regenerating the models associated with the constituent phases, and then regenerating Multiphase models. Parameters ---------...
Regenerate models associated with the Multiphase object This method works by first regenerating the models associated with the constituent phases, and then regenerating Multiphase models. Parameters ---------- propnames : list[str] or str The list of proper...
regenerate_models
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def set_binary_partition_coef(self, phases, model, **kwargs): """ Sets binary partition coefficient as defined by the interface concentration ratio of phase 1 to phase 2. Parameters ---------- phases : list[Phase] List of the two phases for which the binary p...
Sets binary partition coefficient as defined by the interface concentration ratio of phase 1 to phase 2. Parameters ---------- phases : list[Phase] List of the two phases for which the binary partition coefficient model is being added. model : Op...
set_binary_partition_coef
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def _add_interface_prop(self, propname, phases, model, **kwargs): """ Adds an interface model to the MultiPhase object. See Notes. Notes ----- Let's say the two phases corresponding to the interface model are named: 'air' and 'water', and the interface propname to be add...
Adds an interface model to the MultiPhase object. See Notes. Notes ----- Let's say the two phases corresponding to the interface model are named: 'air' and 'water', and the interface propname to be added is 'throat.foo'. After augmentation, 'throat.foo.air:water' will ...
_add_interface_prop
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def _format_interface_prop(self, propname, phases): """Formats propname as {propname}.{phase[0].name}:{phase[1].name}""" prefix = propname suffix = ":".join(phase.name for phase in phases) return f"{prefix}.{suffix}"
Formats propname as {propname}.{phase[0].name}:{phase[1].name}
_format_interface_prop
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def _build_K(self): """Updates the global partition coefficient array""" prefix = self.settings["partition_coef_prefix"] self._K = np.ones(self.Nt, dtype=float) # Find all binary partition coefficient models models = [k for k in self.models.keys() if k.startswith(prefix)] ...
Updates the global partition coefficient array
_build_K
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def _interleave_data(self, prop): """Gathers property values from component phases to build a single array.""" element = self._parse_element(prop)[0] vals = np.zeros(self._count(element=element), dtype=float) # Retrieve property from constituent phases (weight = occupancy) for ph...
Gathers property values from component phases to build a single array.
_interleave_data
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def _set_automatic_throat_occupancy(self, mode="mean"): """ Automatically interpolates throat occupancy based on that in adjacent pores. This method doesn't return any value. Parameters ---------- mode : str Interpolation method. Options are: ===...
Automatically interpolates throat occupancy based on that in adjacent pores. This method doesn't return any value. Parameters ---------- mode : str Interpolation method. Options are: =========== ===================================================== ...
_set_automatic_throat_occupancy
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def multiphase_diffusion(phase, pore_diffusivity="pore.diffusivity", throat_diffusivity="throat.diffusivity", size_factors="throat.diffusive_size_factors", partition_coef_global="throat.partition_coef.global"): r""" ...
Calculates the diffusive conductance of conduits for multiphase systems. Parameters ---------- %(phase)s pore_diffusivity : str %(dict_blurb)s pore diffusivity throat_diffusivity : str %(dict_blurb)s throat diffusivity size_factors : str %(dict_blurb)s conduit size ...
multiphase_diffusion
python
PMEAL/OpenPNM
openpnm/contrib/_multiphase.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_multiphase.py
MIT
def run(self, x0, tspan, saveat=None, integrator=None): """ Runs all of the transient algorithms simultaneoulsy and returns the solution. Parameters ---------- x0 : ndarray or float Array (or scalar) containing initial condition values. tspan : array_...
Runs all of the transient algorithms simultaneoulsy and returns the solution. Parameters ---------- x0 : ndarray or float Array (or scalar) containing initial condition values. tspan : array_like Tuple (or array) containing the integration time s...
run
python
PMEAL/OpenPNM
openpnm/contrib/_transient_multiphysics.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_transient_multiphysics.py
MIT
def _build_rhs(self): """ Returns a function handle, which calculates dy/dt = rhs(y, t). Notes ----- ``y`` is a composite array that contains ALL the variables that the multiphysics algorithm solves for, e.g., if the constituent algorithms are ``TransientFickianD...
Returns a function handle, which calculates dy/dt = rhs(y, t). Notes ----- ``y`` is a composite array that contains ALL the variables that the multiphysics algorithm solves for, e.g., if the constituent algorithms are ``TransientFickianDiffusion``, and ``Transie...
_build_rhs
python
PMEAL/OpenPNM
openpnm/contrib/_transient_multiphysics.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/contrib/_transient_multiphysics.py
MIT
def clear(self, mode=None): r""" Clears or deletes certain things from object. If no arguments are provided it defaults to the normal `dict` behavior. Parameters ---------- mode : str Controls which things are to be deleted. Options are: ========...
Clears or deletes certain things from object. If no arguments are provided it defaults to the normal `dict` behavior. Parameters ---------- mode : str Controls which things are to be deleted. Options are: =========== ====================================...
clear
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def keys(self, mode=None): r""" An overloaded version of ``keys`` that optionally accepts a ``mode`` Parameters ---------- mode : str If given, optionally, it controls which type of keys are returned. Options are: ========== =================...
An overloaded version of ``keys`` that optionally accepts a ``mode`` Parameters ---------- mode : str If given, optionally, it controls which type of keys are returned. Options are: ========== ======================================================= ...
keys
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def to_mask(self, pores=None, throats=None): r""" Generates a boolean mask with `True` values in the given locations Parameters ---------- pores : array_like The pore indices where `True` values will be placed. If `pores` is given the `throats` is ignored...
Generates a boolean mask with `True` values in the given locations Parameters ---------- pores : array_like The pore indices where `True` values will be placed. If `pores` is given the `throats` is ignored. throats : array_like The throat ind...
to_mask
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def to_indices(self, mask): r""" Converts a boolean mask to pore or throat indices Parameters ---------- mask : ndarray A boolean mask with `True` values indicating either pore or throat indices. This array must either be Nt or Np long, otherwise ...
Converts a boolean mask to pore or throat indices Parameters ---------- mask : ndarray A boolean mask with `True` values indicating either pore or throat indices. This array must either be Nt or Np long, otherwise an Exception is raised. Ret...
to_indices
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def props(self, element=['pore', 'throat']): r""" Retrieves a list of keys that contain numerical data (i.e. "properties") Parameters ---------- element : str, list of strings Indicates whether `'pore'` or `'throat'` properties should be returned. The def...
Retrieves a list of keys that contain numerical data (i.e. "properties") Parameters ---------- element : str, list of strings Indicates whether `'pore'` or `'throat'` properties should be returned. The default is `['pore', 'throat']`, so both are returned. ...
props
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def interpolate_data(self, propname, mode='mean'): r""" Generates an array of the requested pore/throat data by interpolating the neighboring throat/pore data. Parameters ---------- propname : str The data to be generated. mode : str Dicta...
Generates an array of the requested pore/throat data by interpolating the neighboring throat/pore data. Parameters ---------- propname : str The data to be generated. mode : str Dictate how the interpolation is done. Options are 'mean', 'min', ...
interpolate_data
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def get_conduit_data(self, propname): r""" Fetches an Nt-by-3 array of the requested property Parameters ---------- propname : str The dictionary key of the property to fetch. Returns ------- data : ndarray An Nt-by-3 array with e...
Fetches an Nt-by-3 array of the requested property Parameters ---------- propname : str The dictionary key of the property to fetch. Returns ------- data : ndarray An Nt-by-3 array with each column containing the requrested data ...
get_conduit_data
python
PMEAL/OpenPNM
openpnm/core/_base2.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_base2.py
MIT
def _parse_indices(self, indices): r""" This private method accepts a list of pores or throats and returns a properly structured Numpy array of indices. Parameters ---------- indices : int or array_like This argument can accept numerous different data types i...
This private method accepts a list of pores or throats and returns a properly structured Numpy array of indices. Parameters ---------- indices : int or array_like This argument can accept numerous different data types including boolean masks, integers an...
_parse_indices
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def _parse_element(self, element, single=False): r""" This private method is used to parse the keyword \'element\' in many of the above methods. Parameters ---------- element : str or List[str] The element argument to check. If is None is recieved, then a li...
This private method is used to parse the keyword \'element\' in many of the above methods. Parameters ---------- element : str or List[str] The element argument to check. If is None is recieved, then a list containing both \'pore\' and \'throat\' is ret...
_parse_element
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def _parse_labels(self, labels, element): r""" This private method is used for converting \'labels\' to a proper format, including dealing with wildcards (\*). Parameters ---------- labels : str or List[str] The label or list of labels to be parsed. Note that...
This private method is used for converting \'labels\' to a proper format, including dealing with wildcards (\*). Parameters ---------- labels : str or List[str] The label or list of labels to be parsed. Note that the \* can be used as a wildcard. ...
_parse_labels
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def _parse_mode(self, mode, allowed=None, single=False): r""" This private method is for checking the \'mode\' used in the calling method. Parameters ---------- mode : str or List[str] The mode(s) to be parsed allowed : List[str] A list co...
This private method is for checking the \'mode\' used in the calling method. Parameters ---------- mode : str or List[str] The mode(s) to be parsed allowed : List[str] A list containing the allowed modes. This list is defined by the ...
_parse_mode
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def _get_labels(self, element, locations, mode): r""" This is the actual label getter method, but it should not be called directly. Use ``labels`` instead. """ # Parse inputs locations = self._parse_indices(locations) element = self._parse_element(element=element...
This is the actual label getter method, but it should not be called directly. Use ``labels`` instead.
_get_labels
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def labels(self, pores=[], throats=[], element=None, mode='union'): r""" Returns a list of labels present on the object Additionally, this function can return labels applied to a specified set of pores or throats Parameters ---------- element : str C...
Returns a list of labels present on the object Additionally, this function can return labels applied to a specified set of pores or throats Parameters ---------- element : str Controls whether pore or throat labels are returned. If empty then b...
labels
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def set_label(self, label, pores=None, throats=None, mode='add'): r""" Creates or updates a label array Parameters ---------- label : str The label to apply to the specified locations pores : array_like A list of pore indices or a boolean mask of ...
Creates or updates a label array Parameters ---------- label : str The label to apply to the specified locations pores : array_like A list of pore indices or a boolean mask of where given label should be added or removed (see ``mode``) ...
set_label
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def _get_indices(self, element, labels, mode='or'): r""" This is the actual method for getting indices, but should not be called directly. Use ``pores`` or ``throats`` instead. """ # Parse and validate all input values. element = self._parse_element(element, single=True)...
This is the actual method for getting indices, but should not be called directly. Use ``pores`` or ``throats`` instead.
_get_indices
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def pores(self, labels=None, mode='or', asmask=False): r""" Returns pore indicies where given labels exist, according to the logic specified by the ``mode`` argument. Parameters ---------- labels : str or list[str] The label(s) whose pores locations are reque...
Returns pore indicies where given labels exist, according to the logic specified by the ``mode`` argument. Parameters ---------- labels : str or list[str] The label(s) whose pores locations are requested. This argument also accepts '*' for wildcard sear...
pores
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def filter_by_label(self, pores=[], throats=[], labels=None, mode='or'): r""" Returns which of the supplied pores (or throats) has the specified label(s) Parameters ---------- pores, or throats : array_like List of pores or throats to be filtered labe...
Returns which of the supplied pores (or throats) has the specified label(s) Parameters ---------- pores, or throats : array_like List of pores or throats to be filtered labels : list of strings The labels to apply as a filter mode : str ...
filter_by_label
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def num_pores(self, labels='all', mode='or'): r""" Returns the number of pores of the specified labels Parameters ---------- labels : list of strings, optional The pore labels that should be included in the count. If not supplied, all pores are counted. ...
Returns the number of pores of the specified labels Parameters ---------- labels : list of strings, optional The pore labels that should be included in the count. If not supplied, all pores are counted. labels : list of strings Label of pores...
num_pores
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def num_throats(self, labels='all', mode='union'): r""" Return the number of throats of the specified labels Parameters ---------- labels : list of strings, optional The throat labels that should be included in the count. If not supplied, all throats are ...
Return the number of throats of the specified labels Parameters ---------- labels : list of strings, optional The throat labels that should be included in the count. If not supplied, all throats are counted. mode : str, optional Specifies how...
num_throats
python
PMEAL/OpenPNM
openpnm/core/_mixins.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_mixins.py
MIT
def _find_target(self): """ Finds and returns the target object to which this ModelsDict is associated. """ for proj in ws.values(): for obj in proj: if hasattr(obj, "models"): if obj.models is self: return o...
Finds and returns the target object to which this ModelsDict is associated.
_find_target
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def dependency_list(self): r""" Returns a list of dependencies in the order with which they should be called to ensure data is calculated by one model before it's asked for by another. Notes ----- This raises an exception if the graph has cycles which means the ...
Returns a list of dependencies in the order with which they should be called to ensure data is calculated by one model before it's asked for by another. Notes ----- This raises an exception if the graph has cycles which means the dependencies are unresolvable (i...
dependency_list
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def dependency_graph(self, deep=False): """ Returns a NetworkX graph object of the dependencies Parameters ---------- deep : bool, optional Defines whether intra- or inter-object dependency graph is desired. Default is False, i.e. only returns dependencie...
Returns a NetworkX graph object of the dependencies Parameters ---------- deep : bool, optional Defines whether intra- or inter-object dependency graph is desired. Default is False, i.e. only returns dependencies within the object. See Also ...
dependency_graph
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def dependency_map(self, ax=None, figsize=None, deep=False, style='shell'): # pragma: no cover """ Create a graph of the dependency graph in a decent format Parameters ---------- ax : ma...
Create a graph of the dependency graph in a decent format Parameters ---------- ax : matplotlib.axis, optional Matplotlib axis object on which dependency map is to be drawn. figsize : tuple, optional Tuple containing frame size. See Also ...
dependency_map
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def _info(self): # Pragma: no cover r""" Prints a nicely formatted list of model names and the domain to which they apply. Notes ----- This is a hidden function for now, but could be exposed if useful. """ names = {} for item in self: ...
Prints a nicely formatted list of model names and the domain to which they apply. Notes ----- This is a hidden function for now, but could be exposed if useful.
_info
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def target(self): """ Finds and returns the object to which this model is assigned """ for proj in ws.values(): for obj in proj: if hasattr(obj, "models"): for mod in obj.models.values(): if mod is self: ...
Finds and returns the object to which this model is assigned
target
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def add_model(self, propname, model, domain='all', regen_mode='normal', **kwargs): r""" Add a pore-scale model to the object, along with the desired arguments Parameters ---------- propname : str The name of the property being computed. E.g. if ...
Add a pore-scale model to the object, along with the desired arguments Parameters ---------- propname : str The name of the property being computed. E.g. if ``propname='pore.diameter'`` then the computed results will be stored in ``obj['pore.diameter...
add_model
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def add_model_collection(self, models, domain='all', regen_mode='deferred'): r""" Add a ``collection`` of several models at once Parameters ---------- models : dict The collection of models to add. regen_mode : str By default the models are not re...
Add a ``collection`` of several models at once Parameters ---------- models : dict The collection of models to add. regen_mode : str By default the models are not regenerated upon addition. See the docstring for ``add_model`` for more informa...
add_model_collection
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def regenerate_models(self, propnames=None, exclude=[]): r""" Runs all the models stored in the object's ``models`` attribute Parameters ---------- propnames : list of strings If given then only the specified models are run exclude : list of strings ...
Runs all the models stored in the object's ``models`` attribute Parameters ---------- propnames : list of strings If given then only the specified models are run exclude : list of strings If given then these models will *not* be run Notes ...
regenerate_models
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def run_model(self, propname, domain=None): r""" Runs the requested model and places the result into the correct locations Parameters ---------- propname : str The name of the model to run. domain : str The label of the domain for which th...
Runs the requested model and places the result into the correct locations Parameters ---------- propname : str The name of the model to run. domain : str The label of the domain for which the model should be run. Passing ``propname='p...
run_model
python
PMEAL/OpenPNM
openpnm/core/_models.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/core/_models.py
MIT
def solve(self, rhs, x0, tspan, saveat, **kwargs): """ Solves the system of ODEs defined by dy/dt = rhs(t, y). Parameters ---------- rhs : function handle RHS vector in the system of ODEs defined by dy/dt = rhs(t, y) x0 : array_like Initial value ...
Solves the system of ODEs defined by dy/dt = rhs(t, y). Parameters ---------- rhs : function handle RHS vector in the system of ODEs defined by dy/dt = rhs(t, y) x0 : array_like Initial value for the system of ODEs tspan : array_like ...
solve
python
PMEAL/OpenPNM
openpnm/integrators/_scipy.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/integrators/_scipy.py
MIT
def network_to_comsol(network, filename=None): r""" Saves the network and geometry data from the given objects into the specified file. This exports in 2D only where throats and pores have rectangular and circular shapes, respectively. Parameters ---------- network : Network The net...
Saves the network and geometry data from the given objects into the specified file. This exports in 2D only where throats and pores have rectangular and circular shapes, respectively. Parameters ---------- network : Network The network containing the desired data Notes ----- ...
network_to_comsol
python
PMEAL/OpenPNM
openpnm/io/_comsol.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_comsol.py
MIT
def project_to_csv(project, filename=''): r""" Save all the pore and throat data on the Network and Phase objects to a CSV file Parameters ---------- project : list An openpnm ``project`` object filename : str or path object The name of the file to store the data """ ...
Save all the pore and throat data on the Network and Phase objects to a CSV file Parameters ---------- project : list An openpnm ``project`` object filename : str or path object The name of the file to store the data
project_to_csv
python
PMEAL/OpenPNM
openpnm/io/_csv.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_csv.py
MIT
def project_to_dict(project, categorize_by=['name'], flatten=False, element=None, delim=' | '): r""" Returns a single dictionary object containing data from the given OpenPNM project, with the keys organized differently depending on optional arguments. Parameters ---------- ...
Returns a single dictionary object containing data from the given OpenPNM project, with the keys organized differently depending on optional arguments. Parameters ---------- project : list An OpenPNM project object categorize_by : str or list[str] Indicates how the dictiona...
project_to_dict
python
PMEAL/OpenPNM
openpnm/io/_dict.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_dict.py
MIT
def project_to_hdf5(project, filename=''): r""" Creates an HDF5 file containing data from the specified objects Parameters ---------- network : Network The network containing the desired data phases : list[Phase]s (optional, default is none) A list of phase objects whose data a...
Creates an HDF5 file containing data from the specified objects Parameters ---------- network : Network The network containing the desired data phases : list[Phase]s (optional, default is none) A list of phase objects whose data are to be included Returns ------- f : ...
project_to_hdf5
python
PMEAL/OpenPNM
openpnm/io/_hdf5.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_hdf5.py
MIT
def print_hdf5(f, flat=False): r""" Given an hdf5 file handle, prints to console in a human readable manner Parameters ---------- f : file handle The hdf5 file to print flat : bool Flag to indicate if print should be nested or flat. The default is ``flat==False`` result...
Given an hdf5 file handle, prints to console in a human readable manner Parameters ---------- f : file handle The hdf5 file to print flat : bool Flag to indicate if print should be nested or flat. The default is ``flat==False`` resulting in a nested view.
print_hdf5
python
PMEAL/OpenPNM
openpnm/io/_hdf5.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_hdf5.py
MIT
def network_to_jsongraph(network, filename=''): r""" Write the network to disk as a JGF file. Parameters ---------- network : Network filename : str Desired file name, defaults to network name if not given """ # Ensure output file is valid filename = _parse_filename(filena...
Write the network to disk as a JGF file. Parameters ---------- network : Network filename : str Desired file name, defaults to network name if not given
network_to_jsongraph
python
PMEAL/OpenPNM
openpnm/io/_jsongraph.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_jsongraph.py
MIT
def network_from_jsongraph(filename): r""" Loads the JGF file onto the given project. Parameters ---------- filename : str The name of the file containing the data to import. The formatting of this file is outlined below. Returns ------- network : dict An OpenP...
Loads the JGF file onto the given project. Parameters ---------- filename : str The name of the file containing the data to import. The formatting of this file is outlined below. Returns ------- network : dict An OpenPNM Network dictionary
network_from_jsongraph
python
PMEAL/OpenPNM
openpnm/io/_jsongraph.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_jsongraph.py
MIT
def network_from_marock(filename, voxel_size=1): r""" Load data from a 3DMA-Rock extracted network. Parameters ---------- filename : str The location of the 'np2th' and 'th2np' files. This can be an absolute path or relative to the current working directory. voxel_size : scalar ...
Load data from a 3DMA-Rock extracted network. Parameters ---------- filename : str The location of the 'np2th' and 'th2np' files. This can be an absolute path or relative to the current working directory. voxel_size : scalar The resolution of the image on which 3DMA-Rock wa...
network_from_marock
python
PMEAL/OpenPNM
openpnm/io/_marock.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_marock.py
MIT
def network_from_networkx(G): r""" Creates an OpenPNM Network from a undirected NetworkX graph object Parameters ---------- G : networkx.classes.graph.Graph Object The NetworkX graph. G should be undirected. The numbering of nodes should be numeric (int's), zero-based and should not...
Creates an OpenPNM Network from a undirected NetworkX graph object Parameters ---------- G : networkx.classes.graph.Graph Object The NetworkX graph. G should be undirected. The numbering of nodes should be numeric (int's), zero-based and should not contain any gaps, i.e. ``G.no...
network_from_networkx
python
PMEAL/OpenPNM
openpnm/io/_networkx.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_networkx.py
MIT
def network_to_networkx(network): r""" Write OpenPNM Network to a NetworkX object. Parameters ---------- network : dict The OpenPNM Network to be converted to a NetworkX object Returns ------- G : undirected graph object A NetworkX object with all pore/throat properties...
Write OpenPNM Network to a NetworkX object. Parameters ---------- network : dict The OpenPNM Network to be converted to a NetworkX object Returns ------- G : undirected graph object A NetworkX object with all pore/throat properties attached to it
network_to_networkx
python
PMEAL/OpenPNM
openpnm/io/_networkx.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_networkx.py
MIT
def network_to_pandas(network, join=False, delim='.'): """Converts network data to a Pandas DataFrame.""" proj = Project() proj.append(network) # Initialize pore and throat data dictionary using Dict class pdata = project_to_dict(project=proj, element='pore', flatten=True...
Converts network data to a Pandas DataFrame.
network_to_pandas
python
PMEAL/OpenPNM
openpnm/io/_pandas.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_pandas.py
MIT
def project_to_pandas(project, join=False, delim='.'): r""" Convert the Network and Phase data to a Pandas DataFrame(s) Parameters ---------- project : list An OpenPNM ``project`` object join : bool If ``False`` (default), two DataFrames are returned with *pore* data in ...
Convert the Network and Phase data to a Pandas DataFrame(s) Parameters ---------- project : list An OpenPNM ``project`` object join : bool If ``False`` (default), two DataFrames are returned with *pore* data in one, and *throat* data in the other. If ``True`` the pore ...
project_to_pandas
python
PMEAL/OpenPNM
openpnm/io/_pandas.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_pandas.py
MIT
def project_to_paraview(project, filename): # pragma: no cover r""" Exports an OpenPNM network to a paraview state file. Parameters ---------- network : Network The network containing the desired data. filename : str Path to saved .vtp file. Notes ----- Outputs a p...
Exports an OpenPNM network to a paraview state file. Parameters ---------- network : Network The network containing the desired data. filename : str Path to saved .vtp file. Notes ----- Outputs a pvsm file that can be opened in Paraview. The pvsm file will be saved...
project_to_paraview
python
PMEAL/OpenPNM
openpnm/io/_paraview.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_paraview.py
MIT
def network_from_pergeos(filename): r""" Loads a network from a PerGeos file. Notes ----- PerGeos is the format used by the Avizo software. See `here for more details <https://cases.pergeos.com/>`_. """ net = {} # --------------------------------------------------------------------...
Loads a network from a PerGeos file. Notes ----- PerGeos is the format used by the Avizo software. See `here for more details <https://cases.pergeos.com/>`_.
network_from_pergeos
python
PMEAL/OpenPNM
openpnm/io/_pergeos.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_pergeos.py
MIT
def network_from_porespy(filename): r""" Load a network extracted using the PoreSpy package Parameters ---------- filename : str or dict Can either be a filename pointing to a pickled dictionary, or a handle to a dictionary in memory. The second option lets users avoid the s...
Load a network extracted using the PoreSpy package Parameters ---------- filename : str or dict Can either be a filename pointing to a pickled dictionary, or a handle to a dictionary in memory. The second option lets users avoid the step of saving the dictionary to a file. ...
network_from_porespy
python
PMEAL/OpenPNM
openpnm/io/_porespy.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_porespy.py
MIT
def network_to_salome(network, filename=None, explicit=False): r""" Saves the network data and writes a Salome .py instruction file. Parameters ---------- network : Network The network containing the desired data Notes ----- This method only saves the data, not any of the pore-...
Saves the network data and writes a Salome .py instruction file. Parameters ---------- network : Network The network containing the desired data Notes ----- This method only saves the data, not any of the pore-scale models or other attributes. To save an actual OpenPNM Project...
network_to_salome
python
PMEAL/OpenPNM
openpnm/io/_salome.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_salome.py
MIT
def network_from_statoil(path, prefix): r""" Load data from the \'dat\' files located in specified folder. Parameters ---------- path : str The full path to the folder containing the set of \'dat\' files. prefix : str The file name prefix on each file. The data files are stored ...
Load data from the \'dat\' files located in specified folder. Parameters ---------- path : str The full path to the folder containing the set of \'dat\' files. prefix : str The file name prefix on each file. The data files are stored as \<prefix\>_node1.dat. network : N...
network_from_statoil
python
PMEAL/OpenPNM
openpnm/io/_statoil.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_statoil.py
MIT
def network_to_stl(network, filename=None, maxsize='auto', fileformat='STL Format', logger_level=0): r""" Saves (transient/steady-state) data from the given objects into the specified file. Parameters ---------- network : Network. The network containing the desired da...
Saves (transient/steady-state) data from the given objects into the specified file. Parameters ---------- network : Network. The network containing the desired data. phases : list[Phase] (place holder, default is None). List of phases containing the desired data. filename :...
network_to_stl
python
PMEAL/OpenPNM
openpnm/io/_stl.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_stl.py
MIT
def project_to_vtk(project, filename="", fill_nans=None, fill_infs=None): r""" Save network and phase data to a single vtp file for visualizing in Paraview. Parameters ---------- network : Network The Network containing the data to be written phases : list, option...
Save network and phase data to a single vtp file for visualizing in Paraview. Parameters ---------- network : Network The Network containing the data to be written phases : list, optional A list containing Phase(s) containing data to be written filename : str, optio...
project_to_vtk
python
PMEAL/OpenPNM
openpnm/io/_vtk.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_vtk.py
MIT
def project_to_xdmf(project, filename=''): r""" Saves (transient/steady-state) data from the given objects into the specified file. Parameters ---------- network : Network The network containing the desired data phases : list[Phase] (optional, default is None) A list of phas...
Saves (transient/steady-state) data from the given objects into the specified file. Parameters ---------- network : Network The network containing the desired data phases : list[Phase] (optional, default is None) A list of phase objects whose data are to be included Notes ...
project_to_xdmf
python
PMEAL/OpenPNM
openpnm/io/_xdmf.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/io/_xdmf.py
MIT
def spheres_and_cylinders( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Calculates conduit lengths in the network assuming pores are spheres and throats are cylinders. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters --...
Calculates conduit lengths in the network assuming pores are spheres and throats are cylinders. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- lengths : ndarray Array (Nt by 3) contain...
spheres_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def circles_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter" ): r""" Calculates conduit lengths in the network assuming pores are circles and throats are rectangles. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------...
Calculates conduit lengths in the network assuming pores are circles and throats are rectangles. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be u...
circles_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def cones_and_cylinders( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter" ): r""" Calculates conduit lengths in the network assuming pores are cones and throats are cylinders. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------- ...
Calculates conduit lengths in the network assuming pores are cones and throats are cylinders. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def intersecting_cones(network, pore_coords="pore.coords", throat_coords="throat.coords"): r""" Calculates conduit lengths in the network assuming pores are cones that intersect. Therefore, the throat is the cross sectional plane where two pores meet and has negligible/zero volume. A conduit is def...
Calculates conduit lengths in the network assuming pores are cones that intersect. Therefore, the throat is the cross sectional plane where two pores meet and has negligible/zero volume. A conduit is defined as ( 1/2 pore - 1/2 pore ). Parameters ---------- %(network)s %(Pcoords)s ...
intersecting_cones
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def hybrid_cones_and_cylinders( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Calculates conduit lengths in the network assuming pores are cones and throats are cylinders. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------- ...
Calculates conduit lengths in the network assuming pores are cones and throats are cylinders. A conduit is defined as ( 1/2 pore - full throat - 1/2 pore ). Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns -------
hybrid_cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter" ): r""" Calculates conduit lengths in the network assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -----...
Calculates conduit lengths in the network assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def intersecting_trapezoids( network, pore_coords="pore.coords", throat_coords="throat.coords" ): r""" Calculates conduit lengths in the network assuming pores are intersecting trapezoids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns ------- Notes ...
Calculates conduit lengths in the network assuming pores are intersecting trapezoids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
intersecting_trapezoids
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def hybrid_trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Calculates conduit lengths in the network assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ...
Calculates conduit lengths in the network assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry. ...
hybrid_trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def pyramids_and_cuboids( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter" ): r""" Calculates conduit lengths in the network assuming pores are truncated pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -----...
Calculates conduit lengths in the network assuming pores are truncated pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
pyramids_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def intersecting_pyramids( network, pore_coords="pore.coords", throat_coords="throat.coords" ): r""" Calculates conduit lengths in the network assuming pores are intersecting pyramids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns ------- """ re...
Calculates conduit lengths in the network assuming pores are intersecting pyramids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns -------
intersecting_pyramids
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def hybrid_pyramids_and_cuboids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Calculates conduit lengths in the network assuming pores are truncated pyramids that intersect. Therefore, the throat is the cross sectional plane where two pores meet and has negligible/ze...
Calculates conduit lengths in the network assuming pores are truncated pyramids that intersect. Therefore, the throat is the cross sectional plane where two pores meet and has negligible/zero volume. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns -------
hybrid_pyramids_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def cubes_and_cuboids( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter" ): r""" Calculates conduit lengths in the network assuming pores are cubes and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ ...
Calculates conduit lengths in the network assuming pores are cubes and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
cubes_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def squares_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter" ): r""" Calculates conduit lengths in the network assuming pores are squares and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- ...
Calculates conduit lengths in the network assuming pores are squares and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
squares_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def _get_L_ctc(network): """Returns throat spacing if it exists, otherwise calculates it.""" try: L_ctc = network["throat.spacing"] except KeyError: P12 = network["throat.conns"] C1 = network["pore.coords"][P12[:, 0]] C2 = network["pore.coords"][P12[:, 1]] L_ctc = np....
Returns throat spacing if it exists, otherwise calculates it.
_get_L_ctc
python
PMEAL/OpenPNM
openpnm/models/geometry/conduit_lengths/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/conduit_lengths/_funcs.py
MIT
def spheres_and_cylinders( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes diffusive shape coefficient for conduits assuming pores are spheres and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ...
Computes diffusive shape coefficient for conduits assuming pores are spheres and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- size_factors : ndarray Array (Nt by 3) containing conduit values for each element of the pore...
spheres_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def circles_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes diffusive shape coefficient for conduits assuming pores are circles and throats are rectangles Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns...
Computes diffusive shape coefficient for conduits assuming pores are circles and throats are rectangles Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry. ...
circles_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def cones_and_cylinders( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes diffusive shape coefficient assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ---...
Computes diffusive shape coefficient assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def intersecting_cones( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes diffusive shape coefficient assuming pores are intersecting cones. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- ...
Computes diffusive shape coefficient assuming pores are intersecting cones. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
intersecting_cones
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def hybrid_cones_and_cylinders( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes diffusive shape coefficient assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ...
Computes diffusive shape coefficient assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry. ...
hybrid_cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Compute diffusive shape coefficient for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s R...
Compute diffusive shape coefficient for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry. ...
trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def intersecting_trapezoids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes diffusive shape coefficient for conduits of intersecting trapezoids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ...
Computes diffusive shape coefficient for conduits of intersecting trapezoids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
intersecting_trapezoids
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def hybrid_trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Compute diffusive shape coefficient for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s...
Compute diffusive shape coefficient for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmet...
hybrid_trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def pyramids_and_cuboids( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes diffusive size factor for conduits of truncated pyramids and cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ...
Computes diffusive size factor for conduits of truncated pyramids and cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
pyramids_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def hybrid_pyramids_and_cuboids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes diffusive size factor for conduits of truncated pyramids and cuboids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- No...
Computes diffusive size factor for conduits of truncated pyramids and cuboids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
hybrid_pyramids_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def intersecting_pyramids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes diffusive size factor for conduits of pores with intersecting pyramids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ...
Computes diffusive size factor for conduits of pores with intersecting pyramids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
intersecting_pyramids
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def cubes_and_cuboids( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", pore_aspect=[1, 1, 1], throat_aspect=[1, 1, 1], ): r""" Computes diffusive shape coefficient for conduits assuming pores are cubes and throats are cuboids. Parameters ---------- ...
Computes diffusive shape coefficient for conduits assuming pores are cubes and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s pore_aspect : list Aspect ratio of the pores throat_aspect : list Aspect ratio of the throats Returns -------...
cubes_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def squares_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", pore_aspect=[1, 1], throat_aspect=[1, 1], ): r""" Computes diffusive size factor for conduits assuming pores are squares and throats are rectangles. Parameters ---------- %...
Computes diffusive size factor for conduits assuming pores are squares and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s pore_aspect : list Aspect ratio of the pores throat_aspect : list Aspect ratio of the throats Returns ------- ...
squares_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def ncylinders_in_series( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", n=5 ): r""" Computes diffusive size factors for conduits of spheres and cylinders with the spheres approximated as N cylinders in series. Parameters ---------- %(network)s %(...
Computes diffusive size factors for conduits of spheres and cylinders with the spheres approximated as N cylinders in series. Parameters ---------- %(network)s %(Dp)s %(Dt)s n : int Number of cylindrical divisions for each pore and throat Returns ------- Notes ...
ncylinders_in_series
python
PMEAL/OpenPNM
openpnm/models/geometry/diffusive_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/diffusive_size_factors/_funcs.py
MIT
def spheres_and_cylinders( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes hydraulic size factors for conduits assuming pores are spheres and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -...
Computes hydraulic size factors for conduits assuming pores are spheres and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- size_factors : ndarray Array (Nt by 3) containing conduit values for each element of the pore-thro...
spheres_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def circles_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes hydraulic size factors for conduits assuming pores are circles and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ...
Computes hydraulic size factors for conduits assuming pores are circles and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes -----
circles_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def cones_and_cylinders( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes hydraulic size factors for conduits assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns...
Computes hydraulic size factors for conduits assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes -----
cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def intersecting_cones( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes hydraulic size factors of intersecting cones. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- """ D1, Dt, D2 = ne...
Computes hydraulic size factors of intersecting cones. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes -----
intersecting_cones
python
PMEAL/OpenPNM
openpnm/models/geometry/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def hybrid_cones_and_cylinders( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes hydraulic size factors for conduits assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s ...
Computes hydraulic size factors for conduits assuming pores are truncated cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes -----
hybrid_cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes hydraulic size factors for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Retur...
Computes hydraulic size factors for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT