예제 #1
0
    def test_areaCheck(self):
        assembly = list(self.blueprints.assemblies.values())[0]
        fuelBlock = assembly.getFirstBlock(Flags.FUEL)
        intercoolant = fuelBlock.getComponent(Flags.INTERCOOLANT)

        bpAssemblyArea = assembly.getArea()
        actualAssemblyArea = math.sqrt(3) / 2.0 * intercoolant.p.op**2

        self.assertAlmostEqual(bpAssemblyArea, actualAssemblyArea)
예제 #2
0
 def test_rotate(self):
     """Test rotation of an assembly spatial objects"""
     a = makeTestAssembly(1, 1)
     b = blocks.HexBlock("TestBlock")
     b.p.THcornTemp = [400, 450, 500, 550, 600, 650]
     rotTemp = [600, 650, 400, 450, 500, 550]
     b.p.displacementX = 0
     b.p.displacementY = 1
     rotX = -math.sqrt(3) / 2
     rotY = -0.5
     a.add(b)
     a.rotate(math.radians(120))
     self.assertEqual(a.getBlocks()[0].p.THcornTemp, rotTemp)
     self.assertAlmostEqual(a.getBlocks()[0].p.displacementX, rotX)
     self.assertAlmostEqual(a.getBlocks()[0].p.displacementY, rotY)
예제 #3
0
 def test_getVolume(self):
     cur = self.assembly.getVolume()
     ref = math.sqrt(
         3) / 2.0 * self.hexDims["op"]**2 * self.height * NUM_BLOCKS
     places = 6
     self.assertAlmostEqual(cur, ref, places=places)
예제 #4
0
 def test_getArea(self):
     cur = self.assembly.getArea()
     ref = math.sqrt(3) / 2.0 * self.hexDims["op"]**2
     places = 6
     self.assertAlmostEqual(cur, ref, places=places)