damogranlabs / classy_blocks

Python classes for easier creation of OpenFOAM's blockMesh dictionaries.
MIT License
126 stars 35 forks source link

Multigrading option #49

Closed sabbraxcaddabra closed 3 months ago

sabbraxcaddabra commented 4 months ago

Is there the option to use multigrading feature of block_mesh utility by classy_blocks?? I cannot find any info about it in source code and examples

FranzBangar commented 4 months ago

Yes, multigrading is supported but not explicitly demonstrated in examples. It's actually so simple that there's very little to demonstrate.

One such example would be the orifice plate, https://github.com/damogranlabs/classy_blocks/blob/master/examples/chaining/orifice_plate.py

# chop to a sensible number of cells;
# dilute long inlet/outlet sections
shapes[0].chop_radial(start_size=cell_size)
shapes[0].chop_tangential(start_size=cell_size)
shapes[0].chop_axial(length_ratio=0.9, start_size=cell_size * cell_dilution, end_size=cell_size)
shapes[0].chop_axial(length_ratio=0.1, start_size=cell_size, end_size=t / 8)

shapes[6].chop_axial(length_ratio=0.1, start_size=t / 8, end_size=cell_size)
shapes[6].chop_axial(length_ratio=0.9, start_size=cell_size, end_size=cell_size * cell_dilution)

So here for shape 0 (inlet) the first 90% of length is graded from coarse to normal and the last 10% goes down to first cell thickness in the boundary layer.

Shape 6 is the same but as it's outlet, it's vice versa.

Hope that answers your question.

sabbraxcaddabra commented 4 months ago

Thank you for your reply. The problem is that i'm working with asymmetric geometry and use wedge operation on face. Unfortunately wedge does not support radial, tangential or axial chop and chop method has now length_ratio keyword argument Is there any chance to use multigrading with wedge. Sorry if my questions very simple, but im realy dont understand it(

FranzBangar commented 4 months ago

If you're using Operations, you just use something like wedge.chop(axis, length_ratio=..., ...) instead. For Wedge specifically, you only use axis 0 (axial direction) and 1 (radial). The rest is the same.

sabbraxcaddabra commented 3 months ago

Thank you, it helps. Awesome project!