Geometry#

class scarabee.Vector#

A Vector object represents a two dimentional spatial vector of arbitrary magnitude. It supports standard vector arithmetic such as addtion, subtraction, and scaling. Vector objects are immutable, and can only be changed through assigning a new Vector.

__init__(self: scarabee._scarabee.Vector, x: SupportsFloat | SupportsIndex, y: SupportsFloat | SupportsIndex) None#

Creates a Vector for an x and a y component.

Parameters:
  • x (float) – x component of vector.

  • y (float) – y component of vector.

dot(self: scarabee._scarabee.Vector, v: scarabee._scarabee.Vector) float#

Computes dot product with another vector.

\[d = \text{self}.x \cdot v.x + \text{self}.y \cdot v.y\]
Parameters:

v (Vector) – Vector with which to take the dot product.

Returns:

d – The result of the dot product

Return type:

float

property norm#

Length of the vector.

property x#

x component of vector.

property y#

y component of vector.

class scarabee.Direction#

A Direction object inherits from a Vector, but is may only have a length of unity. It can also participate in vector arithmetic, but the result is always a Vector object. Like Vectors, Directions are also immutable.

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: scarabee._scarabee.Direction, x: typing.SupportsFloat | typing.SupportsIndex, y: typing.SupportsFloat | typing.SupportsIndex) -> None

Creates a Direction from x and y components. The components will be scaled such that the lengths of the is unity.

Parameters:
  • x (float) – x component of vector.

  • y (float) – y component of vector.

  1. __init__(self: scarabee._scarabee.Direction, phi: typing.SupportsFloat | typing.SupportsIndex) -> None

Creates a direction from an angle formed with the x-axis. The angle is measured by starting at the x-axis and moving counter clockwise.

Parameters:

phi (float) – Angle formed by the vector and the x-axis, in radians.

class scarabee.Cell#
__init__(*args, **kwargs)#
distance(self: scarabee._scarabee.Cell, r: scarabee._scarabee.Vector, u: scarabee._scarabee.Direction) float#

Distance that can be traveled within cell for given position and direction.

Parameters:
  • r (Vector) – Starting position.

  • u (Direction) – Direction of travel in the cell.

Returns:

Distance that can be traveled.

Return type:

float

property dx#

Width of cell along x.

property dy#

Width of cell along y.

get_all_fsr_ids(self: scarabee._scarabee.Cell) list[int]#

Returns a list containing the IDs of all flat source regions in the cell.

Returns:

IDs of all FSRs in the cell.

Return type:

list of int

inside(self: scarabee._scarabee.Cell, r: scarabee._scarabee.Vector, u: scarabee._scarabee.Direction) bool#

Checks if a position - direction pair are inside the cell.

Parameters:
  • r (Vector) – Position to test.

  • u (Direction) – Direction vector for disambiguating a the region.

Returns:

True is r and u are in the cell, False otherwise.

Return type:

bool

property num_fsrs#

Number of flat source regions in the cell.

class scarabee.EmptyCell#
__init__(self: scarabee._scarabee.EmptyCell, mat: scarabee._scarabee.CrossSection, dx: SupportsFloat | SupportsIndex, dy: SupportsFloat | SupportsIndex) None#

An empty cell with only one flat source region.

Parameters:
  • mat (CrossSection) – The material cross sections for the cell.

  • dx (float) – Width of the cell along x.

  • dy (float) – Width of the cell along y.

class scarabee.PinCellType#

Members:

Full : Full pin cell.

XN : Half of a pin cell where x < 0.

XP : Half of a pin cell where x > 0.

YN : Half of a pin cell where y < 0.

YP : Half of a pin cell where y > 0.

I : Quarter of a pin cell in quadrant I.

II : Quarter of a pin cell in quadrant II.

III : Quarter of a pin cell in quadrant III.

IV : Quarter of a pin cell in quadrant IV.

__init__(self: scarabee._scarabee.PinCellType, value: SupportsInt | SupportsIndex) None#
property name#
class scarabee.SimplePinCell#
__init__(self: scarabee._scarabee.SimplePinCell, radii: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], mats: collections.abc.Sequence[scarabee._scarabee.CrossSection], dx: typing.SupportsFloat | typing.SupportsIndex, dy: typing.SupportsFloat | typing.SupportsIndex, pin_type: scarabee._scarabee.PinCellType = <PinCellType.Full: 0>) None#

An annular pin centered in a rectangular cell with no angular segments. Must provide one more CrossSection than radii, as that material will fill the cell out to the boundary.

Parameters:
  • radii (list of float) – Radius of each annular region.

  • mats (list of CrossSection) – Material cross sections for each region.

  • dx (float) – Width of cell along x.

  • dy (float) – Width of cell along y.

  • pin_type (PinCellType) – Wether is a full or half or quarter pin cell. Default is Full.

class scarabee.PinCell#
__init__(self: scarabee._scarabee.PinCell, radii: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], mats: collections.abc.Sequence[scarabee._scarabee.CrossSection], dx: typing.SupportsFloat | typing.SupportsIndex, dy: typing.SupportsFloat | typing.SupportsIndex, pin_type: scarabee._scarabee.PinCellType = <PinCellType.Full: 0>) None#

An annular pin centered in a rectangular cell, with 8 angular segments. Must provide one more CrossSection than radius, as that material will fill the cell out to the boundary.

Parameters:
  • mat (CrossSection) – The material cross sections for the cell.

  • dx (float) – Width of the cell along x.

  • dy (float) – Width of the cell along y.

  • pin_type (PinCellType) – Wether is a full or half or quarter pin cell. Default is Full.

class scarabee.BWRCornerType#

Members:

I : Rounded corner in quadrant I.

II : Rounded corner in quadrant II.

III : Rounded corner in quadrant III.

IV : Rounded corner in quadrant IV.

__init__(self: scarabee._scarabee.BWRCornerType, value: SupportsInt | SupportsIndex) None#
property name#
class scarabee.SimpleBWRCornerPinCell#
__init__(self: scarabee._scarabee.SimpleBWRCornerPinCell, pin_radii: collections.abc.Sequence[SupportsFloat | SupportsIndex], pin_mats: collections.abc.Sequence[scarabee._scarabee.CrossSection], inner_gap: SupportsFloat | SupportsIndex, inner_mod: scarabee._scarabee.CrossSection, box_width: SupportsFloat | SupportsIndex, rc: SupportsFloat | SupportsIndex, box_mat: scarabee._scarabee.CrossSection, outer_mod: scarabee._scarabee.CrossSection, dx: SupportsFloat | SupportsIndex, dy: SupportsFloat | SupportsIndex, corner_type: scarabee._scarabee.BWRCornerType) None#

A pin cell at the corner of a BWR fuel bundle channel. Models the channel box, moderator outside the bundle, and the moderator inside the channel. There can be a gap between the channel box and the normal pin cell boundary. The corners can also be rounded.

Parameters:
  • pin_radii (list of float) – Radius of each annular region for the pin.

  • pin_mats (list of CrossSection) – Cross sections for each annular region of the pin.

  • inner_gap (float) – Width of the moderator gap inside the channel.

  • inner_mod (CrossSection) – Cross sections for the moderator inside the channel.

  • box_width (float) – Width of the channel box.

  • rc (float) – Radius of curvature for the inside of the channel box corner.

  • box_mat (CrossSection) – Cross sections for the channel box.

  • outer_mod (CrossSection) – Cross sections for the moderator outside the channel.

  • dx (float) – Width of cell along x.

  • dy (float) – Width of cell along y.

  • corner_type (BWRCornerType) – Indicates which corner of the BWR channel is being modeled.

class scarabee.BWRCornerPinCell#
__init__(self: scarabee._scarabee.BWRCornerPinCell, pin_radii: collections.abc.Sequence[SupportsFloat | SupportsIndex], pin_mats: collections.abc.Sequence[scarabee._scarabee.CrossSection], inner_gap: SupportsFloat | SupportsIndex, inner_mod: scarabee._scarabee.CrossSection, box_width: SupportsFloat | SupportsIndex, rc: SupportsFloat | SupportsIndex, box_mat: scarabee._scarabee.CrossSection, outer_mod: scarabee._scarabee.CrossSection, dx: SupportsFloat | SupportsIndex, dy: SupportsFloat | SupportsIndex, corner_type: scarabee._scarabee.BWRCornerType) None#

A pin cell at the corner of a BWR fuel bundle channel. Models the channel box, moderator outside the bundle, and the moderator inside the channel. There can be a gap between the channel box and the normal pin cell boundary. The corners can also be rounded.

Parameters:
  • pin_radii (list of float) – Radius of each annular region for the pin.

  • pin_mats (list of CrossSection) – Cross sections for each annular region of the pin.

  • inner_gap (float) – Width of the moderator gap inside the channel.

  • inner_mod (CrossSection) – Cross sections for the moderator inside the channel.

  • box_width (float) – Width of the channel box.

  • rc (float) – Radius of curvature for the inside of the channel box corner.

  • box_mat (CrossSection) – Cross sections for the channel box.

  • outer_mod (CrossSection) – Cross sections for the moderator outside the channel.

  • dx (float) – Width of cell along x.

  • dy (float) – Width of cell along y.

  • corner_type (BWRCornerType) – Indicates which corner of the BWR channel is being modeled.

class scarabee.Tile#

A Tile represents an elemnent of a Cartesian2D geometry, which can contain either a Cell or another Cartensian2D geometry.

__init__(*args, **kwargs)#
property c2d#

The optional Cartesian2D which fills the tile.

property cell#

The optional Cell which fills the tile.

property valid#

True if the tile is completely filled with Cells, False otherwise.

class scarabee.TileIndex#

A TileIndex contains the x and y coordinates of a Tile within a Cartesian2D geometry.

__init__(*args, **kwargs)#
property i#

Index along x axis.

property j#

Index along y axis.

class scarabee.Cartesian2D#
__init__(self: scarabee._scarabee.Cartesian2D, dx: collections.abc.Sequence[SupportsFloat | SupportsIndex], dy: collections.abc.Sequence[SupportsFloat | SupportsIndex]) None#

A Cartesian2D represents a cartesian geometry, which is divided into Tile instances, each of which can contain either other Cartesian2D geometries, or a Cell which terminates the geometry tree with materials.

Parameters:
  • dx (list of float) – List of all x widths.

  • dy (list of float) – List of all y heights.

property dx#

Width of geometry in x.

property dy#

Width of geometry in y.

get_tile_index(self: scarabee._scarabee.Cartesian2D, r: scarabee._scarabee.Vector, u: scarabee._scarabee.Direction) scarabee._scarabee.TileIndex | None#

Returns the TileIndex for given position and direction.

Parameters:
  • r (Vector) – Position of desired tile.

  • u (Direction) – Direction use in the case of geometry ambiguity.

get_xs(self: scarabee._scarabee.Cartesian2D, r: scarabee._scarabee.Vector, u: scarabee._scarabee.Direction) scarabee._scarabee.CrossSection#

Returns the CrossSection for given position and direction.

Parameters:
  • r (Vector) – Position of desired material.

  • u (Direction) – Direction use in the case of geometry ambiguity.

property num_fsrs#

Number of flat source regions.

property nx#

Number of cells in x direction.

property ny#

Number of cells in y direction.

set_tiles(self: scarabee._scarabee.Cartesian2D, fills: collections.abc.Sequence[scarabee._scarabee.Cartesian2D | scarabee._scarabee.Cell]) None#

Sets all tiles in the geometry.

Parameters:

fills (list of Cartesian2D or Cell) – Fills for all tiles.

tile(self: scarabee._scarabee.Cartesian2D, ti: scarabee._scarabee.TileIndex) scarabee._scarabee.Tile#

Returns the Tile for the given TileIndex.

Parameters:

ti (TileIndex) – Index of desired Tile.

property tiles_valid#

Returns True if all tiles are populated with a Cell, False otherwise.

property x_max#

Maximum x coordinate.

property x_min#

Minimum x coordinate.

property y_max#

Maximum y coordinate.

property y_min#

Minimum y coordinate.