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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Do not evaluate absorption coefficient via Kirkhoff
Patrick Mullen committed Jan 16, 2025
commit 64f970da8329e9e48eeef2d82e11a612a66debda
6 changes: 2 additions & 4 deletions singularity-opac/photons/gray_opacity_photons.hpp
Original file line number Diff line number Diff line change
@@ -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.

👍

}

template <typename FrequencyIndexer, typename DataIndexer>
@@ -67,8 +66,7 @@ class GrayOpacity {
Real AngleAveragedAbsorptionCoefficient(const Real rho, const Real temp,
const Real nu,
Real *lambda = nullptr) const {
return dist_.AngleAveragedAbsorptionCoefficientFromKirkhoff(
*this, rho, temp, nu, lambda);
return AbsorptionCoefficient(rho, temp, nu, lambda);
}

template <typename FrequencyIndexer, typename DataIndexer>
6 changes: 2 additions & 4 deletions singularity-opac/photons/powerlaw_opacity_photons.hpp
Original file line number Diff line number Diff line change
@@ -52,8 +52,7 @@ class PowerLawOpacity {
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 * (kappa0_ * std::pow(rho, rho_exp_) * std::pow(temp, temp_exp_));
}

template <typename FrequencyIndexer, typename DataIndexer>
@@ -70,8 +69,7 @@ class PowerLawOpacity {
Real AngleAveragedAbsorptionCoefficient(const Real rho, const Real temp,
const Real nu,
Real *lambda = nullptr) const {
return dist_.AngleAveragedAbsorptionCoefficientFromKirkhoff(
*this, rho, temp, nu, lambda);
return AbsorptionCoefficient(rho, temp, nu, lambda);
}

template <typename FrequencyIndexer, typename DataIndexer>