[cig-commits] [commit] master: Add volume to EOS arguments in entropy and enthalpy for the moment (7257c2d)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Dec 12 15:48:37 PST 2014


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

On branch  : master
Link       : https://github.com/geodynamics/burnman/compare/e7f78ff83a8092bc07fea4398232e73406e7cbbb...6111717707e0bd07c31d999c20c7a56db163ff48

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

commit 7257c2d380d1ff987142f2bb8312a9950d187162
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Fri Dec 12 13:33:06 2014 -0800

    Add volume to EOS arguments in entropy and enthalpy for the moment
    
    Unify equation of state interface
    
    Continue unifying


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

7257c2d380d1ff987142f2bb8312a9950d187162
 burnman/eos/cork.py              |  2 +-
 burnman/eos/equation_of_state.py |  8 ++++----
 burnman/eos/modified_tait.py     | 10 +++++-----
 burnman/eos/slb.py               | 21 +++++++++++++--------
 burnman/mineral.py               |  8 ++++----
 5 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/burnman/eos/cork.py b/burnman/eos/cork.py
index ce4e09c..3369cda 100644
--- a/burnman/eos/cork.py
+++ b/burnman/eos/cork.py
@@ -98,7 +98,7 @@ class CORK(eos.EquationOfState):
         """
         return 0.
 
-    def gibbs_free_energy(self,pressure,temperature,params):
+    def gibbs_free_energy(self,pressure,temperature,volume,params):
         """
         Returns the gibbs free energy [J/mol] as a function of pressure [Pa]
         and temperature [K].
diff --git a/burnman/eos/equation_of_state.py b/burnman/eos/equation_of_state.py
index 47e7fe2..dade9f4 100644
--- a/burnman/eos/equation_of_state.py
+++ b/burnman/eos/equation_of_state.py
@@ -246,7 +246,7 @@ class EquationOfState(object):
             return 300.0
 
 
-    def gibbs_free_energy( self, pressure, temperature, params ):
+    def gibbs_free_energy( self, pressure, temperature, volume, params ):
         """
         Parameters
         ----------
@@ -267,7 +267,7 @@ class EquationOfState(object):
         """
         raise NotImplementedError("")
 
-    def helmholtz_free_energy( self, temperature, volume, params ):
+    def helmholtz_free_energy( self, pressure, temperature, volume, params ):
         """
         Parameters
         ----------
@@ -286,14 +286,14 @@ class EquationOfState(object):
         """
         raise NotImplementedError("")
 
-    def entropy( self, pressure, temperature, params):
+    def entropy( self, pressure, temperature, volume, params):
         """
         Returns the entropy at the pressure and temperature of the mineral [J/K/mol]
         """
 
         raise NotImplementedError("")
 
-    def enthalpy( self, pressure, temperature, params ):
+    def enthalpy( self, pressure, temperature, volume, params ):
         """
         Parameters
         ----------
diff --git a/burnman/eos/modified_tait.py b/burnman/eos/modified_tait.py
index 5196a5d..f11687d 100644
--- a/burnman/eos/modified_tait.py
+++ b/burnman/eos/modified_tait.py
@@ -117,7 +117,7 @@ class MT(eos.EquationOfState):
         K_S = K_T*C_p/C_v
         return K_S
 
-    def gibbs_free_energy(self,pressure,temperature,params):
+    def gibbs_free_energy(self,pressure,temperature, volume, params):
         """
         Returns the gibbs free energy [J/mol] as a function of pressure [Pa]
         and temperature [K].
@@ -143,7 +143,7 @@ class MT(eos.EquationOfState):
         return params['H_0'] + self.__intCpdT(temperature, params) - temperature*(params['S_0'] + self.__intCpoverTdT(temperature, params)) + intVdP + Gdisord
 
 
-    def entropy(self,pressure,temperature,params):
+    def entropy(self,pressure,temperature, volume, params):
         """
         Returns the entropy [J/K/mol] as a function of pressure [Pa]
         and temperature [K].
@@ -167,13 +167,13 @@ class MT(eos.EquationOfState):
 
         return params['S_0'] + self.__intCpoverTdT(temperature, params) + dintVdpdx + Sdisord
 
-    def enthalpy(self, pressure, temperature, params):
+    def enthalpy(self, pressure, temperature, volume, params):
         """
         Returns the enthalpy [J/mol] as a function of pressure [Pa]
         and temperature [K].
         """
-        gibbs=self.gibbs_free_energy(pressure,temperature,params)
-        entropy=self.entropy(pressure,temperature,params)
+        gibbs=self.gibbs_free_energy(pressure,temperature,volume, params)
+        entropy=self.entropy(pressure,temperature,volume, params)
         
         # Add order-disorder terms if required
         if params.has_key('landau_Tc'): # For a phase transition described by Landau term
diff --git a/burnman/eos/slb.py b/burnman/eos/slb.py
index d52e872..46efbc8 100644
--- a/burnman/eos/slb.py
+++ b/burnman/eos/slb.py
@@ -206,29 +206,34 @@ class SLBBase(eos.EquationOfState):
         alpha = gr * C_v / K / volume
         return alpha
 
-    def gibbs_free_energy( self, pressure, temperature, params):
+    def gibbs_free_energy( self, pressure, temperature, volume, params):
         """
         Returns the Gibbs free energy at the pressure and temperature of the mineral [J/mol]
         """
         volume=self.volume(pressure, temperature, params)
-        G = self.helmholtz_free_energy( temperature, volume, params) + pressure * volume
+        G = self.helmholtz_free_energy( pressure, temperature, volume, params) + pressure * volume
         return G
 
-    def entropy( self, pressure, temperature, params):
+    def entropy( self, pressure, temperature, volume, params):
         """
         Returns the entropy at the pressure and temperature of the mineral [J/K/mol]
         """
+        volume=self.volume(pressure, temperature, params)
+        x = params['V_0'] / volume
+        f = 1./2. * (pow(x, 2./3.) - 1.)
+        Debye_T = self.__debye_temperature(params['V_0']/volume, params)
+        S = debye.entropy( temperature, Debye_T, params['n'] )
+        return S 
 
-        return float('nan')
-
-    def enthalpy( self, pressure, temperature, params):
+    def enthalpy( self, pressure, temperature, volume, params):
         """
         Returns the enthalpy at the pressure and temperature of the mineral [J/mol]
         """
         
-        return float('nan')
+        return self.helmholtz_free_energy( pressure, temperature, volume, params) + \
+               temperature * self.entropy( pressure, temperature, volume, params)
 
-    def helmholtz_free_energy( self, temperature, volume, params):
+    def helmholtz_free_energy( self, pressure, temperature, volume, params):
         """
         Returns the Helmholtz free energy at the pressure and temperature of the mineral [J/mol]
         """
diff --git a/burnman/mineral.py b/burnman/mineral.py
index aa0bb18..c401b68 100644
--- a/burnman/mineral.py
+++ b/burnman/mineral.py
@@ -115,19 +115,19 @@ class Mineral(Material):
         # Attempt to calculate the gibbs free energy and helmholtz free energy, but don't complain if the
         # equation of state does not calculate it, or if the mineral params do not have the requisite entries.
         try:
-            self.gibbs = self.method.gibbs_free_energy(self.pressure, self.temperature, self.params)
+            self.gibbs = self.method.gibbs_free_energy(self.pressure, self.temperature, self.V, self.params)
         except (KeyError, NotImplementedError):
             self.gibbs = float('nan')
         try:
-            self.helmholtz = self.method.helmholtz_free_energy(self.temperature, self.V, self.params)
+            self.helmholtz = self.method.helmholtz_free_energy(self.pressure, self.temperature, self.V, self.params)
         except (KeyError, NotImplementedError):
             self.helmholtz = float('nan')
         try:
-            self.S = self.method.entropy(self.pressure, self.temperature, self.params)
+            self.S = self.method.entropy(self.pressure, self.temperature, self.V, self.params)
         except (KeyError, NotImplementedError):
             self.S = float('nan')
         try:
-            self.H = self.method.enthalpy(self.pressure, self.temperature, self.params)
+            self.H = self.method.enthalpy(self.pressure, self.temperature, self.V, self.params)
         except (KeyError, NotImplementedError):
             self.H = float('nan')
 



More information about the CIG-COMMITS mailing list