Skip to content

Commit

Permalink
Move mean opacity enum to its own header: mean_photon_types.hpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanWollaeger committed Jan 8, 2025
1 parent 2357ffb commit 08dfff7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
31 changes: 31 additions & 0 deletions singularity-opac/photons/mean_photon_types.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// ======================================================================
// © 2025. Triad National Security, LLC. All rights reserved. This
// program was produced under U.S. Government contract
// 89233218CNA000001 for Los Alamos National Laboratory (LANL), which
// is operated by Triad National Security, LLC for the U.S.
// Department of Energy/National Nuclear Security Administration. All
// rights in the program are reserved by Triad National Security, LLC,
// and the U.S. Department of Energy/National Nuclear Security
// Administration. The Government is granted for itself and others
// acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
// license in this material to reproduce, prepare derivative works,
// distribute copies to the public, perform publicly and display
// publicly, and to permit others to do so.
// ======================================================================

#ifndef SINGULARITY_OPAC_PHOTONS_MEAN_PHOTON_TYPES_
#define SINGULARITY_OPAC_PHOTONS_MEAN_PHOTON_TYPES_

namespace singularity {
namespace photons {

// mean-opacity mode
enum OpacityAveraging {
Rosseland = 0,
Planck = 1
};

} // namespace photons
} // namespace singularity

#endif // SINGULARITY_OPAC_PHOTONS_MEAN_PHOTON_TYPES_
7 changes: 1 addition & 6 deletions singularity-opac/photons/mean_photon_variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,14 @@
#include <ports-of-call/portability.hpp>
#include <singularity-opac/base/opac_error.hpp>
#include <singularity-opac/base/radiation_types.hpp>
#include <singularity-opac/photons/mean_photon_types.hpp>
#include <singularity-opac/photons/photon_variant.hpp>
#include <variant/include/mpark/variant.hpp>

namespace singularity {
namespace photons {
namespace impl {

// mean-opacity mode
enum OpacityAveraging {
Rosseland = 0,
Planck = 1
};

template <typename... Opacs>
class MeanVariant {
private:
Expand Down
5 changes: 3 additions & 2 deletions singularity-opac/photons/non_cgs_photons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <ports-of-call/portability.hpp>
#include <singularity-opac/base/opac_error.hpp>
#include <singularity-opac/photons/mean_photon_types.hpp>

namespace singularity {
namespace photons {
Expand Down Expand Up @@ -289,14 +290,14 @@ class MeanNonCGSUnits {

PORTABLE_INLINE_FUNCTION
Real AbsorptionCoefficient(const Real rho, const Real temp,
const int gmode = 0) const {
const int gmode = Rosseland) const {
const Real alpha = mean_opac_.AbsorptionCoefficient(rho, temp, gmode);
return alpha * length_unit_;
}

PORTABLE_INLINE_FUNCTION
Real Emissivity(const Real rho, const Real temp,
const int gmode = 0,
const int gmode = Rosseland,
Real *lambda = nullptr) const {
const Real J = mean_opac_.Emissivity(rho, temp, gmode);
return J * inv_emiss_unit_ * time_unit_;
Expand Down

0 comments on commit 08dfff7

Please sign in to comment.