Skip to content

Commit

Permalink
Added holed rectangle, square, and renamed module shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
onufer committed Apr 15, 2020
1 parent d1c3e05 commit 41a52f9
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 137 deletions.
3 changes: 2 additions & 1 deletion armi/reactor/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"""
from armi.reactor.components.component import * # pylint: disable=wildcard-import
from armi.reactor.components.shapes import * # pylint: disable=wildcard-import
from armi.reactor.components.componentCategories import * # pylint: disable=wildcard-import
from armi.reactor.components.basicShapes import * # pylint: disable=wildcard-import
from armi.reactor.components.complexShapes import * # pylint: disable=wildcard-import
from armi.reactor.components.volumetricShapes import * # pylint: disable=wildcard-import


Expand Down
130 changes: 9 additions & 121 deletions armi/reactor/components/basicShapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import math

from armi.reactor.components.shapes import ShapedComponent
from armi.reactor.components.componentCategories import ShapedComponent
from armi.reactor.components import componentParameters


Expand Down Expand Up @@ -145,126 +145,6 @@ def getPerimeter(self, Tc=None):
return perimeter


class ShieldBlock(Hexagon):
"""Solid hexagonal block with n uniform circular holes hollowed out of it."""

is3D = False

THERMAL_EXPANSION_DIMS = {"op", "holeOD"}

pDefs = componentParameters.getShieldBlockParameterDefinitions()

def __init__(
self,
name,
material,
Tinput,
Thot,
op,
holeOD,
nHoles,
mult=1.0,
modArea=None,
isotopics=None,
mergeWith=None,
components=None,
):
ShapedComponent.__init__(
self,
name,
material,
Tinput,
Thot,
isotopics=isotopics,
mergeWith=mergeWith,
components=components,
)
self._linkAndStoreDimensions(
components, op=op, holeOD=holeOD, nHoles=nHoles, mult=mult, modArea=modArea
)

def getComponentArea(self, cold=False):
r"""Computes the area for the hexagon with n number of circular holes in cm^2."""
op = self.getDimension("op", cold=cold)
holeOD = self.getDimension("holeOD", cold=cold)
nHoles = self.getDimension("nHoles", cold=cold)
mult = self.getDimension("mult")
hexArea = math.sqrt(3.0) / 2.0 * (op ** 2)
circularArea = nHoles * math.pi * ((holeOD / 2.0) ** 2)
area = mult * (hexArea - circularArea)
return area


class Helix(ShapedComponent):
"""A spiral wire component used to model a pin wire-wrap.
Notes
-----
http://mathworld.wolfram.com/Helix.html
In a single rotation with an axial climb of P, the length of the helix will be a factor of
2*pi*sqrt(r^2+c^2)/2*pi*c longer than vertical length L. P = 2*pi*c.
"""

is3D = False

THERMAL_EXPANSION_DIMS = {"od", "id", "axialPitch", "helixDiameter"}

pDefs = componentParameters.getHelixParameterDefinitions()

def __init__(
self,
name,
material,
Tinput,
Thot,
od=None,
axialPitch=None,
mult=None,
helixDiameter=None,
id=0.0,
modArea=None,
isotopics=None,
mergeWith=None,
components=None,
):
ShapedComponent.__init__(
self,
name,
material,
Tinput,
Thot,
isotopics=isotopics,
mergeWith=mergeWith,
components=components,
)
self._linkAndStoreDimensions(
components,
od=od,
axialPitch=axialPitch,
mult=mult,
helixDiameter=helixDiameter,
id=id,
modArea=modArea,
)

def getBoundingCircleOuterDiameter(self, Tc=None, cold=False):
return self.getDimension("od", Tc, cold) + self.getDimension(
"helixDiameter", Tc, cold=cold
)

def getComponentArea(self, cold=False):
"""Computes the area for the helix in cm^2."""
ap = self.getDimension("axialPitch", cold=cold)
hd = self.getDimension("helixDiameter", cold=cold)
id = self.getDimension("id", cold=cold)
od = self.getDimension("od", cold=cold)
mult = self.getDimension("mult")
c = ap / (2.0 * math.pi)
helixFactor = math.sqrt((hd / 2.0) ** 2 + c ** 2) / c
area = mult * math.pi * ((od / 2.0) ** 2 - (id / 2.0) ** 2) * helixFactor
return area


class Rectangle(ShapedComponent):
"""A rectangle component."""

Expand Down Expand Up @@ -436,6 +316,14 @@ def getComponentArea(self, cold=False):


class Triangle(ShapedComponent):
"""
Triangle with defined base and height.
Notes
-----
The exact angles of the triangle are undefined. The exact side lenths and angles
are not critical to calculation of component area, so area can still be calculated.
"""

is3D = False

Expand Down
Loading

0 comments on commit 41a52f9

Please sign in to comment.