[cig-commits] [commit] add_thermodynamic_potentials: Add pressure to the various EOSs that need it (aff4977)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Dec 9 09:54:46 PST 2014


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

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

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

commit aff4977dbb4831f09427307c47cd34346fdca725
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Mon Sep 1 17:15:34 2014 -0700

    Add pressure to the various EOSs that need it


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

aff4977dbb4831f09427307c47cd34346fdca725
 burnman/birch_murnaghan.py      |  3 +++
 burnman/equation_of_state.py    | 18 ++++++++++++++++++
 burnman/material.py             | 19 -------------------
 burnman/mie_grueneisen_debye.py |  6 ++++++
 burnman/slb.py                  | 15 +++++++++++++++
 5 files changed, 42 insertions(+), 19 deletions(-)

diff --git a/burnman/birch_murnaghan.py b/burnman/birch_murnaghan.py
index 29789ce..8c366a4 100644
--- a/burnman/birch_murnaghan.py
+++ b/burnman/birch_murnaghan.py
@@ -80,6 +80,9 @@ class BirchMurnaghanBase(eos.EquationOfState):
     def volume(self,pressure, temperature, params):
         return volume(pressure,params)
 
+    def pressure(self, temperature, volume, params):
+        return birch_murnaghan(params['V_0']/volume, params)
+
     def isothermal_bulk_modulus(self,pressure,temperature, volume, params):
         return bulk_modulus(volume, params)
 
diff --git a/burnman/equation_of_state.py b/burnman/equation_of_state.py
index 7d2c38c..cfde27d 100644
--- a/burnman/equation_of_state.py
+++ b/burnman/equation_of_state.py
@@ -40,6 +40,24 @@ class EquationOfState:
         """
         raise NotImplementedError("")
 
+    def pressure(self, temperature, volume, params):
+        """
+        Parameters
+        ----------
+        volume : float
+            Molar volume at which to evaluate the equation of state. [m^3]
+        temperature : float
+            Temperature at which to evaluate the equation of state. [K]
+        params : dictionary
+            Dictionary containing material parameters required by the equation of state.
+
+        Returns
+        -------
+        pressure : float
+            Pressure of the mineral, including cold and thermal parts. [m^3]
+        """
+        raise NotImplementedError("")
+
     def density(self, pressure, temperature, params):
         """
         Calculate the density of the mineral.  
diff --git a/burnman/material.py b/burnman/material.py
index 97f6078..dd4391d 100644
--- a/burnman/material.py
+++ b/burnman/material.py
@@ -116,22 +116,3 @@ class Material:
         """
         raise NotImplementedError("need to implement density() in derived class!")
         return None
-
-    def eos_pressure(self, temperature, volume):
-        """
-        Returns the pressure of this material given temperature and volume as input parameters. The return value of this function does not depend on the current
-        state (temperature, pressure).
-
-        Notes
-        -----
-        Needs to be implemented in derived classes.
-
-        Returns
-        -------
-        eos_pressure : float
-            The pressure experienced by this material in Pa
-
-        """
-        raise NotImplementedError("need to implement eos_pressure() in derived class!")
-        return None
-
diff --git a/burnman/mie_grueneisen_debye.py b/burnman/mie_grueneisen_debye.py
index 9b3a1e5..c4e2e74 100644
--- a/burnman/mie_grueneisen_debye.py
+++ b/burnman/mie_grueneisen_debye.py
@@ -39,6 +39,12 @@ class MGDBase(eos.EquationOfState):
         V = opt.brentq(func, 0.5*params['V_0'], 1.5*params['V_0'])
         return V
 
+    def pressure(self, temperature, volume, params):
+        P = bm.birch_murnaghan(params['V_0']/volume, params) + \
+            self.__thermal_pressure(temperature, volume, params) - \
+            self.__thermal_pressure(300., volume, params)
+        return P
+
     def isothermal_bulk_modulus(self, pressure,temperature,volume, params):
         """
         Returns isothermal bulk modulus [Pa] as a function of pressure [Pa],
diff --git a/burnman/slb.py b/burnman/slb.py
index 6eb9f74..ec45f6f 100644
--- a/burnman/slb.py
+++ b/burnman/slb.py
@@ -99,7 +99,22 @@ class SLBBase(eos.EquationOfState):
                 warnings.warn("May be outside the range of validity for EOS")
                 return sol[0]
 
+    def pressure( self, temperature, volume, params):
+        """
+        Returns the pressure of the mineral at a given temperature and volume [Pa]
+        """
+        debye_T = self.__debye_temperature(params['V_0']/volume, params)
+        gr = self.grueneisen_parameter(0.0, temperature, volume, params) #does not depend on pressure
+        E_th = debye.thermal_energy(temperature, debye_T, params['n'])
+        E_th_ref = debye.thermal_energy(300., debye_T, params['n']) #thermal energy at reference temperature
+
+        b_iikk= 9.*params['K_0'] # EQ 28
+        b_iikkmm= 27.*params['K_0']*(params['Kprime_0']-4.) # EQ 29
+        f = 0.5*(pow(params['V_0']/volume,2./3.)-1.) # EQ 24
+        P = (1./3.)*(pow(1.+2.*f,5./2.))*((b_iikk*f) \
+            +(0.5*b_iikkmm*pow(f,2.))) + gr*(E_th - E_th_ref)/volume #EQ 21
 
+        return P
 
     def grueneisen_parameter(self, pressure, temperature, volume, params):
         """



More information about the CIG-COMMITS mailing list