Example: Regenerating Data from

R. Wu et al. / Elec Acta 54 25 (2010) 7394–7403

Import the modules


In [ ]:
import scipy as sp
import numpy as np
import openpnm as op
import matplotlib.pyplot as plt
import openpnm.models.geometry as gm
import openpnm.topotools as tt
%matplotlib inline
np.random.seed(10)

Set the workspace loglevel to not print anything


In [ ]:
ws = op.Workspace()
ws.settings["loglevel"] = 50

In [ ]:
%run shared_funcs.ipynb

We can also investigate the effect of network size on the single phase diffusivity


In [ ]:
y_2_values = []

n_values = [8, 10, 12, 14, 16, 18, 20]

for x in range(5):
    for n in n_values:
        x_ensemble, y_ensemble = simulation(n=n, npts=1)
        y_2_values.append(y_ensemble)

In [ ]:
y_2_values = np.asarray(y_2_values).flatten()
plt.figure()
plt.plot(n_values + n_values + n_values + n_values + n_values, y_2_values, 'ro')
plt.title('F(epsilon) versus N')
plt.xlabel('N')
plt.ylabel('F(epsilon)')
#plt.axis(xmin = 6,xmax = 22,ymin= 0,ymax = .2)
plt.show()