from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import burnman import warnings if __name__ == '__main__': # FIRST: we must define the composition of the planet as individual layers. # A layer is defined by 4 parameters: Name, min_depth, max_depth,and number of slices within the layer. # Separately the composition and the temperature_mode need to set. radius_planet = 6371.e3 # inner_core inner_core = burnman.Layer('inner core', radii=np.linspace(0, 1220.e3, 10)) inner_core.set_material(burnman.minerals.other.Fe_Dewaele()) # The minerals that make up our core do not currently implement the thermal equation of state, so we will set the temperature at 300 K. inner_core.set_temperature_mode('user-defined', 300. * np.ones_like(inner_core.radii)) # outer_core outer_core = burnman.Layer('outer core', radii=np.linspace(1220.e3, 3480.e3, 10)) outer_core.set_material(burnman.minerals.other.Liquid_Fe_Anderson()) # The minerals that make up our core do not currently implement the thermal equation of state, so we will define the temperature at 300 K. outer_core.set_temperature_mode('user-defined', 300. * np.ones_like(outer_core.radii)) # Next the Mantle.
if example_layer: modelname = 'perovskitic_mantle' # This is the first actual work done in this example. We define # composite object and name it "rock". mg_fe_perovskite = minerals.SLB_2011.mg_fe_perovskite() mg_fe_perovskite.set_composition( [0.9, 0.1, 0]) # frac_mg, frac_fe, frac_al rock = burnman.Composite([mg_fe_perovskite], [1.]) # We create an array of 20 depths at which we want to evaluate the # layer at depths = np.linspace(2890e3, 670e3, 20) # Here we define the lower mantle as a Layer(). The layer needs various # parameters to set a depth array and radius array. lower_mantle = burnman.Layer( name='Perovskitic Lower Mantle', radii=6371.e3 - depths) # Here we set the composition of the layer as the above defined 'rock'. lower_mantle.set_material(rock) # Now we set the temperature mode of the layer. # Here we use an adiabatic temperature and set the temperature at the # top of the layer lower_mantle.set_temperature_mode( temperature_mode='adiabatic', temperature_top=1900.) # And we set a self-consistent pressure. The pressure at the top of the layer and # gravity at the bottom of the layer are given by the PREM. pressure, gravity = burnman.seismic.PREM().evaluate( ['pressure', 'gravity'], depths)
minerals.SLB_2011.periclase()], [0.8, 0.2]) # Here we create and load the PREM seismic velocity model, which will be # used for comparison with the seismic velocities of the "rock" composite seismic_model = burnman.seismic.PREM() # We create an array of 20 depths at which we want to evaluate PREM, and then # query the seismic model for the pressure, density, P wave speed, S wave # speed, and bulk sound velocity at those depths depths = np.linspace(2890e3, 670e3, 20) pressure, gravity, seis_rho, seis_vp, seis_vs, seis_bullen = seismic_model.evaluate( ['pressure', 'gravity', 'density', 'v_p', 'v_s', 'bullen'], depths) # Here we define the lower mantle as a Layer(). The layer needs various # parameters to set a depth array and radius array. lower_mantle = burnman.Layer(name='Lower Mantle', radii=6371.e3 - depths) # Here we set the composition of the layer as the above defined 'rock'. lower_mantle.set_material(rock) # Now we set the temperature mode of the layer. # Here we use an adiabatic temperature and set the temperature at the top of the layer lower_mantle.set_temperature_mode(temperature_mode='adiabatic', temperature_top=1900.) #Alternatively, we choose a user-defined temperature, given by the Brown & Shankland geotherm #lower_mantle.set_temperature_mode(temperature_mode ='user_defined', # temperatures =burnman.geotherm.brown_shankland(depths)) # And we set a self-consistent pressure. The pressure at the top of the layer and # gravity at the bottom of the layer are given by the PREM. lower_mantle.set_pressure_mode(pressure_mode='self-consistent', pressure_top=pressure[-1],