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 got a good PNM model through SNOW, and I can complete the calculation by importing it into Openpnm, but I have a problem when plotting the capillary pressure curve, is it because the throat.volume is missing from the PNM model properties?
import openpnm as op import numpy as np import matplotlib.pyplot as plt op.visualization.set_mpl_style() air = op.phase.Air(network=pn) air['pore.contact_angle'] = 120 air['pore.surface_tension'] = 0.072 f = op.models.physics.capillary_pressure.washburn air.add_model(propname='throat.entry_pressure', model=f, surface_tension='throat.surface_tension', contact_angle='throat.contact_angle', diameter='throat.equivalent_diameter',) mip = op.algorithms.Drainage(network=pn, phase=air) mip.set_inlet_BC(pores=pn.pores('ymax')) mip.run() data = mip.pc_curve() plt.plot(data.pc, data.snwp, 'b-o') plt.xlabel('Capillary Pressure [Pa]') plt.ylabel('Non-Wetting Phase Saturation');
D:\ProgramData\Anaconda3\lib\site-packages\openpnm\algorithms_drainage.py in pc_curve(self, pressures)
260 s = []
261 Vp = self.network[self.settings.pore_volume]
--> 262 Vt = self.network[self.settings.throat_volume]
263 for p in pressures:
264 Snwp_p = self['pore.invasion_pressure'] <= p
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
-
Dear Prof. Gostick,
I got a good PNM model through SNOW, and I can complete the calculation by importing it into Openpnm, but I have a problem when plotting the capillary pressure curve, is it because the throat.volume is missing from the PNM model properties?
import openpnm as op import numpy as np import matplotlib.pyplot as plt op.visualization.set_mpl_style() air = op.phase.Air(network=pn) air['pore.contact_angle'] = 120 air['pore.surface_tension'] = 0.072 f = op.models.physics.capillary_pressure.washburn air.add_model(propname='throat.entry_pressure', model=f, surface_tension='throat.surface_tension', contact_angle='throat.contact_angle', diameter='throat.equivalent_diameter',) mip = op.algorithms.Drainage(network=pn, phase=air) mip.set_inlet_BC(pores=pn.pores('ymax')) mip.run() data = mip.pc_curve() plt.plot(data.pc, data.snwp, 'b-o') plt.xlabel('Capillary Pressure [Pa]') plt.ylabel('Non-Wetting Phase Saturation');
KeyError Traceback (most recent call last)
D:\ProgramData\Anaconda3\lib\site-packages\openpnm\core_base2.py in getitem(self, key)
169 try:
--> 170 return super().getitem(key)
171 except KeyError:
KeyError: 'throat.volume'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_19096\1195212724.py in
----> 1 data = mip.pc_curve()
2 plt.plot(data.pc, data.snwp, 'b-o')
3 plt.xlabel('Capillary Pressure [Pa]')
4 plt.ylabel('Non-Wetting Phase Saturation');
D:\ProgramData\Anaconda3\lib\site-packages\openpnm\algorithms_drainage.py in pc_curve(self, pressures)
260 s = []
261 Vp = self.network[self.settings.pore_volume]
--> 262 Vt = self.network[self.settings.throat_volume]
263 for p in pressures:
264 Snwp_p = self['pore.invasion_pressure'] <= p
D:\ProgramData\Anaconda3\lib\site-packages\openpnm\core_base2.py in getitem(self, key)
183 return vals
184 else:
--> 185 raise KeyError(key)
186
187 def delitem(self, key):
KeyError: 'throat.volume'
Beta Was this translation helpful? Give feedback.
All reactions