@@ -702,8 +702,8 @@ def _buildCell(self, component, material, block, origin=(0.0, 0.0), outsideBuffe
702
702
fill = material ,
703
703
region = openmc .Union (cellRegions ),
704
704
)
705
- if component .getVolume ()> 0 :
706
- cell .temperature = component .getAverageTempInC ()+ 274
705
+ if component .getVolume () > 0 :
706
+ cell .temperature = component .getAverageTempInC () + 274
707
707
return cell
708
708
709
709
@@ -719,66 +719,16 @@ def _buildComponentMaterial(component):
719
719
for n in componentNuclides :
720
720
compNucDens [n ] = component .getNumberDensity (n )
721
721
722
- < << << << HEAD
723
722
if any ([isinstance (nb .byName [nuc ], nb .NaturalNuclideBase ) for nuc in compNucDens .keys ()]):
724
723
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 )
746
724
747
725
if any ([isinstance (nb .byName [nuc ], nb .LumpNuclideBase ) for nuc in compNucDens .keys ()]):
748
726
compNucDens = _expandLumpedNuclides (compNucDens )
749
727
750
- < << << << HEAD
751
728
totalComponentNuclideDensity = sum ([compNucDens [n ] for n in compNucDens .keys ()])
752
729
753
730
for nuclideName in compNucDens .keys ():
754
731
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 )
782
732
if nuclide .a > 0 : # Skip dummy nuclides. Natural and Lumped should be taken care of
783
733
nuclideGNDSName = openmc .data .gnds_name (Z = nuclide .z , A = nuclide .a , m = nuclide .state )
784
734
componentMaterial .add_nuclide (
@@ -793,6 +743,7 @@ def _buildComponentMaterial(component):
793
743
794
744
return componentMaterial
795
745
746
+
796
747
def _expandNaturalNuclides (compNucDens ):
797
748
# Expand any NaturalNuclideBases out to their NaturalIsotopics
798
749
newDensities = dict (compNucDens )
@@ -916,21 +867,21 @@ def _blendHelixComponentsIntoCoolant(block, solventName="coolant"):
916
867
def generateThermalScatteringLabel (tsl ):
917
868
"""Derive the OpenMC label of a TSL"""
918
869
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" :
920
871
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" :
922
873
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" :
924
875
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" :
926
877
return "c_Be"
927
878
if len (tsl .nbs ) > 1 :
928
879
# just compound (like SiO2)
929
880
label = f"c_{ tsl .compoundName } "
930
- elif isinstance (first , nuclideBases .NaturalNuclideBase ):
881
+ elif isinstance (first , nb .NaturalNuclideBase ):
931
882
# element in compound
932
883
label = f"c_{ first .element .symbol .capitalize ()} _in_{ tsl .compoundName } "
933
- elif isinstance (first , nuclideBases .NuclideBase ):
884
+ elif isinstance (first , nb .NuclideBase ):
934
885
# just isotope
935
886
label = f"c_{ first .name .capitalize ()} "
936
887
else :
0 commit comments