def check_birch_murnaghan(): """ Recreates Stixrude and Lithgow-Bertelloni (2005) Figure 1, bulk and shear modulus without thermal corrections """ plt.close() #make a test mineral test_mineral = burnman.material() test_mineral.params = { 'name': 'test', 'V_0': 6.844e-6, 'K_0': 259.0e9, 'Kprime_0': 4.0, 'G_0': 175.0e9, 'Gprime_0': 1.7, 'molar_mass': .0, 'n': 0., 'Debye_0': 0., 'grueneisen_0': 0., 'q_0': 0. } pressure = np.linspace(0., 140.e9, 100) volume = np.empty_like(pressure) bulk_modulus = np.empty_like(pressure) shear_modulus = np.empty_like(pressure) #calculate its static properties for i in range(len(pressure)): volume[i] = bm.volume(pressure[i], test_mineral.params) bulk_modulus[i] = bm.bulk_modulus(volume[i], test_mineral.params) shear_modulus[i] = bm.shear_modulus_third_order( volume[i], test_mineral.params ) #third order is used for the plot we are comparing against #compare with figure 1 plt.plot(pressure / 1.e9, bulk_modulus / 1.e9, pressure / 1.e9, shear_modulus / 1.e9) fig1 = mpimg.imread('input_figures/slb_fig1.png') plt.imshow(fig1, extent=[0, 140, 0, 800], aspect='auto') plt.plot(pressure / 1.e9, bulk_modulus / 1.e9, 'g+', pressure / 1.e9, shear_modulus / 1.e9, 'g+') plt.ylim(0, 800) plt.xlim(0, 140) plt.xlabel("Pressure (GPa)") plt.ylabel("Modulus (GPa)") plt.title( "Comparing with Figure 1 of Stixrude and Lithgow-Bertelloni (2005)") plt.show()
def shear_modulus(self, pressure, temperature, volume, params): """ Returns shear modulus [Pa] as a function of pressure [Pa], temperature [K], and volume [m^3]. EQ B11 """ if self.order==2: return bm.shear_modulus_second_order(volume,params) + \ self.__thermal_shear_modulus(temperature,volume, params) - \ self.__thermal_shear_modulus(300.,volume, params) # EQ B11 elif self.order==3: return bm.shear_modulus_third_order(volume,params) + \ self.__thermal_shear_modulus(temperature,volume, params) - \ self.__thermal_shear_modulus(300.,volume, params) # EQ B11 else: raise NotImplementedError("")
def shear_modulus(self, pressure, temperature, volume, params): """ Returns shear modulus at the pressure, temperature, and volume [Pa] """ debye_T = self.__debye_temperature(params["V_0"] / volume, params) eta_s = self.__isotropic_eta_s(params["V_0"] / volume, params) E_th = debye.thermal_energy(temperature, debye_T, params["n"]) E_th_ref = debye.thermal_energy(300.0, debye_T, params["n"]) if self.order == 2: return bm.shear_modulus_second_order(volume, params) - eta_s * (E_th - E_th_ref) / volume elif self.order == 3: return bm.shear_modulus_third_order(volume, params) - eta_s * (E_th - E_th_ref) / volume else: raise NotImplementedError("")
def check_birch_murnaghan(): """ Recreates Stixrude and Lithgow-Bertelloni (2005) Figure 1, bulk and shear modulus without thermal corrections """ plt.close() #make a test mineral test_mineral = burnman.material() test_mineral.params ={'name':'test', 'V_0': 6.844e-6, 'K_0': 259.0e9, 'Kprime_0': 4.0, 'G_0': 175.0e9, 'Gprime_0': 1.7, 'molar_mass': .0, 'n': 0., 'Debye_0': 0., 'grueneisen_0': 0., 'q_0': 0.} pressure = np.linspace(0., 140.e9, 100) volume = np.empty_like(pressure) bulk_modulus = np.empty_like(pressure) shear_modulus = np.empty_like(pressure) #calculate its static properties for i in range(len(pressure)): volume[i] = bm.volume(pressure[i], test_mineral.params) bulk_modulus[i] = bm.bulk_modulus(volume[i], test_mineral.params) shear_modulus[i] = bm.shear_modulus_third_order(volume[i], test_mineral.params) #third order is used for the plot we are comparing against #compare with figure 1 plt.plot(pressure/1.e9, bulk_modulus/1.e9, pressure/1.e9, shear_modulus/1.e9) fig1 = mpimg.imread('input_figures/slb_fig1.png') plt.imshow(fig1, extent=[0,140,0,800], aspect='auto') plt.plot(pressure/1.e9, bulk_modulus/1.e9, 'g+', pressure/1.e9, shear_modulus/1.e9, 'g+') plt.ylim(0,800) plt.xlim(0,140) plt.xlabel("Pressure (GPa)") plt.ylabel("Modulus (GPa)") plt.title("Comparing with Figure 1 of Stixrude and Lithgow-Bertelloni (2005)") plt.show()