# Exercise 2: how much water is still dissolved as magma rises? import math K = 0.4 # wt% water per sqrt(MPa), rough value (check) RHO, G = 2500, 9.8 def pressure_mpa(depth_km): return RHO * G * depth_km * 1000 / 1e6 def solubility(p_mpa): return K * math.sqrt(p_mpa) for depth in (8, 4, 1, 0.1, 0): p = max(pressure_mpa(depth), 0.1) print(f"{depth:4} km {p:6.1f} MPa holds {solubility(p):4.2f} wt%") # 8 km 196.0 MPa holds 5.60 wt% # 4 km 98.0 MPa holds 3.96 wt% # 1 km 24.5 MPa holds 1.98 wt% # 0.1 km 2.5 MPa holds 0.63 wt% # 0 km 0.1 MPa holds 0.13 wt% # Magma with 4 wt% water in total: total = 4.0 for p in (200, 100, 50, 25, 10, 1): dissolved = min(total, solubility(p)) print(f"{p:4d} MPa dissolved {dissolved:4.2f} exsolved {total - dissolved:4.2f} wt%") # 200 MPa dissolved 4.00 exsolved 0.00 wt% # 100 MPa dissolved 4.00 exsolved 0.00 wt% # 50 MPa dissolved 2.83 exsolved 1.17 wt% # 25 MPa dissolved 2.00 exsolved 2.00 wt% # 10 MPa dissolved 1.26 exsolved 2.74 wt% # 1 MPa dissolved 0.40 exsolved 3.60 wt% # Bubbles first appear at roughly 100 MPa (about 4 km deep): below that # pressure the water no longer all fits in solution.