phipict.meshing.grading

Cell distributions along a block edge.

A grading maps a number of cells to the normalised vertex positions along an edge, n + 1 strictly increasing weights from 0 to 1:

pm.Simple(4.0).weights(8)          # last cell 4x the first (OpenFOAM simpleGrading)
pm.Symmetric(10.0).weights(32)     # fine at both ends, centre cells 10x larger
pm.FirstCell(1e-3).weights(64, length=2.0)   # first cell height 1e-3

Wherever a grading is accepted, a bare number means Simple with that ratio (the blockMesh idiom) and None means “not given”: Uniform, or the grading of a connected block where a BlockMesh can infer it.

Functions

as_grading(grading)

Normalise a grading shorthand.

cells_for_size(length, size)

Number of uniform cells that comes closest to a target cell size.

Classes

ChebyshevBlend(gamma[, cluster])

Blend of a sine (Chebyshev) mapping and uniform spacing.

Cluster(*values)

Where a grading puts its smallest cells.

Cosine([cluster])

Cosine (Chebyshev-like) spacing.

Explicit(values)

Given vertex weights.

FirstCell(size[, cluster])

Geometric grading with a prescribed size of the smallest cell.

Geometric(ratio[, cluster])

Cells that grow by a constant factor from one cell to the next.

Grading()

Distribution of the vertices along an edge.

MultiGrading(segments)

Piecewise geometric grading, OpenFOAM's multi-grading.

Segment(length, cells, ratio)

One segment of a MultiGrading.

Simple(ratio)

Geometric growth with OpenFOAM's simpleGrading expansion ratio.

Symmetric(ratio)

Geometric grading that is fine at both ends, e.g. between two walls.

Tanh(beta[, cluster])

Hyperbolic tangent stretching.

Uniform()

Equal cells.