File size: 744 Bytes
f421c2e | 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 | r"""
In the example script a generic network is created then exported as a
Salome Python script. The script should be executed from Salome with
"load script". The geometry is then built. The geometry generation on
Salome may take some time depending on the number of pores.
"""
import numpy as np
import openpnm as op
# Workspace and project
ws = op.Workspace()
proj = ws.new_project()
export = False
# Network
np.random.seed(7)
net = op.network.Cubic(shape=[4, 3, 3], spacing=1e-4, project=proj)
# Geometry
geo = op.geometry.SpheresAndCylinders(network=net, pores=net.Ps, throats=net.Ts)
# Phase
phase = op.phase.Water(network=net)
# Export the network
if export:
proj.export_data(phases=[phase], filename='out', filetype='Salome')
|