Skip to content

Commit

Permalink
fix BM4, MT pressure calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed Nov 25, 2024
1 parent 4671699 commit aefe9bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions burnman/eos/birch_murnaghan_4th.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ def bulk_modulus_fourth(volume, params):


def volume_fourth_order(pressure, params):
func = lambda x: birch_murnaghan_fourth(params["V_0"] / x, params) - pressure

def delta_pressure(x):
return birch_murnaghan_fourth(params["V_0"] / x, params) - pressure

try:
sol = bracket(func, params["V_0"], 1.0e-2 * params["V_0"])
sol = bracket(delta_pressure, params["V_0"], 1.0e-2 * params["V_0"])
except:
raise ValueError(
"Cannot find a volume, perhaps you are outside of the range of validity for the equation of state?"
)
return opt.brentq(func, sol[0], sol[1])
return opt.brentq(delta_pressure, sol[0], sol[1])


def birch_murnaghan_fourth(x, params):
Expand Down Expand Up @@ -93,7 +96,7 @@ def volume(self, pressure, temperature, params):
return volume_fourth_order(pressure, params)

def pressure(self, temperature, volume, params):
return birch_murnaghan_fourth(volume / params["V_0"], params)
return birch_murnaghan_fourth(params["V_0"] / volume, params)

def isothermal_bulk_modulus_reuss(self, pressure, temperature, volume, params):
"""
Expand Down
2 changes: 1 addition & 1 deletion burnman/eos/modified_tait.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def pressure(self, temperature, volume, params):
"""
Returns pressure [Pa] as a function of temperature [K] and volume[m^3]
"""
return modified_tait(params["V_0"] / volume, params)
return modified_tait(volume / params["V_0"], params)

def isothermal_bulk_modulus_reuss(self, pressure, temperature, volume, params):
"""
Expand Down

0 comments on commit aefe9bc

Please sign in to comment.