-
Notifications
You must be signed in to change notification settings - Fork 172
/
example_script_OP.py
35 lines (34 loc) · 1.47 KB
/
example_script_OP.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import openpnm as op
ws = op.Workspace()
proj = ws.new_project()
pn = op.network.Cubic(shape=[10, 10, 10], project=proj, spacing=1e-4)
geom = op.geometry.StickAndBall(network=pn, pores=pn.Ps, throats=pn.Ts)
geom['pore.volume'][pn.pores('left')] = 0
hg = op.phases.Mercury(network=pn)
phys = op.physics.GenericPhysics(network=pn, phase=hg, geometry=geom)
phys.add_model(propname='throat.entry_pressure',
model=op.models.physics.capillary_pressure.washburn)
phys.add_model(propname='pore.pc_star',
model=op.models.misc.from_neighbor_throats,
throat_prop='throat.entry_pressure',
mode='min')
phys.add_model(propname='pore.late_filling',
model=op.models.physics.multiphase.late_filling,
pressure='pore.pressure',
Pc_star='pore.pc_star',
eta=1, Swp_star=0.4,
regen_mode='deferred')
phys['throat.pc_star'] = phys['throat.entry_pressure']
phys.add_model(propname='throat.late_filling',
model=op.models.physics.multiphase.late_filling,
pressure='throat.pressure',
Pc_star='throat.pc_star',
eta=1, Swp_star=0.2,
regen_mode='deferred')
mip = op.algorithms.Porosimetry(project=proj)
mip.set_inlets(pores=pn.pores('left'))
mip.setup(phase=hg)
mip.set_partial_filling(propname='pore.late_filling')
mip.set_partial_filling(propname='throat.late_filling')
mip.run(points=20, stop=1e7)
mip.plot_intrusion_curve()