[cig-commits] [commit] add_gibbs_energy: Added P, T attributes and calcgibbs to solid solution class (cdc75d9)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Dec 11 17:12:37 PST 2014


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

On branch  : add_gibbs_energy
Link       : https://github.com/geodynamics/burnman/compare/0000000000000000000000000000000000000000...2148b324d3e8aa7b527f831eb397590942563008

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

commit cdc75d985b77f4bf1cd4691863000424b2efebeb
Author: Bob Myhill <myhill.bob at gmail.com>
Date:   Mon Sep 8 00:12:43 2014 +0100

    Added P,T attributes and calcgibbs to solid solution class


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

cdc75d985b77f4bf1cd4691863000424b2efebeb
 burnman/solidsolution.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/burnman/solidsolution.py b/burnman/solidsolution.py
index f24757d..0c0f19c 100644
--- a/burnman/solidsolution.py
+++ b/burnman/solidsolution.py
@@ -43,10 +43,10 @@ class SolidSolution(Mineral):
         self.molar_fraction = molar_fraction 
 
     def set_state(self, pressure, temperature):
-
+        self.pressure=pressure
+        self.temperature=temperature
         # Set the state of all the endmembers
         for i in range(self.n_endmembers):
-            self.base_material[i][0].method = self.method
             self.base_material[i][0].set_state(pressure, temperature)
 
         self.excess_gibbs = self.solution_model.excess_gibbs_free_energy( pressure, temperature, self.molar_fraction)
@@ -65,3 +65,7 @@ class SolidSolution(Mineral):
                self.params[prop] = self.base_materials[0].params[prop]
         Mineral.set_state(self, pressure, temperature)
         '''
+
+
+    def calcgibbs(self, pressure, temperature, molar_fractions): 
+        return sum([ self.base_material[i][0].calcgibbs(pressure, temperature) * molar_fractions[i] for i in range(self.n_endmembers) ]) + self.solution_model.excess_gibbs_free_energy( pressure, temperature, molar_fractions)



More information about the CIG-COMMITS mailing list