flow.domain.FlowGrid
flow.domain.FlowGrid(shape, origin, size)A fixed axis-aligned lattice of cell centres in world coordinates.
Attributes
| Name | Type | Description |
|---|---|---|
| shape | tuple[int, int, int] | (NX, NY, NZ) cell counts. Flow runs along +Y. |
| origin | tuple[float, float, float] | World coordinates of the box’s minimum corner. |
| size | tuple[float, float, float] | World extent of the box along each axis. |
Methods
| Name | Description |
|---|---|
| centers | Cell-centre coordinates. |
| flat_centers | Cell-centre coordinates as a point list. |
| suggested_epsilon | Half a cell, which puts the interface across about two of them. |
centers
flow.domain.FlowGrid.centers()Cell-centre coordinates.
Returns
| Name | Type | Description |
|---|---|---|
| jax.Array | (NX, NY, NZ, 3) world coordinates. |
flat_centers
flow.domain.FlowGrid.flat_centers()Cell-centre coordinates as a point list.
Returns
| Name | Type | Description |
|---|---|---|
| jax.Array | (NX*NY*NZ, 3) world coordinates. |
suggested_epsilon
flow.domain.FlowGrid.suggested_epsilon()Half a cell, which puts the interface across about two of them.
sigmoid(-d/eps) runs from 0.12 to 0.88 over |d| < 2 eps, so the transition band is four epsilon wide: half a cell here means two cells of smear. That is the narrowest band the lattice still resolves, and it matters that it is narrow — a wider one never lets chi reach 1 inside a thin fin, so the Brinkman drag never reaches alpha_max and the fin leaks. (Measured on the starter sink at 32x64x32: max chi is 0.85 at one cell diagonal and 0.99 here.)
Returns
| Name | Type | Description |
|---|---|---|
| float | The recommended epsilon for :func:solid_fraction. |