Commit b0175602 authored by Gurecky, William's avatar Gurecky, William
Browse files

assign unique powID to each asssembly when setting power shape from 3d distribution

parent bd44addb
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import Solid
import Section
import utils.utils as utils


class NodalChannelGeom(object):
   """ Calculates geometry of a nodal channel in the model

@@ -901,7 +902,7 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):

   @property
   def z_power_grid(me):
      """ manually adjust z center endpoints to be consistent """
      """ Adjust z center endpoints to span entire axial core height """
      z_pwr_grid = me.z_centers
      z_pwr_grid[0] = 0.0
      z_pwr_grid[-1] = np.cumsum(me.dz)[-1] + 0.0001
@@ -926,7 +927,7 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
      axial power shape.

      Args:
         powerDist (numpy.ndarray): 3 dim array. Contains power distribution with indixing
         powerDist (numpy.ndarray): 3 dim array. Contains power distribution with indexing
           (asm_i, asm_j, asm_axial)
         wgts (numpy.ndarray): Same shape as powerDist. Weights of powers (optional)
         coreStart (float): The axial location of the start of the core.  In CTF, the bottom of the
@@ -939,8 +940,6 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
      assert powerDist.shape[1] == me.chMapObj.getAssemDimLen()
      assert me.z_power_grid.size == powerDist.shape[2]

      # expand powerDist to NodalMesh

      # normalize 3d powers
      if wgts is None:
          wgts = np.ones(powerDist.shape)
@@ -956,13 +955,12 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
            for j in range(me.chMapObj.getAssemDimLen()):
               assemID = me.chMapObj.getAssemIndexFromLoc(i, j)
               if assemID:
                  rods = me.rodsInAssem[assemID]
                  for rod in rods:
                     powID = "pwr_" + str(rod)
                  powID = "pwr_" + str(assemID)
                  me.model.addAxialPowerShape(powID, me.z_power_grid, powerDist[i, j, :])
                     obj.powID = powID
                  rods = me.rodsInAssem[assemID]
                  for rodID in rods:
                     obj_rod = me.model.solidObjects[rodID]
                     objType_rod = me.model.solidTypeIDs[rodID]
                     obj_rod.powID = powID
                     # radial power factors are implicit in the 3d power distribution
                     if powerDist[i, j, 0] == 0.0:
                         obj.power = 0.0
                     else:
                         obj.power = 1.0
                     obj_rod.power = 1.0