Spaces:
Sleeping
Sleeping
dzs commited on
Commit ·
9c9b518
1
Parent(s): 622f49f
added ethanol:water (50:50) mixture
Browse files- assets/{style_v2.css → style.css} +0 -0
- data/functions.py +21 -0
- data/solventData.xlsx +2 -2
assets/{style_v2.css → style.css}
RENAMED
|
File without changes
|
data/functions.py
CHANGED
|
@@ -108,6 +108,24 @@ Vmcg = df_desc['VMcGowan']
|
|
| 108 |
m = ~pd.isna(Vabc)
|
| 109 |
popt_V = np.polyfit(Vmcg[m], Vabc[m], 1)
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
def get_WC(T,solv,V):
|
| 112 |
params = df_visc[df_visc['Solvent_Name']==solv].iloc[0]
|
| 113 |
if params['Equation'] == '10^A(1/T-1/B)':
|
|
@@ -126,6 +144,9 @@ def get_WC(T,solv,V):
|
|
| 126 |
eta = params['A'] * 298.15/T
|
| 127 |
elif params['Equation'] == 'A*T+B':
|
| 128 |
eta = params['A'] * T + params['A']
|
|
|
|
|
|
|
|
|
|
| 129 |
else:
|
| 130 |
eta = np.nan
|
| 131 |
D_WC = 7.4e-8*(params['MW']*params['WC_assoc_param'])**0.5*(T)/eta/V**0.6
|
|
|
|
| 108 |
m = ~pd.isna(Vabc)
|
| 109 |
popt_V = np.polyfit(Vmcg[m], Vabc[m], 1)
|
| 110 |
|
| 111 |
+
# ---- model: Grunberg–Nissan style with polynomial interaction that vanishes at x=0,1 ----
|
| 112 |
+
# fitted to data from R. Belda, J. V. Herráez, O. Diez, Rheological study and thermodynamic analysis of the binary system (water/ethanol): Influence of concentration. Physics and Chemistry of Liquids 42, 467-479 (2004).
|
| 113 |
+
popt_etoh = np.array([-6.35036532e+00, 1.86507282e+03, -5.30902320e+00, 1.60463200e+03, -1.03040657e+01, 3.05646061e+00, -4.93824317e+00, 4.16274239e+03, -1.18411097e+03, 1.69557649e+03])
|
| 114 |
+
def predict_lneta(p, T, x, n_poly=3, interaction_has_T=True):
|
| 115 |
+
Aw, Bw, Ae, Be = p[:4] # ln(eta_w)=Aw+Bw/T, ln(eta_e)=Ae+Be/T
|
| 116 |
+
ln_eta_w = Aw + Bw / T
|
| 117 |
+
ln_eta_e = Ae + Be / T
|
| 118 |
+
xc = 2.0*x - 1.0 # map wt frac [0,1] -> [-1,1]
|
| 119 |
+
Phi = np.vstack([xc**k for k in range(n_poly)]) # (n_poly, N)
|
| 120 |
+
if interaction_has_T:
|
| 121 |
+
a = p[4:4+n_poly]
|
| 122 |
+
b = p[4+n_poly:4+2*n_poly]
|
| 123 |
+
G = (a @ Phi) + (b @ Phi) / T
|
| 124 |
+
else:
|
| 125 |
+
a = p[4:4+n_poly]
|
| 126 |
+
G = (a @ Phi)
|
| 127 |
+
return x*ln_eta_e + (1-x)*ln_eta_w + x*(1-x)*G
|
| 128 |
+
|
| 129 |
def get_WC(T,solv,V):
|
| 130 |
params = df_visc[df_visc['Solvent_Name']==solv].iloc[0]
|
| 131 |
if params['Equation'] == '10^A(1/T-1/B)':
|
|
|
|
| 144 |
eta = params['A'] * 298.15/T
|
| 145 |
elif params['Equation'] == 'A*T+B':
|
| 146 |
eta = params['A'] * T + params['A']
|
| 147 |
+
elif params['Equation'] == 'fitted_EtOH':
|
| 148 |
+
# assuming 50% is by volume --> by mass for consistency with fitted model
|
| 149 |
+
eta = np.exp(predict_lneta(popt_etoh, T, 0.5*0.7898/(0.5*0.7898+0.5*1.000), n_poly=3, interaction_has_T=True))
|
| 150 |
else:
|
| 151 |
eta = np.nan
|
| 152 |
D_WC = 7.4e-8*(params['MW']*params['WC_assoc_param'])**0.5*(T)/eta/V**0.6
|
data/solventData.xlsx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8786e15998c9272e69ad5bc20d096cfbb0044e6af49e7947aa8d4740aec663d3
|
| 3 |
+
size 15835
|