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

Enforce checks and limits on mass scalars #378

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

psharda
Copy link
Contributor

@psharda psharda commented Sep 13, 2023

This PR will:

1.) Ensure we return an invalid State via isStateValid if the partial densities of any mass scalars are < 0.

2.) Ensure we enforce a partial density floor for mass scalars while doing hydro. We already do this while doing chemistry (via the small_x param in Microphysics)

@psharda psharda changed the title Enforce checks on mass scalars Enforce checks and limits on mass scalars Sep 13, 2023
@psharda psharda marked this pull request as ready for review September 13, 2023 15:10
@psharda
Copy link
Contributor Author

psharda commented Sep 13, 2023

@BenWibking , regarding point 2 above, this line seems to enforce positivity for all scalars when it enforces the density floor:

state[bx](i, j, k, scalar0_index + n) *= rho / rho_new;

@BenWibking
Copy link
Collaborator

Yes but it only triggers when the total density is negative, not when only the mass scalars are negative.

@BenWibking
Copy link
Collaborator

/azp run

src/hydro_system.hpp Outdated Show resolved Hide resolved
@psharda
Copy link
Contributor Author

psharda commented Sep 13, 2023

/azp run

@BenWibking BenWibking added this pull request to the merge queue Sep 14, 2023
Merged via the queue into quokka-astro:development with commit a3fc85c Sep 14, 2023
8 checks passed
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