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

Modify evaluation of absorption coefficients #63

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

pdmullen
Copy link
Collaborator

This PR originally started much larger---actually changing all calls from AbsorptionCoefficient to SpecificAbsorptionOpacity. After some retrospection, a simple change of mindset got me on board with instead dealing with absorption coefficients. I'd like to discuss this via meeting.

After this realization, this PR shrunk to only changing out some calls to AbsorptionCoefficient to directly returning rho * kappa (where rho is the material density and kappa is the material specific absorption opacity), instead of arriving there via Kirchhoff's laws.

I kept the functions for *FromKirchhoff in this PR for photons, even though they are not used, as I think they do help guide readers of the code as to what things correspond to. Neutrinos also have calls to *FromKirchhoff (e.g., for the tophat absorption coefficient), but I did not edit these (was this the right move?).

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the cleanup! Yes let's discuss the larger picture changes together at some later date.

@@ -55,7 +55,7 @@ class TophatEmissivity {
Real AbsorptionCoefficient(const Real rho, const Real temp, const Real Ye,
const RadiationType type, const Real nu,
Real *lambda = nullptr) const {
return dist_.AbsorptionCoefficientFromKirkhoff(*this, rho, temp, Ye, type,
return dist_.AbsorptionCoefficientFromKirchhoff(*this, rho, temp, Ye, type,
Copy link
Collaborator

Choose a reason for hiding this comment

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

oops thank you for the spelling fix...

@@ -49,8 +49,7 @@ class GrayOpacity {
PORTABLE_INLINE_FUNCTION
Real AbsorptionCoefficient(const Real rho, const Real temp, const Real nu,
Real *lambda = nullptr) const {
return dist_.AbsorptionCoefficientFromKirkhoff(*this, rho, temp, nu,
lambda);
return rho * kappa_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@Yurlungur Yurlungur merged commit 6ccf891 into main Jan 17, 2025
1 check passed
@Yurlungur
Copy link
Collaborator

I kept the functions for *FromKirchhoff in this PR for photons, even though they are not used, as I think they do help guide readers of the code as to what things correspond to.

I agree with this choice

Neutrinos also have calls to *FromKirchhoff (e.g., for the tophat absorption coefficient), but I did not edit these (was this the right move?).

I think it's maybe worth editing those down the line but no need to change it here. 👍

@Yurlungur Yurlungur deleted the pdmullen/absorption_coef branch January 17, 2025 21:33
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