# Released under GPL v2 or later. """ Generates a text table with mineral properties. """ import os, sys, numpy as np, matplotlib.pyplot as plt #hack to allow scripts to be placed in subdirectories next to burnman: if not os.path.exists('burnman') and os.path.exists('../burnman'): sys.path.insert(1,os.path.abspath('..')) import burnman from burnman import minerals from burnman import tools if __name__ == "__main__": phases = [minerals.stishovite(), \ minerals.periclase(), \ minerals.wustite(), \ minerals.ferropericlase(0), \ minerals.mg_fe_perovskite(0), \ minerals.mg_perovskite(), \ minerals.fe_perovskite(), \ minerals.Catalli_fe_perovskite("on"), \ minerals.Murakami_fe_perovskite(), \ minerals.Murakami_fe_periclase("on")] #minerals.Speziale_fe_periclase("on"), \ #mg_fe_perovskite_pt_dependent #ferropericlase_pt_dependent params = ['ref_V','ref_K','K_prime','ref_mu','mu_prime','molar_mass','n','ref_Debye','ref_grueneisen','q0','eta_0s']
amount_perovskite = 0.95 molar_abundances = [amount_perovskite, 1.0-amount_perovskite] #Example 3: input weight percentages #See comments in burnman/composition.py for references to partition coefficent calculation if False: weight_percents = {'Mg':0.213, 'Fe': 0.08, 'Si':0.27, 'Ca':0., 'Al':0.} phase_fractions,relative_molar_percent = burnman.calculate_phase_percents(weight_percents) iron_content = lambda p,t: burnman.calculate_partition_coefficient(p,t,relative_molar_percent) phases = [minerals.mg_fe_perovskite_pt_dependent(iron_content,0), \ minerals.ferropericlase_pt_dependent(iron_content,1)] molar_abundances = [phase_fractions['pv'],phase_fractions['fp']] #Example 4: three materials if False: phases = [minerals.Murakami_fe_perovskite(), minerals.ferropericlase(0.5), minerals.stishovite()] molar_abundances = [0.7, 0.2, 0.1] #seismic model for comparison: seismic_model = burnman.seismic.prem() # pick from .prem() .slow() .fast() (see burnman/seismic.py) number_of_points = 20 #set on how many depth slices the computations should be done # we will do our computation and comparison at the following depth values: depths = np.linspace(700, 2800, number_of_points) #alternatively, we could use the values where prem is defined: #depths = seismic_model.internal_depth_list() seis_p, seis_rho, seis_vp, seis_vs, seis_vphi = seismic_model.evaluate_all_at(depths) geotherm = burnman.geotherm.brown_shankland temperature = [geotherm(p) for p in seis_p]