Skip to content

Commit

Permalink
Allow setting Hydrogen inventory relative to mantle mass, H_ppmw. Thi…
Browse files Browse the repository at this point in the history
…s is summed with absolute inventory, H_oceans
  • Loading branch information
nichollsh committed Nov 26, 2024
1 parent a194012 commit deff7c6
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 12 deletions.
7 changes: 4 additions & 3 deletions input/aragog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,10 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# Set initial volatile inventory by planetary element abundances
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt
H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass
S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mantle mass

# Set initial volatile inventory by partial pressures in atmosphere
[delivery.volatiles]
Expand Down
7 changes: 4 additions & 3 deletions input/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,10 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# Set initial volatile inventory by planetary element abundances
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt
H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass
S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mantle mass

# Set initial volatile inventory by partial pressures in atmosphere
[delivery.volatiles]
Expand Down
1 change: 1 addition & 0 deletions input/hd63433d.toml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt

Expand Down
1 change: 1 addition & 0 deletions input/k218b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 0.1 # C/H ratio in mantle/atmosphere system
H_oceans = 60.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt

Expand Down
1 change: 1 addition & 0 deletions input/l9859d.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt

Expand Down
1 change: 1 addition & 0 deletions input/trappist1c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt

Expand Down
11 changes: 7 additions & 4 deletions src/proteus/config/_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ class Elements:
CH_ratio: float
Volatile C/H nass ratio in combined mantle+atmosphere system.
H_oceans: float
Bulk hydrogen inventory in units of equivalent Earth oceans.
Absolute hydrogen inventory, units of equivalent Earth oceans.
H_ppmw: float
Relative hydrogen inventory, ppmw relative to mantle mass.
N_ppmw: float
Bulk nitrogen inventory in ppmw relative to mantle mass.
Relative nitrogen inventory, ppmw relative to mantle mass.
S_ppmw: float
Bulk sulfur inventory in ppmw relative to mantle mass.
Absolute sulfur inventory, ppmw relative to mantle mass.
"""
CH_ratio: float = field(validator=gt(0))
H_oceans: float = field(validator=gt(0))
H_oceans: float = field(validator=ge(0))
H_ppmw: float = field(validator=ge(0))
N_ppmw: float = field(validator=ge(0))
S_ppmw: float = field(validator=ge(0))

Expand Down
16 changes: 15 additions & 1 deletion src/proteus/outgas/calliope.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
get_target_from_params,
get_target_from_pressures,
)
from calliope.constants import ocean_moles, molar_mass

from proteus.utils.constants import element_list, vol_list
from proteus.utils.helper import UpdateStatusfile
Expand All @@ -35,8 +36,21 @@ def construct_options(dirs:dict, config:Config, hf_row:dict):
solvevol_inp["T_magma"] = hf_row["T_magma"]
solvevol_inp['fO2_shift_IW'] = config.outgas.fO2_shift_IW

# Sum hydrogen absolute and relative amounts...

# absolute part
# internally, calliope will convert this to mass in kg as:
# H_kg = H_oceans * number_ocean_moles * molar_mass['H2']
H_abs = float(config.delivery.elements.H_oceans)

# relative part
# H_kg = H_rel * 1e-6 * M_mantle
# then converted to units of earth oceans, and summed with absolute part
H_rel = config.delivery.elements.H_ppmw * 1e-6 * hf_row["M_mantle"]
H_rel /= ocean_moles * molar_mass['H2']

# Elemental inventory
solvevol_inp['hydrogen_earth_oceans'] = config.delivery.elements.H_oceans
solvevol_inp['hydrogen_earth_oceans'] = H_abs + H_rel
solvevol_inp['CH_ratio'] = config.delivery.elements.CH_ratio
solvevol_inp['nitrogen_ppmw'] = config.delivery.elements.N_ppmw
solvevol_inp['sulfur_ppmw'] = config.delivery.elements.S_ppmw
Expand Down
1 change: 0 additions & 1 deletion src/proteus/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
R_core_earth = 3485000.0 # m
M_core_earth = 1.94E24 # kg
mol = 6.02214076e+23 # mol definition
ocean_moles = 7.68894973907177e+22 # moles of H2 (or H2O) in one present-day Earth ocean

# Earth heat flux, globally averaged [W m-2]
# https://se.copernicus.org/articles/1/5/2010/
Expand Down
1 change: 1 addition & 0 deletions tests/integration/dummy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt

Expand Down
1 change: 1 addition & 0 deletions tests/integration/physical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass
H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass
N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass
S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt

Expand Down

0 comments on commit deff7c6

Please sign in to comment.