Skip to content

Commit

Permalink
WIP + compile time number of tracies for MOCMC
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroBarker committed Jan 17, 2025
1 parent bf398c4 commit 13a84dd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions cmake/Transport.cmake
Original file line number Diff line number Diff line change
@@ -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.")
2 changes: 2 additions & 0 deletions src/compile_constants.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
24 changes: 15 additions & 9 deletions src/radiation/radiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,26 @@ std::shared_ptr<StateDescriptor> 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<int>{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<int>{num_species, nu_bins});
physics->AddSwarmValue("Inuinv", swarm_name, Inu_swarmvalue_metadata);
std::vector<int>{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");
Expand Down

0 comments on commit 13a84dd

Please sign in to comment.