[cig-commits] [commit] add_thermodynamic_potentials: Bugfix (b840571)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Dec 9 09:57:32 PST 2014


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

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

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

commit b840571fd1fc49ae285a5d726084171087092b54
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Fri Sep 26 22:30:16 2014 -0700

    Bugfix


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

b840571fd1fc49ae285a5d726084171087092b54
 burnman/equilibriumassemblage.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/burnman/equilibriumassemblage.py b/burnman/equilibriumassemblage.py
index b22c949..135e9b8 100644
--- a/burnman/equilibriumassemblage.py
+++ b/burnman/equilibriumassemblage.py
@@ -132,12 +132,11 @@ class EquilibriumAssemblage(burnman.Material):
 
                 n = len(phase.base_material)
                 frac = np.sum(species_vector[i:(i+n)])
-                molar_fractions = ( species_vector[i:(i+n)]/frac if frac > 0.0 else np.ones( n )/n )
-
+                molar_fractions = ( species_vector[i:(i+n)]/frac if (frac > 1.e-6)  else np.ones( n )/n )
                 phase.set_composition( molar_fractions )
                 phase.set_state( pressure, temperature )
 
-                tmp_gibbs += phase.gibbs
+                tmp_gibbs += phase.gibbs * (frac if frac > 1.e-6 else 0.0)
                 i+=n
                    
             elif isinstance(phase, burnman.Mineral):



More information about the CIG-COMMITS mailing list