[cig-commits] [commit] master: SolidSolution asked for excess_enthalpy and excess_entropy, which are not always defined. Make dummy functions in the base class that returns zero. (c1259b3)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Dec 31 15:34:45 PST 2014


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

On branch  : master
Link       : https://github.com/geodynamics/burnman/compare/911aa89d9079e32f4cee0d042a9ab7ec493c74c1...b1584d2363e96870d7fa5f75e71b16d436be6c38

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

commit c1259b3bd586bd5e44e9d0c76c2ad23e8e3ba54a
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Wed Dec 31 15:27:54 2014 -0800

    SolidSolution asked for excess_enthalpy and excess_entropy, which are not always defined.  Make dummy functions in the base class that returns zero.


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

c1259b3bd586bd5e44e9d0c76c2ad23e8e3ba54a
 burnman/solutionmodel.py | 60 +++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/burnman/solutionmodel.py b/burnman/solutionmodel.py
index 30d4d5f..896d55f 100644
--- a/burnman/solutionmodel.py
+++ b/burnman/solutionmodel.py
@@ -20,11 +20,11 @@ class SolutionModel(object):
     in defining solid solutions and performing thermodynamic calculations
     on them.
 
-    A user wanting a new solution model should define the functions for
-    excess_gibbs_free_energy and excess_volume.  In the base class these
-    return zero, so if this class is used then the Gibbs free energy and molar
-    volume of a solution are just the weighted arithmetic averages of the
-    different endmember values.
+    A user wanting a new solution model should define the functions below.
+    In the base class all of these return zero, so if the solution model 
+    does not implement them, they essentially have no effect, and 
+    then the Gibbs free energy and molar volume of a solid solution are 
+    just the weighted arithmetic averages of the different endmember values.
     """
 
     def __init__(self):
@@ -86,7 +86,7 @@ class SolutionModel(object):
     def excess_volume( self, pressure, temperature, molar_fraction):
         """
         Given a list of molar fractions of different phases,
-        compute the excess Gibbs free energy of the solution,
+        compute the excess volume of the solution.
         The base class implementation assumes that the excess volume is zero.
 
         Parameters
@@ -107,6 +107,54 @@ class SolutionModel(object):
         """
         return 0.0
 
+    def excess_enthalpy( self, pressure, temperature, molar_fraction):
+        """
+        Given a list of molar fractions of different phases,
+        compute the excess enthalpy of the solution.
+        The base class implementation assumes that the excess enthalpy is zero.
+
+        Parameters
+        ----------
+        pressure : float
+            Pressure at which to evaluate the solution model. [Pa]
+
+        temperature : float
+            Temperature at which to evaluate the solution. [K]
+
+        molar_fraction : list of floats
+            List of molar fractions of the different endmembers in solution
+
+        Returns
+        -------
+        H_excess : float
+            The excess enthalpy of the solution
+        """
+        return 0.0
+
+    def excess_entropy( self, pressure, temperature, molar_fraction):
+        """
+        Given a list of molar fractions of different phases,
+        compute the excess entropy of the solution.
+        The base class implementation assumes that the excess entropy is zero.
+
+        Parameters
+        ----------
+        pressure : float
+            Pressure at which to evaluate the solution model. [Pa]
+
+        temperature : float
+            Temperature at which to evaluate the solution. [K]
+
+        molar_fraction : list of floats
+            List of molar fractions of the different endmembers in solution
+
+        Returns
+        -------
+        S_excess : float
+            The excess entropy of the solution
+        """
+        return 0.0
+
 
 class IdealSolution (SolutionModel):
     """



More information about the CIG-COMMITS mailing list