|
48 | 48 |
|
49 | 49 |
|
50 | 50 | def buildSimpleFuelBlock():
|
51 |
| - """Return a simple block containing fuel, clad, duct, and coolant.""" |
| 51 | + """Return a simple hex block containing fuel, clad, duct, and coolant.""" |
52 | 52 | b = blocks.HexBlock("fuel", height=10.0)
|
53 | 53 |
|
54 | 54 | fuelDims = {"Tinput": 25.0, "Thot": 600, "od": 0.76, "id": 0.00, "mult": 127.0}
|
@@ -816,25 +816,89 @@ def test_replaceBlockWithBlock(self):
|
816 | 816 | self.assertEqual(block.p.height, refHeight)
|
817 | 817 |
|
818 | 818 | def test_getWettedPerimeter(self):
|
819 |
| - cur = self.block.getWettedPerimeter() |
820 |
| - |
| 819 | + # calculate the reference value |
821 | 820 | wire = self.block.getComponent(Flags.WIRE)
|
822 | 821 | correctionFactor = np.hypot(
|
823 | 822 | 1.0,
|
824 | 823 | math.pi
|
825 | 824 | * wire.getDimension("helixDiameter")
|
826 | 825 | / wire.getDimension("axialPitch"),
|
827 | 826 | )
|
828 |
| - wireDiameter = wire.getDimension("od") * correctionFactor |
829 |
| - |
830 |
| - ref = math.pi * ( |
831 |
| - self.block.getDim(Flags.CLAD, "od") + wireDiameter |
832 |
| - ) * self.block.getDim(Flags.CLAD, "mult") + 6 * self.block.getDim( |
833 |
| - Flags.DUCT, "ip" |
834 |
| - ) / math.sqrt( |
835 |
| - 3 |
836 |
| - ) |
| 827 | + wireDiam = wire.getDimension("od") * correctionFactor |
| 828 | + |
| 829 | + ipDim = self.block.getDim(Flags.DUCT, "ip") |
| 830 | + odDim = self.block.getDim(Flags.CLAD, "od") |
| 831 | + mult = self.block.getDim(Flags.CLAD, "mult") |
| 832 | + ref = math.pi * (odDim + wireDiam) * mult + 6 * ipDim / math.sqrt(3) |
| 833 | + |
| 834 | + # test getWettedPerimeter |
| 835 | + cur = self.block.getWettedPerimeter() |
| 836 | + self.assertAlmostEqual(cur, ref) |
| 837 | + |
| 838 | + def test_getWettedPerimeterCircularInnerDuct(self): |
| 839 | + """Calculate the wetted perimeter for a HexBlock with circular inner duct.""" |
| 840 | + # build a test block with a Hex inner duct |
| 841 | + fuelDims = {"Tinput": 400, "Thot": 400, "od": 0.76, "id": 0.00, "mult": 127.0} |
| 842 | + cladDims = {"Tinput": 400, "Thot": 400, "od": 0.80, "id": 0.77, "mult": 127.0} |
| 843 | + ductDims = {"Tinput": 400, "Thot": 400, "od": 16, "id": 15.3, "mult": 1.0} |
| 844 | + intercoolantDims = { |
| 845 | + "Tinput": 400, |
| 846 | + "Thot": 400, |
| 847 | + "od": 17.0, |
| 848 | + "id": ductDims["od"], |
| 849 | + "mult": 1.0, |
| 850 | + } |
| 851 | + |
| 852 | + fuel = components.Circle("fuel", "UZr", **fuelDims) |
| 853 | + clad = components.Circle("clad", "HT9", **cladDims) |
| 854 | + duct = components.Circle("inner duct", "HT9", **ductDims) |
| 855 | + intercoolant = components.Circle("intercoolant", "Sodium", **intercoolantDims) |
| 856 | + |
| 857 | + b = blocks.HexBlock("fuel", height=10.0) |
| 858 | + b.add(fuel) |
| 859 | + b.add(clad) |
| 860 | + b.add(duct) |
| 861 | + b.add(intercoolant) |
| 862 | + |
| 863 | + # calculate the reference value |
| 864 | + ref = (ductDims["id"] + ductDims["od"]) * math.pi |
| 865 | + ref += b.getNumPins() * cladDims["od"] * math.pi |
| 866 | + |
| 867 | + # test getWettedPerimeter |
| 868 | + cur = b.getWettedPerimeter() |
| 869 | + self.assertAlmostEqual(cur, ref) |
| 870 | + |
| 871 | + def test_getWettedPerimeterHexInnerDuct(self): |
| 872 | + """Calculate the wetted perimeter for a HexBlock with hexagonal inner duct.""" |
| 873 | + # build a test block with a Hex inner duct |
| 874 | + fuelDims = {"Tinput": 400, "Thot": 400, "od": 0.76, "id": 0.00, "mult": 127.0} |
| 875 | + cladDims = {"Tinput": 400, "Thot": 400, "od": 0.80, "id": 0.77, "mult": 127.0} |
| 876 | + ductDims = {"Tinput": 400, "Thot": 400, "op": 16, "ip": 15.3, "mult": 1.0} |
| 877 | + intercoolantDims = { |
| 878 | + "Tinput": 400, |
| 879 | + "Thot": 400, |
| 880 | + "op": 17.0, |
| 881 | + "ip": ductDims["op"], |
| 882 | + "mult": 1.0, |
| 883 | + } |
| 884 | + |
| 885 | + fuel = components.Circle("fuel", "UZr", **fuelDims) |
| 886 | + clad = components.Circle("clad", "HT9", **cladDims) |
| 887 | + duct = components.Hexagon("inner duct", "HT9", **ductDims) |
| 888 | + intercoolant = components.Hexagon("intercoolant", "Sodium", **intercoolantDims) |
| 889 | + |
| 890 | + b = blocks.HexBlock("fuel", height=10.0) |
| 891 | + b.add(fuel) |
| 892 | + b.add(clad) |
| 893 | + b.add(duct) |
| 894 | + b.add(intercoolant) |
| 895 | + |
| 896 | + # calculate the reference value |
| 897 | + ref = 6 * (ductDims["ip"] + ductDims["op"]) / math.sqrt(3) |
| 898 | + ref += b.getNumPins() * cladDims["od"] * math.pi |
837 | 899 |
|
| 900 | + # test getWettedPerimeter |
| 901 | + cur = b.getWettedPerimeter() |
838 | 902 | self.assertAlmostEqual(cur, ref)
|
839 | 903 |
|
840 | 904 | def test_getFlowAreaPerPin(self):
|
|
0 commit comments