phipict.meshing.write_blockmeshdict

phipict.meshing.write_blockmeshdict(block_mesh: BlockMesh, path: str | Path, thickness: float = 1.0) → None[source]

Write the blocks of a BlockMesh as a blockMeshDict.

Cells and gradings are written as blockMesh edgeGrading, curved edges as arc/polyLine/spline/BSpline, and patches with their condition’s type (wall, symmetryPlane) or the type they were read with. A 2D mesh is written with one cell of thickness in z between empty patches.

Parameters:
  • block_mesh (BlockMesh) – The blocks.

  • path (str or pathlib.Path) – Output file.

  • thickness (float, optional) – Extent in z of a 2D mesh. Default is 1.

Raises:

ValueError – If a grading or edge has no blockMesh equivalent (e.g. tanh), or a block uses PICT row interpolation.