diff --git a/armi/bookkeeping/db/tests/test_comparedb3.py b/armi/bookkeeping/db/tests/test_comparedb3.py index a81881d2c..b195b566a 100644 --- a/armi/bookkeeping/db/tests/test_comparedb3.py +++ b/armi/bookkeeping/db/tests/test_comparedb3.py @@ -177,7 +177,7 @@ def test_compareDatabaseSim(self): dbs[1]._fullPath, timestepCompare=[(0, 0), (0, 1)], ) - self.assertEqual(len(diffs.diffs), 468) + self.assertEqual(len(diffs.diffs), 465) # Cycle length is only diff (x3) self.assertEqual(diffs.nDiffs(), 3) diff --git a/armi/bookkeeping/db/tests/test_databaseInterface.py b/armi/bookkeeping/db/tests/test_databaseInterface.py index 68d4a492b..9570a1b4b 100644 --- a/armi/bookkeeping/db/tests/test_databaseInterface.py +++ b/armi/bookkeeping/db/tests/test_databaseInterface.py @@ -31,7 +31,6 @@ from armi.reactor import grids from armi.reactor.flags import Flags from armi.reactor.tests.test_reactors import loadTestReactor, reduceTestReactorRings -from armi.settings.fwSettings.databaseSettings import CONF_FORCE_DB_PARAMS from armi.tests import TEST_ROOT from armi.utils import directoryChangers @@ -52,7 +51,6 @@ def getSimpleDBOperator(cs): newSettings["runType"] = "Standard" newSettings["geomFile"] = "geom1Assem.xml" newSettings["nCycles"] = 1 - newSettings[CONF_FORCE_DB_PARAMS] = ["baseBu"] cs = cs.modified(newSettings=newSettings) genDBCase = case.Case(cs) settings.setMasterCs(cs) @@ -76,7 +74,6 @@ def __init__(self, r, cs, action=None): self.action = action def interactEveryNode(self, cycle, node): - self.r.core.getFirstBlock().p.baseBu = 5.0 self.action(cycle, node) @@ -161,7 +158,6 @@ def goodMethod(cycle, node): self.assertIn("geomFile", h5["inputs"]) self.assertIn("settings", h5["inputs"]) self.assertIn("blueprints", h5["inputs"]) - self.assertIn("baseBu", h5["c00n02/HexBlock"]) def test_metaDataEndFail(self): def failMethod(cycle, node): diff --git a/armi/operators/tests/test_operatorSnapshots.py b/armi/operators/tests/test_operatorSnapshots.py index 6d80899c8..36d2f6d52 100644 --- a/armi/operators/tests/test_operatorSnapshots.py +++ b/armi/operators/tests/test_operatorSnapshots.py @@ -21,7 +21,6 @@ from armi.operators.runTypes import RunTypes from armi.operators.snapshots import OperatorSnapshots from armi.reactor.tests import test_reactors -from armi.settings.fwSettings.databaseSettings import CONF_FORCE_DB_PARAMS class TestOperatorSnapshots(unittest.TestCase): @@ -32,7 +31,6 @@ def setUp(self): newSettings["verbosity"] = "important" newSettings["branchVerbosity"] = "important" newSettings["nCycles"] = 1 - newSettings[CONF_FORCE_DB_PARAMS] = ["baseBu"] newSettings["dumpSnapshot"] = ["000000", "008000", "016005"] o1, self.r = test_reactors.loadTestReactor(customSettings=newSettings) self.o = OperatorSnapshots(o1.cs) diff --git a/armi/physics/fuelPerformance/parameters.py b/armi/physics/fuelPerformance/parameters.py index 276bc2049..7622c2daa 100644 --- a/armi/physics/fuelPerformance/parameters.py +++ b/armi/physics/fuelPerformance/parameters.py @@ -29,7 +29,7 @@ def _getFuelPerformanceBlockParams(): pb.defParam( "fuelCladLocked", - units="", + units=units.UNITLESS, default=False, description="Boolean to indicate if the fuel is locked with the clad." " This is used to determine the expansion constraints for the fuel during" @@ -47,7 +47,7 @@ def gasReleaseFraction(self, value): pb.defParam( "gasReleaseFraction", setter=gasReleaseFraction, - units="fraction", + units=units.UNITLESS, description="Fraction of generated fission gas that no longer exists in the block.", categories=["eq cumulative shift"], ) @@ -63,7 +63,7 @@ def bondRemoved(self, value): pb.defParam( "bondRemoved", setter=bondRemoved, - units="fraction", + units=units.UNITLESS, description="Fraction of thermal bond between fuel and clad that has been pushed out.", categories=["eq cumulative shift"], ) @@ -78,35 +78,35 @@ def bondRemoved(self, value): pb.defParam( "totalCladStrain", - units="%", + units=units.PERCENT, description="Total diametral clad strain.", categories=["eq cumulative shift"], ) pb.defParam( "axialGrowthPct", - units="%", + units=units.PERCENT, description="Axial growth percentage", categories=["eq cumulative shift"], ) pb.defParam( "fpPeakFuelTemp", - units="C", + units=units.DEGC, description="Fuel performance calculated peak fuel temperature.", location=ParamLocation.AVERAGE, ) pb.defParam( "fpAveFuelTemp", - units="C", + units=units.DEGC, description="Fuel performance calculated average fuel temperature.", location=ParamLocation.AVERAGE, ) pb.defParam( "gasPorosity", - units="", + units=units.UNITLESS, description="Fraction of fuel volume that is occupied by gas pores", default=0.0, categories=["eq cumulative shift"], @@ -114,7 +114,7 @@ def bondRemoved(self, value): pb.defParam( "liquidPorosity", - units="", + units=units.UNITLESS, description="Fraction of fuel volume that is occupied by liquid filled pores", default=0.0, ) diff --git a/armi/physics/neutronics/parameters.py b/armi/physics/neutronics/parameters.py index f85ade6c5..5a020b9c0 100644 --- a/armi/physics/neutronics/parameters.py +++ b/armi/physics/neutronics/parameters.py @@ -24,6 +24,7 @@ from armi.reactor.parameters import ParamLocation from armi.reactor.parameters.parameterDefinitions import isNumpyArray from armi.reactor.reactors import Core +from armi.utils import units def getNeutronicsParameterDefinitions(): @@ -37,7 +38,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "axMesh", - units="", + units=units.UNITLESS, description="number of neutronics axial mesh points in this block", default=None, categories=[parameters.Category.retainOnReplacement], @@ -142,7 +143,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "mgFluxSK", - units="", + units=f"n-{units.CM}/{units.SECONDS}", description="multigroup volume-integrated flux stored for multiple time steps in spatial kinetics (2-D array)", location=ParamLocation.VOLUME_INTEGRATED, saveToDB=False, @@ -170,7 +171,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "pinMgFluxesAdj", - units="", + units=units.UNITLESS, description="should be a blank 3-D array, but re-defined later (ng x nPins x nAxialSegments)", categories=[parameters.Category.pinQuantities], saveToDB=False, @@ -188,11 +189,9 @@ def _getNeutronicsBlockParams(): pb.defParam( "axialPowerProfile", - units="", - description=""" - For each reconstructed axial location, a tuple (z,power density) where with axial origin at the bottom - of assembly in which the blocks are located. - """, + units=f"{units.WATTS}/{units.CM}^3", + description="""For each reconstructed axial location, a tuple (z,power density) where with + axial origin at the bottom of assembly in which the blocks are located.""", location=ParamLocation.AVERAGE, saveToDB=True, default=None, @@ -200,8 +199,9 @@ def _getNeutronicsBlockParams(): pb.defParam( "axialPowerProfileNeutron", - units="", - description="", + units=f"{units.WATTS}/{units.CM}^3", + description="""For each reconstructed axial location, a tuple (z, neutron power density) + where with axial origin at the bottom of assembly in which the blocks are located.""", location=ParamLocation.AVERAGE, saveToDB=True, default=None, @@ -209,8 +209,9 @@ def _getNeutronicsBlockParams(): pb.defParam( "axialPowerProfileGamma", - units="", - description="", + units=f"{units.WATTS}/{units.CM}^3", + description="""For each reconstructed axial location, a tuple (z, gamma power density) + where with axial origin at the bottom of assembly in which the blocks are located.""", location=ParamLocation.AVERAGE, saveToDB=True, default=None, @@ -218,7 +219,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "betad", - units="", + units=units.UNITLESS, description="Delayed neutron beta", location=ParamLocation.AVERAGE, saveToDB=True, @@ -227,7 +228,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "chi", - units="", + units=units.UNITLESS, description="Energy distribution of fission neutrons", location=ParamLocation.AVERAGE, saveToDB=True, @@ -236,7 +237,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "chid", - units="", + units=units.UNITLESS, description="Energy distribution of delayed fission neutrons", location=ParamLocation.AVERAGE, saveToDB=True, @@ -317,14 +318,14 @@ def _getNeutronicsBlockParams(): pb.defParam( "pointsEdgeFastFluxFr", - units=None, + units=units.UNITLESS, description="Fraction of flux above 100keV at edges of the block", ) pb.defParam( "pointsEdgeDpa", setter=isNumpyArray("pointsEdgeDpa"), - units="dpa", + units=units.DPA, description="displacements per atom at edges of the block", categories=["cumulative", "detailedAxialExpansion", "depletion"], ) @@ -353,14 +354,14 @@ def _getNeutronicsBlockParams(): pb.defParam( "pointsCornerFastFluxFr", - units=None, + units=units.UNITLESS, description="Fraction of flux above 100keV at corners of the block", ) pb.defParam( "pointsCornerDpa", setter=isNumpyArray("pointsCornerDpa"), - units="dpa", + units=units.DPA, description="displacements per atom at corners of the block", location=ParamLocation.CORNERS, categories=["cumulative", "detailedAxialExpansion", "depletion"], @@ -435,7 +436,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "capturePowerFrac", - units=None, + units=units.UNITLESS, description="Fraction of the power produced through capture in a block.", saveToDB="True", ) @@ -475,12 +476,10 @@ def _getNeutronicsBlockParams(): ], ) - pb.defParam( - "fluxAdj", units="", description="Adjoint flux" # adjoint flux is unitless - ) + pb.defParam("fluxAdj", units=units.UNITLESS, description="Adjoint flux") pb.defParam( "fluxAdjPeak", - units="", + units=units.UNITLESS, description="Adjoint flux", location=ParamLocation.MAX, ) @@ -500,7 +499,9 @@ def _getNeutronicsBlockParams(): pb.defParam("arealPd", units="MW/m^2", description="Power divided by XY area") - pb.defParam("fertileBonus", units=None, description="The fertile bonus") + pb.defParam( + "fertileBonus", units=units.UNITLESS, description="The fertile bonus" + ) pb.defParam( "fisDens", @@ -531,21 +532,21 @@ def _getNeutronicsBlockParams(): pb.defParam( "kInf", - units="None", + units=units.UNITLESS, description="Neutron production rate in this block/neutron absorption rate in this block. Not truly kinf but a reasonable approximation of reactivity.", ) pb.defParam( - "medAbsE", units="eV", description="Median neutron absorption energy" + "medAbsE", units=units.EV, description="Median neutron absorption energy" ) pb.defParam( "medFisE", - units="eV", + units=units.EV, description="Median energy of neutron causing fission", ) - pb.defParam("medFlxE", units="eV", description="Median neutron flux energy") + pb.defParam("medFlxE", units=units.EV, description="Median neutron flux energy") pb.defParam( "pdensGamma", @@ -624,23 +625,23 @@ def _getNeutronicsBlockParams(): ) as pb: pb.defParam( "powerGenerated", - units=" W", + units=units.WATTS, description="Generated power. Different than b.p.power only when gamma transport is activated.", categories=[parameters.Category.gamma], ) pb.defParam( "power", - units="W", + units=units.WATTS, description="Total power", categories=[parameters.Category.neutronics], ) - pb.defParam("powerDecay", units="W", description="Total decay power") + pb.defParam("powerDecay", units=units.WATTS, description="Total decay power") pb.defParam( "powerGamma", - units="W", + units=units.WATTS, description="Total gamma power", categories=[parameters.Category.gamma], ) @@ -648,7 +649,7 @@ def _getNeutronicsBlockParams(): # gamma category because power is only split by neutron/gamma when gamma is activated pb.defParam( "powerNeutron", - units="W", + units=units.WATTS, description="Total neutron power", categories=[parameters.Category.gamma], ) @@ -656,7 +657,7 @@ def _getNeutronicsBlockParams(): with pDefs.createBuilder(default=0.0) as pb: pb.defParam( "detailedDpaThisCycle", - units="dpa", + units=units.DPA, location=ParamLocation.AVERAGE, description="Displacement per atom accumulated during this cycle. This accumulates over a cycle and resets to zero at BOC.", categories=[ @@ -667,7 +668,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "detailedDpaPeakRate", - units="DPA/s", + units=f"{units.DPA}/{units.SECONDS}", description="Peak DPA rate based on detailedDpaPeak", location=ParamLocation.MAX, categories=[parameters.Category.cumulative, parameters.Category.neutronics], @@ -675,7 +676,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "dpaPeakFromFluence", - units="dpa", + units=units.DPA, description=f"DPA approximation based on a fluence conversion factor set in the {CONF_DPA_PER_FLUENCE} setting", location=ParamLocation.MAX, categories=[ @@ -700,7 +701,7 @@ def _getNeutronicsBlockParams(): pb.defParam( "fastFluxFr", - units="", + units=units.UNITLESS, description="Fraction of flux above 100keV", location=ParamLocation.AVERAGE, categories=["detailedAxialExpansion"], @@ -723,7 +724,7 @@ def _getNeutronicsCoreParams(): with pDefs.createBuilder(categories=[parameters.Category.neutronics]) as pb: pb.defParam( "eigenvalues", - units=None, + units=units.UNITLESS, description="All available lambda-eigenvalues of reactor.", default=None, # will be a list though, can't set default to mutable type. location=ParamLocation.AVERAGE, @@ -731,7 +732,7 @@ def _getNeutronicsCoreParams(): pb.defParam( "kInf", - units=None, + units=units.UNITLESS, description="k-infinity", default=0.0, location=ParamLocation.AVERAGE, @@ -739,7 +740,7 @@ def _getNeutronicsCoreParams(): pb.defParam( "refKeff", - units=None, + units=units.UNITLESS, description="Reference unperturbed keff", default=0.0, location=ParamLocation.AVERAGE, diff --git a/armi/physics/thermalHydraulics/parameters.py b/armi/physics/thermalHydraulics/parameters.py index f3136b3c4..fb81b9655 100644 --- a/armi/physics/thermalHydraulics/parameters.py +++ b/armi/physics/thermalHydraulics/parameters.py @@ -35,7 +35,7 @@ def _getBlockParams(): pb.defParam( "pressureLossCoeffs", - units="", + units=units.UNITLESS, description="Pressure loss coefficients from form losses outside of bundle region of " "assembly, e.g. losses through pin attachment hardware, expansion in inlet " "nozzle.", @@ -137,7 +137,7 @@ def _getBlockParams(): pb.defParam( "THdilationPressure", - units="Pa", + units=units.PASCALS, description="Dilation pressure", categories=["thInterface"], default=0.0, @@ -228,7 +228,7 @@ def _getBlockParams(): pb.defParam( "THdeltaPTotal", - units="Pa", + units=units.PASCALS, description="Total pressure difference in a block", location=ParamLocation.AVERAGE, ) diff --git a/armi/reactor/assemblyParameters.py b/armi/reactor/assemblyParameters.py index 63d7457ff..006011a18 100644 --- a/armi/reactor/assemblyParameters.py +++ b/armi/reactor/assemblyParameters.py @@ -28,7 +28,7 @@ def getAssemblyParameterDefinitions(): pb.defParam( "powerDecay", setter=isNumpyArray("powerDecay"), - units="W", + units=units.WATTS, description="List of decay heats at each time step specified in " "decayHeatCalcTimesInSeconds setting.", saveToDB=True, @@ -40,7 +40,7 @@ def getAssemblyParameterDefinitions(): pb.defParam( "orientation", - units="degrees", + units=units.ANGLE_DEGREES, description=( "Triple representing rotations counterclockwise around each spatial axis. " "For example, a hex assembly rotated by 1/6th has orientation (0,0,60.0)" @@ -57,7 +57,10 @@ def getAssemblyParameterDefinitions(): ) pb.defParam( - "buLimit", units="", description="buLimit", default=parameters.NoDefault + "buLimit", + units=units.UNITLESS, + description="buLimit", + default=parameters.NoDefault, ) pb.defParam( @@ -70,7 +73,7 @@ def getAssemblyParameterDefinitions(): pb.defParam( "chargeCycle", - units="", + units=units.UNITLESS, description="Cycle number that this assembly most recently entered the core." " If the assembly was discharged and then re-charged, this value will only" " reflect the most recent charge.", @@ -78,7 +81,7 @@ def getAssemblyParameterDefinitions(): pb.defParam( "chargeFis", - units="kg", + units=units.KG, description="Fissile mass in assembly when it most recently entered the core." " If the assembly was discharged and then re-charged, this value will only" " reflect the most recent charge.", @@ -86,7 +89,7 @@ def getAssemblyParameterDefinitions(): pb.defParam( "chargeTime", - units="years", + units=units.YEARS, description="Time at which this assembly most recently entered the core." " If the assembly was discharged and then re-charged, this value will only" " reflect the most recent charge.", @@ -95,7 +98,7 @@ def getAssemblyParameterDefinitions(): pb.defParam( "multiplicity", - units=None, + units=units.UNITLESS, description="The number of physical assemblies that the associated object " "represents. This is typically 1, but may need to change when the assembly " "is moved between containers with different types of symmetry. For " @@ -111,17 +114,21 @@ def getAssemblyParameterDefinitions(): default=1, ) - pb.defParam("daysSinceLastMove", units="", description="daysSinceLastMove") + pb.defParam( + "daysSinceLastMove", units=units.UNITLESS, description="daysSinceLastMove" + ) - pb.defParam("kInf", units="", description="kInf") + pb.defParam("kInf", units=units.UNITLESS, description="kInf") - pb.defParam("maxDpaPeak", units="", description="maxDpaPeak") + pb.defParam("maxDpaPeak", units=units.DPA, description="maxDpaPeak") - pb.defParam("maxPercentBu", units="", description="maxPercentBu") + pb.defParam("maxPercentBu", units=units.PERCENT, description="maxPercentBu") - pb.defParam("numMoves", units="", description="numMoves") + pb.defParam("numMoves", units=units.UNITLESS, description="numMoves") - pb.defParam("timeToLimit", units="", description="timeToLimit", default=1e6) + pb.defParam( + "timeToLimit", units=units.DAYS, description="timeToLimit", default=1e6 + ) with pDefs.createBuilder(location=ParamLocation.AVERAGE) as pb: @@ -176,7 +183,7 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "crCriticalFraction", - units="", + units=units.UNITLESS, description=( "The insertion fraction when the control rod assembly is in its critical configuration. " "Note that the default of -1.0 is a trigger for this value not being set yet." @@ -187,7 +194,7 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "crCurrentElevation", - units="cm", + units=units.CM, description="The current elevation of the bottom of the moveable section of a control rod assembly.", categories=[parameters.Category.assignInBlueprints], saveToDB=True, @@ -195,7 +202,7 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "crInsertedElevation", - units="cm", + units=units.CM, description=( "The elevation of the furthest-most insertion point of a control rod assembly. For a control rod assembly " "inserted from the top, this will be the lower tip of the bottom-most moveable section in the assembly when " @@ -207,14 +214,14 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "crRodLength", - units="cm", + units=units.CM, description="length of the control material within the control rod", saveToDB=True, ) pb.defParam( "crWithdrawnElevation", - units="cm", + units=units.CM, description=( "The elevation of the tip of a control rod assembly when it is fully withdrawn. For a control rod assembly " "inserted from the top, this will be the lower tip of the bottom-most moveable section in the assembly when " @@ -228,18 +235,22 @@ def _enforceNotesRestrictions(self, value): location=ParamLocation.AVERAGE, default=0.0, categories=["thermal hydraulics"] ) as pb: - pb.defParam("THdeltaPNoGrav", units="Pa", description="?") + pb.defParam( + "THdeltaPNoGrav", + units=units.PASCALS, + description="Total pressure difference minus gravity; it can be thought of as being 'total pressure loss'", + ) pb.defParam( "THdeltaPPump", - units="Pa", + units=units.PASCALS, description="Pumping pressure rise required to pump the given mass flow rate through the rod bundle", categories=["broadcast"], ) pb.defParam( "THdeltaPTotal", - units="Pa", + units=units.PASCALS, description="Total pressure difference across the assembly", categories=["broadcast"], ) @@ -274,7 +285,7 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "THorificeZone", - units=None, + units=units.UNITLESS, description="orifice zone for assembly; should be location specific", default=0, # integer default ) @@ -283,18 +294,16 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "type", - units="?", + units=units.UNITLESS, description="The name of the assembly input on the blueprints input", - location="?", default="defaultAssemType", saveToDB=True, ) pb.defParam( "nozzleType", - units="None", + units=units.UNITLESS, description="nozzle type for assembly", - location="?", default="Default", saveToDB=True, categories=[parameters.Category.assignInBlueprints], @@ -302,9 +311,13 @@ def _enforceNotesRestrictions(self, value): with pDefs.createBuilder(default=0.0) as pb: - pb.defParam("THcoolantInletT", units="?", description="?", location="?") + pb.defParam( + "THcoolantInletT", + units=units.DEGC, + description="Assembly inlet temperature in C (cold temperature)", + ) - pb.defParam("assemNum", units="?", description="?", location="?") + pb.defParam("assemNum", units=units.UNITLESS, description="Assembly number") pb.defParam( "axExpWorthPT", @@ -327,7 +340,11 @@ def _enforceNotesRestrictions(self, value): location=ParamLocation.AVERAGE, ) - pb.defParam("dischargeTime", units="?", description="?", location="?") + pb.defParam( + "dischargeTime", + units=units.YEARS, + description="Time the Assembly was removed from the Reactor.", + ) pb.defParam( "fuelWorthPT", @@ -338,9 +355,8 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "hotChannelFactors", - units="None", + units=units.UNITLESS, description="Definition of set of HCFs to be applied to assembly.", - location="?", default="Default", saveToDB=True, categories=[parameters.Category.assignInBlueprints], @@ -364,18 +380,16 @@ def _enforceNotesRestrictions(self, value): pb.defParam( "AziMesh", - units="?", - description="?", - location="?", + units=units.UNITLESS, + description="Number of points in the Azimuthal mesh.", saveToDB=False, default=1, ) pb.defParam( "RadMesh", - units="?", - description="?", - location="?", + units=units.UNITLESS, + description="Number of points in the Radial mesh.", saveToDB=False, default=1, ) diff --git a/armi/reactor/blockParameters.py b/armi/reactor/blockParameters.py index 33d27f6f9..a936a0233 100644 --- a/armi/reactor/blockParameters.py +++ b/armi/reactor/blockParameters.py @@ -31,7 +31,7 @@ def getBlockParameterDefinitions(): pb.defParam( "orientation", - units="degrees", + units=units.ANGLE_DEGREES, description=( "Triple representing rotations counterclockwise around each spatial axis. For example, " "a hex assembly rotated by 1/6th has orientation (0,0,60.0)" @@ -42,7 +42,7 @@ def getBlockParameterDefinitions(): pb.defParam( "pinLocation", description="Location of fuel pins", - units=None, + units=units.UNITLESS, saveToDB=False, default=None, location=ParamLocation.CHILDREN, @@ -77,7 +77,7 @@ def getBlockParameterDefinitions(): pb.defParam( "fissileFraction", - units=None, + units=units.UNITLESS, description="Ratio of fissile mass to heavy metal mass at block-level", ) @@ -89,7 +89,7 @@ def getBlockParameterDefinitions(): pb.defParam( "massHmBOL", - units="grams", + units=units.GRAMS, description="Mass of heavy metal at BOL", ) @@ -116,7 +116,7 @@ def getBlockParameterDefinitions(): pb.defParam( "newDPA", - units="dpa", + units=units.DPA, description="Dose in DPA accrued during the current time step", ) @@ -146,8 +146,8 @@ def getBlockParameterDefinitions(): pb.defParam( "percentBuMaxPinLocation", - units="int", - description="Peak burnup pin location", + units=units.UNITLESS, + description="Peak burnup pin location (integer)", location=ParamLocation.MAX, ) @@ -168,7 +168,7 @@ def getBlockParameterDefinitions(): pDefs.add( Parameter( name="depletionMatrix", - units="N/A", + units=units.UNITLESS, description="Full BurnMatrix objects containing transmutation and decay info about this block.", location=ParamLocation.AVERAGE, saveToDB=False, @@ -181,7 +181,7 @@ def getBlockParameterDefinitions(): pDefs.add( Parameter( name="cycleAverageBurnMatrix", - units="N/A", + units=units.UNITLESS, description="Integrated burn matrix mapping this block from its BOC to EOC number densities.", location=ParamLocation.AVERAGE, saveToDB=False, @@ -193,15 +193,11 @@ def getBlockParameterDefinitions(): with pDefs.createBuilder(default=0.0, location=ParamLocation.AVERAGE) as pb: - pb.defParam("bu", units="", description="?") - def buGroup(self, buGroupChar): if isinstance(buGroupChar, (int, float)): intValue = int(buGroupChar) runLog.warning( - "Attempting to set `b.p.buGroup` to int value ({}). Possibly loading from old database".format( - buGroupChar - ), + f"Attempting to set `b.p.buGroup` to int value ({buGroupChar}). Possibly loading from old database", single=True, label="bu group as int " + str(intValue), ) @@ -209,9 +205,7 @@ def buGroup(self, buGroupChar): return elif not isinstance(buGroupChar, six.string_types): raise Exception( - "Wrong type for buGroupChar {}: {}".format( - buGroupChar, type(buGroupChar) - ) + f"Wrong type for buGroupChar {buGroupChar}: {type(buGroupChar)}" ) buGroupNum = ord(buGroupChar) - ASCII_LETTER_A @@ -267,14 +261,14 @@ def buGroupNum(self, buGroupNum): pb.defParam( "detailedDpa", - units="dpa", + units=units.DPA, description="displacements per atom", categories=["cumulative", "detailedAxialExpansion", "depletion"], ) pb.defParam( "detailedDpaPeak", - units="dpa", + units=units.DPA, description="displacements per atom with peaking factor", categories=["cumulative", "detailedAxialExpansion", "depletion"], location=ParamLocation.MAX, @@ -289,61 +283,60 @@ def buGroupNum(self, buGroupNum): pb.defParam( "displacementX", - units="m", + units=units.METERS, description="Assembly displacement in the x direction", ) pb.defParam( "displacementY", - units="m", + units=units.METERS, description="Assembly displacement in the y direction", ) pb.defParam( - "powerRx", units="W/cm$^3$", description="?", location=ParamLocation.AVERAGE + "heliumInB4C", + units="He/s/cm$^3$", + description="Alpha particle production rate in B4C control and shield material.", + location=ParamLocation.AVERAGE, ) pb.defParam( - "heliumInB4C", - units="He/s/cm$^3$", - description="?", + "powerRx", + units="W/cm$^3$", + description="Power density of the reactor", location=ParamLocation.AVERAGE, ) pb.defParam( "timeToLimit", - units="days", + units=units.DAYS, description="Time unit block violates its burnup limit.", ) pb.defParam( "zbottom", - units="cm", + units=units.CM, description="Axial position of the bottom of this block", categories=[parameters.Category.retainOnReplacement], ) pb.defParam( "ztop", - units="cm", + units=units.CM, description="Axial position of the top of this block", categories=[parameters.Category.retainOnReplacement], ) - pb.defParam("baseBu", units="?", description="?", saveToDB=False) - - pb.defParam("basePBu", units="?", description="?", saveToDB=False) - pb.defParam( "nHMAtBOL", - units="atoms/bn-cm.", + units="atoms/bn-cm", description="Ndens of heavy metal at BOL", saveToDB=False, ) pb.defParam( "z", - units="cm", + units=units.CM, description="Center axial dimension of this block", categories=[parameters.Category.retainOnReplacement], ) @@ -351,7 +344,7 @@ def buGroupNum(self, buGroupNum): with pDefs.createBuilder() as pb: pb.defParam( "axialExpTargetComponent", - units="", + units=units.UNITLESS, description="The name of the target component used for axial expansion and contraction of solid components.", default="", saveToDB=True, @@ -359,7 +352,7 @@ def buGroupNum(self, buGroupNum): pb.defParam( "topIndex", - units="", + units=units.UNITLESS, description=( "the axial block index within its parent assembly (0 is bottom block). This index with" "regard to the mesh of the reference assembly so it does not increase by 1 for each block." @@ -373,23 +366,28 @@ def buGroupNum(self, buGroupNum): pb.defParam( "eqRegion", - units="", + units=units.UNITLESS, description="Equilibrium shuffling region. Corresponds to how many full cycles fuel here has gone through.", default=-1, ) pb.defParam( "eqCascade", - units="", + units=units.UNITLESS, description="Cascade number in repetitive equilibrium shuffling fuel management.", default=-1, ) - pb.defParam("id", units="?", description="?", default=None) + pb.defParam( + "id", + units=units.UNITLESS, + description="Inner diameter of the Block.", + default=None, + ) pb.defParam( "height", - units="cm", + units=units.CM, description="the block height", default=None, categories=[parameters.Category.retainOnReplacement], @@ -425,7 +423,7 @@ def xsTypeNum(self, value): pb.defParam( "type", - units="N/A", + units=units.UNITLESS, description="string name of the input block", default="defaultType", saveToDB=True, @@ -788,7 +786,7 @@ def xsTypeNum(self, value): pb.defParam( "assemNum", - units="None", + units=units.UNITLESS, description="Index that refers, nominally, to the assemNum parameter of " "the containing Assembly object. This is stored on the Block to aid in " "visualizing shuffle patterns and the like, and should not be used within " @@ -798,17 +796,9 @@ def xsTypeNum(self, value): categories=[parameters.Category.retainOnReplacement], ) - pb.defParam( - "avgFuelTemp", units="?", description="?", location=ParamLocation.AVERAGE - ) - - pb.defParam( - "avgTempRef", units="?", description="?", location=ParamLocation.AVERAGE - ) - pb.defParam( "axExtenNodeHeight", - units="meter", + units=units.METERS, description="Axial extension node height", location=ParamLocation.AVERAGE, default=0.0, @@ -816,7 +806,7 @@ def xsTypeNum(self, value): pb.defParam( "blockBeta", - units="unitless", + units=units.UNITLESS, description="Beta in each block", location=ParamLocation.AVERAGE, ) @@ -830,7 +820,7 @@ def xsTypeNum(self, value): pb.defParam( "breedRatio", - units="None", + units=units.UNITLESS, description="Breeding ratio", categories=["detailedAxialExpansion"], location=ParamLocation.AVERAGE, @@ -868,7 +858,7 @@ def xsTypeNum(self, value): pb.defParam( "convRatio", - units="None", + units=units.UNITLESS, description="Conversion ratio", categories=["detailedAxialExpansion"], location=ParamLocation.AVERAGE, @@ -876,7 +866,7 @@ def xsTypeNum(self, value): pb.defParam( "coolRemFrac", - units="?", + units=units.UNITLESS, description="Fractional sodium density change for each block", location=ParamLocation.AVERAGE, ) @@ -890,7 +880,7 @@ def xsTypeNum(self, value): pb.defParam( "cyclicNErr", - units="None", + units=units.UNITLESS, description="Relative error of the block number density", location=ParamLocation.AVERAGE, ) @@ -918,7 +908,7 @@ def xsTypeNum(self, value): pb.defParam( "heightBOL", - units="cm", + units=units.CM, description="As-fabricated height of this block (as input). Used in fuel performance. Should be constant.", location=ParamLocation.AVERAGE, categories=[parameters.Category.retainOnReplacement], @@ -926,51 +916,51 @@ def xsTypeNum(self, value): pb.defParam( "intrinsicSource", - units="?", + units=units.UNITLESS, description="Intrinsic neutron source from spontaneous fissions before a decay period", location=ParamLocation.AVERAGE, ) pb.defParam( "intrinsicSourceDecayed", - units="?", + units=units.UNITLESS, description="Intrinsic source from spontaneous fissions after a decay period", location=ParamLocation.AVERAGE, ) pb.defParam( "kgFis", - units="kg", + units=units.KG, description="Mass of fissile material in block", location=ParamLocation.VOLUME_INTEGRATED, ) pb.defParam( "kgHM", - units="kg", + units=units.KG, description="Mass of heavy metal in block", location=ParamLocation.VOLUME_INTEGRATED, ) pb.defParam( "mchan", - units="None", + units=units.UNITLESS, description="SASSYS/DIF3D-K (external) channel index assignment", location=ParamLocation.AVERAGE, ) pb.defParam( "mreg", - units="None", + units=units.UNITLESS, description="SASSYS/DIF3D-K radial region index assignment", location=ParamLocation.AVERAGE, ) - pb.defParam("nPins", units=None, description="Number of pins") + pb.defParam("nPins", units=units.UNITLESS, description="Number of pins") pb.defParam( "newDPAPeak", - units="dpa", + units=units.DPA, description="The peak DPA accumulated in the last burn step", location=ParamLocation.MAX, ) @@ -984,21 +974,21 @@ def xsTypeNum(self, value): pb.defParam( "powerShapeDelta", - units="W", + units=units.WATTS, description="Change in power shape when core temperature rises.", location=ParamLocation.VOLUME_INTEGRATED, ) pb.defParam( "puFrac", - units="None", + units=units.UNITLESS, description="Current Pu number density relative to HM at BOL", location=ParamLocation.AVERAGE, ) pb.defParam( "smearDensity", - units="?", + units=units.UNITLESS, description="Smear density of fuel pins in this block. Defined as the ratio of fuel area to total space inside cladding.", location=ParamLocation.AVERAGE, ) diff --git a/armi/reactor/blocks.py b/armi/reactor/blocks.py index db2bf909f..326b03f0c 100644 --- a/armi/reactor/blocks.py +++ b/armi/reactor/blocks.py @@ -118,7 +118,6 @@ def __init__(self, name: str, height: float = 1.0): "displacementX", "displacementY", "fluxAdj", - "bu", "buRate", "eqRegion", "fissileFraction", diff --git a/armi/reactor/components/componentParameters.py b/armi/reactor/components/componentParameters.py index c2e6e9391..fd1c51dd2 100644 --- a/armi/reactor/components/componentParameters.py +++ b/armi/reactor/components/componentParameters.py @@ -30,20 +30,20 @@ def getComponentParameterDefinitions(): pb.defParam( "mult", - units=None, + units=units.UNITLESS, description="The multiplicity of this component, i.e. how many of them there are. ", default=1, ) pb.defParam( "mergeWith", - units=None, + units=units.UNITLESS, description="Label of other component to merge with", ) pb.defParam( "type", - units="", + units=units.UNITLESS, description="The name of this object as input on the blueprints", ) @@ -78,7 +78,7 @@ def getComponentParameterDefinitions(): pb.defParam( "massHmBOL", - units="grams", + units=units.GRAMS, description="Mass of heavy metal at BOL", default=None, ) @@ -93,7 +93,7 @@ def getComponentParameterDefinitions(): pb.defParam( "customIsotopicsName", - units=None, + units=units.UNITLESS, description="Label of isotopics applied to this component. ", ) @@ -106,13 +106,13 @@ def getComponentParameterDefinitions(): pb.defParam( "zrFrac", - units=None, + units=units.UNITLESS, description="Original Zr frac of this, used for material properties. ", ) pb.defParam( "pinNum", - units="N/A", + units=units.UNITLESS, description="Pin number of this component in some mesh. Starts at 1.", default=None, ) @@ -124,11 +124,11 @@ def getCircleParameterDefinitions(): pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("od", units="cm", description="Outer diameter") + pb.defParam("od", units=units.CM, description="Outer diameter") - pb.defParam("id", units="cm", description="Inner diameter", default=0.0) + pb.defParam("id", units=units.CM, description="Inner diameter", default=0.0) - pb.defParam("op", units="cm", description="Outer pitch") + pb.defParam("op", units=units.CM, description="Outer pitch") return pDefs @@ -137,9 +137,9 @@ def getHexagonParameterDefinitions(): """Return parameters for Hexagon.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("ip", units="cm", description="Inner pitch", default=0.0) + pb.defParam("ip", units=units.CM, description="Inner pitch", default=0.0) - pb.defParam("op", units="cm", description="Outer pitch") + pb.defParam("op", units=units.CM, description="Outer pitch") return pDefs @@ -148,7 +148,9 @@ def getHoledHexagonParameterDefinitions(): """Return parameters for HoledHexagon.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("holeOD", units="cm", description="Diameter of interior hole(s)") + pb.defParam( + "holeOD", units=units.CM, description="Diameter of interior hole(s)" + ) pb.defParam( "nHoles", units=units.UNITLESS, description="Number of interior holes" @@ -161,7 +163,7 @@ def getHexHoledCircleParameterDefinitions(): """Return parameters for HexHoledCircle.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("holeOP", units="cm", description="Pitch of interior hole") + pb.defParam("holeOP", units=units.CM, description="Pitch of interior hole") return pDefs @@ -170,7 +172,7 @@ def getHoledRectangleParameterDefinitions(): """Return parameters for HoledRectangle.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("holeOD", units="cm", description="Diameter of interior hole") + pb.defParam("holeOD", units=units.CM, description="Diameter of interior hole") return pDefs @@ -179,19 +181,19 @@ def getHelixParameterDefinitions(): """Return parameters for Helix.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("od", units="cm", description="Outer diameter") + pb.defParam("od", units=units.CM, description="Outer diameter") - pb.defParam("id", units="cm", description="Inner diameter", default=0.0) + pb.defParam("id", units=units.CM, description="Inner diameter", default=0.0) - pb.defParam("op", units="cm", description="Outer pitch") + pb.defParam("op", units=units.CM, description="Outer pitch") pb.defParam( "axialPitch", - units="cm", + units=units.CM, description="Axial pitch of helix in helical shapes.", ) - pb.defParam("helixDiameter", units="cm", description="Diameter of helix") + pb.defParam("helixDiameter", units=units.CM, description="Diameter of helix") return pDefs @@ -200,13 +202,13 @@ def getRectangleParameterDefinitions(): """Return parameters for Rectangle.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("lengthInner", units="cm", description="Inner length") + pb.defParam("lengthInner", units=units.CM, description="Inner length") - pb.defParam("lengthOuter", units="cm", description="Outer length") + pb.defParam("lengthOuter", units=units.CM, description="Outer length") - pb.defParam("widthInner", units="cm", description="Inner width") + pb.defParam("widthInner", units=units.CM, description="Inner width") - pb.defParam("widthOuter", units="cm", description="Outer width") + pb.defParam("widthOuter", units=units.CM, description="Outer width") return pDefs @@ -215,17 +217,38 @@ def getCubeParameterDefinitions(): """Return parameters for Cube.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("lengthInner", units="cm", description="Inner length") + pb.defParam( + "lengthInner", + units=units.CM, + default=0.0, + description="Inner length dimension (if the cube is hollow).", + ) - pb.defParam("lengthOuter", units="cm", description="Outer length") + pb.defParam( + "lengthOuter", units=units.CM, description="Outermost length dimension" + ) - pb.defParam("widthInner", units="cm", description="Inner width") + pb.defParam( + "widthInner", + units=units.CM, + default=0.0, + description="Inner width dimension (if the cube is hollow).", + ) - pb.defParam("widthOuter", units="cm", description="Outer width") + pb.defParam( + "widthOuter", units=units.CM, description="Outermost width dimension" + ) - pb.defParam("heightOuter", units="?", description="?") + pb.defParam( + "heightInner", + units=units.CM, + default=0.0, + description="Inner height dimension (if the cube is hollow).", + ) - pb.defParam("heightInner", units="?", description="?") + pb.defParam( + "heightOuter", units=units.CM, description="Outermost height dimension" + ) return pDefs @@ -234,9 +257,11 @@ def getTriangleParameterDefinitions(): """Return parameters for Triangle.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("base", units="?", description="?") + pb.defParam( + "base", units=units.CM, description="Length of the base of the triangle" + ) - pb.defParam("height", units="?", description="?") + pb.defParam("height", units=units.CM, description="Height of the triangle") return pDefs @@ -245,7 +270,7 @@ def getUnshapedParameterDefinitions(): """Return parameters for UnshapedComponent.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("op", units="cm", description="Outer pitch") + pb.defParam("op", units=units.CM, description="Outer pitch") pb.defParam( "userDefinedVolume", units="cm^3", description="Volume of this object." @@ -258,59 +283,54 @@ def getRadialSegmentParameterDefinitions(): """Return parameters for RadialSegment.""" pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("inner_theta", units="?", description="?") - - pb.defParam("outer_theta", units="?", description="?") - - pb.defParam("inner_radius", units="?", description="?") - - pb.defParam("outer_radius", units="?", description="?") - - pb.defParam("height", units="?", description="?") - - pb.defParam("azimuthal_differential", units="?", description="?") - - pb.defParam("radius_differential", units="?", description="?") - - pb.defParam("inner_axial", units="?", description="?") - - pb.defParam("outer_axial", units="?", description="?") - - return pDefs - - -def getTorusParameterDefinitions(): - """Return parameters for Torus.""" - pDefs = parameters.ParameterDefinitionCollection() - with pDefs.createBuilder(location=ParamLocation.AVERAGE, saveToDB=True) as pb: - pb.defParam("inner_theta", units="?", description="?") - - pb.defParam("outer_theta", units="?", description="?") - - pb.defParam("inner_radius", units="?", description="?") - - pb.defParam("outer_radius", units="?", description="?") - - pb.defParam("height", units="?", description="?") - - pb.defParam("azimuthal_differential", units="?", description="?") - - pb.defParam("radius_differential", units="?", description="?") + pb.defParam( + "inner_theta", + units=units.ANGLE_RADIANS, + description="Starting axial position, in radians.", + ) - pb.defParam("inner_axial", units="?", description="?") + pb.defParam( + "outer_theta", + units=units.ANGLE_RADIANS, + description="Ending axial position, in radians.", + ) - pb.defParam("outer_axial", units="?", description="?") + pb.defParam( + "inner_radius", + units=units.CM, + description="Starting radial position; this can be zero.", + ) - pb.defParam("inner_minor_radius", units="?", description="?") + pb.defParam( + "outer_radius", units=units.CM, description="Ending radial position." + ) - pb.defParam("outer_minor_radius", units="?", description="?") + pb.defParam( + "height", units=units.CM, description="Height of the 3D radial segment." + ) - pb.defParam("major_radius", units="?", description="?") + pb.defParam( + "azimuthal_differential", + units=units.ANGLE_RADIANS, + description="Perturbation in the azimuthal dimension (see inner_theta and outer_theta).", + ) - pb.defParam("inner_phi", units="?", description="?") + pb.defParam( + "radius_differential", + units=units.UNITLESS, + description="Perturbation in the radial dimension (see inner_radius and outer_radius).", + ) - pb.defParam("outer_phi", units="?", description="?") + pb.defParam( + "inner_axial", + units=units.UNITLESS, + description="Perturbation in the axial dimension (picture outer_axial = inner_axial + height).", + ) - pb.defParam("reference_volume", units="?", description="?") + pb.defParam( + "outer_axial", + units=units.UNITLESS, + description="Perturbation result in the axial dimension (picture outer_axial = inner_axial + height).", + ) return pDefs diff --git a/armi/reactor/components/volumetricShapes.py b/armi/reactor/components/volumetricShapes.py index fb1461cde..cb7f84343 100644 --- a/armi/reactor/components/volumetricShapes.py +++ b/armi/reactor/components/volumetricShapes.py @@ -14,12 +14,11 @@ """3-dimensional shapes. - .. impl:: ARMI supports a reasonable set of basic shapes. :id: IMPL_REACTOR_SHAPES_2 :links: REQ_REACTOR_SHAPES - Here ARMI implements its support for: Spheres, Cubes, Toruses, and more. + Here ARMI implements its support for: Cubes, Spheres, RadialSegments, and more. """ import math @@ -89,7 +88,10 @@ def getComponentVolume(self, cold=False): class Cube(ShapedComponent): - """More correctly, a rectangular cuboid.""" + """More correctly, a rectangular cuboid. + + Optionally, there may be a centric cuboid volume cut out of center of this shape. + """ is3D = True @@ -141,7 +143,7 @@ def getComponentArea(self, cold=False): raise NotImplementedError("Cannot compute area of a cube component.") def getComponentVolume(self): - r"""Computes the volume of the cube in cm^3.""" + """Computes the volume of the cube in cm^3.""" lengthO = self.getDimension("lengthOuter") widthO = self.getDimension("widthOuter") heightO = self.getDimension("heightOuter") @@ -153,49 +155,24 @@ def getComponentVolume(self): return vol -class Torus(ShapedComponent): - r""" - A torus. - - Theta defines the extent the radial segment is rotated around the Z-axis - phi defines the extent around the major radius (i.e. a half torus is from 0 to pi) +class RadialSegment(ShapedComponent): + r"""A RadialSegement represents a volume element with thicknesses in the + azimuthal, radial and axial directions. - Notes - ----- - The dimensions are: + This a 3D projection of a 2D shape that is an angular slice of a ring or circle. - * p0 - inner minor radius - * p1 - outer minor radius - * p2 - major radius - * p3 - multiplier - * p4 - inner theta (optional) 0 (default) - * p5 - outer theta (optional) 2pi (default) - * p6 - inner phi (optional) 0 (default) - * p7 - outer phi (optional) 2pi (default) - * p8 - height (optional) (default) - * p9 - reference volume (optional) + The 2D shape is like the one below, with an inner and outer position for the + theta and the radius: Image:: - Z - | - | - | - | - ^ - - | / | minor radius - |-----------------------> major radius, R - | \ / - | - - - - | - Y ^ - | - - | - \ - | - \ \ - | theta | | - ZX-----------------------> major radius, X - | + | -XXXX\ + | - \XXXXXXX\ + | theta |XXXXXXX| + |-----------------------> radius, X | | """ @@ -204,153 +181,6 @@ class Torus(ShapedComponent): THERMAL_EXPANSION_DIMS = {} - pDefs = componentParameters.getTorusParameterDefinitions() - - def __init__( - self, - name, - material, - Tinput, - Thot, - inner_minor_radius=None, - outer_minor_radius=None, - major_radius=None, - mult=1, - inner_theta=0.0, - outer_theta=math.pi * 2, - inner_phi=0, - outer_phi=math.pi * 2, - height=None, - reference_volume=None, - inner_radius=None, - outer_radius=None, - isotopics=None, - mergeWith=None, - components=None, - ): - ShapedComponent.__init__( - self, - name, - material, - Tinput, - Thot, - isotopics=isotopics, - mergeWith=mergeWith, - components=components, - ) - height = 2 * outer_minor_radius if height is None else height - inner_radius = ( - major_radius - outer_minor_radius if inner_radius is None else inner_radius - ) - outer_radius = ( - major_radius + outer_minor_radius if outer_radius is None else outer_radius - ) - self._linkAndStoreDimensions( - components, - inner_minor_radius=inner_minor_radius, - outer_minor_radius=outer_minor_radius, - major_radius=major_radius, - mult=mult, - inner_theta=inner_theta, - outer_theta=outer_theta, - inner_phi=inner_phi, - outer_phi=outer_phi, - height=height, - reference_volume=reference_volume, - inner_radius=inner_radius, - outer_radius=outer_radius, - ) - - def getComponentArea( - self, refVolume=None, refArea=None, refHeight=None, cold=False - ): - r"""Computes the volume averaged area of the torus component. - - Parameters - ---------- - RefVolume - float - This is the volume to use when normalizing area - RefArea - float - This is the area to use when normalizing area - RefHeight - floats - This is the height to use to estimate volume if a reference volume - is not given - - Notes - ----- - Since area fractions are being used as a proxy for volume fractions, this method returns the reference - area normalized to the volume ratio of the torus within reference volume - """ - refPhi = self.getDimension("reference_phi", cold=cold) - height = self.getDimension("height", cold=cold) - if refArea is None: - # assume the footprint of the assembly is the footprint of a half torus - if "reference_phi" in self.p and "height" in self.p: - # reference volume and reference height defined in the component - refArea = refPhi / height - else: - majorRad = self.getDimension("major_radius", cold=cold) - outerMinorRad = self.getDimension("outer_minor_radius", cold=cold) - outerTh = self.getDimension("outer_theta") - innerTh = self.getDimension("inner_theta") - refArea = ( - math.pi - * ( - (majorRad + outerMinorRad) ** 2.0 - - (majorRad - outerMinorRad) ** 2.0 - ) - * (outerTh - innerTh) - / (2 * math.pi) - ) - - if refVolume is None: - if refPhi: - refVolume = refPhi - elif refHeight is None: - refVolume = refArea * height - else: - refVolume = refArea * refHeight - - return self.getVolume() * refArea / refVolume - - def getComponentVolume(self): - """Computes the volume of the torus in cm^3. - - Notes - ----- - The exact solution is the solution to integrating the volume: - dV ~ (dr)*((R+cos(Ph)*r)*dTh)*(r*dPh) - Solution from WolframAlpha: - integrate (m*(R + cos(phi)*r)*r) dr dphi dtheta, theta=t1...t2, r=r1...r2, phi=p1...p2 - """ - r1 = self.getDimension("inner_minor_radius") - r2 = self.getDimension("outer_minor_radius") - R = self.getDimension("major_radius") - mult = self.getDimension("mult") - t1 = self.getDimension("inner_theta") - t2 = self.getDimension("outer_theta") - p1 = self.getDimension("inner_phi") - p2 = self.getDimension("outer_phi") - dTh = t2 - t1 - dPhi = p1 - p2 - dRad = r1 - r2 - totRad = r1 + r2 - dAngle = math.sin(p1) - math.sin(p2) - vol = ( - mult - * dTh - * (3 * R * dPhi * dRad * totRad + 2 * (r1 ** 3 - r2 ** 3) * dAngle) - / 6.0 - ) - return vol - - -class RadialSegment(ShapedComponent): - - is3D = True - - THERMAL_EXPANSION_DIMS = {} - pDefs = componentParameters.getRadialSegmentParameterDefinitions() def __init__( @@ -440,7 +270,6 @@ class DifferentialRadialSegment(RadialSegment): This component class is super useful for defining ThRZ reactors and perturbing its dimensions using the optimization modules - See Also -------- geometry purturbation: diff --git a/armi/reactor/composites.py b/armi/reactor/composites.py index 1b25194b0..1c3c1abd9 100644 --- a/armi/reactor/composites.py +++ b/armi/reactor/composites.py @@ -227,7 +227,7 @@ def _defineBaseParameters(): pDefs.add( parameters.Parameter( "flags", - units=None, + units=units.UNITLESS, description="The type specification of this object", location=parameters.ParamLocation.AVERAGE, saveToDB=True, diff --git a/armi/reactor/parameters/parameterCollections.py b/armi/reactor/parameters/parameterCollections.py index cff62dff5..be380617b 100644 --- a/armi/reactor/parameters/parameterCollections.py +++ b/armi/reactor/parameters/parameterCollections.py @@ -28,6 +28,7 @@ SINCE_ANYTHING, NEVER, ) +from armi.utils import units GLOBAL_SERIAL_NUM = -1 @@ -49,7 +50,7 @@ def _getBaseParameterDefinitions(): pDefs.add( parameterDefinitions.Parameter( "serialNum", - units="", + units=units.UNITLESS, description=( "Unique serial integer for all objects in the ARMI Composite Tree. " "The numbers are only unique for a simulation, on an MPI rank." diff --git a/armi/reactor/parameters/parameterDefinitions.py b/armi/reactor/parameters/parameterDefinitions.py index 54ce24c97..0dc5a38d2 100644 --- a/armi/reactor/parameters/parameterDefinitions.py +++ b/armi/reactor/parameters/parameterDefinitions.py @@ -33,6 +33,7 @@ import numpy +from armi import runLog from armi.reactor.flags import Flags from armi.reactor.parameters.exceptions import ParameterError, ParameterDefinitionError @@ -208,7 +209,7 @@ def setParameter(selfObj, value): @functools.total_ordering class Parameter: - r"""Metadata about a specific parameter.""" + """Metadata about a specific parameter.""" _validName = re.compile("^[a-zA-Z0-9_]+$") @@ -247,10 +248,14 @@ def __init__( serializer: Optional[Type[Serializer]] = None, ): assert self._validName.match(name), "{} is not a valid param name".format(name) + # nonsensical to have a serializer with no intention of saving to DB assert not (serializer is not None and not saveToDB) - # nonsensical to have a serializer with no intention of saving to DB; probably - # in error assert serializer is None or saveToDB + # TODO: This warning is temporary. At some point, it will become an AssertionError. + if not len(description): + runLog.warning( + f"DeprecationWarning: Parameter {name} defined without description." + ) self.collectionType = _Undefined self.name = name self.fieldName = "_p_" + name @@ -422,7 +427,7 @@ def __len__(self): return len(self._paramDefs) def __getitem__(self, name): - r"""Get a parameter by name. + """Get a parameter by name. Notes ----- @@ -587,7 +592,7 @@ def createBuilder(self, *args, **kwargs): class ParameterBuilder: - r"""Factory for creating Parameter and parameter properties.""" + """Factory for creating Parameter and parameter properties.""" def __init__( self, @@ -596,7 +601,7 @@ def __init__( categories=None, saveToDB=True, ): - r"""Create a :py:class:`ParameterBuilder`.""" + """Create a :py:class:`ParameterBuilder`.""" self._entered = False self._defaultLocation = location self._defaultCategories = set(categories or []) # make sure it is always a set diff --git a/armi/reactor/reactorParameters.py b/armi/reactor/reactorParameters.py index 966770a3c..2d522d7b8 100644 --- a/armi/reactor/reactorParameters.py +++ b/armi/reactor/reactorParameters.py @@ -25,8 +25,8 @@ def defineReactorParameters(): pDefs.add( parameters.Parameter( "rdIterNum", - units="int", - description="Number of region-density equilibrium iterations", + units=units.UNITLESS, + description="Integer number of region-density equilibrium iterations", location=ParamLocation.AVERAGE, saveToDB=True, default=parameters.NoDefault, @@ -38,22 +38,24 @@ def defineReactorParameters(): with pDefs.createBuilder(location=ParamLocation.AVERAGE, default=0.0) as pb: pb.defParam( "cycle", - units="int", - description="current cycle of the simulation", + units=units.UNITLESS, + description="Current cycle of the simulation (integer)", default=0, ) pb.defParam( "cycleLength", - units="days", + units=units.DAYS, description="Length of the cycle, including outage time described by availabilityFactor", ) - pb.defParam("stepLength", units="days", description="Length of current step") + pb.defParam( + "stepLength", units=units.DAYS, description="Length of current step" + ) pb.defParam( "availabilityFactor", - units="fraction", + units=units.UNITLESS, description="Availability factor of the plant. This is the fraction of the time that " "the plant is operating.", default=1.0, @@ -61,7 +63,7 @@ def defineReactorParameters(): pb.defParam( "capacityFactor", - units="fraction", + units=units.UNITLESS, description="The fraction of power produced by the plant this cycle over the " "full-power, 100% uptime potential of the plant.", default=1.0, @@ -71,12 +73,14 @@ def defineReactorParameters(): pb.defParam( "time", - units="yr", + units=units.YEARS, description="Time of reactor life from BOL to current time node", categories=["depletion"], ) - pb.defParam("timeNode", units="", description="timeNode", default=0) + pb.defParam( + "timeNode", units=units.UNITLESS, description="Integer timeNode", default=0 + ) with pDefs.createBuilder( location=ParamLocation.AVERAGE, default=0.0, categories=["economics"] @@ -121,7 +125,7 @@ def defineCoreParameters(): pb.defParam( "orientation", - units="degrees", + units=units.ANGLE_DEGREES, description=( "Triple representing rotations counterclockwise around each spatial axis. For example, " "a hex assembly rotated by 1/6th has orientation (0,0,60.0)" @@ -131,20 +135,21 @@ def defineCoreParameters(): with pDefs.createBuilder(location=ParamLocation.AVERAGE, default=0.0) as pb: - pb.defParam("currentPercentExpanded", units="", description="") - pb.defParam( - "maxAssemNum", units=None, description="maximum assembly number", default=0 + "maxAssemNum", + units=units.UNITLESS, + description="Maximum assembly number", + default=0, ) - pb.defParam("numMoves", units="", description="numMoves", default=0) + pb.defParam("numMoves", units=units.UNITLESS, description="numMoves", default=0) with pDefs.createBuilder(location="N/A", categories=["control rods"]) as pb: pb.defParam( "crMostValuablePrimaryRodLocation", default="", - units=None, + units=units.UNITLESS, saveToDB=True, description=( "Core assembly location for the most valuable primary control rod." @@ -153,7 +158,7 @@ def defineCoreParameters(): pb.defParam( "crMostValuableSecondaryRodLocation", default="", - units=None, + units=units.UNITLESS, saveToDB=True, description=( "Core assembly location for the most valuable secondary control rod." @@ -188,7 +193,7 @@ def defineCoreParameters(): pb.defParam( "axialMesh", - units="cm", + units=units.CM, description="Global axial mesh of the reactor core from bottom to top.", default=None, location=ParamLocation.TOP, @@ -198,13 +203,15 @@ def defineCoreParameters(): pb.defParam( "referenceBlockAxialMesh", - units="cm", + units=units.CM, description="The axial block boundaries that assemblies should conform to in a uniform mesh case.", default=None, ) pb.defParam( - "critSearchSlope", units=None, description="Critical keff search slope" + "critSearchSlope", + units="1/day", + description="Critical keff search slope", ) pb.defParam( @@ -213,15 +220,19 @@ def defineCoreParameters(): description="The time it takes to produce enough spent fuel to fuel a daughter reactor", ) - pb.defParam("fissileMass", units="g", description="Fissile mass of the reactor") + pb.defParam( + "fissileMass", units=units.GRAMS, description="Fissile mass of the reactor" + ) pb.defParam( - "heavyMetalMass", units="g", description="Heavy Metal mass of the reactor" + "heavyMetalMass", + units=units.GRAMS, + description="Heavy Metal mass of the reactor", ) pb.defParam( "keffUnc", - units=None, + units=units.UNITLESS, saveToDB=True, default=0.0, description=( @@ -231,29 +242,37 @@ def defineCoreParameters(): pb.defParam( "lastKeff", - units=None, + units=units.UNITLESS, description="Previously calculated Keff for potential keff convergence", ) pb.defParam( "loadPadDpaAvg", - units="dpa", + units=units.DPA, description="The highest average dpa in any load pad", ) pb.defParam( - "loadPadDpaPeak", units="dpa", description="The peak dpa in any load pad" + "loadPadDpaPeak", + units=units.DPA, + description="The peak dpa in any load pad", ) - pb.defParam("maxcladFCCI", units="", description="", default=0.0) + pb.defParam( + "maxcladFCCI", + units=units.MICRONS, + description="The core wide maximum amount of cladding wastage due to fuel chemical clad interaction calculated " + + "at the 0-sigma TH HCF temperatures and using the conservative FCCI model", + default=0.0, + ) pb.defParam( "maxDPA", - units="dpa", + units=units.DPA, description="Maximum DPA based on pin-level max if it exists, block level max otherwise", ) - pb.defParam("maxGridDpa", units="dpa", description="Grid plate max dpa") + pb.defParam("maxGridDpa", units=units.DPA, description="Grid plate max dpa") pb.defParam( "maxProcessMemoryInMB", @@ -275,19 +294,19 @@ def defineCoreParameters(): pb.defParam( "outsideFuelRing", - units="int", - description="The ring with the fraction of flux that best meets the target", + units=units.UNITLESS, + description="The ring (integer) with the fraction of flux that best meets the target", ) pb.defParam( "outsideFuelRingFluxFr", - units=None, + units=units.UNITLESS, description="Ratio of the flux in a ring to the total reactor fuel flux", ) pb.defParam( "peakGridDpaAt60Years", - units="dpa", + units=units.DPA, description="Grid plate peak dpa after 60 years irradiation", ) @@ -309,12 +328,14 @@ def defineCoreParameters(): pb.defParam( "THmaxDeltaPPump", - units="Pa", + units=units.PASCALS, description="The maximum pumping pressure rise required to pump the given mass flow rate through the rod bundle", ) pb.defParam( - "THmaxDilationPressure", units="", description="THmaxDilationPressure" + "THmaxDilationPressure", + units=units.PASCALS, + description="THmaxDilationPressure", ) pb.defParam( @@ -329,28 +350,40 @@ def defineCoreParameters(): pb.defParam( "power", - units="W", + units=units.WATTS, description="Thermal power of the reactor core. Corresponds to the " "nuclear power generated in the core.", ) pb.defParam( "powerDecay", - units="W", + units=units.WATTS, description="Decay power from decaying radionuclides", ) - pb.defParam("medAbsCore", units="?", description="?") + pb.defParam( + "medAbsCore", + units=units.EV, + description="Median energy of neutrons absorbed in the core", + ) - pb.defParam("medFluxCore", units="?", description="?") + pb.defParam( + "medFluxCore", + units=units.EV, + description="Median energy of neutrons in the core", + ) - pb.defParam("medSrcCore", units="?", description="?") + pb.defParam( + "medSrcCore", + units=units.EV, + description="Median energy of source neutrons in the core?", + ) - pb.defParam("pkFlux", units="?", description="?") + pb.defParam("pkFlux", units="n/cm2-s", description="Peak flux in the core") pb.defParam( "maxdetailedDpaPeak", - units="dpa", + units=units.DPA, description="Highest peak dpa of any block in the problem", ) @@ -366,25 +399,25 @@ def defineCoreParameters(): pb.defParam( "maxDetailedDpaThisCycle", - units="dpa", + units=units.DPA, description="Max increase in dpa this cycle (only defined at EOC)", ) pb.defParam( "dpaFullWidthHalfMax", - units="cm", + units=units.CM, description="Full width at half max of the detailedDpa distribution", ) pb.defParam( "elevationOfACLP3Cycles", - units="cm", + units=units.CM, description="minimum axial location of the ACLP for 3 cycles at peak dose", ) pb.defParam( "elevationOfACLP7Cycles", - units="cm", + units=units.CM, description="minimum axial location of the ACLP for 7 cycles at peak dose", ) @@ -398,37 +431,47 @@ def defineCoreParameters(): pb.defParam( "maxBuF", - units="%", + units=units.PERCENT, description="Maximum burnup seen in any feed assemblies", ) pb.defParam( "maxBuI", - units="%", + units=units.PERCENT, description="Maximum burnup seen in any igniter assemblies", ) - pb.defParam("keff", units=None, description="Global multiplication factor") + pb.defParam( + "keff", units=units.UNITLESS, description="Global multiplication factor" + ) pb.defParam( - "peakKeff", units=None, description="Maximum keff in the simulation" + "peakKeff", + units=units.UNITLESS, + description="Maximum keff in the simulation", ) pb.defParam( - "fastFluxFrAvg", units=None, description="Fast flux fraction average" + "fastFluxFrAvg", + units=units.UNITLESS, + description="Fast flux fraction average", ) pb.defParam( - "leakageFracTotal", units=None, description="Total leakage fraction" + "leakageFracTotal", + units=units.UNITLESS, + description="Total leakage fraction", ) pb.defParam( - "leakageFracPlanar", units=None, description="Leakage fraction in planar" + "leakageFracPlanar", + units=units.UNITLESS, + description="Leakage fraction in planar", ) pb.defParam( "leakageFracAxial", - units=None, + units=units.UNITLESS, description="Leakage fraction in axial direction", ) @@ -446,7 +489,7 @@ def defineCoreParameters(): pb.defParam( "jumpRing", - units=None, + units=units.UNITLESS, description=( "Radial ring number where bred-up fuel assemblies shuffle jump from the low power to the " "high power region." @@ -495,7 +538,7 @@ def defineCoreParameters(): pb.defParam("voidWorth", units="$", description="Coolant void worth") - pb.defParam("voidedKeff", units=None, description="Voided keff") + pb.defParam("voidedKeff", units=units.UNITLESS, description="Voided keff") pb.defParam( "radialHT9", @@ -517,14 +560,14 @@ def defineCoreParameters(): pb.defParam( "beta", - units=None, + units=units.UNITLESS, description="Effective delayed neutron fraction", default=None, ) pb.defParam( "betaComponents", - units=None, + units=units.UNITLESS, description="Group-wise delayed neutron fractions.", default=None, ) @@ -538,12 +581,14 @@ def defineCoreParameters(): pb.defParam( "promptNeutronGenerationTime", - units="s", + units=units.SECONDS, description="Prompt neutron generation time", ) pb.defParam( - "promptNeutronLifetime", units="s", description="Prompt neutron lifetime" + "promptNeutronLifetime", + units=units.SECONDS, + description="Prompt neutron lifetime", ) with pDefs.createBuilder( @@ -698,13 +743,15 @@ def defineCoreParameters(): location=ParamLocation.AVERAGE, categories=["equilibrium"] ) as pb: - pb.defParam("boecKeff", units=None, description="BOEC Keff", default=0.0) + pb.defParam( + "boecKeff", units=units.UNITLESS, description="BOEC Keff", default=0.0 + ) pb.defParam( "cyclics", - units="int", + units=units.UNITLESS, description=( - "The number of cyclic mode equilibrium-cycle " + "The integer number of cyclic mode equilibrium-cycle " "iterations that have occurred so far" ), default=0, @@ -712,7 +759,7 @@ def defineCoreParameters(): pb.defParam( "maxCyclicNErr", - units=None, + units=units.UNITLESS, description="Maximum relative number density error", default=0.0, ) @@ -723,42 +770,47 @@ def defineCoreParameters(): pb.defParam( "breedingRatio", - units="N/A", + units=units.UNITLESS, description="Breeding ratio of the reactor", default=0.0, ) - pb.defParam("ConvRatioCore", units="?", description="?") + pb.defParam( + "ConvRatioCore", + units=units.UNITLESS, + description="Conversion ratio of the core", + ) - pb.defParam("absPerFisCore", units="?", description="?") + pb.defParam( + "absPerFisCore", + units=units.UNITLESS, + description="absorptions per fission in core", + ) pb.defParam( "axialExpansionPercent", - units="%", + units=units.PERCENT, description="Percent of axial growth of fuel blocks", default=0.0, ) - pb.defParam("coupledIteration", units="?", description="?", default=0) - - pb.defParam("fisFrac", units="?", description="?") - - pb.defParam("fisRateCore", units="?", description="?") + pb.defParam( + "coupledIteration", + units=units.UNITLESS, + description="Pre-defined number of tightly coupled iterations.", + default=0, + ) pb.defParam( - "maxdilationTotal", - units="?", - description="?", - default=0.0, - categories=["block-max"], + "fisFrac", + units=units.UNITLESS, + description="Percent of fissions in fertile nuclides", ) pb.defParam( - "maxresidence", - units="?", - description="?", - default=0.0, - categories=["block-max"], + "fisRateCore", + units=units.UNITLESS, + description="peak/average fission rate in core", ) return pDefs diff --git a/armi/reactor/tests/test_assemblies.py b/armi/reactor/tests/test_assemblies.py index b0913f73e..f8a93e460 100644 --- a/armi/reactor/tests/test_assemblies.py +++ b/armi/reactor/tests/test_assemblies.py @@ -212,9 +212,7 @@ def setUp(self): # Use these if they are needed self.blockParams = { "height": self.height, - "avgFuelTemp": 873.0, "bondRemoved": 0.0, - "bu": 15.1, "buGroupNum": 0, "buLimit": 35, "buRate": 0.0, @@ -233,8 +231,6 @@ def setUp(self): self.blockSettings = { "axMesh": 1, - "baseBu": 0.0, - "basePBu": 0.0, "bondBOL": 0.0028698019026172574, "buGroup": "A", "height": 14.4507, @@ -920,27 +916,27 @@ def test_getBlocksBetweenElevations(self): def test_getParamValuesAtZ(self): # single value param - for b, temp in zip(self.assembly, [800, 850, 900]): - b.p.avgFuelTemp = temp - avgFuelTempDef = b.p.paramDefs["avgFuelTemp"] - originalLoc = avgFuelTempDef.location + for b, temp in zip(self.assembly, [80, 85, 90]): + b.p.percentBu = temp + percentBuDef = b.p.paramDefs["percentBu"] + originalLoc = percentBuDef.location try: self.assertAlmostEqual( - 875, self.assembly.getParamValuesAtZ("avgFuelTemp", 20.0) + 87.5, self.assembly.getParamValuesAtZ("percentBu", 20.0) ) - avgFuelTempDef.location = parameters.ParamLocation.BOTTOM + percentBuDef.location = parameters.ParamLocation.BOTTOM self.assertAlmostEqual( - 825, - self.assembly.getParamValuesAtZ("avgFuelTemp", 5.0, fillValue="extend"), + 82.5, + self.assembly.getParamValuesAtZ("percentBu", 5.0, fillValue="extend"), ) - avgFuelTempDef.location = parameters.ParamLocation.TOP + percentBuDef.location = parameters.ParamLocation.TOP self.assertAlmostEqual( - 825, self.assembly.getParamValuesAtZ("avgFuelTemp", 15.0) + 82.5, self.assembly.getParamValuesAtZ("percentBu", 15.0) ) for b in self.assembly: - b.p.avgFuelTemp = None + b.p.percentBu = None self.assertTrue( - numpy.isnan(self.assembly.getParamValuesAtZ("avgFuelTemp", 25.0)) + numpy.isnan(self.assembly.getParamValuesAtZ("percentBu", 25.0)) ) # multiDimensional param @@ -970,7 +966,7 @@ def test_getParamValuesAtZ(self): value = self.assembly.getParamValuesAtZ("THcornTemp", 20.0) self.assertTrue(numpy.allclose([200, 201, 202, 203, 204, 205], value)) finally: - avgFuelTempDef.location = originalLoc + percentBuDef.location = originalLoc def test_hasContinuousCoolantChannel(self): self.assertFalse(self.assembly.hasContinuousCoolantChannel()) diff --git a/armi/reactor/tests/test_blocks.py b/armi/reactor/tests/test_blocks.py index 0b7fb8ad7..8899059a6 100644 --- a/armi/reactor/tests/test_blocks.py +++ b/armi/reactor/tests/test_blocks.py @@ -374,8 +374,8 @@ def test_getSmearDensityMultipleLiner(self): self.assertAlmostEqual(cur, ref, places=10) def test_timeNodeParams(self): - self.block.p["avgFuelTemp", 3] = 2.0 - self.assertEqual(2.0, self.block.p[("avgFuelTemp", 3)]) + self.block.p["buRate", 3] = 0.1 + self.assertEqual(0.1, self.block.p[("buRate", 3)]) def test_getType(self): ref = "plenum pin" diff --git a/armi/reactor/tests/test_components.py b/armi/reactor/tests/test_components.py index 435b9caa2..779022569 100644 --- a/armi/reactor/tests/test_components.py +++ b/armi/reactor/tests/test_components.py @@ -37,7 +37,6 @@ SolidRectangle, Square, Triangle, - Torus, RadialSegment, DifferentialRadialSegment, DerivedShape, @@ -1317,24 +1316,6 @@ def test_thermallyExpands(self): self.assertFalse(self.component.THERMAL_EXPANSION_DIMS) -class TestTorus(TestShapedComponent): - componentCls = Torus - componentDims = { - "Tinput": 25.0, - "Thot": 430.0, - "inner_minor_radius": 28.73, - "outer_minor_radius": 30, - "major_radius": 140, - } - - def test_thermallyExpands(self): - self.assertFalse(self.component.THERMAL_EXPANSION_DIMS) - - def test_getVolume(self): - expectedVolume = 2.0 * 103060.323859 - self.assertAlmostEqual(self.component.getVolume() / expectedVolume, 1.0) - - class TestRadialSegment(TestShapedComponent): componentCls = RadialSegment componentDims = { diff --git a/armi/reactor/tests/test_composites.py b/armi/reactor/tests/test_composites.py index 242b73d55..6094b4010 100644 --- a/armi/reactor/tests/test_composites.py +++ b/armi/reactor/tests/test_composites.py @@ -48,8 +48,7 @@ class MockBP: def getDummyParamDefs(): dummyDefs = parameters.ParameterDefinitionCollection() with dummyDefs.createBuilder() as pb: - - pb.defParam("type", units="none", description="Fake type") + pb.defParam("type", units=utils.units.UNITLESS, description="Fake type") return dummyDefs diff --git a/armi/reactor/tests/test_reactors.py b/armi/reactor/tests/test_reactors.py index f074be463..efcf9f211 100644 --- a/armi/reactor/tests/test_reactors.py +++ b/armi/reactor/tests/test_reactors.py @@ -822,7 +822,6 @@ def test_removeAssemblyNoSfp(self): runLog.LOG.setVerbosity(logging.INFO) a = self.r.core[-1] # last assembly - b = a[-1] # use the last block in case we ever figure out stationary blocks aLoc = a.spatialLocator self.assertIsNotNone(aLoc.grid) core = self.r.core diff --git a/armi/scripts/__init__.py b/armi/scripts/__init__.py index 2ee3d3be7..68246dea8 100644 --- a/armi/scripts/__init__.py +++ b/armi/scripts/__init__.py @@ -12,10 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -This package contains some peripheral scripts that do something useful using the ARMI system. - -* There are migration scripts to help with backward compatibility -* There are analysis scripts that help prepare various physics prerequisites - -""" +"""This package contains some migration scripts to help with backward compatibility.""" diff --git a/armi/utils/reportPlotting.py b/armi/utils/reportPlotting.py index 0954d87dd..277f6cd47 100644 --- a/armi/utils/reportPlotting.py +++ b/armi/utils/reportPlotting.py @@ -465,7 +465,6 @@ def _getMechanicalVals(r): labels, vals = list( zip( *[ - ("Dilation", r.core.p.maxdilationTotal), ("Hold down", 1.0), ("Distortion", 3.0), ] @@ -513,7 +512,6 @@ def _getFuelVals(r): data = [ ("Max FCCI", r.core.p.maxcladFCCI), ("Max BU", r.core.p.maxpercentBu), - ("Residence", r.core.p.maxresidence), ( "Smear dens.", r.core.calcAvgParam("smearDensity", generationNum=2, typeSpec=Flags.FUEL), diff --git a/armi/utils/units.py b/armi/utils/units.py index 69af40ca2..716f24b15 100644 --- a/armi/utils/units.py +++ b/armi/utils/units.py @@ -18,10 +18,24 @@ # Names +ANGLE_DEGREES = "degrees" +ANGLE_RADIANS = "radians" +CM = "cm" +DAYS = "days" DEGC = chr(176) + "C" +DPA = "dpa" +EV = "eV" +GRAMS = "g" +KG = "kg" +METERS = "m" MICRONS = chr(181) + "m" -NOT_APPLICABLE = "N/A" +NOT_APPLICABLE = "N/A" # prefer UNITLESS +PASCALS = "Pa" +PERCENT = "%" +SECONDS = "s" UNITLESS = "" +WATTS = "W" +YEARS = "yr" # conversions C_TO_K = 273.15 diff --git a/doc/release/0.2.rst b/doc/release/0.2.rst index 22e1ff300..6a9e3be3b 100644 --- a/doc/release/0.2.rst +++ b/doc/release/0.2.rst @@ -9,6 +9,7 @@ Release Date: TBD What's new in ARMI ------------------ #. The Spent Fuel Pool (``sfp``) was moved from the ``Core`` out to the ``Reactor``. (`PR#1336 `_) +#. Broad cleanup of ``Parameters``: filled in all empty units and descriptions, removed unused params. (`PR#1345 `_) #. Removed redundant ``Material.name`` variable. (`PR#1335 `_) #. Added SHA1 hashes of XS control files to the welcome text. (`PR#1334 `_) #. TBD