def interactEveryNode(self, cycle, node): if self.cs["zoneFlowSummary"]: reportingUtils.summarizeZones(self.r.core, self.cs) if self.cs["assemPowSummary"]: reportingUtils.summarizePower(self.r.core) self.r.core.calcBlockMaxes() reportingUtils.summarizePowerPeaking(self.r.core) runLog.important("Cycle {}, node {} Summary: ".format(cycle, node)) runLog.important( " time= {0:8.2f} years, keff= {1:.12f} maxPD= {2:-8.2f} MW/m^2, " "maxBuI= {3:-8.4f} maxBuF= {4:8.4f}".format( self.r.p.time, self.r.core.p.keff, self.r.core.p.maxPD, self.r.core.p.maxBuI, self.r.core.p.maxBuF, )) if self.cs["plots"]: adjoint = self.cs["neutronicsType"] == neutronics.ADJREAL_CALC figName = (self.cs.caseTitle + "_{0}_{1}".format(cycle, node) + ".mgFlux." + self.cs["outputFileExtension"]) if self.r.core.getFirstBlock(Flags.FUEL).p.mgFlux is not None: from armi.reactor import blocks blocks.Block.plotFlux(self.r.core, fName=figName, peak=True, adjoint=adjoint) else: runLog.warning("No mgFlux to plot in reports")
def test_reactorSpecificReporting(self): """Test a number of reporting utils that require reactor/core information""" o, r = loadTestReactor() with mockRunLogs.BufferLog() as mock: # we should start with a clean slate self.assertEqual("", mock._outputStream) runLog.LOG.startLog("test_reactorSpecificReporting") runLog.LOG.setVerbosity(logging.INFO) writeAssemblyMassSummary(r) self.assertIn("BOL Assembly Mass Summary", mock._outputStream) self.assertIn("igniter fuel", mock._outputStream) self.assertIn("primary control", mock._outputStream) self.assertIn("plenum", mock._outputStream) mock._outputStream = "" setNeutronBalancesReport(r.core) self.assertIn("No rate information", mock._outputStream) mock._outputStream = "" summarizePinDesign(r.core) self.assertIn("Assembly Design Summary", mock._outputStream) self.assertIn("Design & component information", mock._outputStream) self.assertIn("Multiplicity", mock._outputStream) mock._outputStream = "" summarizePower(r.core) self.assertIn("Power in radial shield", mock._outputStream) self.assertIn("Power in primary control", mock._outputStream) self.assertIn("Power in feed fuel", mock._outputStream) mock._outputStream = "" writeCycleSummary(r.core) self.assertIn("Core Average", mock._outputStream) self.assertIn("Outlet Temp", mock._outputStream) self.assertIn("End of Cycle", mock._outputStream) mock._outputStream = "" # this report won't do much for the test reactor - improve test reactor summarizeZones(r.core, o.cs) self.assertTrue(len(mock._outputStream) == 0) mock._outputStream = "" # this report won't do much for the test reactor - improve test reactor makeBlockDesignReport(r) self.assertTrue(len(mock._outputStream) == 0) mock._outputStream = "" # this report won't do much for the test reactor - improve test reactor summarizePowerPeaking(r.core) self.assertTrue(len(mock._outputStream) == 0)