Diffusion#
- class scarabee.DiffusionData#
A DiffusionData object contains all necessary cross section information to perform a diffusion calculation, along with assembly discontinuity factors and corner discontinuity factors.
- D(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Diffusion coefficient in group g.
- Parameters:
g (int) – Energy group.
- Ea(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Absorption cross section in group g.
- Parameters:
g (int) – Energy group.
- Ef(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Fission cross section in group g.
- Parameters:
g (int) – Energy group.
- Er(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Removal cross section in group g.
- Parameters:
g (int) – Energy group.
- Es(*args, **kwargs)#
Overloaded function.
Es(self: scarabee._scarabee.DiffusionData, g: typing.SupportsInt | typing.SupportsIndex) -> float
Transport corrected scattering cross section in group g.
- Parameters:
g (int) – Energy group.
Es(self: scarabee._scarabee.DiffusionData, gin: typing.SupportsInt | typing.SupportsIndex, gout: typing.SupportsInt | typing.SupportsIndex) -> float
Transport corrected scattering cross section from group gin to gout
- Parameters:
gin (int) – Incoming energy group.
gout (int) – Outgoing energy group.
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: scarabee._scarabee.DiffusionData, xs: scarabee._scarabee.DiffusionCrossSection) -> None
Creates a DiffusionData object.
- Parameters:
xs (DiffusionCrossSection) – Diffusion cross sections for calculations.
__init__(self: scarabee._scarabee.DiffusionData, xs: scarabee._scarabee.DiffusionCrossSection, adf: numpy.ndarray[numpy.float64], cdf: numpy.ndarray[numpy.float64]) -> None
Creates a DiffusionData object.
- Parameters:
xs (DiffusionCrossSection) – Diffusion cross sections for calculations.
adf (ndarray) – A 2D array of ADFs. The first axis is energy group, and the second axis is the side (Y+, X+, Y-, X-).
cdf (ndarray) – A 2D array of CDFs. The first axis is energy group, and the second axis is the corner (I, II, III, IV).
- property adf#
Assembly discontinuity factors.
- adf_xn(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The ADS for the x- surface in group g.
- Parameters:
g (int) – Energy group.
- adf_xp(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The ADS for the x+ surface in group g.
- Parameters:
g (int) – Energy group.
- adf_yn(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The ADS for the y- surface in group g.
- Parameters:
g (int) – Energy group.
- adf_yp(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The ADS for the y+ surface in group g.
- Parameters:
g (int) – Energy group.
- adf_zn(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The ADS for the z- surface in group g.
- Parameters:
g (int) – Energy group.
- adf_zp(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The ADS for the z+ surface in group g.
- Parameters:
g (int) – Energy group.
- property cdf#
Corner discontinuity factors.
- cdf_I(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The CDF for the quadrant I corner in group g.
- Parameters:
g (int) – Energy group.
- cdf_II(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The CDF for the quadrant II corner in group g.
- Parameters:
g (int) – Energy group.
- cdf_III(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The CDF for the quadrant III corner in group g.
- Parameters:
g (int) – Energy group.
- cdf_IV(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
The CDF for the quadrant IV corner in group g.
- Parameters:
g (int) – Energy group.
- chi(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Fission spectrum in group g.
- Parameters:
g (int) – Energy group.
- property fissile#
True if material is fissile.
- property leakage_corrections#
Optional LeakageCorrection data to update cross sections based on in-situ leakage in nodal solver.
- static load(fname: str) scarabee._scarabee.DiffusionData#
Loads diffusion data from a binary file.
- Parameters:
fname (str) – Name of file from which to load data.
- Returns:
Diffusion cross sections and ADF from the file.
- Return type:
- property name#
Name of material.
- property ngroups#
Number of energy groups.
- nu(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Fission yield in group g.
- Parameters:
g (int) – Energy group.
- reflect_across_x_axis(self: scarabee._scarabee.DiffusionData) scarabee._scarabee.DiffusionData#
Performs a reflection of the ADFs across the x axis. A reflection across the x axis means that the +y and -y ADFs are swapped.
- reflect_across_y_axis(self: scarabee._scarabee.DiffusionData) scarabee._scarabee.DiffusionData#
Performs a reflection of the ADFs across the y axis. A reflection across the y axis means that the +x and -x ADFs are swapped.
- property reflector#
Flag to indicate the data is for a reflector, and the ADFs should be multiplied by the adjacent fuel ADFs.
- rotate_clockwise(self: scarabee._scarabee.DiffusionData) scarabee._scarabee.DiffusionData#
Rotates the ADFs corresponding to a 90 degree rotation of the assembly in the clockwise direction.
- rotate_counterclockwise(self: scarabee._scarabee.DiffusionData) scarabee._scarabee.DiffusionData#
Rotates the ADFs corresponding to a 90 degree rotation of the assembly in the counter clockwise direction.
- save(self: scarabee._scarabee.DiffusionData, fname: str) None#
Saves the diffuion data to a binary file.
- Parameters:
fname (str) – Name of file in which to save data.
- vEf(self: scarabee._scarabee.DiffusionData, g: SupportsInt | SupportsIndex) float#
Fission yield * cross section in group g.
- Parameters:
g (int) – Energy group.
- property xs#
The contained DiffusionCrossSection object.
- property xs_name#
Name of the DiffusionCrossSection.
- class scarabee.LeakageCorrections#
- D(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex) float#
Obtains the correction coefficient for the diffusion coefficient in group g.
- Parameters:
g (int) – Energy group index
- Returns:
Leakage correction coefficient for group g.
- Return type:
float
- Ea(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex) float#
Obtains the correction coefficient for the absorption cross section in group g.
- Parameters:
g (int) – Energy group index
- Returns:
Leakage correction coefficient for group g.
- Return type:
float
- Ef(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex) float#
Obtains the correction coefficient for the fission cross section in group g.
- Parameters:
g (int) – Energy group index
- Returns:
Leakage correction coefficient for group g.
- Return type:
float
- Es(self: scarabee._scarabee.LeakageCorrections, g_in: SupportsInt | SupportsIndex, g_out: SupportsInt | SupportsIndex) float#
Obtains the correction coefficient for the scattering cross section from group g_in to group g_out. Only down-scattering cross sections are available (g_out > g_in).
- Parameters:
g_in (int) – Incident energy group index
g_out (int) – Outgoing energy group index
- Returns:
Leakage correction coefficient for group g.
- Return type:
float
- __init__(self: scarabee._scarabee.LeakageCorrections, ngroups: SupportsInt | SupportsIndex) None#
Creates a LeakageCorrections object which contains coefficients to correct few-group diffusion cross sections for the actual experienced leakage. All coefficients are initialized to zero.
- Parameters:
ngroups (int) – Number of energy groups.
- property ngroups#
Number of energy groups.
- set_D(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex, val: SupportsFloat | SupportsIndex) None#
Sets the correction coefficient for the diffusion coefficient in group g.
- Parameters:
g (int) – Energy group index
val (float) – New value of the correction coefficient
- set_Ea(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex, val: SupportsFloat | SupportsIndex) None#
Sets the correction coefficient for the absorption cross section in group g.
- Parameters:
g (int) – Energy group index
val (float) – New value of the correction coefficient
- set_Ef(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex, val: SupportsFloat | SupportsIndex) None#
Sets the correction coefficient for the fission cross section in group g.
- Parameters:
g (int) – Energy group index
val (float) – New value of the correction coefficient
- set_Es(self: scarabee._scarabee.LeakageCorrections, g_in: SupportsInt | SupportsIndex, g_out: SupportsInt | SupportsIndex, val: SupportsFloat | SupportsIndex) None#
Sets the correction coefficient for the scattering cross section from group g_in to group g_out. Only down-scattering cross sections are available (g_out > g_in).
- Parameters:
g_in (int) – Incident energy group index
g_out (int) – Outgoing energy group index
val (float) – New value of the correction coefficient
- set_vEf(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex, val: SupportsFloat | SupportsIndex) None#
Sets the correction coefficient for the nu-fission cross section in group g.
- Parameters:
g (int) – Energy group index
val (float) – New value of the correction coefficient
- vEf(self: scarabee._scarabee.LeakageCorrections, g: SupportsInt | SupportsIndex) float#
Obtains the correction coefficient for the nu-fission cross section in group g.
- Parameters:
g (int) – Energy group index
- Returns:
Leakage correction coefficient for group g.
- Return type:
float
- class scarabee.FormFactors#
A FormFactors object contains the form factors used to compute the pin powers after a full core diffusion simulation. It is essentially a 2D array where the average value of the non-zero entries is 1. The array should be provided as “what you see is what you get”, where the first row of the array would have a Python index of 0, but actually represents the largest possible y coordinate.
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: scarabee._scarabee.FormFactors, ff: numpy.ndarray[numpy.float64], xw: numpy.ndarray[numpy.float64], yw: numpy.ndarray[numpy.float64]) -> None
Creates a FormFactors object.
- Parameters:
ff (ndarray) – 2D array containing the form factors.
xw (ndarray) – 1D array with the widths of each tile along x.
yw (ndarray) – 1D array with the widths of each tile along y.
__init__(self: scarabee._scarabee.FormFactors, q1: scarabee._scarabee.FormFactors, q2: scarabee._scarabee.FormFactors, q3: scarabee._scarabee.FormFactors, q4: scarabee._scarabee.FormFactors, half_pins: bool = True) -> None
Builds a FormFactors object from four other FormFactors, which represent the four quadrants.
- Parameters:
q1 (FormFactors) – Form factors for quadrant I.
q2 (FormFactors) – Form factors for quadrant II.
q3 (FormFactors) – Form factors for quadrant III.
q4 (FormFactors) – Form factors for quadrant IV.
half_pins (bool) – True if the pins along the x and y axis planes are cut in half in the four quadrants, and False otherwise. Default value is True.
- cut_half_neg_x(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the -x half of this instance.
- Returns:
Form factors on the -x half.
- Return type:
- cut_half_neg_y(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the -y half of this instance.
- Returns:
Form factors on the -y half.
- Return type:
- cut_half_pos_x(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the +x half of this instance.
- Returns:
Form factors on the +x half.
- Return type:
- cut_half_pos_y(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the +y half of this instance.
- Returns:
Form factors on the +y half.
- Return type:
- cut_quad_I(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the I quadrant of this instance.
- Returns:
Form factors on the I quadrant.
- Return type:
- cut_quad_II(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the II quadrant of this instance.
- Returns:
Form factors on the II quadrant.
- Return type:
- cut_quad_III(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the III quadrant of this instance.
- Returns:
Form factors on the III quadrant.
- Return type:
- cut_quad_IV(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Creates a new FromFactor instance from the IV quadrant of this instance.
- Returns:
Form factors on the IV quadrant.
- Return type:
- property form_factors#
2D array of form factors.
- reflect_across_x_axis(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Performs a reflection of the form factors across the x axis.
- reflect_across_y_axis(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Performs a reflection of the form factors across the y axis
- rotate_clockwise(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Rotates the form factors corresponding to a 90 degree rotation of the assembly in the clockwise direction.
- rotate_counterclockwise(self: scarabee._scarabee.FormFactors) scarabee._scarabee.FormFactors#
Rotates the form factors corresponding to a 90 degree rotation of the assembly in the counter clockwise direction.
- property x_width#
Total width along x.
- property x_widths#
1D array of the widths of tiles along x.
- property y_width#
Total width along y.
- property y_widths#
1D array of the widths of tiles along y.
- class scarabee.DiffusionGeometryTile#
A DiffusionGeometryTile represents an element of a cartesian diffusion mesh. It can have either an albedo entry (float) or a xs entry (
DiffusionData), but not both.- __init__(*args, **kwargs)#
- property albedo#
The albedo if the tile is a boundary condition.
- property xs#
The DiffusionData if the tile represents a material.
- class scarabee.Neighbor#
Members:
XN : Neighbor on the x < 0 side.
XP : Neighbor on the x > 0 side.
YN : Neighbor on the y < 0 side.
YP : Neighbor on the y > 0 side.
ZN : Neighbor on the z < 0 side.
ZP : Neighbor on the z > 0 side.
- __init__(self: scarabee._scarabee.Neighbor, value: SupportsInt | SupportsIndex) None#
- property name#
- class scarabee.DiffusionGeometry#
A DiffusionGeometry represents a cartesian mesh used to solve diffusion problems.
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: scarabee._scarabee.DiffusionGeometry, tiles: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex | scarabee._scarabee.DiffusionData | scarabee._scarabee.DiffusionCrossSection], dx: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], xdivs: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], albedo_xn: typing.SupportsFloat | typing.SupportsIndex, albedo_xp: typing.SupportsFloat | typing.SupportsIndex) -> None
Creates a 1D DiffusionGeometry.
- Parameters:
tiles (list of float or DiffusionData or DiffusionCrossSection) – All tiles in the geometry.
dx (list of float) – Width of each tile.
xdivs (list of int) – Number of meshes in each tile.
albedo_xn (float) – Albedo at the negative x boundary.
albedo_xp (float) – Albedo at the positive x boundary.
__init__(self: scarabee._scarabee.DiffusionGeometry, tiles: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex | scarabee._scarabee.DiffusionData | scarabee._scarabee.DiffusionCrossSection], dx: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], xdivs: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], dy: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], ydivs: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], albedo_xn: typing.SupportsFloat | typing.SupportsIndex, albedo_xp: typing.SupportsFloat | typing.SupportsIndex, albedo_yn: typing.SupportsFloat | typing.SupportsIndex, albedo_yp: typing.SupportsFloat | typing.SupportsIndex) -> None
Creates a 2D DiffusionGeometry.
- Parameters:
tiles (list of float or DiffusionData or DiffusionCrossSection) – All tiles in the geometry.
dx (list of float) – Width of each tile along x.
xdivs (list of int) – Number of x meshes in each tile.
dy (list of float) – Width of each tile along y.
ydivs (list of int) – Number of y meshes in each tile.
albedo_xn (float) – Albedo at the negative x boundary.
albedo_xp (float) – Albedo at the positive x boundary.
albedo_yn (float) – Albedo at the negative y boundary.
albedo_yp (float) – Albedo at the positive y boundary.
__init__(self: scarabee._scarabee.DiffusionGeometry, tiles: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex | scarabee._scarabee.DiffusionData | scarabee._scarabee.DiffusionCrossSection], dx: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], xdivs: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], dy: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], ydivs: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], dz: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], zdivs: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], albedo_xn: typing.SupportsFloat | typing.SupportsIndex, albedo_xp: typing.SupportsFloat | typing.SupportsIndex, albedo_yn: typing.SupportsFloat | typing.SupportsIndex, albedo_yp: typing.SupportsFloat | typing.SupportsIndex, albedo_zn: typing.SupportsFloat | typing.SupportsIndex, albedo_zp: typing.SupportsFloat | typing.SupportsIndex) -> None
Creates a 3D DiffusionGeometry.
- Parameters:
tiles (list of float or DiffusionData or DiffusionCrossSection) – All tiles in the geometry.
dx (list of float) – Width of each tile along x.
xdivs (list of int) – Number of x meshes in each tile.
dy (list of float) – Width of each tile along y.
ydivs (list of int) – Number of y meshes in each tile.
dz (list of float) – Width of each tile along z.
zdivs (list of int) – Number of z meshes in each tile.
albedo_xn (float) – Albedo at the negative x boundary.
albedo_xp (float) – Albedo at the positive x boundary.
albedo_yn (float) – Albedo at the negative y boundary.
albedo_yp (float) – Albedo at the positive y boundary.
albedo_zn (float) – Albedo at the negative z boundary.
albedo_zp (float) – Albedo at the positive z boundary.
- dx(self: scarabee._scarabee.DiffusionGeometry, i: SupportsInt | SupportsIndex) float#
Width in the x direction of the i mesh along the x axis.
- Parameters:
i (int) – Mesh index along x-axis.
Returns –
float – Width of mesh along x-axis.
- dy(self: scarabee._scarabee.DiffusionGeometry, j: SupportsInt | SupportsIndex) float#
Width in the y direction of the j mesh along the y axis.
- Parameters:
j (int) – Mesh index along y-axis.
Returns –
float – Width of mesh along y-axis.
- dz(self: scarabee._scarabee.DiffusionGeometry, k: SupportsInt | SupportsIndex) float#
Width in the z direction of the k mesh along the z axis.
- Parameters:
k (int) – Mesh index along z-axis.
Returns –
float – Width of mesh along z-axis.
- geom_indx(self: scarabee._scarabee.DiffusionGeometry, m: SupportsInt | SupportsIndex) list[int]#
The geometry indices for material index m.
- Parameters:
m (int) – Material index.
- Returns:
Geometry indices of material index m.
- Return type:
list of int
- mat(self: scarabee._scarabee.DiffusionGeometry, m: SupportsInt | SupportsIndex) scarabee._scarabee.DiffusionData#
Obtains the
DiffusionDatafor material m.- Parameters:
m (int) – Material index.
- Returns:
Cross section data and ADFs for material m.
- Return type:
- property ndims#
Number of dimensions (1, 2, or 3).
- neighbor(self: scarabee._scarabee.DiffusionGeometry, m: SupportsInt | SupportsIndex, n: scarabee._scarabee.Neighbor) tuple[scarabee._scarabee.DiffusionGeometryTile, int | None]#
Obtains the desired neighboring DiffusionGeometryTile and index for material m. If the neighbor does not exist, an albedo tile is returned and the neighbor index is None.
- Parameters:
m (int) – Material index.
n (Neighbor) – Desired neighbor of tile m.
- Returns:
DiffusionGeometryTile – Tile of the desired neighbor.
int (optional) – The material index of the neighbor (if neighbor is a material).
- property ngroups#
Number of energy groups.
- property nmats#
Total number of material tiles.
- property nx#
Number of tiles along the x-axis.
- property ny#
Number of tiles along the y-axis.
- property nz#
Number of tiles along the z-axis.
- volume(self: scarabee._scarabee.DiffusionGeometry, m: SupportsInt | SupportsIndex) float#
Obtains the volume for material m.
- Parameters:
m (int) – Material index.
- Returns:
Volume of material m.
- Return type:
float
- class scarabee.FDDiffusionDriver#
A FDDiffusionDriver solves a diffusion problem using the cell centered finite-difference method. It is capable of solving 1D, 2D, or 3D problems which are defined by providing a
DiffusionGeometryinstance.- __init__(self: scarabee._scarabee.FDDiffusionDriver, arg0: scarabee._scarabee.DiffusionGeometry) None#
Initializes a finite-difference diffusion solver.
- Parameters:
geom (DiffusionGeometry) – Problem deffinition to solve.
- extern_src(*args, **kwargs)#
Overloaded function.
extern_src(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Returns the external source in group g and region i.
- Parameters:
i (int) – Region index along x axis.
g (int) – Energy group index.
- Returns:
Value of the external source.
- Return type:
float
extern_src(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Returns the external source in group g and region (i, j).
- Parameters:
i (int) – Region index along x axis.
j (int) – Region index along y axis.
g (int) – Energy group index.
- Returns:
Value of the external source.
- Return type:
float
extern_src(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex, k: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Returns the external source in group g and region (i, j, k).
- Parameters:
i (int) – Region index along x axis.
j (int) – Region index along y axis.
k (int) – Region index along z axis.
g (int) – Energy group index.
- Returns:
Value of the external source.
- Return type:
float
- flux(*args, **kwargs)#
Overloaded function.
flux(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Returns the scalar flux in group g and region i.
- Parameters:
i (int) – Region index along x axis.
g (int) – Energy group index.
- Returns:
Flux in region i and in group g.
- Return type:
float
flux(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Returns the scalar flux in group g and region (i, j).
- Parameters:
i (int) – Region index along x axis.
j (int) – Region index along y axis.
g (int) – Energy group index.
- Returns:
Flux in region (i, j) and in group g.
- Return type:
float
flux(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex, k: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Returns the scalar flux in group g and region (i, j, k).
- Parameters:
i (int) – Region index along x axis.
j (int) – Region index along y axis.
k (int) – Region index along z axis.
g (int) – Energy group index.
- Returns:
Flux in region (i, j, k) and in group g.
- Return type:
float
flux(self: scarabee._scarabee.FDDiffusionDriver) -> tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64] | None, numpy.ndarray[numpy.float64] | None]
Returns the computed flux, along with the mesh bounds. The first dimension of the flux array is the energy group index. The second index is for the x coordinate. If the problem is 2 or 3 dimensional, the third and fourth indices are for the y and z coordinates respectively.
- Returns:
flux (ndarray) – 2D, 3D, or 4D array containing the multigroup flux.
x_bounds (ndarray) – 1D array with the x-bounds for the flux mesh.
y_bounds (ndarray or None) – 1D array with the y-bounds for the flux mesh, if a 2D problem.
z_bounds (ndarray or None) – 1D array with the z-bounds for the flux mesh, if a 3D problem.
- property flux_tolerance#
Maximum relative error in the flux for problem convergence.
- property geometry#
The
DiffusionGeometrygeometry for the problem.
- property keff#
Value of keff. This is 1 by default is solved is False.
- property keff_tolerance#
Maximum relative error in keff for problem convergence.
- static load(fname: str) scarabee._scarabee.FDDiffusionDriver#
Loads a previously save FDDiffusionDriver from a binary file.
- Parameters:
fname (str) – Name of the file.
- Return type:
- property ngroups#
Number of energy groups.
- power(self: scarabee._scarabee.FDDiffusionDriver) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64] | None, numpy.ndarray[numpy.float64] | None]#
Returns the computed power distribution, along with the mesh bounds. The first dimension of the power array is for the x coordinate. If the problem is 2 or 3 dimensional, the second and third indices are for the y and z coordinates respectively.
- Returns:
power (ndarray) – 1D, 2D, or 3D array containing the power distribution.
x_bounds (ndarray) – 1D array with the x-bounds for the power mesh.
y_bounds (ndarray or None) – 1D array with the y-bounds for the power mesh, if a 2D problem.
z_bounds (ndarray or None) – 1D array with the z-bounds for the power mesh, if a 3D problem.
- save(self: scarabee._scarabee.FDDiffusionDriver, fname: str) None#
Saves the FDDiffusionDriver to a binary file.
- Parameters:
fname (str) – Name of the file.
- set_extern_src(*args, **kwargs)#
Overloaded function.
set_extern_src(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex, src: typing.SupportsFloat | typing.SupportsIndex) -> None
Sets the external source in group g and region i.
- Parameters:
i (int) – Region index along x axis.
g (int) – Energy group index.
src (float) – Value of source.
set_extern_src(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex, src: typing.SupportsFloat | typing.SupportsIndex) -> None
Sets the external source in group g and region (i, j).
- Parameters:
i (int) – Region index along x axis.
j (int) – Region index along y axis.
g (int) – Energy group index.
src (float) – Value of source.
set_extern_src(self: scarabee._scarabee.FDDiffusionDriver, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex, k: typing.SupportsInt | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex, src: typing.SupportsFloat | typing.SupportsIndex) -> None
Sets the external source in group g and region (i, j, k).
- Parameters:
i (int) – Region index along x axis.
j (int) – Region index along y axis.
k (int) – Region index along z axis.
g (int) – Energy group index.
src (float) – Value of source.
- property sim_mode#
SimulationModedescribing type of simulation (fixed-source or keff).
- solve(self: scarabee._scarabee.FDDiffusionDriver) None#
Solves the diffusion problem.
- property solved#
True if the problem has been solved, False otherwise.
- class scarabee.NEMDiffusionDriver#
A NEMDiffusionDriver solves a diffusion problem using the nodal expansion method. It is capable of solving 3D problems which are defined by providing a
DiffusionGeometryinstance.- __init__(self: scarabee._scarabee.NEMDiffusionDriver, arg0: scarabee._scarabee.DiffusionGeometry) None#
Initializes a nodal diffusion solver.
- Parameters:
geom (DiffusionGeometry) – Problem deffinition to solve.
- avg_flux(self: scarabee._scarabee.NEMDiffusionDriver) numpy.ndarray[numpy.float64]#
Constructs an array storing the value of the average flux in each node. The resulting array is indexed as (g, x, y, z).
- Returns:
Value of the average flux in each node.
- Return type:
array of float
- avg_power(self: scarabee._scarabee.NEMDiffusionDriver) numpy.ndarray[numpy.float64]#
Constructs an array storing the value of the average power density in each node. The resulting array is indexed as (x, y, z).
- Returns:
Value of the average power density in each node.
- Return type:
array of float
- flux(*args, **kwargs)#
Overloaded function.
flux(self: scarabee._scarabee.NEMDiffusionDriver, x: typing.SupportsFloat | typing.SupportsIndex, y: typing.SupportsFloat | typing.SupportsIndex, z: typing.SupportsFloat | typing.SupportsIndex, g: typing.SupportsInt | typing.SupportsIndex) -> float
Calculates the flux at the desired position and group. The lowest value for any coordinate is 0.
- Parameters:
x (float) – Position along the x axis.
y (float) – Position along the y axis.
z (float) – Position along the z axis.
g (ing) – Energy group index.
- Returns:
Value of the flux.
- Return type:
float
flux(self: scarabee._scarabee.NEMDiffusionDriver, x: numpy.ndarray[numpy.float64], y: numpy.ndarray[numpy.float64], z: numpy.ndarray[numpy.float64]) -> numpy.ndarray[numpy.float64]
Constructs an array storing the flux at all desired (x,y,z) points and at all energy groups. The first index is the group, the second is x, the third is y, and the fourth is z.
- Parameters:
x (array of float) – Positions along the x axis.
y (array of float) – Positions along the y axis.
z (array of float) – Positions along the z axis.
- Returns:
Value of the flux at all (g,x,y,z).
- Return type:
array of float
- property flux_tolerance#
Maximum relative error in the flux for problem convergence.
- property geometry#
The
DiffusionGeometrygeometry for the problem.
- property keff#
Value of keff. This is 1 by default is solved is False.
- property keff_tolerance#
Maximum relative error in keff for problem convergence.
- property leakage_corrections#
Apply leakage corrections to update node cross sections.
- static load(fname: str) scarabee._scarabee.NEMDiffusionDriver#
Loads a previously save NEMDiffusionDriver from a binary file.
- Parameters:
fname (str) – Name of the file.
- Return type:
- property ngroups#
Number of energy groups.
- power(*args, **kwargs)#
Overloaded function.
power(self: scarabee._scarabee.NEMDiffusionDriver, x: typing.SupportsFloat | typing.SupportsIndex, y: typing.SupportsFloat | typing.SupportsIndex, z: typing.SupportsFloat | typing.SupportsIndex) -> float
Calculates the power density at the desired position. The lowest value for any coordinate is 0.
- Parameters:
x (float) – Position along the x axis.
y (float) – Position along the y axis.
z (float) – Position along the z axis.
- Returns:
Value of the power density.
- Return type:
float
power(self: scarabee._scarabee.NEMDiffusionDriver, x: numpy.ndarray[numpy.float64], y: numpy.ndarray[numpy.float64], z: numpy.ndarray[numpy.float64]) -> numpy.ndarray[numpy.float64]
Constructs an array storing the power density at all desired (x,y,z) points. The first index is x, the second is y, and the third is z.
- Parameters:
x (array of float) – Positions along the x axis.
y (array of float) – Positions along the y axis.
z (array of float) – Positions along the z axis.
- Returns:
Value of the power density at all (x,y,z).
- Return type:
array of float
- save(self: scarabee._scarabee.NEMDiffusionDriver, fname: str) None#
Saves the NEMDiffusionDriver to a binary file.
- Parameters:
fname (str) – Name of the file.
- solve(self: scarabee._scarabee.NEMDiffusionDriver) None#
Solves the diffusion problem.
- property solved#
True if the problem has been solved, False otherwise.