Closed JiyuanZhang221 closed 7 years ago
Hi @JiyuanZhang221, it's difficult to know why you're seeing this...it's quite possible a bug in the example, but may also be due to a bug in your script. For instance, how are you changing pores sizes, are you regenerating the geometry objects after you change the size distribution info.
Perhaps you could condense your script down to the bare minimum lines and share it here?
Thanks @jgostick. Actually my primary target is to investigate the effect of pore/throat deformation at varying confining pressures on relative permeability. So I used a data file as an initial input to the pore sizes. Pore sizes were repeatedly updated according to certain rules and relative permeability were then re-calculated in a loop.
For consideration of simplicity, I attached a condensed version of the script for your reference (without calculation of deformation). In this condensed script, you can change the scaling factor (I) to see that the average pore sizes have very minor effect on relative permeability.
Thanks again.
Hi @JiyuanZhang221 ... perhaps you could email me a script file that I could just run? I'm getting errors after cutting & pasting the above code. (jgostick at gmail)
@jgostick , hi, I did an easy simulation by using two sets of pores to construct a pnm. The two pore diameters are 5e-5 m and 2.5 e-5 m, respectively. Then I use it to simulation single-phase flow. As intuitive feeling, I think the constant-pressure surface should not be vertical to the flow direction (z-axis) near the pore-size-changing areas. But the results show that the pressrue is the same at the plane cross the flow direction.
About the following two pictures:
visualization for the pore size.
show the pressure and flow rate along y-axis.
It seems flow rate is ok. But I suspect the pressure result.
I do not understand your question but the data you show above all looks good.
The pressure should be relatively constant at any z-position.
The flow should be 0 in every pore, except for boundary pores, because the mass balances to 0 (in - out). Your flow rate axis is scaled by 10^-22, so the red points are basically just showing numerical noise...the flows are indeed 0 as expected.
Thank you. Still, I don't understand why the pore size will not change the pressure distribution. About the flow rate, I understand it.
Thank you. Still, I don't understand why the pore size will not change the pressure distribution. About the flow rate, I understand it.
If you radically change the pore size distribution, you might see some noticeable change.
Try on a smaller network so the heterogeneity gets more pronounced.
The only thing that pore size changes is the flow in the throats., not the pressure in the pores. There are several ways to think about this. Consider the pores at the same z-position...if there were a pressure difference between them, then flow would move between them, but there is no reason for flow to move laterally when the pressure is lower toward the outlet. Or, you can say that the flow rate through small throats is low, so no flow will go there, so therefore there won't be a pressure difference. Also, remember that the steady-state solution is at infinite time, so after a long time, the pressure will all pores will be equilibrated with it's neighbors. So if there is an 'instantaneous' low pressure somewhere, then fluid will rush in there to fill that location, and it's pressure will be close to it's neighbors.
I guess I understand. I forget the steady-state condition. Thank you!
Then, I made some changes, the new pore size distribution is as follows:
From the figure, I can see pressure difference obviously in lateral direction. This may show the flow at the x-y plane.
I was assuming the size of pores/throats should have negligible effect on relative permeabilities. Unfortunately, I found the simulated relative permeabilities are identical when inputting different pore sizes following the example "Example: Regenerating Data from J.T. Gostick et al. / JPS 173 (2007) 277–290". Does anybody have a clue about the reasons?
-- coding: utf-8 --
import OpenPNM as op
workspace = op.Base.Workspace() workspace.clear()
N=1 nx=15 #No. of pores in x-direction ny=15 #No. of pores in y-direction nz=15 #No. of pores in z-direction I=3 # Scaling factor used for controlling pore size Lc = 0.005 # Lattice spacing
1 setting up network
sgl = op.Network.Cubic([nx, ny, nz], spacing=Lc, connectivity=6,name='relativeperm2') sgl.add_boundaries()
2 set up geometries
Ps = sgl.pores('boundary') Ts = sgl.find_neighbor_throats(pores=Ps,mode='not_intersection') boun = op.Geometry.Boundary(network=sgl,pores=Ps,throats=Ts,name='boun')
Ps = sgl.pores('boundary',mode='difference') Ts = sgl.find_neighbor_throats(pores=Ps,mode='intersection',flatten=True) geo = op.Geometry.Cube_and_Cuboid(network=sgl,pores=Ps,throats=Ts,name='geo')
geo.models.add(propname='pore.diameter', model=op.Geometry.models.pore_diameter.normal, shape=1.0, scale=0.00001, loc=0.00006*I,seeds='pore.seed') pore_dia=geo['pore.diameter']
geo.models.add(propname='throat.diameter', model=op.Geometry.models.throat_misc.neighbor, pore_prop='pore.diameter',mode='mean')
geo.models.add(propname='throat.length', model=op.Geometry.models.throat_length.straight)
geo.models.add(propname='throat.area', model=op.Geometry.models.throat_area.cuboid)
geo.models.add(propname='pore.area', model=op.Geometry.models.pore_area.cubic)
geo.models.add(propname='pore.volume', model=op.Geometry.models.pore_volume.cube)
geo.models.add(propname='throat.volume', model=op.Geometry.models.throat_volume.cuboid)
boun.regenerate()
air = op.Phases.Air(network = sgl, name = 'air') water = op.Phases.Water(network = sgl, name = 'water')
reset pore contact angle
water['pore.contact_angle'] = 120 air['throat.contact_angle']=110 air['throat.surface_tension']=.072 air['pore.surface_tension']=0.072
1 create physics objects associated with our phases
Ps = sgl.pores() Ts = sgl.throats() phys_water = op.Physics.Standard(network=sgl,phase=water,pores=Ps,throats=Ts,dynamic_data=True,name='standard_water_physics') phys_air = op.Physics.Standard(network=sgl,phase=air,pores=Ps,throats=Ts,dynamic_data=True,name='standard_air_physics')
2 calculating physics properties (capillary pressure, hydraulic conductance, etc)
phys_water.regenerate() phys_air.regenerate()
inlets = sgl.pores('top_boundary') used_inlets = [inlets[x] for x in range(0, len(inlets), 2)]
using every other pore in the bottom and boundary as an inlet
prevents extremely small diffusivity and permeability values in the z direction
used_inlets = [inlets[x] for x in range(0, len(inlets), 2)] OP_1 = op.Algorithms.OrdinaryPercolation(network=sgl,invading_phase=water,defending_phase=air)
OP_1.run(inlets = used_inlets,npts=50) OP_1.run() OP_1.evaluate_trapping(p_outlets=sgl.pores('bottom_boundary')) sw_eva=OP_1.evaluate_late_pore_filling(Pc=500)
OP_1.evaluate_late_throat_filling(Pc=1000)
OP_1.plot_drainage_curve() OP_1.plot_primary_drainage_curve()
sat = [] perm_air = {'0': [], '1': [], '2': []} diff_air = {'0': [], '1': [], '2': []} perm_water = {'0': [], '1': [], '2': []} diff_water = {'0': [], '1': [], '2': []}
max_inv_seq = max(OP_1['throat.inv_seq'])
num_seq = 10
pore_oc=(num_seq+1)[len(Ps)[0]] throat_oc=(num_seq+1)[len(Ts)[0]] sat1=(num_seq+1)*[0]
netname1='Stokes_alg_single_phase_air' netname2='Stokes_alg_single_phase_water' netname3='Stokes_alg_multi_phase_air' netname4='Stokes_alg_multi_phase_water'
for x in range(num_seq+1):
result=[sat,perm_air['0'], perm_water['0']]