import numpy as np
import holoviews as hv
hv.extension('bokeh', logo=False)
def rubeyw0(dd, nu=10**(-6)):
rhosw = 1.65 # Specific gravity in water of sand
g = 9.8 # acceleration of gravity
tmp = 36.0*nu**2/rhosw/g/dd**3
F = np.sqrt(2.0/3.0 + tmp) - np.sqrt(tmp)
return np.sqrt(rhosw*g*dd)*F
def vanRijinw0(dd, nu=10**(-6)):
rhosw = 1.65 # Specific gravity in water of sand
g = 9.8 # acceleration of gravity
if dd < 0.0001 :
w0 = float(1/18)*rhosw*g*dd**2/nu
elif dd <= 0.001 :
w0 = float(10)*nu/dd*( (1+0.01*rhosw*g*dd**3/nu**2)**0.5 -1 )
else:
w0 = np.sqrt(rhosw*g*dd)*1.1
return w0
dm = np.logspace(-2,1,10000)
dm /= 1000
w01 = np.array( [rubeyw0(dmp) for dmp in dm] )
w02 = np.array( [vanRijinw0(dmp) for dmp in dm] )
g = hv.Curve((dm*1000,w01),label='Rubey') \
*hv.Curve((dm*1000,w02),label='Van Rijin').options(line_dash='dashed', line_width=3)
g.options(logx=True, logy=True
, xlabel='diameter[mm]', ylabel='setling velocity[m/s]'
, legend_position='bottom_right', show_grid=True, width=500,height=450)