[newchem-cpp] Introduce the GrainSpeciesInfo type#428
Merged
brittonsmith merged 12 commits intoDec 17, 2025
Merged
Conversation
GrainSpeciesInfo typeGrainSpeciesInfo type
5 tasks
Collaborator
Author
|
@brittonsmith, conflicts are addressed |
…InfoEntry This information will only be used after we transcribe `calc_grain_size_increment_1d` (at which point we will remove the corresponding constants from phys_constants.h and can entirely delete the dust_const.def file
…e readability (and add some comments)
I moved them from initialize_dust_yields.cpp where the comments were out of place to dust/grain_species_info.cpp
This was referenced Dec 8, 2025
brittonsmith
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should be reviewed after #416 is merged
This introduces structures a bunch of GrainSpecies information that is used for computing sublimation, H2 formation rates, and grain growth rates into a standard format. The impetus for doing this was to finish cleaning up
lookup_cool_rate1dand replace all the logic where we explicitly list out the various kinds of grain species with much simpler (and more maintainable for-loops). The ultimate goal is to let us entirely delete theOnlyGrainSpeciesLUTenumeration (we won't be able to do that until we finish transcription).Originally, I was intended for this to be quick-and-dirty, but in the course of resolving a bug1 I ended up building out the infrastructure. Building out the logic made it easier to write some test-code. Plus I think we want all of this sooner or later.
Footnotes
The bug was related to the order of enumerators (i.e. the named constants of an enumeration) within the
OnlyGrainSpeciesLUTenumeration (the order didn't match the species order of enumerators inSpeciesLUT). This PR fixed the bug & adds a unit-test to ensure this isn't violated the future. ↩