[cig-commits] [commit] add_thermodynamic_potentials: Reproduce two of the curves from fig 3b (ea5b24c)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Dec 9 09:55:38 PST 2014


Repository : https://github.com/geodynamics/burnman

On branch  : add_thermodynamic_potentials
Link       : https://github.com/geodynamics/burnman/compare/2e5646d93cedbbf8eae54cc37cffc14e0aa85180...d5ddad03ff9f30f5a4efaddb4e3ec585ea1a7c51

>---------------------------------------------------------------

commit ea5b24c97a4a06b2ecc6b414b18b3a2abc55d6b0
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Tue Sep 2 19:18:22 2014 -0700

    Reproduce two of the curves from fig 3b


>---------------------------------------------------------------

ea5b24c97a4a06b2ecc6b414b18b3a2abc55d6b0
 solidsolution_benchmarks.py | 45 +++++++++++++++++++++++++++++++++------------
 1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/solidsolution_benchmarks.py b/solidsolution_benchmarks.py
index 5c7b921..62538e4 100644
--- a/solidsolution_benchmarks.py
+++ b/solidsolution_benchmarks.py
@@ -73,7 +73,7 @@ class mg_tschermaks_molecule (burnman.Mineral):
             'Gprime_0': 1.5 ,
             'eta_s_0': 2.5 }
 
-class orthopyroxene(burnman.SolidSolution):
+class orthopyroxene_a(burnman.SolidSolution):
     def __init__(self):
         # Name
         self.name='orthopyroxene'
@@ -86,25 +86,46 @@ class orthopyroxene(burnman.SolidSolution):
 
         burnman.SolidSolution.__init__(self, base_material, \
                           burnman.solutionmodel.SymmetricRegularSolution(base_material, enthalpy_interaction) )
+class orthopyroxene_b(burnman.SolidSolution):
+    def __init__(self):
+        # Name
+        self.name='orthopyroxene'
+
+        # Endmembers (cpx is symmetric)
+        base_material = [[enstatite(), '[Mg][Mg]Si2O6'],[mg_tschermaks_molecule(), '[Mg][Al]AlSiO6'] ]
 
-opx = orthopyroxene()
-opx.set_method('slb3')
+        # Interaction parameters
+        enthalpy_interaction=[[0.0]]
+
+        burnman.SolidSolution.__init__(self, base_material, \
+                          burnman.solutionmodel.SymmetricRegularSolution(base_material, enthalpy_interaction) )
+
+opx_a = orthopyroxene_a()
+opx_a.set_method('slb3')
+opx_b = orthopyroxene_b()
+opx_b.set_method('slb3')
 
 comp = np.linspace(0, 1.0, 100)
-entropy = np.empty_like(comp)
+entropy_a = np.empty_like(comp)
+entropy_b = np.empty_like(comp)
 
 for i,c in enumerate(comp):
-   opx.set_composition( np.array([1.0-c, c]) )
-   opx.set_state( 0.0, 0.0 )
-   entropy[i] = opx.solution_model.configurational_entropy( [1.0-c, c] )
+   opx_a.set_composition( np.array([1.0-c, c]) )
+   opx_a.set_state( 0.0, 0.0 )
+   entropy_a[i] = opx_a.solution_model.configurational_entropy( [1.0-c, c] )
 
+   opx_b.set_composition( np.array([1.0-c, c]) )
+   opx_b.set_state( 0.0, 0.0 )
+   entropy_b[i] = opx_b.solution_model.configurational_entropy( [1.0-c, c] )
 
-#fig1 = mpimg.imread('dicats.png')  # Uncomment these two lines if you want to overlay the plot on a screengrab from SLB2011
-#plt.imshow(fig1, extent=[0.0, 1.0,-2.,8.0], aspect='auto')
 
-plt.plot( comp, entropy/1000., 'b--', linewidth=3.)
-#plt.xlim(0.0,1.0)
-#plt.ylim(-2.,8.0)
+#fig1 = mpimg.imread('configurational_entropy.png')  # Uncomment these two lines if you want to overlay the plot on a screengrab from SLB2011
+#plt.imshow(fig1, extent=[0.0, 1.0,0.,17.0], aspect='auto')
+
+plt.plot( comp, entropy_a, 'b--', linewidth=3.)
+plt.plot( comp, entropy_b, 'r--', linewidth=3.)
+plt.xlim(0.0,1.0)
+plt.ylim(0.,17.0)
 plt.ylabel("Configurational enthalpy of solution")
 plt.xlabel("cats fraction")
 plt.show()



More information about the CIG-COMMITS mailing list