You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I modeled the predicted relative permeability using the code in the documentation, which is https://github.com/PMEAL/OpenPNM/blob/dev/examples/applications/relative _ permeability.ipynb. I used the SNOW2 algorithm for the pore network to extract it, but running the code produced KeyError: ' throat. [Volume']
, Here's my code:
`import porespy as ps
import matplotlib.pyplot as plt
import numpy as np
import openpnm as op
op.visualization.set_mpl_style()
np.random.seed(0)
np.set_printoptions(precision=5)
op.Workspace().settings.loglevel = 40
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I modeled the predicted relative permeability using the code in the documentation, which is https://github.com/PMEAL/OpenPNM/blob/dev/examples/applications/relative _ permeability.ipynb. I used the SNOW2 algorithm for the pore network to extract it, but running the code produced KeyError: ' throat. [Volume']
, Here's my code:
`import porespy as ps
import matplotlib.pyplot as plt
import numpy as np
import openpnm as op
op.visualization.set_mpl_style()
np.random.seed(0)
np.set_printoptions(precision=5)
op.Workspace().settings.loglevel = 40
def sat_occ_update(network, nwp, wp, ip, i):
pore_mask = ip['pore.invasion_sequence'] < i
throat_mask = ip['throat.invasion_sequence'] < i
sat_p = np.sum(network['pore.volume'][pore_mask])
sat_t = np.sum(network['throat.volume'][throat_mask])
sat1 = sat_p + sat_t
bulk = network['pore.volume'].sum() + network['throat.volume'].sum()
sat = sat1/bulk
nwp['pore.occupancy'] = pore_mask
nwp['throat.occupancy'] = throat_mask
wp['throat.occupancy'] = 1-throat_mask
wp['pore.occupancy'] = 1-pore_mask
return sat
def Rate_calc(network, phase, inlet, outlet, conductance):
phase.regenerate_models()
St_p = op.algorithms.StokesFlow(network=network, phase=phase)
St_p.settings._update({'conductance' : conductance})
St_p.set_value_BC(pores=inlet, values=1)
St_p.set_value_BC(pores=outlet, values=0)
St_p.run()
val = np.abs(St_p.rate(pores=inlet, mode='group'))
return val
if name == "main":
shape = [30, 30, 30]
im = ps.generators.blobs(shape=shape, porosity = 0.4, blobiness = 1)
Beta Was this translation helpful? Give feedback.
All reactions