Cells

Cells(n_cells, centers, nodes, interface_area, cell_area, face_distances)

Represents the spatial discretization of a 1D domain into cells.

This class defines the geometry and discretization of the 1D transport domain, including cell centers, nodes, areas, and distances.

Parameters

Name Type Description Default
n_cells int Number of cells in the domain. required
centers jax.Array The x coordinate of the center of each cell. Shape = (n_cells,). required
nodes jax.Array The x coordinate of the points between cells, including boundaries. Shape = (n_cells + 1,). required
interface_area jax.Array Cross-sectional area at cell interfaces. Shape = (n_cells + 1,). required
cell_area jax.Array Cross-sectional area of each cell. Shape = (n_cells,). required
face_distances jax.Array Distance between cell faces. Shape = (n_cells,). required

Attributes

Name Description
center_distances Return the distance between cell centers (dx for slope computation).

Methods

Name Description
equally_spaced Create an equally spaced cell grid for the transport domain.

equally_spaced

Cells.equally_spaced(length, n_cells, *, interface_area=None)

Create an equally spaced cell grid for the transport domain.

Parameters

Name Type Description Default
length float Total length of the domain. required
n_cells int Number of cells in the domain. required
interface_area jax.Array Cross-sectional area at cell interfaces. Default is a constant array of ones. None

Returns

Name Type Description
Cells Spatial discretization object for the domain.
Back to top