rizer.models.nrp.channel_grid#

Cell faces and cross-sections of the 1D radial channel grid.

One definition for every consumer that integrates over the channel’s cells: the split solver’s conduction operator and hydro half-step (ChannelReactor1D), and the current and plasma resistance both channel wrappers report. The native solver builds the same faces in PlasmaChannel1D::faceRadius and the same cross-sections in ChannelCircuit, so a quantity integrated here and one integrated natively describe the same cells.

The conventions are NUMERICS.md section 2’s: faces at node midpoints, the axis face pinned at zero so it carries no area, and the wall face mirrored half a spacing past the outermost node.

Functions#

face_radii(r[, domain_radius]) → numpy.ndarray

Face radii \(r_{i\pm1/2}\) of a node-centred radial grid [m].

cross_section_areas(r[, domain_radius]) → numpy.ndarray

Cross-sectional area of each cell [m^2].

Module Contents#

rizer.models.nrp.channel_grid.face_radii(r: numpy.ndarray, domain_radius: float | None = None) → numpy.ndarray#

Face radii \(r_{i\pm1/2}\) of a node-centred radial grid [m].

Parameters:
  • r (numpy.ndarray, shape (npts,)) – Node radii [m], increasing, r[0] = 0.

  • domain_radius (float or None, optional) – Channel radius [m], for a single node, which has no spacing to mirror: given, it stands in for one, as in the native PlasmaChannel1D::faceSpacing; otherwise the node radius does, as in ChannelReactor1D’s conduction operator. Unused for two or more nodes.

Returns:

Face radii [m]: zero at the axis, node midpoints inside, and the wall face \(r_{N-1} + (r_{N-1}-r_{N-2})/2\); for a single node r[0] + domain_radius / 2, or 1.5 * r[0] without it.

Return type:

numpy.ndarray, shape (npts+1,)

Raises:

ValueError – If r is a single node on the axis and domain_radius is not given: the node radius is then zero and would give a cell of no area.

Examples

>>> face_radii(np.array([0.0, 1.0, 2.0]))
array([0. , 0.5, 1.5, 2.5])
rizer.models.nrp.channel_grid.cross_section_areas(r: numpy.ndarray, domain_radius: float | None = None) → numpy.ndarray#

Cross-sectional area of each cell [m^2].

\(\pi(r_{i+1/2}^2 - r_{i-1/2}^2)\) on the faces of face_radii(), out to the wall face half a spacing past the last node: the cells the hydro sub-step, the conduction stencil and the Joule source act on, so a conductance integrated here balances the deposited Joule power.

A node trapezoid of \(2\pi r\) is not equivalent: it weights the axis node by \(2\pi r_0 = 0\), so the hottest, most conductive point carries none of the integral.

Parameters:
  • r (numpy.ndarray, shape (npts,)) – Node radii [m], increasing, r[0] = 0.

  • domain_radius (float or None, optional) – Channel radius [m], required for a single node; see face_radii().

Returns:

Cell cross-sections [m^2], summing to \(\pi r_{N-1/2}^2\) with \(r_{N-1/2}\) the wall face.

Return type:

numpy.ndarray, shape (npts,)

Examples

>>> float(np.sum(cross_section_areas(np.array([0.0, 1.0, 2.0]))) / np.pi)
6.25