STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.stability_hifi.acoustics.mesh Namespace Reference

Classes

class  MeridionalMesh

Functions

np.ndarray _grid_triangles (int nx, int nr)
MeridionalMesh _structured_mesh (np.ndarray xs, np.ndarray rs)
MeridionalMesh cylinder_mesh (float L, float R, int nx, int nr)
tuple[MeridionalMesh, np.ndarray] two_zone_duct_mesh (float L1, float L2, float R, int nx1, int nx2, int nr)

Detailed Description

Structured triangular meridional mesh (paper Section III.F).

A "meridional mesh" is a 2-D triangulation of the half-plane Omega = {(x, r): r >= 0}
obtained by revolving the chamber contour about the axis of symmetry. Every axisymmetric
mode family (m=0 longitudinal/radial, m=1 first tangential, ...) is solved on the *same*
2-D mesh — only the azimuthal wavenumber ``m`` changes between solves (Eq. 9).

``cylinder_mesh`` builds the mesh for the uniform right-circular cylinder used by
verification case V1. Later tiers replace it with a mesh built from the true chamber
contour (revolved via gmsh), without touching the assembly or eigensolver code.

Function Documentation

◆ _grid_triangles()

np.ndarray engine.stability_hifi.acoustics.mesh._grid_triangles ( int nx,
int nr )
protected
Triangulation topology of an nx-by-nr logical node grid (node id = i*nr + j):
each logical quad cell split into 2 triangles along the same diagonal.

Shared by the plain tensor-product meshes below AND the wall-mapped meshes of
``contour.py`` (where r depends on x): the topology is identical, only the node
coordinates differ — so the triangulation convention lives in exactly one place.

Definition at line 91 of file mesh.py.

Referenced by _structured_mesh().

◆ _structured_mesh()

MeridionalMesh engine.stability_hifi.acoustics.mesh._structured_mesh ( np.ndarray xs,
np.ndarray rs )
protected
Shared builder: structured triangulation over an arbitrary (not necessarily
uniform) axial node grid ``xs`` crossed with a radial node grid ``rs``.

Both ``cylinder_mesh`` (uniform ``xs`` spacing) and ``two_zone_duct_mesh`` (two
uniformly-spaced runs of ``xs`` stitched together, with a shared column at the
zone interface) delegate to this.

Definition at line 113 of file mesh.py.

References _grid_triangles().

Referenced by cylinder_mesh(), and two_zone_duct_mesh().

◆ cylinder_mesh()

MeridionalMesh engine.stability_hifi.acoustics.mesh.cylinder_mesh ( float L,
float R,
int nx,
int nr )
Structured mesh of the rectangle [0, L] x [0, R] (uniform cylinder, case V1).

``nx``, ``nr`` are node counts (not cell counts) along the axial and radial
directions. Each of the ``(nx-1)*(nr-1)`` rectangular cells is split into 2
triangles sharing the same diagonal, so refinement is simply increasing nx, nr.

Definition at line 127 of file mesh.py.

References _structured_mesh().

◆ two_zone_duct_mesh()

tuple[MeridionalMesh, np.ndarray] engine.stability_hifi.acoustics.mesh.two_zone_duct_mesh ( float L1,
float L2,
float R,
int nx1,
int nx2,
int nr )
Structured mesh of a duct [0, L1+L2] x [0, R] with an exact node column at the
zone interface ``x = L1`` (verification case V2, temperature-jump duct).

Why an exact shared column, and not two independent grids glued approximately:
the pressure field itself is physically continuous across a sound-speed
discontinuity (only its second derivative jumps — see the derivation in
``validation/v2_temperature_jump.py``), so the standard, exact way to represent
that in FEM is a single shared node at the interface, with each side's *element*
(not node) carrying its own material property. Building ``xs`` as two runs of
``linspace`` that share their common endpoint (rather than gluing two separately-
spaced grids) guarantees that shared column exists exactly, with no search or
tolerance-based node-snapping needed.

Returns ``(mesh, zone_of_element)`` where ``zone_of_element`` is an ``(n_tri,)``
int array, 1 for elements entirely in ``[0, L1]`` and 2 for elements entirely in
``[L1, L1+L2]`` — unambiguous because no element straddles the shared column by
construction.

Definition at line 142 of file mesh.py.

References _structured_mesh().