diff --git a/CMakeLists.txt b/CMakeLists.txt index 4700cfd1f..bb8d5daca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,6 +185,9 @@ include(cmake/Geometry.cmake) # Fluid include(cmake/Fluid.cmake) +# Transport +include(cmake/Transport.cmake) + # Phoebus src message("\nConfiguring src") add_subdirectory(src) diff --git a/cmake/Transport.cmake b/cmake/Transport.cmake new file mode 100644 index 000000000..6e97fb6e5 --- /dev/null +++ b/cmake/Transport.cmake @@ -0,0 +1,13 @@ +# © 2021-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. + +set(MOCMC_NUM_SPECIES 3 CACHE INTEGER "Number of radiation species for MOCMC.") diff --git a/src/compile_constants.hpp.in b/src/compile_constants.hpp.in index 4fdf0db20..44c69c8a7 100644 --- a/src/compile_constants.hpp.in +++ b/src/compile_constants.hpp.in @@ -16,6 +16,8 @@ #define NCONS_MAX (@MAX_NUMBER_CONSERVED_VARS@) +#define MOCMC_NUM_SPECIES (@MOCMC_NUM_SPECIES@) + #define PHOEBUS_GEOMETRY Geometry::@PHOEBUS_GEOMETRY@ #define GEOMETRY_MESH @GEOMETRY_MESH@ #define GEOMETRY_MESH_BLOCK @GEOMETRY_MESH_BLOCK@ diff --git a/src/radiation/radiation.cpp b/src/radiation/radiation.cpp index cb0cb633e..0ca6f58cb 100644 --- a/src/radiation/radiation.cpp +++ b/src/radiation/radiation.cpp @@ -144,20 +144,26 @@ std::shared_ptr Initialize(ParameterInput *pin) { } if (method == "mocmc") { - std::string swarm_name = "mocmc"; + static constexpr auto swarm_name = "mocmc"; Metadata swarm_metadata({Metadata::Provides}); physics->AddSwarm(swarm_name, swarm_metadata); Metadata real_swarmvalue_metadata({Metadata::Real}); - physics->AddSwarmValue("t", swarm_name, real_swarmvalue_metadata); - physics->AddSwarmValue("mu_lo", swarm_name, real_swarmvalue_metadata); - physics->AddSwarmValue("mu_hi", swarm_name, real_swarmvalue_metadata); - physics->AddSwarmValue("phi_lo", swarm_name, real_swarmvalue_metadata); - physics->AddSwarmValue("phi_hi", swarm_name, real_swarmvalue_metadata); + physics->AddSwarmValue(mocmc_core::t::name(), swarm_name, real_swarmvalue_metadata); + physics->AddSwarmValue(mocmc_core::mu_lo::name(), swarm_name, + real_swarmvalue_metadata); + physics->AddSwarmValue(mocmc_core::mu_hi::name(), swarm_name, + real_swarmvalue_metadata); + physics->AddSwarmValue(mocmc_core::phi_lo::name(), swarm_name, + real_swarmvalue_metadata); + physics->AddSwarmValue(mocmc_core::phi_hi::name(), swarm_name, + real_swarmvalue_metadata); Metadata fourv_swarmvalue_metadata({Metadata::Real}, std::vector{4}); - physics->AddSwarmValue("ncov", swarm_name, fourv_swarmvalue_metadata); + physics->AddSwarmValue(mocmc_core::ncov::name(), swarm_name, + fourv_swarmvalue_metadata); Metadata Inu_swarmvalue_metadata({Metadata::Real}, - std::vector{num_species, nu_bins}); - physics->AddSwarmValue("Inuinv", swarm_name, Inu_swarmvalue_metadata); + std::vector{MOCMC_NUM_SPECIES, nu_bins}); + physics->AddSwarmValue(mocmc_core::Inuinv::name(), swarm_name, + Inu_swarmvalue_metadata); // Boundary temperatures for outflow sample boundary conditions const std::string ix1_bc = pin->GetOrAddString("phoebus", "ix1_bc", "None");