zoomy_core.numerics.boundary_closure

zoomy_core.numerics.boundary_closure#

Classify, per boundary face and row, whether a boundary condition fixes the value (Dirichlet), the normal derivative (Neumann) or neither (ghost), from the ghost-state kernel. Feeds the constrained LSQ derivative fits of geometry_xp.build_topology; a row misclassified as ghost costs accuracy, never correctness.

A vector BC (a wall reflecting the normal momentum) couples the rows of a vector group on a face not aligned with an axis: no row is Dirichlet or Neumann by itself. In the face’s normal frame (normal component n.q, tangential components) the same ghost is Dirichlet in the normal and Neumann in the tangential components; face_closure classifies the groups there wherever that fixes more rows than the Cartesian frame (RowClosure.rotated).

References

Module Contents#

Classes#

RowClosure

Closure kinds of the rows of one row space on the boundary faces.

Functions#

face_kinds

Kinds (GHOST / DIRICHLET / NEUMANN) of the rows of space on the boundary faces; a Coupled face’s rows are GHOST (its ghost is the coupling’s data).

vector_groups

The vector row groups the BCs of nsm act on as vectors (momentum_field_indices of walls), components in axis order; groups of one row and groups that share a row with a different group are dropped.

face_closure

RowClosure of the rows of space on the boundary faces: the Cartesian face_kinds, and on each face where a vector group’s rows are coupled, the group’s kinds in the face’s normal frame if that fixes more rows.

closure_spaces

Row spaces whose derivative fits a solver template closes: the state of nsm and systems, and the reconstruction variables at order >= 2.

closure_kinds

{key: (n_rows, n_bf) kinds} over closure_spaces, the closure argument of geometry_xp.build_topology; systems without BCs are skipped. With frames the values are RowClosures (vector groups in the faces’ normal frames, face_closure).

Data#

API#

zoomy_core.numerics.boundary_closure.KIND_NAMES#

None

zoomy_core.numerics.boundary_closure.face_kinds(nsm, space, branch, normals)#

Kinds (GHOST / DIRICHLET / NEUMANN) of the rows of space on the boundary faces; a Coupled face’s rows are GHOST (its ghost is the coupling’s data).

Args

  • branch: BC branch per face (-1: no BC, e.g. a partition cut, gives ghost).

  • normals: outward unit normals, shape (dim_n, n_faces).

Returns

(n_rows, n_faces) int8 array.

class zoomy_core.numerics.boundary_closure.RowClosure#

Closure kinds of the rows of one row space on the boundary faces.

Attributes

  • kinds: (n_rows, n_bf) int8 kinds. On a face where rotated[g], the rows of vector group g carry the kinds of the group’s components in the face’s normal frame: its first row the normal component n . q, the others the tangential components.

  • groups: vector row groups ((r_x, r_y[, r_z]), ...), components in axis order.

  • rotated: (n_groups, n_bf) bool, the faces whose group rows are in the normal frame.

kinds: numpy.ndarray#

None

groups: tuple#

()

rotated: numpy.ndarray#

‘field(…)’

zoomy_core.numerics.boundary_closure.vector_groups(nsm)#

The vector row groups the BCs of nsm act on as vectors (momentum_field_indices of walls), components in axis order; groups of one row and groups that share a row with a different group are dropped.

zoomy_core.numerics.boundary_closure.face_closure(nsm, space, branch, normals)#

RowClosure of the rows of space on the boundary faces: the Cartesian face_kinds, and on each face where a vector group’s rows are coupled, the group’s kinds in the face’s normal frame if that fixes more rows.

Args

  • branch: BC branch per face (-1: no BC).

  • normals: outward unit normals, shape (dim_n, n_faces).

zoomy_core.numerics.boundary_closure.closure_spaces(nsm, systems=())#

Row spaces whose derivative fits a solver template closes: the state of nsm and systems, and the reconstruction variables at order >= 2.

Returns

List of (key, system, space) with key = (owner, space).

zoomy_core.numerics.boundary_closure.closure_kinds(nsm, systems, branch, normals, frames=False)#

{key: (n_rows, n_bf) kinds} over closure_spaces, the closure argument of geometry_xp.build_topology; systems without BCs are skipped. With frames the values are RowClosures (vector groups in the faces’ normal frames, face_closure).