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 intersecting_trapezoids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes hydraulic size factors for conduits of intersecting trapezoids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes --...
Computes hydraulic size factors 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/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def hybrid_trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes hydraulic size factors for conduits assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s ...
Computes hydraulic size factors 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 symmetry. ...
hybrid_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
def pyramids_and_cuboids( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", ): r""" Computes hydraulic size factors for conduits assuming pores are truncated pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Retur...
Computes hydraulic size factors for conduits assuming pores are truncated pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- Notes -----
pyramids_and_cuboids
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_pyramids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes hydraulic size factors of intersecting pyramids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes ----- """ D1, ...
Computes hydraulic size factors of intersecting pyramids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes -----
intersecting_pyramids
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_pyramids_and_cuboids( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Computes hydraulic size factors for conduits assuming pores are truncated pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s ...
Computes hydraulic size factors for conduits assuming pores are truncated pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- Notes -----
hybrid_pyramids_and_cuboids
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 cubes_and_cuboids( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", pore_aspect=[1, 1, 1], throat_aspect=[1, 1, 1], ): r""" Computes hydraulic size factors for conduits assuming pores are cubes and throats are cuboids. Parameters ---------- %(ne...
Computes hydraulic size factors 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/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_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 hydraulic size factors for conduits assuming pores are squares and throats are rectangles. Parameters ---------- ...
Computes hydraulic size factors 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/hydraulic_size_factors/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/hydraulic_size_factors/_funcs.py
MIT
def ncylinders_in_series( network, pore_diameter="pore.diameter", throat_diameter="throat.diameter", n=5, ): r""" Computes hydraulic size factors for conduits of spheres and cylinders with the spheres approximated as N cylinders in series. Parameters ---------- %(network)s %...
Computes hydraulic 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 Returns ------- Notes ----- ...
ncylinders_in_series
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 sphere( network, pore_diameter='pore.diameter' ): r""" Calculate cross-sectional area assuming the pore body is a sphere Parameters ---------- %(network)s %(Dp)s Returns ------- areas : ndarray A numpy ndarry containing pore cross-sectional area values """ ...
Calculate cross-sectional area assuming the pore body is a sphere Parameters ---------- %(network)s %(Dp)s Returns ------- areas : ndarray A numpy ndarry containing pore cross-sectional area values
sphere
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
MIT
def cone( network, pore_diameter='pore.diameter' ): r""" Calculate cross-sectional area assuming the pore body is a cone Parameters ---------- %(network)s %(Dp)s Returns ------- """ D = network[pore_diameter] return _pi / 4 * D**2
Calculate cross-sectional area assuming the pore body is a cone Parameters ---------- %(network)s %(Dp)s Returns -------
cone
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
MIT
def cube( network, pore_diameter='pore.diameter' ): r""" Calculate cross-sectional area assuming the pore body is a cube Parameters ---------- %(network)s %(Dp)s Returns ------- """ D = network[pore_diameter] return D**2
Calculate cross-sectional area assuming the pore body is a cube Parameters ---------- %(network)s %(Dp)s Returns -------
cube
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
MIT
def circle( network, pore_diameter='pore.diameter' ): r""" Calculate cross-sectional area assuming the pore body is a circle Parameters ---------- %(network)s %(Dp)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar ...
Calculate cross-sectional area assuming the pore body is a circle Parameters ---------- %(network)s %(Dp)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
circle
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
MIT
def square( network, pore_diameter='pore.diameter' ): r""" Calculate cross-sectional area assuming the pore body is a square Parameters ---------- %(network)s %(Dp)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar ...
Calculate cross-sectional area assuming the pore body is a square Parameters ---------- %(network)s %(Dp)s Returns ------- Notes ----- This model should only be used for true 2D networks, i.e. with planar symmetry.
square
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_cross_sectional_area/_funcs.py
MIT
def equivalent_diameter( network, pore_volume='pore.volume', pore_shape='sphere' ): r""" Calculate the diameter of a sphere or edge-length of a cube with same volume as the pore. Parameters ---------- %(network)s %(Vp)s pore_shape : str The shape of the pore body to ...
Calculate the diameter of a sphere or edge-length of a cube with same volume as the pore. Parameters ---------- %(network)s %(Vp)s pore_shape : str The shape of the pore body to assume when back-calculating from volume. Options are 'sphere' (default) or 'cube'. Return...
equivalent_diameter
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_size/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_size/_funcs.py
MIT
def sphere( network, pore_diameter='pore.diameter' ): r""" Calculate pore volume from diameter assuming a spherical pore body Parameters ---------- %(network)s %(Dp)s Returns ------- volumes : ndarray Numpy ndarray containing pore volume values """ return 4...
Calculate pore volume from diameter assuming a spherical pore body Parameters ---------- %(network)s %(Dp)s Returns ------- volumes : ndarray Numpy ndarray containing pore volume values
sphere
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_volume/_funcs.py
MIT
def cube( network, pore_diameter='pore.diameter' ): r""" Calculate pore volume from diameter assuming a cubic pore body Parameters ---------- %(network)s %(Dp)s Returns ------- """ return network[pore_diameter]**3
Calculate pore volume from diameter assuming a cubic pore body Parameters ---------- %(network)s %(Dp)s Returns -------
cube
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_volume/_funcs.py
MIT
def circle( network, pore_diameter='pore.diameter', ): r""" Calculate pore volume from diameter assuming a spherical pore body Parameters ---------- %(network)s %(Dp)s Returns ------- """ return _pi/4 * network[pore_diameter]**2
Calculate pore volume from diameter assuming a spherical pore body Parameters ---------- %(network)s %(Dp)s Returns -------
circle
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_volume/_funcs.py
MIT
def effective( network, pore_volume='pore.volume', throat_volume='throat.volume', ): r""" Calculate the effective pore volume for optional use in transient simulations. The effective pore volume is calculated by adding half the volume of all neighbouring throats to the pore volume. Para...
Calculate the effective pore volume for optional use in transient simulations. The effective pore volume is calculated by adding half the volume of all neighbouring throats to the pore volume. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
effective
python
PMEAL/OpenPNM
openpnm/models/geometry/pore_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/pore_volume/_funcs.py
MIT
def mason_morrow( network, throat_perimeter='throat.perimeter', throat_area='throat.cross_sectional_area', ): r""" Mason and Morrow relate the capillary pressure to the shape factor in a similar way to Mortensen but for triangles. Parameters ---------- %(network)s %(Pt)s %(A...
Mason and Morrow relate the capillary pressure to the shape factor in a similar way to Mortensen but for triangles. Parameters ---------- %(network)s %(Pt)s %(At)s Returns ------- References ---------- Mason, G. and Morrow, N.R.. Capillary behavior of a perfectly wett...
mason_morrow
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_capillary_shape_factor/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_capillary_shape_factor/_funcs.py
MIT
def jenkins_rao( network, throat_perimeter='throat.perimeter', throat_area='throat.cross_sectional_area', throat_diameter='throat.indiameter', ): r""" Jenkins and Rao relate the capillary pressure in an eliptical throat to the aspect ratio Parameters ---------- %(network)s %...
Jenkins and Rao relate the capillary pressure in an eliptical throat to the aspect ratio Parameters ---------- %(network)s %(Pt)s %(At)s %(Dt)s Returns ------- References ---------- Jenkins, R.G. and Rao, M.B., The effect of elliptical pores on mercury porosim...
jenkins_rao
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_capillary_shape_factor/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_capillary_shape_factor/_funcs.py
MIT
def pore_coords( network ): r""" Calculate throat centroid values by averaging adjacent pore coordinates Parameters ---------- %(network)s Returns ------- values : ndarray A numpy ndarray containing throat centroid values """ conns = network['throat.conns'] coo...
Calculate throat centroid values by averaging adjacent pore coordinates Parameters ---------- %(network)s Returns ------- values : ndarray A numpy ndarray containing throat centroid values
pore_coords
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_centroid/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_centroid/_funcs.py
MIT
def cylinder( network, throat_diameter='throat.diameter', ): r""" Calculate throat cross-sectional area for a cylindrical throat Parameters ---------- %(network)s %(Dt)s Returns ------- """ diams = network[throat_diameter] value = _pi / 4 * diams**2 return valu...
Calculate throat cross-sectional area for a cylindrical throat Parameters ---------- %(network)s %(Dt)s Returns -------
cylinder
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_cross_sectional_area/_funcs.py
MIT
def cuboid( network, throat_diameter='throat.diameter', ): r""" Calculate throat cross-sectional area for a cuboid throat Parameters ---------- %(network)s %(Dt)s Returns ------- """ diams = network[throat_diameter] value = (diams)**2 return value
Calculate throat cross-sectional area for a cuboid throat Parameters ---------- %(network)s %(Dt)s Returns -------
cuboid
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_cross_sectional_area/_funcs.py
MIT
def rectangle( network, throat_diameter='throat.diameter', ): r""" Calculate throat cross-sectional area for a rectangular throat Parameters ---------- %(network)s %(Dt)s Returns ------- """ return network[throat_diameter]
Calculate throat cross-sectional area for a rectangular throat Parameters ---------- %(network)s %(Dt)s Returns -------
rectangle
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_cross_sectional_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_cross_sectional_area/_funcs.py
MIT
def spheres_and_cylinders( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter', throat_centroid='throat.centroid', ): r""" Computes the endpoints of throats when pores are spherical. The endpoints lie inside the sphere, defined by the lens formed between the inters...
Computes the endpoints of throats when pores are spherical. The endpoints lie inside the sphere, defined by the lens formed between the intersection of the sphere and cylinder. Parameters ---------- %(network)s %(Dp)s %(Dt)s %(Tcen)s Returns ------- endpoints : ndarra...
spheres_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_endpoints/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_endpoints/_funcs.py
MIT
def spheres_and_cylinders( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter' ): r""" Finds throat length assuming pores are spheres and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- lengths : ndarr...
Finds throat length assuming pores are spheres and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- lengths : ndarray A numpy ndarray containing throat length values
spheres_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def circles_and_rectangles( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter', ): r""" Finds throat length assuming pores are circles and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ fro...
Finds throat length assuming pores are circles and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
circles_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def cones_and_cylinders( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter' ): r""" Finds throat length assuming pores are cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ from openp...
Finds throat length assuming pores are cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def intersecting_cones( network, pore_coords="pore.coords", throat_coords="throat.coords" ): r""" Finds throat length assuming pores are intersecting cones. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns ------- """ from openpnm.models.geomet...
Finds throat length assuming pores are intersecting cones. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns -------
intersecting_cones
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def hybrid_cones_and_cylinders( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Finds throat length assuming pores are cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- """ fr...
Finds throat length assuming pores are cones and throats are cylinders. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns -------
hybrid_cones_and_cylinders
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def trapezoids_and_rectangles( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter' ): r""" Finds throat length assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ ...
Finds throat length assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def intersecting_trapezoids( network, pore_coords="pore.coords", throat_coords="throat.coords" ): r""" Finds throat length assuming pores are intersecting trapezoids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns ------- """ from openpnm.mod...
Finds throat length assuming pores are intersecting trapezoids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns -------
intersecting_trapezoids
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def hybrid_trapezoids_and_rectangles( network, pore_diameter="pore.diameter", throat_coords="throat.coords" ): r""" Finds throat length assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns ------- ...
Finds throat length assuming pores are trapezoids and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Tcoords)s Returns -------
hybrid_trapezoids_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def pyramids_and_cuboids( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter' ): r""" Finds throat length assuming pores are pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ from ope...
Finds throat length assuming pores are pyramids and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
pyramids_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def intersecting_pyramids( network, pore_coords="pore.coords", throat_coords="throat.coords" ): r""" Finds throat length assuming pores are intersecting pyramids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns ------- """ from openpnm.models....
Finds throat length assuming pores are intersecting pyramids. Parameters ---------- %(network)s %(Pcoords)s %(Tcoords)s Returns -------
intersecting_pyramids
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def hybrid_pyramids_and_cuboids( network, pore_diameter='pore.diameter', throat_coords="throat.coords", ): r""" Finds throat length assuming pores are pyramids and throats are cuboids. Parameters ---------- %(network)s Returns ------- """ from openpnm.models.geomet...
Finds throat length assuming pores are pyramids and throats are cuboids. Parameters ---------- %(network)s Returns -------
hybrid_pyramids_and_cuboids
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def cubes_and_cuboids( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter' ): r""" Finds throat length assuming pores are cubes and throats are cuboids. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ from openpnm.m...
Finds throat length 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/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def squares_and_rectangles( network, pore_diameter='pore.diameter', throat_diameter='throat.diameter' ): r""" Finds throat length assuming pores are squares and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns ------- """ from...
Finds throat length assuming pores are squares and throats are rectangles. Parameters ---------- %(network)s %(Dp)s %(Dt)s Returns -------
squares_and_rectangles
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_length/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_length/_funcs.py
MIT
def cylinder( network, throat_diameter='throat.diameter', ): r""" Calcuate the throat perimeter assuming a circular cross-section Parameters ---------- %(network)s %(Dt)s Returns ------- perimeters : ndarray A numpy ndarray containing throat perimeter values ""...
Calcuate the throat perimeter assuming a circular cross-section Parameters ---------- %(network)s %(Dt)s Returns ------- perimeters : ndarray A numpy ndarray containing throat perimeter values
cylinder
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_perimeter/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_perimeter/_funcs.py
MIT
def cuboid( network, throat_diameter='throat.diameter', ): r""" Calcuate the throat perimeter assuming a square cross-section Parameters ---------- %(network)s %(Dt)s Returns ------- """ return network[throat_diameter]*4
Calcuate the throat perimeter assuming a square cross-section Parameters ---------- %(network)s %(Dt)s Returns -------
cuboid
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_perimeter/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_perimeter/_funcs.py
MIT
def rectangle( network, throat_diameter='throat.diameter', ): r""" Calcuate the throat perimeter assuming a rectangular cross-section (2D) Parameters ---------- %(network)s %(Dt)s Returns ------- """ return 1.0
Calcuate the throat perimeter assuming a rectangular cross-section (2D) Parameters ---------- %(network)s %(Dt)s Returns -------
rectangle
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_perimeter/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_perimeter/_funcs.py
MIT
def equivalent_diameter( network, throat_area='throat.cross_sectional_area', throat_shape='circle', ): r""" Calculates the diameter of a cirlce or edge-length of a sqaure with same area as the throat. Parameters ---------- %(network)s %(At)s throat_shape : str The sh...
Calculates the diameter of a cirlce or edge-length of a sqaure with same area as the throat. Parameters ---------- %(network)s %(At)s throat_shape : str The shape cross-sectional shape of the throat to assume when back-calculating from the area. Options are 'circle' (defau...
equivalent_diameter
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_size/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_size/_funcs.py
MIT
def cylinder( network, throat_diameter='throat.diameter', throat_length='throat.length', ): r""" Calculate surface area for a cylindrical throat Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- surface_areas : ndarray A numpy ndarray containin...
Calculate surface area for a cylindrical throat Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- surface_areas : ndarray A numpy ndarray containing throat surface area values
cylinder
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_surface_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_surface_area/_funcs.py
MIT
def cuboid( network, throat_diameter='throat.diameter', throat_length='throat.length', ): r""" Calculate surface area for a cuboid throat Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- """ return 4 * network[throat_diameter] * network[throat_le...
Calculate surface area for a cuboid throat Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns -------
cuboid
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_surface_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_surface_area/_funcs.py
MIT
def extrusion( network, throat_perimeter='throat.perimeter', throat_length='throat.length', ): r""" Calculate surface area for an arbitrary shaped throat give the perimeter and length. Parameters ---------- %(network)s %(Pt)s %(Lt)s Returns ------- """ retu...
Calculate surface area for an arbitrary shaped throat give the perimeter and length. Parameters ---------- %(network)s %(Pt)s %(Lt)s Returns -------
extrusion
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_surface_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_surface_area/_funcs.py
MIT
def rectangle( network, throat_length='throat.length', ): r""" Calculate surface area for a rectangular throat Only suitable for true 2D simulations Parameters ---------- %(network)s %(Lt)s Returns ------- """ return 2 * network[throat_length]
Calculate surface area for a rectangular throat Only suitable for true 2D simulations Parameters ---------- %(network)s %(Lt)s Returns -------
rectangle
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_surface_area/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_surface_area/_funcs.py
MIT
def pore_to_pore(network): r""" Calculates throat vector as straight path between connected pores. Parameters ---------- %(network)s Returns ------- unit_vec : ndarray A [Nt-by-3] numpy ndarray containing pore-to-pore unit vectors Notes ----- There is an important ...
Calculates throat vector as straight path between connected pores. Parameters ---------- %(network)s Returns ------- unit_vec : ndarray A [Nt-by-3] numpy ndarray containing pore-to-pore unit vectors Notes ----- There is an important impicit assumption here: the positi...
pore_to_pore
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_vector/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_vector/_funcs.py
MIT
def cylinder( network, throat_diameter='throat.diameter', throat_length='throat.length', ): r""" Calculate throat volume assuing a cylindrical shape Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- volumes : ndarray A numpy ndarray containing ...
Calculate throat volume assuing a cylindrical shape Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- volumes : ndarray A numpy ndarray containing throat volume values Notes ----- This models does not account for the volume reprsented by the ...
cylinder
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_volume/_funcs.py
MIT
def cuboid( network, throat_diameter='throat.diameter', throat_length='throat.length', ): r""" Calculate throat volume assuing a square cross-section Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- Notes ----- At present this models does NOT...
Calculate throat volume assuing a square cross-section Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- Notes ----- At present this models does NOT account for the volume reprsented by the intersection of the throat with a spherical pore body.
cuboid
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_volume/_funcs.py
MIT
def rectangle( network, throat_diameter='throat.diameter', throat_length='throat.length', ): r""" Calculate throat volume assuing a rectangular shape Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- Notes ----- At present this models does NOT...
Calculate throat volume assuing a rectangular shape Parameters ---------- %(network)s %(Dt)s %(Lt)s Returns ------- Notes ----- At present this models does NOT account for the volume reprsented by the intersection of the throat with a spherical pore body.
rectangle
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_volume/_funcs.py
MIT
def extrusion( network, throat_length='throat.length', throat_area='throat.cross_sectional_area', ): r""" Calculate throat volume from the throat area and the throat length. This method is useful for abnormal shaped throats. Parameters ---------- %(network)s %(Lt)s %(At)s ...
Calculate throat volume from the throat area and the throat length. This method is useful for abnormal shaped throats. Parameters ---------- %(network)s %(Lt)s %(At)s Returns ------- Notes ----- At present this models does NOT account for the volume reprsented by the ...
extrusion
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_volume/_funcs.py
MIT
def lens( network, throat_diameter='throat.diameter', pore_diameter='pore.diameter', ): r""" Calculates the volume residing the hemispherical caps formed by the intersection between cylindrical throats and spherical pores. This volume should be subtracted from throat volumes if the throat l...
Calculates the volume residing the hemispherical caps formed by the intersection between cylindrical throats and spherical pores. This volume should be subtracted from throat volumes if the throat lengths were found using throat end points. Parameters ---------- %(network)s %(Dt)s ...
lens
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_volume/_funcs.py
MIT
def pendular_ring( network, throat_diameter='throat.diameter', pore_diameter='pore.diameter', ): r""" Calculates the volume of the pendular rings residing between the end of a cylindrical throat and spherical pores that are in contact but not overlapping. This volume should be added to ...
Calculates the volume of the pendular rings residing between the end of a cylindrical throat and spherical pores that are in contact but not overlapping. This volume should be added to the throat volume if the throat length was found as the center-to-center distance less the pore radii. Param...
pendular_ring
python
PMEAL/OpenPNM
openpnm/models/geometry/throat_volume/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/geometry/throat_volume/_funcs.py
MIT
def difference(target, props): r""" Subtracts elements 1:N in `props` from element 0 Parameters ---------- target : OpenPNM dict The object to which the model is associated props : list A list of dict keys containing the values to operate on. If the first element is A, ...
Subtracts elements 1:N in `props` from element 0 Parameters ---------- target : OpenPNM dict The object to which the model is associated props : list A list of dict keys containing the values to operate on. If the first element is A, and the next are B and C, then the resu...
difference
python
PMEAL/OpenPNM
openpnm/models/misc/_basic_math.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_basic_math.py
MIT
def fraction(target, numerator, denominator): r""" Calculates the ratio between two values Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary proper...
Calculates the ratio between two values Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. numerator : str Dictionary key point...
fraction
python
PMEAL/OpenPNM
openpnm/models/misc/_basic_math.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_basic_math.py
MIT
def summation(target, props=[]): r""" Sums the values in the given arrays Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. props :...
Sums the values in the given arrays Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. props : list of dictionary keys The dict...
summation
python
PMEAL/OpenPNM
openpnm/models/misc/_basic_math.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_basic_math.py
MIT
def product(target, props): r""" Calculates the product of multiple property values Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. ...
Calculates the product of multiple property values Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. props : list[str] The nam...
product
python
PMEAL/OpenPNM
openpnm/models/misc/_basic_math.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_basic_math.py
MIT
def from_neighbor_throats(target, prop, mode='min', ignore_nans=True): r""" Adopt a value from the values found in neighboring throats Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provi...
Adopt a value from the values found in neighboring throats Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. prop : str The di...
from_neighbor_throats
python
PMEAL/OpenPNM
openpnm/models/misc/_neighbor_lookups.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_neighbor_lookups.py
MIT
def from_neighbor_pores(target, prop, mode='min', ignore_nans=True): r""" Adopt a value based on the values in neighboring pores Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides ac...
Adopt a value based on the values in neighboring pores Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. prop : str The dictio...
from_neighbor_pores
python
PMEAL/OpenPNM
openpnm/models/misc/_neighbor_lookups.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_neighbor_lookups.py
MIT
def generic_function(target, prop, func, **kwargs): r""" Runs an arbitrary function on the given data This allows users to place a customized calculation into the automatated model regeneration pipeline. Parameters ---------- target : Base The object which this model is associated ...
Runs an arbitrary function on the given data This allows users to place a customized calculation into the automatated model regeneration pipeline. Parameters ---------- target : Base The object which this model is associated with. This controls the length of the calculated arr...
generic_function
python
PMEAL/OpenPNM
openpnm/models/misc/_simple_equations.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_simple_equations.py
MIT
def linear(target, m, b, prop): r""" Calculates a property as a linear function of a given property Parameters ---------- target : Base The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to othe...
Calculates a property as a linear function of a given property Parameters ---------- target : Base The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to other necessary thermofluid properties. ...
linear
python
PMEAL/OpenPNM
openpnm/models/misc/_simple_equations.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_simple_equations.py
MIT
def polynomial(target, a, prop): r""" Calculates a property as a polynomial function of a given property Parameters ---------- target : Base The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to...
Calculates a property as a polynomial function of a given property Parameters ---------- target : Base The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to other necessary thermofluid properties. ...
polynomial
python
PMEAL/OpenPNM
openpnm/models/misc/_simple_equations.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_simple_equations.py
MIT
def weibull(network, seeds, shape, scale, loc): r""" Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- %(network)s seeds : str (dict key) %(dict_blurb) seed shape : float Controls the width or skewness of the distribution. For m...
Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- %(network)s seeds : str (dict key) %(dict_blurb) seed shape : float Controls the width or skewness of the distribution. For more information on the effect of this parameter ...
weibull
python
PMEAL/OpenPNM
openpnm/models/misc/_statistical_distributions.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_statistical_distributions.py
MIT
def normal(network, seeds, mean=None, stddev=None, scale=None, loc=None): r""" Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- %(network)s seeds : str (dict key) %(dict_blurb) seed mean : float The mean value of the distributi...
Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- %(network)s seeds : str (dict key) %(dict_blurb) seed mean : float The mean value of the distribution. This is referred to as the ``loc`` in the scipy.stats function, and t...
normal
python
PMEAL/OpenPNM
openpnm/models/misc/_statistical_distributions.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_statistical_distributions.py
MIT
def generic_distribution(network, seeds, func, **kwargs): r""" Accepts an object from the Scipy.stats submodule and returns values from the distribution for the given seeds Parameters ---------- %(network)s seeds : str (dict key) %(dict_blurb) seed func : object An obj...
Accepts an object from the Scipy.stats submodule and returns values from the distribution for the given seeds Parameters ---------- %(network)s seeds : str (dict key) %(dict_blurb) seed func : object An object from the scipy.stats library. Can be a 'frozen' object, where ...
generic_distribution
python
PMEAL/OpenPNM
openpnm/models/misc/_statistical_distributions.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_statistical_distributions.py
MIT
def random(network, element, seed=None, num_range=[0, 1]): r""" Create an array of random numbers of a specified size. Parameters ---------- %(network)s seed : int The starting seed value to sent to numpy's random number generator. A value of ``None`` means a different distribut...
Create an array of random numbers of a specified size. Parameters ---------- %(network)s seed : int The starting seed value to sent to numpy's random number generator. A value of ``None`` means a different distribution is returned each time the model is (re)run. num_ran...
random
python
PMEAL/OpenPNM
openpnm/models/misc/_statistical_distributions.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_statistical_distributions.py
MIT
def match_histogram(network, bin_centers, bin_heights, element='pore'): r""" Generate values corresponding to a given histogram Parameters ---------- %(network)s bin_centers : array_like The x-axis of the histogram, such as pore sizes. bin_heights : array_like The y-axis of ...
Generate values corresponding to a given histogram Parameters ---------- %(network)s bin_centers : array_like The x-axis of the histogram, such as pore sizes. bin_heights : array_like The y-axis of the histogram, such as the number of pores of each size. element : str ...
match_histogram
python
PMEAL/OpenPNM
openpnm/models/misc/_statistical_distributions.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/misc/_statistical_distributions.py
MIT
def cluster_number(network): r""" Assign a cluster number to each pore """ from scipy.sparse import csgraph as csg am = network.create_adjacency_matrix(fmt='coo', triu=True) N, Cs = csg.connected_components(am, directed=False) return Cs
Assign a cluster number to each pore
cluster_number
python
PMEAL/OpenPNM
openpnm/models/network/_health.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_health.py
MIT
def cluster_size(network, cluster=None): r""" Find the size of the cluster to which each pore belongs Parameters ---------- network : dict The Network cluster : str, optional Dict key pointing to the array containing the cluster number of each pore. If not provided then...
Find the size of the cluster to which each pore belongs Parameters ---------- network : dict The Network cluster : str, optional Dict key pointing to the array containing the cluster number of each pore. If not provided then it will be calculated. Returns ------- ...
cluster_size
python
PMEAL/OpenPNM
openpnm/models/network/_health.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_health.py
MIT
def isolated_pores(network): r""" Find which pores, if any, are not connected to a throat """ values = np.ones(network.Np, dtype=bool) hits = np.unique(network.conns) if np.any(hits >= network.Np): logger.warning("Some throats point to non-existent pores") hits = hits[hits < netw...
Find which pores, if any, are not connected to a throat
isolated_pores
python
PMEAL/OpenPNM
openpnm/models/network/_health.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_health.py
MIT
def count_coincident_pores(network, thresh=1e-6): r""" Count number of pores that are spatially coincident with other pores Parameters ---------- network : dict The Network thresh : float The distance below which two pores are considered spatially coincident Returns ---...
Count number of pores that are spatially coincident with other pores Parameters ---------- network : dict The Network thresh : float The distance below which two pores are considered spatially coincident Returns ------- count : ndarray A numpy array of Np lengt...
count_coincident_pores
python
PMEAL/OpenPNM
openpnm/models/network/_health.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_health.py
MIT
def find_coincident_pores(network, thresh=1e-6): r""" Find the indices of coincident pores Parameters ---------- network : dict The Network thresh : float The distance below which two pores are considered spatially coincident Returns ------- indices : list of lists ...
Find the indices of coincident pores Parameters ---------- network : dict The Network thresh : float The distance below which two pores are considered spatially coincident Returns ------- indices : list of lists One row corresponding to each pore, with each row...
find_coincident_pores
python
PMEAL/OpenPNM
openpnm/models/network/_health.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_health.py
MIT
def gabriel_edges(network): r""" Find throats which make a Gabriel subgraph Returns ------- throats : ndarray An ndarray of boolean values with ``True`` indicating that a throat satisfies the conditions of Gabriel graph, meaning that a circle (or sphere) can be drawn between...
Find throats which make a Gabriel subgraph Returns ------- throats : ndarray An ndarray of boolean values with ``True`` indicating that a throat satisfies the conditions of Gabriel graph, meaning that a circle (or sphere) can be drawn between its two connected pores that does n...
gabriel_edges
python
PMEAL/OpenPNM
openpnm/models/network/_topology.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_topology.py
MIT
def pore_to_pore_distance(network): r""" Find the center to center distance between each pair of pores """ cn = network['throat.conns'] C1 = network['pore.coords'][cn[:, 0]] C2 = network['pore.coords'][cn[:, 1]] values = norm(C1 - C2, axis=1) return values
Find the center to center distance between each pair of pores
pore_to_pore_distance
python
PMEAL/OpenPNM
openpnm/models/network/_topology.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_topology.py
MIT
def distance_to_nearest_neighbor(network): r""" Find the distance between each pore and its closest topological neighbor """ cn = network['throat.conns'] C1 = network['pore.coords'][cn[:, 0]] C2 = network['pore.coords'][cn[:, 1]] D = norm(C1 - C2, axis=1) im = network.create_incidence_ma...
Find the distance between each pore and its closest topological neighbor
distance_to_nearest_neighbor
python
PMEAL/OpenPNM
openpnm/models/network/_topology.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_topology.py
MIT
def distance_to_furthest_neighbor(network): r""" Find the distance between each pore and its furthest topological neighbor """ throats = network.throats(network.name) cn = network['throat.conns'][throats] C1 = network['pore.coords'][cn[:, 0]] C2 = network['pore.coords'][cn[:, 1]] D = nor...
Find the distance between each pore and its furthest topological neighbor
distance_to_furthest_neighbor
python
PMEAL/OpenPNM
openpnm/models/network/_topology.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_topology.py
MIT
def distance_to_nearest_pore(network): r""" Find distance to and index of nearest pore even if not topologically connected """ import scipy.spatial as sptl coords = network.coords tree = sptl.KDTree(coords) ds, ids = tree.query(coords, k=2) values = ds[:, 1] return values
Find distance to and index of nearest pore even if not topologically connected
distance_to_nearest_pore
python
PMEAL/OpenPNM
openpnm/models/network/_topology.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/network/_topology.py
MIT
def chemicals_wrapper(phase, f, **kwargs): r""" Wrapper function for calling models in the ``chemicals`` package Parameters ---------- phase : dict The OpenPNM Species object for which this model should calculate values. This object should ideally have all the necessary chemical ...
Wrapper function for calling models in the ``chemicals`` package Parameters ---------- phase : dict The OpenPNM Species object for which this model should calculate values. This object should ideally have all the necessary chemical properties in its ``params`` attribute, althou...
chemicals_wrapper
python
PMEAL/OpenPNM
openpnm/models/phase/__init__.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/__init__.py
MIT
def liquid_mixture_Vc_XXX( phase, Vcs='pore.critical_volume.*', ): # pragma: no cover r""" Calculates the critical volume of a liquid mixture using the correlation in [1]_ Parameters ---------- %(phase)s %(Vcs)s Returns ------- References ---------- .. [1] tbd...
Calculates the critical volume of a liquid mixture using the correlation in [1]_ Parameters ---------- %(phase)s %(Vcs)s Returns ------- References ---------- .. [1] tbd
liquid_mixture_Vc_XXX
python
PMEAL/OpenPNM
openpnm/models/phase/critical_props/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/critical_props/_funcs.py
MIT
def liquid_mixture_Tc_XXX( phase, Vm='pore.molar_volume', Vcs='pore.critical_volume.*', Tcs='pore.critical_temperature.*', ): # pragma: no cover r""" Calculates the critical temperature of a liquid mixture using the correlation in [1]_ Parameters ---------- %(phase)s %(Vm)s...
Calculates the critical temperature of a liquid mixture using the correlation in [1]_ Parameters ---------- %(phase)s %(Vm)s %(Vcs)s %(Tcs)s Returns ------- References ---------- .. [1] tbd
liquid_mixture_Tc_XXX
python
PMEAL/OpenPNM
openpnm/models/phase/critical_props/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/critical_props/_funcs.py
MIT
def liquid_mixture_acentric_factor_XXX( phase, omegas='param.acentric_factor.*', ): # pragma: no cover r""" Calculates the accentric factor of a liquid mixture using the correlation in [1]_ Parameters ---------- %(phase)s %(omegas)s Returns ------- References ----...
Calculates the accentric factor of a liquid mixture using the correlation in [1]_ Parameters ---------- %(phase)s %(omegas)s Returns ------- References ---------- .. [1] tbd
liquid_mixture_acentric_factor_XXX
python
PMEAL/OpenPNM
openpnm/models/phase/critical_props/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/critical_props/_funcs.py
MIT
def ideal_gas( phase, P='pore.pressure', T='pore.temperature', MW='param.molecular_weight', ): r""" Uses ideal gas law to calculate the mass density of an ideal gas Parameters ---------- %(phase)s %(T)s %(P)s %(MW)s Returns ------- """ P = phase[P] ...
Uses ideal gas law to calculate the mass density of an ideal gas Parameters ---------- %(phase)s %(T)s %(P)s %(MW)s Returns -------
ideal_gas
python
PMEAL/OpenPNM
openpnm/models/phase/density/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/density/_funcs.py
MIT
def water_correlation( phase, T='pore.temperature', salinity='pore.salinity', ): r""" Calculates density of pure water or seawater at atmospheric pressure using Eq. (8) given by Sharqawy et. al [1]. Values at temperature higher than the normal boiling temperature are calculated at the satura...
Calculates density of pure water or seawater at atmospheric pressure using Eq. (8) given by Sharqawy et. al [1]. Values at temperature higher than the normal boiling temperature are calculated at the saturation pressure. Parameters ---------- %(phase)s %(T)s %(salinity)s Retur...
water_correlation
python
PMEAL/OpenPNM
openpnm/models/phase/density/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/density/_funcs.py
MIT
def liquid_mixture_COSTALD( phase, T='pore.temperature', MWs='param.molecular_weight.*', Tcs='param.critical_temperature.*', Vcs='param.critical_volume.*', omegas='param.acentric_factor.*', ): r""" Computes the density of a liquid mixture using the COrrospoding STAtes Liquid Density ...
Computes the density of a liquid mixture using the COrrospoding STAtes Liquid Density (COSTALD) method. Parameters ---------- %(phase)s %(T)s %(MWs)s %(Tcs)s %(Vcs)s %(omegas)s Returns ------- density : ndarray The density of the liquid mixture in units of ...
liquid_mixture_COSTALD
python
PMEAL/OpenPNM
openpnm/models/phase/density/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/density/_funcs.py
MIT
def liquid_pure_COSTALD( phase, T='pore.temperature', Tc='param.critical_temperature', Vc='param.critical_volume', omega='param.acentric_factor', MW='param.molecular_weight', ): r""" Computes the density of a pure liquid using the COrrospoding STAtes Liquid Density (COSTALD) method. ...
Computes the density of a pure liquid using the COrrospoding STAtes Liquid Density (COSTALD) method. Parameters ---------- %(phase)s %(T)s %(Tc)s %(Vc)s %(omega)s %(MW)s Returns -------
liquid_pure_COSTALD
python
PMEAL/OpenPNM
openpnm/models/phase/density/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/density/_funcs.py
MIT
def mass_to_molar( phase, MW='param.molecular_weight', rho='pore.density', ): r""" Calculates the molar density from the molecular weight and mass density Parameters ---------- %(phase)s %(MW)s %(rho)s Returns ------- value : ndarray A numpy ndrray containin...
Calculates the molar density from the molecular weight and mass density Parameters ---------- %(phase)s %(MW)s %(rho)s Returns ------- value : ndarray A numpy ndrray containing molar density values [mol/m3]
mass_to_molar
python
PMEAL/OpenPNM
openpnm/models/phase/density/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/density/_funcs.py
MIT
def liquid_mixture_tc( phase, T='pore.temperature', mu='pore.viscosity', Vms_at_Tb='param.molar_volume_Tb.*', sigmas_at_Tb='param.surface_tension_Tb.*', ): r""" Uses Tyn-Calus model to estimate diffusion coefficient in a dilute liquid solution of A in B from first principles at condition...
Uses Tyn-Calus model to estimate diffusion coefficient in a dilute liquid solution of A in B from first principles at conditions of interest Parameters ---------- %(phase)s %(T)s %(mu)s Vms_at_Tb : str or list of scalars Molar volumes of each component at its boiling temperatur...
liquid_mixture_tc
python
PMEAL/OpenPNM
openpnm/models/phase/diffusivity/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/diffusivity/_funcs.py
MIT
def gas_mixture_ce( phase, T='pore.temperature', P='pore.pressure', Tcs='param.critical_temperature.*', Pcs='param.critical_pressure.*', omegas='param.acentric_factor.*', MWs='param.molecular_weight.*', epsilons='param.LJ_energy.*', sigmas='param.LJ_diameter.*', ): r""" Calcu...
Calculate gas phase diffusion coefficient using Chapman-Enskog equation. Parameters ---------- %(phase)s %(T)s %(P)s %(Tcs)s %(Pcs)s %(omegas)s %(MWs)s %(epsilons)s %(sigmas)s Returns -------
gas_mixture_ce
python
PMEAL/OpenPNM
openpnm/models/phase/diffusivity/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/diffusivity/_funcs.py
MIT
def gas_mixture_fesg( phase, T='pore.temperature', P='pore.pressure', MWs='param.molecular_weight.*', Vdms='param.molar_diffusion_volume.*', ): r""" Estimates the diffusion coefficient of both species in a binary gas mixture using the Fuller et al correlation [1]_, [2]_, [3]_. Param...
Estimates the diffusion coefficient of both species in a binary gas mixture using the Fuller et al correlation [1]_, [2]_, [3]_. Parameters ---------- %(phase)s %(T)s %(P)s %(MWs)s %(Vdms)s Returns ------- Dij : dict[ndarray] The dict contains one array for eac...
gas_mixture_fesg
python
PMEAL/OpenPNM
openpnm/models/phase/diffusivity/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/diffusivity/_funcs.py
MIT
def gas_pure_TRC( phase, T='pore.temperature', a=[], ): r""" Parameters ---------- %(phase)s %(T)s a : list The coefficients to use (see notes for form of equation). If not given the ``phase['param.CAS']`` is used to lookup the values from ``chemicals.heat_ca...
Parameters ---------- %(phase)s %(T)s a : list The coefficients to use (see notes for form of equation). If not given the ``phase['param.CAS']`` is used to lookup the values from ``chemicals.heat_capacity.TRC_gas_data`` Returns -------
gas_pure_TRC
python
PMEAL/OpenPNM
openpnm/models/phase/heat_capacity/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/heat_capacity/_funcs.py
MIT
def gas_mixture_yweighted( phase, Cps='pore.heat_capacity.*', ): r""" Uses a linearly mole fraction weighted average Parameters ---------- %(phase)s %(Cps)s Returns ------- """ Cpmix = mixing_rule(phase=phase, prop=Cps, mode='linear') return Cpmix
Uses a linearly mole fraction weighted average Parameters ---------- %(phase)s %(Cps)s Returns -------
gas_mixture_yweighted
python
PMEAL/OpenPNM
openpnm/models/phase/heat_capacity/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/heat_capacity/_funcs.py
MIT
def mix_and_match( phase, prop, phases, occupancy, ): r""" Return the given property by looking it up from a list of given phases based on occupancy. Parameters ---------- %(phase)s prop : str The dictionary key to the array containing the pore/throat property to ...
Return the given property by looking it up from a list of given phases based on occupancy. Parameters ---------- %(phase)s prop : str The dictionary key to the array containing the pore/throat property to be used in the calculation. phases : list List of Phases over...
mix_and_match
python
PMEAL/OpenPNM
openpnm/models/phase/misc/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/misc/_funcs.py
MIT
def mole_to_mass_fraction( phase, MWs='param.molecular_weight.*', ): r""" Convert mole fraction to mass fraction Parameters ---------- %(phase)s %(MWs)s Returns ------- """ MWs = phase.get_comp_vals(MWs) xs = phase['pore.mole_fraction'] ms = {} # Find the a...
Convert mole fraction to mass fraction Parameters ---------- %(phase)s %(MWs)s Returns -------
mole_to_mass_fraction
python
PMEAL/OpenPNM
openpnm/models/phase/misc/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/misc/_funcs.py
MIT
def salinity( phase, T='pore.temperature', conc='pore.concentration', ): r""" Calculates the salinity in g salt per kg of solution from concentration Parameters ---------- %(phase)s %(T)s %(conc)s Returns ------- salinity : ndarray The salinity in g of solut...
Calculates the salinity in g salt per kg of solution from concentration Parameters ---------- %(phase)s %(T)s %(conc)s Returns ------- salinity : ndarray The salinity in g of solute per kg of solution. Notes ----- This model is useful for converting known conc...
salinity
python
PMEAL/OpenPNM
openpnm/models/phase/mixtures/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/mixtures/_funcs.py
MIT
def mixing_rule( phase, prop, mode='logarithmic', power=1, ): r""" Computes the property of a mixture using the specified mixing rule Parameters ---------- %(phase)s prop : str The dictionary key containing the property of interest on each component mode : st...
Computes the property of a mixture using the specified mixing rule Parameters ---------- %(phase)s prop : str The dictionary key containing the property of interest on each component mode : str The mixing rule to to use. Options are: ============== ============...
mixing_rule
python
PMEAL/OpenPNM
openpnm/models/phase/mixtures/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/mixtures/_funcs.py
MIT
def mole_to_mass_fraction( phase, MWs='param.molecular_weight' ): r""" Computes the mass fraction in each pore Parameters ---------- %(phase)s %(MWs)s Returns ------- ws : ndarray An ndarray containing the mass fraction in each pore computed from the mole fr...
Computes the mass fraction in each pore Parameters ---------- %(phase)s %(MWs)s Returns ------- ws : ndarray An ndarray containing the mass fraction in each pore computed from the mole fractions of each component and their molecular weights.
mole_to_mass_fraction
python
PMEAL/OpenPNM
openpnm/models/phase/mixtures/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/mixtures/_funcs.py
MIT
def mole_summation(phase): r""" Computes total mole fraction in each pore given component values Parameters ---------- %(phase)s Returns ------- vals : ND-array An ND-array containing the total mole fraction. Note that this is not guaranteed to sum to 1.0. """ ...
Computes total mole fraction in each pore given component values Parameters ---------- %(phase)s Returns ------- vals : ND-array An ND-array containing the total mole fraction. Note that this is not guaranteed to sum to 1.0.
mole_summation
python
PMEAL/OpenPNM
openpnm/models/phase/mixtures/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/mixtures/_funcs.py
MIT
def from_component(phase, prop, compname): r""" Fetches the given values from the specified object Parameters ---------- %(phase)s prop : str The name of the array to retreive compname : str The name of the object possessing the desired data Returns ------- vals...
Fetches the given values from the specified object Parameters ---------- %(phase)s prop : str The name of the array to retreive compname : str The name of the object possessing the desired data Returns ------- vals : ND-array An ND-array containing the requ...
from_component
python
PMEAL/OpenPNM
openpnm/models/phase/mixtures/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/mixtures/_funcs.py
MIT
def gaseous_species_in_water( phase, T="throat.temperature", ): r""" Calculate Henry's law constant for gaseous species dissolved in water Parameters ---------- %(phase)s %(T)s Returns ------- H : ndarray A numpy ndarray containing Henry's law constant (Kpx) [atm/mo...
Calculate Henry's law constant for gaseous species dissolved in water Parameters ---------- %(phase)s %(T)s Returns ------- H : ndarray A numpy ndarray containing Henry's law constant (Kpx) [atm/mol-frac] Notes ----- The constant for the correlation a lookup using...
gaseous_species_in_water
python
PMEAL/OpenPNM
openpnm/models/phase/partition_coefficient/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/partition_coefficient/_funcs.py
MIT
def water_correlation( phase, T='pore.temperature', salinity='pore.salinity' ): r""" Calculates surface tension of pure water or seawater at atmospheric pressure This model uses Eq. (28) given by Sharqawy et al. [1]. Values at temperature higher than the normal boiling temperature are c...
Calculates surface tension of pure water or seawater at atmospheric pressure This model uses Eq. (28) given by Sharqawy et al. [1]. Values at temperature higher than the normal boiling temperature are calculated at the saturation pressure. Parameters ---------- %(phase)s %(T)s ...
water_correlation
python
PMEAL/OpenPNM
openpnm/models/phase/surface_tension/_funcs.py
https://github.com/PMEAL/OpenPNM/blob/master/openpnm/models/phase/surface_tension/_funcs.py
MIT