Skip to content

Commit

Permalink
Uniform mesh check modification (terrapower#472)
Browse files Browse the repository at this point in the history
* Fix applyInputParams bug when values are zero
* Only check against user-provided power when the current node power is available

No new capability is added. The check of the power on the uniform mesh against the
user-provided power for the cycle is only changed so that it no longer occurs on
the BOC time node of each cycle, when the power data on the blocks is stale.
  • Loading branch information
keckler authored Nov 11, 2021
1 parent 08e2768 commit a10a396
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions armi/reactor/converters/uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,20 +339,23 @@ def _checkConversion(self):
sourcePow = self._sourceReactor.core.getTotalBlockParam("power")
convPow = self.convReactor.core.getTotalBlockParam("power")
if sourcePow > 0.0 and convPow > 0.0:
expectedPow = (
self._sourceReactor.core.p.power
/ self._sourceReactor.core.powerMultiplier
)
if abs(sourcePow - convPow) / sourcePow > 1e-5:
runLog.info(
f"Source reactor power ({sourcePow}) is too different from "
f"converted power ({convPow})."
)
if sourcePow and abs(sourcePow - expectedPow) / sourcePow > 1e-5:
raise ValueError(
f"Source reactor power ({sourcePow}) is too different from "
f"user-input power ({expectedPow})."

if self._sourceReactor.p.timeNode != 0:
# only check on nodes other than BOC
expectedPow = (
self._sourceReactor.core.p.power
/ self._sourceReactor.core.powerMultiplier
)
if sourcePow and abs(sourcePow - expectedPow) / sourcePow > 1e-5:
raise ValueError(
f"Source reactor power ({sourcePow}) is too different from "
f"user-input power ({expectedPow})."
)

def _setParamsToUpdate(self):
"""Activate conversion of various neutronics paramters."""
Expand Down

0 comments on commit a10a396

Please sign in to comment.