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 scalar floor and refactor temperature and density floors #363

Merged
merged 59 commits into from
Feb 1, 2024

Conversation

helenarichie
Copy link
Collaborator

@helenarichie helenarichie commented Jan 13, 2024

In summary, this PR:

  • Adds the ability to apply a floor to any scalar in the conserved array in Apply_Scalar_Floor.
    • The particular scalar the floor is applied to is specified using the field_num argument of Apply_Scalar_Floor, and should be specified with its grid_enum index.
  • Refactors the density, temperature, and scalar floor values to be set from the input parameter file.
    • Deletes the DENS_FLOOR and TEMP_FLOOR macros (the floors are instead stored in the Grid3D header as density_floor, temperature_floor, and scalar_floor).
  • Adds a unit test for Apply_Scalar_Floor.
  • Refactors where the scalar and temperature floor functions are called from based on Issue Move location of temperature floor #362.

helenarichie and others added 30 commits April 28, 2023 16:39
@helenarichie helenarichie changed the title Add scalar floor kernel and specify floors from parameter file Add scalar floor kernel, refactor temperature floor, and specify floors from parameter file Jan 24, 2024
@helenarichie helenarichie changed the title Add scalar floor kernel, refactor temperature floor, and specify floors from parameter file Add scalar floor kernel and refactor temperature and density floors Jan 24, 2024
@helenarichie helenarichie changed the title Add scalar floor kernel and refactor temperature and density floors Add scalar floor and refactor temperature and density floors Jan 24, 2024
@helenarichie helenarichie marked this pull request as ready for review January 24, 2024 01:05
#else
H.temperature_floor = 0.0;
H.scalar_floor = 0.0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

While I understand this logic for the density and temperature floors, I think it doesn't actually apply for the scalar floor, since scalars can have negative values (think for example about the transverse velocities in the Riemann problem). In practice, it shouldn't matter, since you don't call the floor function unless you are applying a floor, in which case the value should have been specified in the parameter file. But I think it might make more sense rather than setting a default value of 0 here to just have the code throw a warning if the floor macro is turned on but no input value is supplied.

bcaddy and others added 7 commits February 1, 2024 13:45
Updated the default hydro build to use the Van Leer (VL) and PLMC build
options. Also, updated the test data for those new builds
Updated template, basic_scalar, disk, dust, rot_proj, static_grav to
use PLMC and Van Leer integrator
Avoids issues with running clang-tidy in non-VL builds
Copy link
Collaborator

@evaneschneider evaneschneider left a comment

Choose a reason for hiding this comment

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

New parameter defaults should be set in global.h, and the code should give a warning if any floor is turned on but the input parameter isn't set.

@helenarichie
Copy link
Collaborator Author

New parameter defaults should be set in global.h, and the code should give a warning if any floor is turned on but the input parameter isn't set.

Addressed in 3e1c195

@evaneschneider evaneschneider merged commit 737d039 into cholla-hydro:dev Feb 1, 2024
10 checks passed
@helenarichie helenarichie deleted the dev-scalar-floor branch February 1, 2024 20:43
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.

3 participants