# Exercise 3: how much does the escaping gas expand? # Ideal gas: V = n R T / P, for the water vapour from 1 m3 of magma. R = 8.314 def vapour_volume(exsolved_wt, p_mpa, temp_c, rho=2500): kg_water = rho * exsolved_wt / 100 # per 1 m3 of magma moles = kg_water / 0.018 return moles * R * (temp_c + 273.15) / (p_mpa * 1e6) for p, ex in ((100, 0.0), (25, 2.0), (10, 2.74), (1, 3.6)): print(p, "MPa:", round(vapour_volume(ex, p, 900), 1), "m3 of vapour") # 100 MPa: 0.0 m3 of vapour # 25 MPa: 1.1 m3 of vapour # 10 MPa: 3.7 m3 of vapour # 1 MPa: 48.8 m3 of vapour # Near the surface 1 m3 of magma would be accompanied by about 49 m3 of # vapour: the gas takes up about 98% of the volume. That is why the mixture # is blown apart unless the gas can escape (runny magma) rather than being # trapped (sticky magma).