示例#1
0
import validation

epsilon = 1e-7

# Wetting of an HF135 membrane, Van Genuchten model
# Data from Buser (PhD thesis, 2016)
# http://hdl.handle.net/1773/38064
theta_range = (0.0473, 0.945)
k = 5.50e-13  # m**2
alpha = 0.2555  # 1/m
n = 2.3521
theta_i = 0.102755  # Computed from P0

theta_b = theta_range[1] - epsilon

D_analytical = van_genuchten(n=n, alpha=alpha, k=k, theta_range=theta_range)

analytical = solve(D=D_analytical, i=theta_i, b=theta_b)

o = np.linspace(analytical.o[0], analytical.o[-1], 2000)

theta = analytical(o=o)

D_inverse = inverse(o=o, samples=theta)

fig = plt.figure()
fig.canvas.set_window_title("Diffusivity plot")

plt.title("Diffusivity function")
plt.plot(theta, D_analytical(theta), label="Analytical")
plt.plot(theta, D_inverse(theta), label="Obtained with inverse()")
示例#2
0
epsilon = 1e-7

# Wetting of an HF135 membrane, Van Genuchten model
# Data from Buser (PhD thesis, 2016)
# http://hdl.handle.net/1773/38064
theta_range = (0.0473, 0.945)
k = 5.50e-13  # m**2
alpha = 0.2555  # 1/m
n = 2.3521
theta_i = 0.102755  # Computed from P0
h = 1.60e-4  # m -- thickness

flowrate = 1e-9  # m**3/s

D = van_genuchten(n=n, alpha=alpha, k=k, theta_range=theta_range)


theta = solve_flowrate(D=D, i=theta_i, Qb=flowrate, radial='cylindrical', height=h,
	               verbose=2)


r = np.linspace(0, 5e-2, 200)  # m
t = (60, 120)  # s

fig = plt.figure()
fig.canvas.set_window_title("Water content plot")

plt.title("Water content fields")
plt.plot(r, theta(r,t[0]), label="t={} {}".format(t[0], t_unit))
plt.plot(r, theta(r,t[1]), label="t={} {}".format(t[1], t_unit))
示例#3
0
import numpy as np
import matplotlib.pyplot as plt

from fronts.D import van_genuchten

from validation import r_unit, t_unit

epsilon = 1e-6

Ks = 25  # cm/h
alpha = 0.01433  # 1/cm
n = 1.506
theta_range = (0, 0.3308)

D = van_genuchten(n=n, alpha=alpha, Ks=Ks, theta_range=theta_range)

theta = np.linspace(theta_range[0] + epsilon, theta_range[1] - epsilon, 200)

fig = plt.figure()
fig.canvas.set_window_title("Diffusivity plot")

plt.title("Diffusivity function")
plt.plot(theta, D(theta))
plt.xlabel("water content [-]")
plt.ylabel("diffusivity [{}**2/{}]".format(r_unit, t_unit))
plt.yscale('log')
plt.grid(which='both')

plt.show()