Skip to content

H-grid topology ​

An H-grid fills the inside of a duct: i runs streamwise from the inlet face to the outlet face, j and k span the cross-section, and the faces on the duct's surface are its walls. SHORE's H-grids are analytic primitives without an internal body. A body in a channel is handled the overset way: an H-grid for the channel plus a body-fitted grid around the body (Chimera mesh generation).

H-grid primitives: the rectangular duct, one block, and the circular tube, five blocks in an O-H section.H-grid primitives: the rectangular duct, one block, and the circular tube, five blocks in an O-H section.
H-grid primitives: the rectangular duct, one block, and the circular tube, five blocks in an O-H section.

Variants ​

shore.primitive exposes two analytic H-grid primitives:

VariantCLICross-sectionBlock layoutUse case
Rectangularshore primitive h-grid-rectrectangle1 hex block, no singular axisprismatic rectangular ducts; channels
Circularshore primitive h-grid-tubecircle5 hex blocks, O-H: a square core and four ring blocks, no singular axisstraight cylindrical ducts; simple SRM chambers

Ducts of varying or non-circular cross-section are not covered by a primitive; build them as a blocking on the duct geometry.

Conventions (both variants) ​

  • Block axes: i is streamwise, j and k are the two cross-section directions.
  • World alignment: streamwise_axis ("x", "y", or "z") selects which world axis the duct length runs along. Default x.
  • Default face BCs: streamwise faces (i_lo, i_hi) are FREE (inflow / outflow); the faces on the duct's wall are WALL.
  • On the rectangular duct the j and k faces are the four walls; on the circular tube the faces between its five blocks are SHARED.

Rectangular duct ​

Single hex block of shape (ni, nj, nk, 3). length / width / height set the three Cartesian extents (length along the streamwise axis, width along block j, height along block k). Tanh / tanh2 spacing on the cross-section axes clusters nodes near the duct walls — the natural choice for boundary-layer resolution.

Face boundary conditions ​

FaceBCMeaning
i_loFREEStreamwise inflow
i_hiFREEStreamwise outflow
j_lo / j_hiWALLTwo of the four duct walls
k_lo / k_hiWALLThe other two duct walls

In cc.par the streamwise FREE faces take the block's free_face_bc; set a positive natural code for them, per block or per face (3 / 4 for inflow / outflow).

Circular tube ​

Five hex blocks in an O-H ("butterfly") cross-section (ADR 0060):

  • core: a square in the middle, its corners at core_frac (0.5) of the radius, a Cartesian grid of n_circ / 4 cells a side;
  • ring_0 .. ring_3: each joins one side of the core to a quarter of the wall (ring_q from −45 + 90 q to 45 + 90 q degrees). j runs along the wall, k from the core (k = 0) to the wall (k = n_radial - 1); the lines are straight, and at the core's corners they follow the 45° diagonals.
  • i = streamwise in every block.

Every block is right-handed, whatever streamwise_axis, and there is no singular axis: the worst cells, at the core's corners, score about 0.71 (sin 135°). Before ADR 0060 the tube was one block on a polar grid whose centreline row collapsed to a point and was marked WALL.

Face boundary conditions ​

FaceBCMeaning
i_lo (every block)FREEStreamwise inflow
i_hi (every block)FREEStreamwise outflow
the rings' k_hiWALLThe tube's wall
the rest (16 faces)SHAREDBetween the core and the rings, and between neighbouring rings

Parameters ​

CommandSizesNodesSpacing
h-grid-rect--length (1.0), --width (0.1), --height (0.1)--ni 40, --nj 20, --nk 20--i/j/k-spacing uniform / tanh / tanh2, --i/j/k-beta 3.0
h-grid-tube--length (1.0), --radius (0.05), --core-frac (0.5)--n-axial 40, --n-circ 32 (a multiple of 4), --n-radial 8--i-spacing, --k-spacing (core to wall; tanh clusters at the wall), betas 3.0

Both take --streamwise-axis (x default). Two-sided tanh2 on the cross-section axes clusters toward the walls. In Python they are HGridRectMesh.build(...) and HGridTubeMesh.build(...), with the same PrimitiveMesh contract as the other primitives. Commands: shore primitive.

See also ​

Released under the MIT License.