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

Refactor dual energy #418

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from

Conversation

mabruzzo
Copy link
Collaborator

This PR should be reviewed after #417 is merged


This PR essentially moves around the contents for some dual-energy routines so that we only need to maintain a single version of these function rather than 3 independent functions. Motivation for doing this is provided at the top of the new dual_energy.h file

mabruzzo and others added 24 commits July 22, 2024 13:36
In slightly more detail, we invoke `Average_Cell_All_Fields` to get the average values from the neighbors to overwrite the value in a crashed cell or (when the `AVERAGE_SLOW_CELLS` macro is defined).

  - We have already been excluding any neighboring cell from this average that had crashed.

  - The key inovation here is that we now exclude a neighboring cell that we would consider a slow cell (when the `AVERAGE_SLOW_CELLS` macro is defined).

To implement this, we pass around the SlowCellConditionCheck object, which implements methods to check whether a cell is considered slow or not. When the `AVERAGE_SLOW_CELLS` macro is defined, that method does the full check. When the macro isn't defined, the logic short-circuits and always returns that the cell isn't slow.
The dual-energy formalism now respects crashed cells in the function
call `Select_Internal_Energy_ND`
-> the function does not modify any cells where the cell "crashed"
-> while considering the neighboring values of the crashed cells, we
   ignore any neighbors that "crashed"
-> we also now explicitly pick advected internal energy over the
   internal energy computed from total energy in cases where the total
   energy is positive, but does not exceed kinetic energy.

This was all done in preparation for Averaging Crashed Cells after
It now operates after the dual-energy formalism.
Previously it always held 3 Real values. Now it holds values of an
arbitrary type.
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.

1 participant