takaakiaoki / ofblockmeshdicthelper

Helper utilities for OpenFOAM blockMeshDict generation.
MIT License
21 stars 15 forks source link

Support for cyclic patches #7

Open carowjp opened 5 years ago

carowjp commented 5 years ago

Thanks for developing this helper.

It would be great to add support for cyclic patches in the add_boundary method. The code creates a cyclic boundary but is missing information.

Cyclic patches are unique in that they require an additional line in the blockMeshDict with specification of a neighbor patch, and optionally lines defining a transformation.

cyclicLeft { type cyclic; neighbourPatch cyclicRight; transform rotational; rotationAxis (0 0 1); rotationCentre (0 0 0); faces ( (3 8 20 15) ); }

paugier commented 1 year ago

Just to say that we used and adapted ofblockmeshdicthelper code in https://foss.heptapod.net/fluiddyn/fluidsimfoam/ and that we support cyclic boundaries.

I will soon release a version on PyPI so that this code can be used with pip install fluidsimfoam

from fluidsimfoam.foam_input_files.blockmeshhelper import BlockMeshDict

 bmd = BlockMeshDict()

 ...

 b0 = bmd.add_hexblock(
    [f"v{i}" for i in range(8)],
    (nx, ny, nz),
    "",
 )

bmd.add_cyclic_boundaries(
    "upperBoundary", "lowerBoundary", b0.face("n"), b0.face("s")
)