Ejemplo n.º 1
0
plt.text(
    x_goal_label,
    1.2 * ymax,
    '%s\n$p_{\mathrm{full}} = $ %g bar\n$p_{\mathrm{empty}} = $ %g bar\n$T=%g$ K'
    % (
        gas,
        p_full / bar,
        p_empty / bar,
        T[0] / Kelvin,
    ),
    color='k')

first_legend = plt.legend(to_be_legended, legend_labels, loc='upper right')
plt.gca().add_artist(first_legend)

for mof in colors.order(experimental_data):
    if basename == 'methane-298':
        try:
            data = np.loadtxt(mof + '-298.txt', skiprows=1, unpack=True)
            T_MOF = data[0][0] * Kelvin
            p_MOF = data[1] * bar
            print(mof)
            rho_MOF = data[2] * density_units

            rho_lo_p = my_interp(p_empty, p_MOF, rho_MOF)
            delta_G_lo_p = mu_from_n(rho_lo_p) - mu_from_p(p_empty)

            rho_hi_p = my_interp(p_full, p_MOF, rho_MOF)
            delta_G_hi_p = mu_from_n(rho_hi_p) - mu_from_p(p_full)
            plt.plot([delta_G_lo_p / (kJ / mol), delta_G_hi_p / (kJ / mol)],
                     2 * [experimental_data[mof][0] / density_units],
    'CuMOF74': 1.323 * gram / cm**3,
    'PCN250': 0.896 * gram / cm**3,
    'NU1000': 0.571 * gram / cm**3,
    'UiO67': 0.688 * gram / cm**3,
    'UiO68Ant': 0.607 * gram / cm**3,
    'CYCU3Al': 0.447 * gram / cm**3,
    'Zn2bdc2dabco': 0.873 * gram / cm**3,
    'NU1101': 0.459 * gram / cm**3,
    'NU1102': 0.403 * gram / cm**3,
    'NU1103': 0.298 * gram / cm**3,
    'COF102': 0.41 * gram / cm**3,
}

mof_isotherms = gas.isotherm_experiments(T[0], float(sys.argv[3]),
                                         float(sys.argv[4]))
for mof in colors.order(mof_isotherms):  # For each MOF
    if basename == 'methane':
        rho_lo_p = mof_isotherms[mof]['rho_empty']  #*crystal_density[mof]
    else:
        rho_lo_p = mof_isotherms[mof]['rho_empty'] * crystal_density[mof]
    delta_G_lo_p = np.interp(rho_lo_p, n, mu) - mu_empty

    if basename == 'methane':
        rho_hi_p = mof_isotherms[mof]['rho_full']  #*crystal_density[mof]
    else:
        rho_hi_p = mof_isotherms[mof]['rho_full'] * crystal_density[mof]
    delta_G_hi_p = np.interp(rho_hi_p, n, mu) - mu_full

    plt.plot([delta_G_lo_p / (kJ / mol), delta_G_hi_p / (kJ / mol)],
             [(rho_hi_p - rho_lo_p) / density_units,
              (rho_hi_p - rho_lo_p) / density_units],
Ejemplo n.º 3
0
# Calculate the free energies
G = H - T * S

# Calculate chemical potential, number, inverse beta
mu = G  # per mol
n = 1 / V
mu_empty = my_interp(p_empty, p, mu)
mu_full = my_interp(p_full, p, mu)

# --- Read in the data from MOF file --- #

# Note that all of the *-298.txt files are for methane
# total adsorption and come from the Mason and Long 2014 paper
mofs_shown = set()
plt.figure(figsize=(5, 5))
for mof in colors.order(CH4_298_E_Data):  # For each MOF
    fname = 'data/%s/%s-%g.txt' % ('methane', mof, 298)
    MofData = np.loadtxt(fname, skiprows=1, unpack=True)
    T_MOF = MofData[0][0] * Kelvin
    p_MOF = MofData[1] * bar
    rho_MOF = MofData[2] * density_units
    rho_lo_p = my_interp(p_empty, p_MOF, rho_MOF)
    delta_G_lo_p = mu_from_n(rho_lo_p) - mu_empty

    rho_hi_p = my_interp(p_full, p_MOF, rho_MOF)
    delta_G_hi_p = mu_from_n(rho_hi_p) - mu_full

    qst = CH4_298_E_Data[mof]
    plt.plot([delta_G_lo_p / (kJ / mol), delta_G_hi_p / (kJ / mol)],
             [qst / (kJ / mol), qst / (kJ / mol)],
             colors.symbol('methane') + '-',