mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Storing surface source points using a cell ID (#2888)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
84f561c1ed
commit
ddc9526966
120 changed files with 3963 additions and 86 deletions
|
|
@ -119,6 +119,8 @@ std::unordered_set<int> sourcepoint_batch;
|
|||
std::unordered_set<int> statepoint_batch;
|
||||
std::unordered_set<int> source_write_surf_id;
|
||||
int64_t max_surface_particles;
|
||||
int64_t ssw_cell_id {C_NONE};
|
||||
SSWCellType ssw_cell_type {SSWCellType::None};
|
||||
TemperatureMethod temperature_method {TemperatureMethod::NEAREST};
|
||||
double temperature_tolerance {10.0};
|
||||
double temperature_default {293.6};
|
||||
|
|
@ -747,7 +749,9 @@ void read_settings_xml(pugi::xml_node root)
|
|||
// Get surface source write node
|
||||
xml_node node_ssw = root.child("surf_source_write");
|
||||
|
||||
// Determine surface ids at which crossing particles are to be banked
|
||||
// Determine surface ids at which crossing particles are to be banked.
|
||||
// If no surfaces are specified, all surfaces in the model will be used
|
||||
// to bank source points.
|
||||
if (check_for_node(node_ssw, "surface_ids")) {
|
||||
auto temp = get_node_array<int>(node_ssw, "surface_ids");
|
||||
for (const auto& b : temp) {
|
||||
|
|
@ -759,7 +763,12 @@ void read_settings_xml(pugi::xml_node root)
|
|||
if (check_for_node(node_ssw, "max_particles")) {
|
||||
max_surface_particles =
|
||||
std::stoll(get_node_value(node_ssw, "max_particles"));
|
||||
} else {
|
||||
fatal_error("A maximum number of particles needs to be specified "
|
||||
"using the 'max_particles' parameter to store surface "
|
||||
"source points.");
|
||||
}
|
||||
|
||||
if (check_for_node(node_ssw, "mcpl")) {
|
||||
surf_mcpl_write = get_node_value_bool(node_ssw, "mcpl");
|
||||
|
||||
|
|
@ -769,6 +778,27 @@ void read_settings_xml(pugi::xml_node root)
|
|||
"surface source files.");
|
||||
}
|
||||
}
|
||||
// Get cell information
|
||||
if (check_for_node(node_ssw, "cell")) {
|
||||
ssw_cell_id = std::stoll(get_node_value(node_ssw, "cell"));
|
||||
ssw_cell_type = SSWCellType::Both;
|
||||
}
|
||||
if (check_for_node(node_ssw, "cellfrom")) {
|
||||
if (ssw_cell_id != C_NONE) {
|
||||
fatal_error(
|
||||
"'cell', 'cellfrom' and 'cellto' cannot be used at the same time.");
|
||||
}
|
||||
ssw_cell_id = std::stoll(get_node_value(node_ssw, "cellfrom"));
|
||||
ssw_cell_type = SSWCellType::From;
|
||||
}
|
||||
if (check_for_node(node_ssw, "cellto")) {
|
||||
if (ssw_cell_id != C_NONE) {
|
||||
fatal_error(
|
||||
"'cell', 'cellfrom' and 'cellto' cannot be used at the same time.");
|
||||
}
|
||||
ssw_cell_id = std::stoll(get_node_value(node_ssw, "cellto"));
|
||||
ssw_cell_type = SSWCellType::To;
|
||||
}
|
||||
}
|
||||
|
||||
// If source is not separate and is to be written out in the statepoint file,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue