[cig-commits] [commit] add_thermodynamic_potentials: Unify how R is imported (c1765ac)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Dec 9 10:23:00 PST 2014
Repository : https://github.com/geodynamics/burnman
On branch : add_thermodynamic_potentials
Link : https://github.com/geodynamics/burnman/compare/f9b95219360a9197b16a07248236bbdabe05485c...c1765acff2860859783948cff0ead7ae2841ec0a
>---------------------------------------------------------------
commit c1765acff2860859783948cff0ead7ae2841ec0a
Author: ian-r-rose <ian.r.rose at gmail.com>
Date: Tue Dec 9 10:16:21 2014 -0800
Unify how R is imported
>---------------------------------------------------------------
c1765acff2860859783948cff0ead7ae2841ec0a
burnman/cork.py | 3 +--
burnman/debye.py | 4 +---
burnman/einstein.py | 3 +--
burnman/mie_grueneisen_debye.py | 5 +++--
burnman/modified_tait.py | 3 +--
burnman/solidsolution.py | 3 +--
burnman/solutionmodel.py | 3 +--
7 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/burnman/cork.py b/burnman/cork.py
index 51eaa5d..8d29a13 100644
--- a/burnman/cork.py
+++ b/burnman/cork.py
@@ -9,11 +9,10 @@ import numpy as np
import scipy.optimize as opt
import burnman.equation_of_state as eos
-from burnman.constants import gas_constant
+from burnman.constants import R
T_0=298.15 # Standard temperature = 25 C
P_0=1.e5 # Standard pressure = 1.e5 Pa
-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/debye.py b/burnman/debye.py
index 6ca1350..e5e1b8c 100644
--- a/burnman/debye.py
+++ b/burnman/debye.py
@@ -5,7 +5,7 @@
import numpy as np
import scipy.integrate as integrate
from numpy.polynomial.chebyshev import Chebyshev
-from burnman.constants import gas_constant
+from burnman.constants import R
"""
Functions for the Debye model. Note that this is not Mie-Grueneisen-Debye,
@@ -13,8 +13,6 @@ just Debye, so is pretty limited. Combine this with Mie-Grueneisen and
Birch-Murnaghan to get a full EOS
"""
-R = gas_constant
-
def debye_fn(x):
diff --git a/burnman/einstein.py b/burnman/einstein.py
index 59045df..edc8dc1 100644
--- a/burnman/einstein.py
+++ b/burnman/einstein.py
@@ -3,13 +3,12 @@
# Released under GPL v2 or later.
import numpy as np
-from burnman.constants import gas_constant
+from burnman.constants import R
"""
Functions for the Einstein model of a solid.
"""
-R = gas_constant
def thermal_energy(T, einstein_T, n):
"""
diff --git a/burnman/mie_grueneisen_debye.py b/burnman/mie_grueneisen_debye.py
index c4e2e74..e0a485a 100644
--- a/burnman/mie_grueneisen_debye.py
+++ b/burnman/mie_grueneisen_debye.py
@@ -8,6 +8,7 @@ import scipy.optimize as opt
import burnman.equation_of_state as eos
import burnman.birch_murnaghan as bm
import burnman.debye as debye
+from burnman.constants import R
class MGDBase(eos.EquationOfState):
@@ -127,7 +128,7 @@ class MGDBase(eos.EquationOfState):
gr = self.__grueneisen_parameter(params['V_0']/V, params)
Debye_T = self.__debye_temperature(params['V_0']/V, params)
G_th= 3./5. * ( self.__thermal_bulk_modulus(T,V,params) - \
- 6*debye.R*T*params['n']/V * gr * debye.debye_fn(Debye_T/T) ) # EQ B10
+ 6*R*T*params['n']/V * gr * debye.debye_fn(Debye_T/T) ) # EQ B10
return G_th
#compute the Debye temperature in K. Takes the
@@ -158,7 +159,7 @@ class MGDBase(eos.EquationOfState):
def __thermal_bulk_modulus(self, T,V,params):
gr = self.__grueneisen_parameter(params['V_0']/V, params)
Debye_T = self.__debye_temperature(params['V_0']/V, params)
- K_th = 3.*params['n']*debye.R*T/V * gr * \
+ K_th = 3.*params['n']*R*T/V * gr * \
((1. - params['q_0'] - 3.*gr)*debye.debye_fn(Debye_T/T)+3.*gr*(Debye_T/T)/(np.exp(Debye_T/T) - 1.)) # EQ B5
return K_th
diff --git a/burnman/modified_tait.py b/burnman/modified_tait.py
index 985b597..aae91a0 100644
--- a/burnman/modified_tait.py
+++ b/burnman/modified_tait.py
@@ -10,11 +10,10 @@ import scipy.optimize as opt
import burnman.equation_of_state as eos
import burnman.einstein as einstein
-from burnman.constants import gas_constant
+from burnman.constants import R
T_0=298.15 # Standard temperature = 25 C
P_0=1.e5 # Standard pressure = 1.e5 Pa
-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 4f852e7..e03676c 100644
--- a/burnman/solidsolution.py
+++ b/burnman/solidsolution.py
@@ -6,10 +6,9 @@ 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
+from burnman.constants import R
import warnings
-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 f13ff1f..ad97188 100644
--- a/burnman/solutionmodel.py
+++ b/burnman/solutionmodel.py
@@ -6,9 +6,8 @@ import numpy as np
import warnings
import burnman
from burnman.processchemistry import *
-from burnman.constants import gas_constant
+from burnman.constants import R
-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