Skip to content

Commit 908c5e2

Browse files
committed
Fix incomplete merge and reformat
1 parent 00c57c2 commit 908c5e2

File tree

2 files changed

+10
-61
lines changed

2 files changed

+10
-61
lines changed

armicontrib/armiopenmc/inputWriters.py

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ def _buildCell(self, component, material, block, origin=(0.0, 0.0), outsideBuffe
702702
fill=material,
703703
region=openmc.Union(cellRegions),
704704
)
705-
if component.getVolume()>0:
706-
cell.temperature=component.getAverageTempInC()+274
705+
if component.getVolume() > 0:
706+
cell.temperature = component.getAverageTempInC() + 274
707707
return cell
708708

709709

@@ -719,66 +719,16 @@ def _buildComponentMaterial(component):
719719
for n in componentNuclides:
720720
compNucDens[n] = component.getNumberDensity(n)
721721

722-
<<<<<<< HEAD
723722
if any([isinstance(nb.byName[nuc], nb.NaturalNuclideBase) for nuc in compNucDens.keys()]):
724723
compNucDens = _expandNaturalNuclides(compNucDens)
725-
=======
726-
# Expand any NaturalNuclideBases out to their NaturalIsotopics
727-
while any(
728-
[
729-
isinstance(nuclideBases.byName[nuclideName], nuclideBases.NaturalNuclideBase)
730-
for nuclideName in componentNuclideDensities.keys()
731-
]
732-
):
733-
newDensities = dict(componentNuclideDensities)
734-
for nuclideName in componentNuclideDensities.keys():
735-
nuclide = nuclideBases.byName[nuclideName]
736-
if isinstance(nuclide, nuclideBases.NaturalNuclideBase):
737-
elementDensity = componentNuclideDensities[nuclideName]
738-
del newDensities[nuclideName]
739-
for n in nuclide.getNaturalIsotopics():
740-
if n.name in newDensities:
741-
newDensities[n.name] += n.abundance * elementDensity
742-
else:
743-
newDensities[n.name] = n.abundance * elementDensity
744-
componentNuclideDensities = newDensities
745-
>>>>>>> d9a2e18... Move block lattice construction for 2 mult groups to its own function and reformat with black (incorrect line length used before)
746724

747725
if any([isinstance(nb.byName[nuc], nb.LumpNuclideBase) for nuc in compNucDens.keys()]):
748726
compNucDens = _expandLumpedNuclides(compNucDens)
749727

750-
<<<<<<< HEAD
751728
totalComponentNuclideDensity = sum([compNucDens[n] for n in compNucDens.keys()])
752729

753730
for nuclideName in compNucDens.keys():
754731
nuclide = nb.byName[nuclideName]
755-
=======
756-
with open(REFERENCE_LUMPED_FISSION_PRODUCT_FILE, "r") as LFP_FILE:
757-
LFP_TEXT = LFP_FILE.read()
758-
fpd = lumpedFissionProduct.FissionProductDefinitionFile(io.StringIO(LFP_TEXT))
759-
fpd.fName = REFERENCE_LUMPED_FISSION_PRODUCT_FILE
760-
lfps = fpd.createLFPsFromFile()
761-
762-
newDensities = dict(componentNuclideDensities)
763-
for nuclideName in componentNuclideDensities.keys():
764-
nuclide = nuclideBases.byName[nuclideName]
765-
if isinstance(nuclide, nuclideBases.LumpNuclideBase):
766-
lumpDensity = componentNuclideDensities[nuclideName]
767-
del newDensities[nuclideName]
768-
for n in lfps[nuclideName].keys():
769-
if n.name in newDensities:
770-
newDensities[n.name] += lfps[nuclideName][n] * lumpDensity
771-
else:
772-
newDensities[n.name] = lfps[nuclideName][n] * lumpDensity
773-
componentNuclideDensities = newDensities
774-
775-
totalComponentNuclideDensity = sum(
776-
[componentNuclideDensities[n] for n in componentNuclideDensities.keys()]
777-
)
778-
779-
for nuclideName in componentNuclideDensities.keys():
780-
nuclide = nuclideBases.byName[nuclideName]
781-
>>>>>>> d9a2e18... Move block lattice construction for 2 mult groups to its own function and reformat with black (incorrect line length used before)
782732
if nuclide.a > 0: # Skip dummy nuclides. Natural and Lumped should be taken care of
783733
nuclideGNDSName = openmc.data.gnds_name(Z=nuclide.z, A=nuclide.a, m=nuclide.state)
784734
componentMaterial.add_nuclide(
@@ -793,6 +743,7 @@ def _buildComponentMaterial(component):
793743

794744
return componentMaterial
795745

746+
796747
def _expandNaturalNuclides(compNucDens):
797748
# Expand any NaturalNuclideBases out to their NaturalIsotopics
798749
newDensities = dict(compNucDens)
@@ -916,21 +867,21 @@ def _blendHelixComponentsIntoCoolant(block, solventName="coolant"):
916867
def generateThermalScatteringLabel(tsl):
917868
"""Derive the OpenMC label of a TSL"""
918869
first = next(iter(tsl.nbs))
919-
if first == nuclideBases.byName["C"] and tsl.compoundName == "reactor-graphite-10P":
870+
if first == nb.byName["C"] and tsl.compoundName == "reactor-graphite-10P":
920871
return "c_Graphite_10p"
921-
if first == nuclideBases.byName["C"] and tsl.compoundName == "reactor-graphite-30P":
872+
if first == nb.byName["C"] and tsl.compoundName == "reactor-graphite-30P":
922873
return "c_Graphite_30p"
923-
if first == nuclideBases.byName["C"] and tsl.compoundName == "crystalline-graphite":
874+
if first == nb.byName["C"] and tsl.compoundName == "crystalline-graphite":
924875
return "c_Graphite"
925-
if first == nuclideBases.byName["BE"] and tsl.compoundName == "Be-metal":
876+
if first == nb.byName["BE"] and tsl.compoundName == "Be-metal":
926877
return "c_Be"
927878
if len(tsl.nbs) > 1:
928879
# just compound (like SiO2)
929880
label = f"c_{tsl.compoundName}"
930-
elif isinstance(first, nuclideBases.NaturalNuclideBase):
881+
elif isinstance(first, nb.NaturalNuclideBase):
931882
# element in compound
932883
label = f"c_{first.element.symbol.capitalize()}_in_{tsl.compoundName}"
933-
elif isinstance(first, nuclideBases.NuclideBase):
884+
elif isinstance(first, nb.NuclideBase):
934885
# just isotope
935886
label = f"c_{first.name.capitalize()}"
936887
else:

openmcdemo/cli/runFFTF.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ def invoke(self):
116116
mesh.upper_right = [100.0, 100.0, 300.0]
117117
mesh.dimension = [500, 500, 1]
118118
meshFilter = openmc.MeshFilter(mesh=mesh)
119-
energyGroupStructure = parseEnergyGroupStructure(
120-
energyGroups.getGroupStructure("ARMI33")
121-
)
119+
energyGroupStructure = parseEnergyGroupStructure(energyGroups.getGroupStructure("ARMI33"))
122120
energyFilter = openmc.EnergyFilter(energyGroupStructure)
123121
meshFluxTally = openmc.Tally(1, name="custom tally")
124122
meshFluxTally.scores = ["flux"]

0 commit comments

Comments
 (0)