def check_mgd_shim_duffy_kenichi(): """ Attemmpts to recreate Shim Duffy Kenichi (2002) """ plt.close() # Create gold material from Table 1 gold = burnman.Mineral() gold.params = { 'name': 'gold', 'V_0': 10.22e-6, 'K_0': 167.0e9, 'Kprime_0': 5.0, 'G_0': 0.0e9, 'Gprime_0': 0.0, 'molar_mass': .196966, 'n': 1.0, 'Debye_0': 170., 'grueneisen_0': 2.97, # this does better with gr = 2.93. Why? 'q_0': 1.0 } gold.set_method('mgd3') # Total pressures, pulled from Table 2 ref_pressures = [ np.array([ 0., 3.55, 7.55, 12.06, 17.16, 22.91, 29.42, 36.77, 45.11, 54.56, 65.29, 77.50, 91.42, 107.32, 125.51, 146.38, 170.38, 198.07 ]) ] ref_pressures.append( np.array([ 4.99, 8.53, 12.53, 17.04, 22.13, 27.88, 34.38, 41.73, 50.06, 59.50, 70.22, 82.43, 96.33, 112.22, 130.40, 151.25, 175.24, 202.90 ])) ref_pressures.append( np.array([ 12.14, 15.69, 19.68, 24.19, 29.28, 35.03, 41.53, 48.88, 57.20, 66.64, 77.37, 89.57, 103.47, 119.35, 137.53, 158.38, 182.36, 210.02 ])) ref_pressures.append( np.array([ 19.30, 22.84, 26.84, 31.35, 36.44, 42.19, 48.68, 56.03, 64.35, 73.80, 84.52, 96.72, 110.62, 126.50, 144.68, 165.53, 189.51, 217.17 ])) eos = mgd.MGD3() pressures = np.empty_like(ref_pressures) ref_dv = np.linspace(0.0, 0.34, len(pressures[0])) ref_volumes = (1 - ref_dv) * gold.params['V_0'] T = np.array([300., 1000., 2000., 3000.]) for t in range(len(pressures)): for i in range(len(pressures[t])): pressures[t][i] = eos.pressure(T[t], ref_volumes[i], gold.params) plt.plot(ref_dv, (pressures[t] / 1.e9 - ref_pressures[t])) plt.ylim(-1, 1) plt.ylabel("Difference in pressure (GPa)") plt.xlabel("1-dV/V") plt.title("Comparing with Shim, Duffy, and Kenichi (2002)") plt.show()
def check_mgd_fei_mao_shu_hu(): """ Benchmark agains Fei Mao Shu Hu (1991) """ mgfeo = burnman.Mineral() mgfeo.params = { 'name': 'MgFeO', 'V_0': 11.657e-6, 'K_0': 157.0e9, 'Kprime_0': 4.0, 'G_0': 0.0e9, 'Gprime_0': 0.0, 'molar_mass': .196966, 'n': 2.0, 'Debye_0': 500., 'grueneisen_0': 1.50, 'q_0': 1.1 } mgfeo.set_method('mgd3') # pulled from table 1 temperatures = np.array([ 300, 300, 483, 483, 483, 590, 593, 593, 593, 700, 600, 500, 650, 600, 600, 650, 700, 737, 727, 673, 600, 543, 565, 585, 600, 628, 654, 745, 768, 747, 726, 700, 676 ]) volumes = np.array([ 77.418, 72.327, 74.427, 73.655, 72.595, 74.1, 73.834, 73.101, 70.845, 73.024, 72.630, 68.644, 72.969, 72.324, 71.857, 72.128, 73.283, 73.337, 72.963, 71.969, 69.894, 67.430, 67.607, 67.737, 68.204, 68.518, 68.955, 70.777, 72.921, 72.476, 72.152, 71.858, 71.473 ]) # change from cubic angstroms per unit cell to cubic meters per mol of # molecules. volumes = volumes / 1.e30 * 6.022141e23 / 4.0 ref_pressures = np.array([ 0.0, 12.23, 7.77, 9.69, 12.54, 9.21, 9.90, 11.83, 18.35, 12.68, 13.15, 25.16, 12.53, 14.01, 15.34, 14.86, 11.99, 12.08, 13.03, 15.46, 21.44, 29.98, 29.41, 29.05, 27.36, 26.38, 24.97, 19.49, 13.39, 14.48, 15.27, 15.95, 16.94 ]) ref_pressures = ref_pressures pressures = np.empty_like(volumes) eos = mgd.MGD3() for i in range(len(temperatures)): pressures[i] = eos.pressure(temperatures[i], volumes[i], mgfeo.params) plt.scatter(temperatures, (pressures / 1.e9 - ref_pressures)) plt.ylim(-1, 1) plt.title("Comparing with Fei, Mao, Shu, and Hu (1991)") plt.xlabel("Temperature (K) at various volumes") plt.ylabel("Difference in total pressure (GPa)") plt.show()