[cig-commits] [commit] add_thermodynamic_potentials: Use burnman.constants (d615573)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Dec 9 10:08:40 PST 2014


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

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

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

commit d615573d0c849392955acc74130c13b6109784e2
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Tue Dec 9 10:07:16 2014 -0800

    Use burnman.constants


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

d615573d0c849392955acc74130c13b6109784e2
 burnman/chemicalpotentials.py | 4 +++-
 burnman/cork.py               | 3 ++-
 burnman/einstein.py           | 3 ++-
 burnman/modified_tait.py      | 3 ++-
 burnman/solidsolution.py      | 3 ++-
 burnman/solutionmodel.py      | 3 ++-
 6 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/burnman/chemicalpotentials.py b/burnman/chemicalpotentials.py
index fb57d96..b4d089e 100644
--- a/burnman/chemicalpotentials.py
+++ b/burnman/chemicalpotentials.py
@@ -7,8 +7,10 @@ from burnman import minerals
 from processchemistry import *
 import numpy as np
 from scipy.linalg import lu
+from burnman.constants import gas_constant
+
+R=gas_constant
 
-R=8.3145
 # This module computes chemical potentials (partial molar gibbs free energies) for an assemblage based on the Gibbs free energies and compositions of the individual phases.
 
 # It can also calculate fugacities based on the gibbs free energies of the endmembers corresponding to chemical components.
diff --git a/burnman/cork.py b/burnman/cork.py
index fde85ec..51eaa5d 100644
--- a/burnman/cork.py
+++ b/burnman/cork.py
@@ -9,10 +9,11 @@ import numpy as np
 import scipy.optimize as opt
 
 import burnman.equation_of_state as eos
+from burnman.constants import gas_constant
 
 T_0=298.15 # Standard temperature = 25 C
 P_0=1.e5 # Standard pressure = 1.e5 Pa
-R=8.31446 # J/K/mol
+R=gas_constant # J/K/mol
 
 def cork_variables(cork, cork_P, cork_T, temperature):
     a=cork[0][0]*cork_T**(2.5)/cork_P + cork[0][1]*cork_T**(1.5)/cork_P*temperature
diff --git a/burnman/einstein.py b/burnman/einstein.py
index a96b29d..59045df 100644
--- a/burnman/einstein.py
+++ b/burnman/einstein.py
@@ -3,12 +3,13 @@
 # Released under GPL v2 or later.
 
 import numpy as np
+from burnman.constants import gas_constant
 
 """
 Functions for the Einstein model of a solid.
 """
 
-R = 8.314462175
+R = gas_constant
 
 def thermal_energy(T, einstein_T, n):
     """
diff --git a/burnman/modified_tait.py b/burnman/modified_tait.py
index 499f7f2..985b597 100644
--- a/burnman/modified_tait.py
+++ b/burnman/modified_tait.py
@@ -10,10 +10,11 @@ import scipy.optimize as opt
 
 import burnman.equation_of_state as eos
 import burnman.einstein as einstein
+from burnman.constants import gas_constant
 
 T_0=298.15 # Standard temperature = 25 C
 P_0=1.e5 # Standard pressure = 1.e5 Pa
-R=8.31446 # J/K/mol
+R=gas_constant # J/K/mol
 
 # see Holland and Powell, 2011
 def einstein_temperature(S, n):
diff --git a/burnman/solidsolution.py b/burnman/solidsolution.py
index 5508b06..4f852e7 100644
--- a/burnman/solidsolution.py
+++ b/burnman/solidsolution.py
@@ -6,9 +6,10 @@ import numpy as np
 from burnman.mineral import Mineral
 from burnman.processchemistry import ProcessSolidSolutionChemistry
 from burnman.solutionmodel import SolutionModel
+from burnman.constants import gas_constant
 import warnings
 
-R = 8.3145 # J/K/mol
+R = gas_constant # J/K/mol
 kd = lambda x,y : 1 if x==y else 0
 
 class SolidSolution(Mineral):
diff --git a/burnman/solutionmodel.py b/burnman/solutionmodel.py
index 465eb34..f13ff1f 100644
--- a/burnman/solutionmodel.py
+++ b/burnman/solutionmodel.py
@@ -6,8 +6,9 @@ import numpy as np
 import warnings
 import burnman
 from burnman.processchemistry import *
+from burnman.constants import gas_constant
 
-R = 8.31446 # J/K/mol
+R = gas_constant # J/K/mol
 kd = lambda x,y : 1 if x==y else 0
 class SolutionModel:
     """



More information about the CIG-COMMITS mailing list