Replies: 1 comment 1 reply
-
|
Maybe I should write an FAQ, because this one comes up a lot. Also, the error message contains exactly the keywords you'd want to look for. Anyway, this example should help. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I used the blobs function of porespy to generate the digital core, extracted the pore network using the snow2 algorithm, and did the simulation of single-phase transport. The simulation showed the following error: Exception: Your network is clustered, making Ax = b ill-conditioned, my code is as follows:
`import matplotlib.pyplot as plt
import porespy as ps
import numpy as np
import openpnm as op
op.visualization.set_mpl_style()
np.random.seed(0)
shape = [40, 40, 40]
im = ps.generators.blobs(shape=shape, porosity = 0.4, blobiness = 1)
net = ps.networks.snow2(phases = im)
pn = op.io.network_from_porespy(net.network)
print(pn)
ax = op.visualization.plot_connections(pn, color_by=pn['throat.equivalent_diameter'],linewidth=4)
ax = op.visualization.plot_coordinates(pn, color_by=pn['pore.equivalent_diameter'], ax=ax, markersize=50)
water = op.phase.Water(network=pn)
R = pn['throat.equivalent_diameter']/2
L = pn['throat.direct_length']
mu = water['throat.viscosity'] # See ProTip below
water['throat.hydraulic_conductance'] = np.piR**4/(8mu*L)
sf = op.algorithms.StokesFlow(network=pn, phase=water)
sf.set_value_BC(pores=pn.pores('xmin'), values=1)
sf.set_value_BC(pores=pn.pores('xmax'), values=0)
soln = sf.run()
print(sf`
Beta Was this translation helpful? Give feedback.
All reactions