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

Add cosmic rays to metal chemistry #1651

Merged
merged 12 commits into from
Sep 19, 2024
Merged

Conversation

psharda
Copy link
Collaborator

@psharda psharda commented Sep 17, 2024

We build on #1642 to add cosmic ray chemistry and heating to the metal chemistry network. Two new tests are added, which use cosmic rays and evolves networks at 1 and 1e-4 Solar metallicity.

@psharda psharda marked this pull request as ready for review September 17, 2024 22:30
@psharda
Copy link
Collaborator Author

psharda commented Sep 17, 2024

Right now, I have just added a new RHS file that includes cosmic rays. However, I could also just replace the current actual_rhs.H with this file, since setting the cosmic ray ionization rate to 0 reduces the new RHS to the existing one. But if a user does not want to include cosmic rays, using the new RHS file might take slightly longer to integrate the network (because of the added terms in the ydots and Eint_dot). So is it worth keeping two separate RHS files, or just using the new (more general) one?

@psharda
Copy link
Collaborator Author

psharda commented Sep 17, 2024

Right now, I have just added a new RHS file that includes cosmic rays. However, I could also just replace the current actual_rhs.H with this file, since setting the cosmic ray ionization rate to 0 reduces the new RHS to the existing one. But if a user does not want to include cosmic rays, using the new RHS file might take slightly longer to integrate the network (because of the added terms in the ydots and Eint_dot). So is it worth keeping two separate RHS files, or just using the new (more general) one?

The added time is negligible in one zone tests, but it might not be negiligble in Quokka at high densities and with several AMR levels.

@BenWibking
Copy link
Collaborator

You could make it a compile-time parameter, e.g. enable_cosmic_rays?

@psharda
Copy link
Collaborator Author

psharda commented Sep 18, 2024

Decided to just have one RHS for now, can come back to having multiple later if needed for Quokka.

@psharda psharda marked this pull request as draft September 18, 2024 10:13
@psharda
Copy link
Collaborator Author

psharda commented Sep 18, 2024

omukai2005_i
Attaching this plot for future reference. Solid curves are with cosmic rays included (for a fixed CR ionization rate of 3e-17 per s), dashed curves are without cosmic rays. As expected, cosmic ays heat the gas at low density, high metallicity, and cool the gas at low density, low metallicity.

@psharda psharda marked this pull request as ready for review September 18, 2024 10:52
Copy link
Collaborator

@BenWibking BenWibking 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 to me.

@zingale zingale merged commit 397d3d2 into AMReX-Astro:development Sep 19, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants