Skip to content

Commit aefe9bc

Browse files
committed
fix BM4, MT pressure calcs
1 parent 4671699 commit aefe9bc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

burnman/eos/birch_murnaghan_4th.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ def bulk_modulus_fourth(volume, params):
4545

4646

4747
def volume_fourth_order(pressure, params):
48-
func = lambda x: birch_murnaghan_fourth(params["V_0"] / x, params) - pressure
48+
49+
def delta_pressure(x):
50+
return birch_murnaghan_fourth(params["V_0"] / x, params) - pressure
51+
4952
try:
50-
sol = bracket(func, params["V_0"], 1.0e-2 * params["V_0"])
53+
sol = bracket(delta_pressure, params["V_0"], 1.0e-2 * params["V_0"])
5154
except:
5255
raise ValueError(
5356
"Cannot find a volume, perhaps you are outside of the range of validity for the equation of state?"
5457
)
55-
return opt.brentq(func, sol[0], sol[1])
58+
return opt.brentq(delta_pressure, sol[0], sol[1])
5659

5760

5861
def birch_murnaghan_fourth(x, params):
@@ -93,7 +96,7 @@ def volume(self, pressure, temperature, params):
9396
return volume_fourth_order(pressure, params)
9497

9598
def pressure(self, temperature, volume, params):
96-
return birch_murnaghan_fourth(volume / params["V_0"], params)
99+
return birch_murnaghan_fourth(params["V_0"] / volume, params)
97100

98101
def isothermal_bulk_modulus_reuss(self, pressure, temperature, volume, params):
99102
"""

burnman/eos/modified_tait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def pressure(self, temperature, volume, params):
113113
"""
114114
Returns pressure [Pa] as a function of temperature [K] and volume[m^3]
115115
"""
116-
return modified_tait(params["V_0"] / volume, params)
116+
return modified_tait(volume / params["V_0"], params)
117117

118118
def isothermal_bulk_modulus_reuss(self, pressure, temperature, volume, params):
119119
"""

0 commit comments

Comments
 (0)