phipict.meshing.formats.blockmeshdict

OpenFOAM blockMeshDict files.

blockMesh describes a mesh exactly like a BlockMesh: vertices, hex blocks with cells and grading, curved edges and boundary patches. Reading one gives the same mesh blockMesh would make, as phiPICT blocks:

mesh = pm.read_blockmeshdict("system/blockMeshDict")
mesh.set_bc("inlet", pm.Inflow((1.0, 0.0)))
mesh.set_bc("outlet", pm.Outflow())

Supported: convertToMeters/scale, $macros, hex blocks with simpleGrading or edgeGrading (with multi-grading), arc (point and origin forms), polyLine, spline and BSpline edges, boundary (and the old patches) with defaultPatch, and cyclic patches, which become periodic connections. A mesh whose blocks have one cell between two empty patches is read as a 2D mesh.

Patch types map to conditions: wall to Wall, symmetry/symmetryPlane to FreeSlip; other patches (patch, …) are named only, so their condition must be set.

Not supported: #calc and other directives, projected vertices, edges and faces, mergePatchPairs with entries, and collapsed hexes.

Functions

load_blockmeshdict(path[, ndims])

The blocks of a blockMeshDict as an unbuilt BlockMesh.

read_blockmeshdict(path[, ndims, rel_tol])

Read a blockMeshDict as a Mesh.

write_blockmeshdict(block_mesh, path[, ...])

Write the blocks of a BlockMesh as a blockMeshDict.