Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting Hydrogen inventory relative to mantle mass #292

Merged
merged 4 commits into from
Nov 26, 2024
Merged

Conversation

nichollsh
Copy link
Contributor

@nichollsh nichollsh commented Nov 26, 2024

Currently, the user can only set the hydrogen inventory in absolute terms (H_oceans). This becomes somewhat annoying when varying planet mass -- such as when comparing different planets in the same star system -- since it means that the relative amount of hydrogen is implicitly changing.

This PR makes it possible to set the hydrogen inventory in relative terms (H_ppmw) in the same way as we do with nitrogen and sulfur. This is then summed with the absolute amount, although I can imagine that the user will probably only set one of these parameters to be >0 at any one time.

…s is summed with absolute inventory, H_oceans
@nichollsh nichollsh marked this pull request as ready for review November 26, 2024 09:03
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 = 0.0 # Hydrogen inventory in units of equivalent Earth oceans
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So both settings are possible then? Does this also translate to the CALLIOPE repository itself?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so you need to make clear to set only one or the other somehow, via comments or if conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this makes both of them possible. In theory the user could use both at once, for whatever reason, but it probably makes sense for them to only set one of them to be >0 at any one time.

Could add a warning for this I suppose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't require any changes to CALLIOPE, because it converts the H_ppmw to an equivalent amount of H_oceans before the value is passed to CALLIOPE.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would setting both of them make sense? This gives two different H inventories, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current formulation sums them together, so the total hydrogen inventory is now:

H_total = H_oceans * ocean + H_ppmw * mantle.

This obviously reduces quite nicely if the user just sets one of the two parameters. And it allows them to set both (which will generate a warning) if they would want to do that too.

@@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[delivery.elements]
CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C content is then the only quantity that is set via different means than ppm. Change this as well? (Perhaps in a new PR).

In addition, I just realise it is not clear here whether this C/H ratio is by mass or by mole fraction. A comment would suffice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this means that C/H is the only quantity that cannot be specified in ppmw. We could probably make a new issue for this.

I'll fix the description.

@@ -15,14 +15,17 @@ class Elements:
CH_ratio: float
Volatile C/H nass ratio in combined mantle+atmosphere system.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Volatile C/H nass ratio in combined mantle+atmosphere system.
Volatile C/H mass ratio in combined mantle+atmosphere system.

Copy link
Collaborator

@timlichtenberg timlichtenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only a few clarifying statements in the comments needed. Additionally, the C/H setting could be reworked similarly.

@nichollsh
Copy link
Contributor Author

nichollsh commented Nov 26, 2024

Thanks Tim! I'll make these changes to the comments and add a warning for when both H_oceans and H_ppmw are >0.

@nichollsh nichollsh merged commit 5a273dd into main Nov 26, 2024
5 checks passed
@nichollsh nichollsh deleted the hn/hppm branch November 26, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants