mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Fixed several bugs related to decay-rate
1) In mdgxs.py, DecayRate, get_xs(). There is no need to reverse the order since there isn't an energy group filter anymore. Also, the new_shape addition formats the cross section like all the others. I updated mgxs_library_hdf5 test results accordingly. 2) In material.cpp. If you use a macroscopic dnesity other than 1.0, the code still pushed back '1.0'. My change fixes that. Using a macro density other than 1.0 wasn't tested anywhere, so I modifed mg_convert to take a density of 1.1. The default macro density of 1.0 is used in many other tests. 3) tally_scoring.cpp. Notice that the score is accumulated, then sent to the function score_fission_delayed_dg where the tally is accumulated. This amounts to "double accumulation". It makes sense to accumulate the score over the delayed groups if there is no delayed group filter, but in this case, when delayed group filter is not None, the score needs to reset each time. In other parts of SCORE_DECAY_RATE, I think the distinction between accumulating and resetting the score is correct. The only place I wasn't sure was line 1057 (and its equivalent in multi-group, line 1962). It's too bad the decay-rate isn't tested very thoroughly. Although I don't have time to do it myself, I think adding a DelayedGroups filter to the mg_tallies test would be a good start.
This commit is contained in:
parent
8d67b64ba8
commit
954450a841
7 changed files with 31 additions and 27 deletions
|
|
@ -2044,13 +2044,9 @@ class DecayRate(MDGXS):
|
|||
num_delayed_groups)
|
||||
else:
|
||||
new_shape = (num_subdomains, num_delayed_groups)
|
||||
new_shape += xs.shape[1:]
|
||||
xs = np.reshape(xs, new_shape)
|
||||
|
||||
# Reverse data if user requested increasing energy groups since
|
||||
# tally data is stored in order of increasing energies
|
||||
if order_groups == 'increasing':
|
||||
xs = xs[..., ::-1, :]
|
||||
|
||||
if squeeze:
|
||||
# We want to squeeze out everything but the polar, azimuthal,
|
||||
# delayed group, and energy group data.
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ Material::Material(pugi::xml_node node)
|
|||
|
||||
// Set density for macroscopic data
|
||||
if (units == "macro") {
|
||||
densities.push_back(1.0);
|
||||
densities.push_back(density_);
|
||||
} else {
|
||||
fatal_error("Units can only be macro for macroscopic data " + name);
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ Material::Material(pugi::xml_node node)
|
|||
// Check if no atom/weight percents were specified or if both atom and
|
||||
// weight percents were specified
|
||||
if (units == "macro") {
|
||||
densities.push_back(1.0);
|
||||
densities.push_back(density_);
|
||||
} else {
|
||||
bool has_ao = check_for_node(node_nuc, "ao");
|
||||
bool has_wo = check_for_node(node_nuc, "wo");
|
||||
|
|
|
|||
|
|
@ -1995,13 +1995,13 @@ score_general_mg(Particle& p, int i_tally, int start_index, int filter_index,
|
|||
for (auto d_bin = 0; d_bin < filt.n_bins(); ++d_bin) {
|
||||
auto d = filt.groups()[d_bin] - 1;
|
||||
if (i_nuclide >= 0) {
|
||||
score += atom_density * flux
|
||||
score = atom_density * flux
|
||||
* nuc_xs.get_xs(MgxsType::DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* nuc_xs.get_xs(MgxsType::DELAYED_NU_FISSION, p_g, nullptr,
|
||||
nullptr, &d);
|
||||
} else {
|
||||
score += flux
|
||||
score = flux
|
||||
* macro_xs.get_xs(MgxsType::DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* macro_xs.get_xs(MgxsType::DELAYED_NU_FISSION, p_g, nullptr,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<materials>
|
||||
<cross_sections>./mgxs.h5</cross_sections>
|
||||
<material id="1" name="UO2 fuel">
|
||||
<density units="macro" value="1.0" />
|
||||
<density units="macro" value="1.1" />
|
||||
<macroscopic name="UO2" />
|
||||
</material>
|
||||
</materials>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
k-combined:
|
||||
9.930873E-01 2.221904E-03
|
||||
9.834385E-01 7.095193E-03
|
||||
k-combined:
|
||||
9.948148E-01 1.216270E-03
|
||||
9.936965E-01 4.118371E-03
|
||||
k-combined:
|
||||
9.930873E-01 2.221904E-03
|
||||
9.834385E-01 7.095193E-03
|
||||
k-combined:
|
||||
9.755034E-01 6.178296E-03
|
||||
9.977232E-01 1.084193E-02
|
||||
k-combined:
|
||||
9.738059E-01 4.529068E-03
|
||||
9.945011E-01 5.571771E-03
|
||||
k-combined:
|
||||
9.866847E-01 9.485912E-03
|
||||
9.982627E-01 2.662444E-03
|
||||
k-combined:
|
||||
9.755024E-01 6.179047E-03
|
||||
9.977232E-01 1.084193E-02
|
||||
k-combined:
|
||||
9.738061E-01 4.529462E-03
|
||||
9.945007E-01 5.571589E-03
|
||||
k-combined:
|
||||
9.866835E-01 9.485832E-03
|
||||
9.982620E-01 2.662746E-03
|
||||
k-combined:
|
||||
9.719024E-01 4.213166E-03
|
||||
1.000071E+00 3.364791E-03
|
||||
k-combined:
|
||||
9.930873E-01 2.221904E-03
|
||||
9.834385E-01 7.095193E-03
|
||||
k-combined:
|
||||
9.930873E-01 2.221904E-03
|
||||
9.834385E-01 7.095193E-03
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
|
||||
# Instantiate some Materials and register the appropriate objects
|
||||
mat = openmc.Material(material_id=1, name='UO2 fuel')
|
||||
mat.set_density('macro', 1.0)
|
||||
mat.set_density('macro', 1.1)
|
||||
mat.add_macroscopic(uo2_data)
|
||||
|
||||
# Instantiate a Materials collection and export to XML
|
||||
|
|
|
|||
|
|
@ -193,10 +193,18 @@ domain=1 type=beta
|
|||
[1.21876271e-04 8.77101834e-05]
|
||||
[4.95946084e-05 3.67414816e-05]]
|
||||
domain=1 type=decay-rate
|
||||
[1.33568413e-02 3.25887984e-02 1.21105565e-01 3.06139633e-01
|
||||
8.62763808e-01 2.89789222e+00]
|
||||
[9.57055016e-04 2.28222032e-03 8.35436401e-03 2.06734948e-02
|
||||
5.63019289e-02 1.89486538e-01]
|
||||
[[1.33568413e-02]
|
||||
[3.25887984e-02]
|
||||
[1.21105565e-01]
|
||||
[3.06139633e-01]
|
||||
[8.62763808e-01]
|
||||
[2.89789222e+00]]
|
||||
[[9.57055016e-04]
|
||||
[2.28222032e-03]
|
||||
[8.35436401e-03]
|
||||
[2.06734948e-02]
|
||||
[5.63019289e-02]
|
||||
[1.89486538e-01]]
|
||||
domain=1 type=delayed-nu-fission matrix
|
||||
[[[0.00000000e+00 0.00000000e+00]
|
||||
[0.00000000e+00 0.00000000e+00]]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue