Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: structured block array #42

Open
bjnieuwboer opened this issue Sep 27, 2023 · 3 comments
Open

enhancement: structured block array #42

bjnieuwboer opened this issue Sep 27, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@bjnieuwboer
Copy link

Hi,

I have an idea for an additional functionality in classy blocks: a multiHex object. This is a structured 3d array of blocks. I’ve attached a proof of concept in python. This is not yet linked to classy blocks. It creates the points and blocks and shows how one can interact with these.

The advantage of creating a separate class over having multiple lofts is the ease of selecting and editing the location of the vertices. In this class one can select vertices and blocks based on their location in the blocking structure; i.e. (1,2,3) means the second vertex in x direction, the third vertex in y direction and the fourth vertex in z direction. When selecting this vertex it can be translated or rotated afterwards. Since the hexblocks have an index to the vertices in the multiHex class, all the hexBlocks are updated automatically when the vertex is moved. For a Cartesian mesh this procedure is far easier than the current method in classy blocks of selecting vertices in the mesh by looking at their location within a sphere or box.

The idea is based on blockmeshbuilder: https://github.com/NauticalMile64/blockmeshbuilder/blob/master/blockmeshbuilder/blockstructures/cartesian.py . However, I’ve built the code from scratch and added more features. In the attached file, you can see what the code is currently capable of and what I still would like to add.

My question is: would this be interesting for you to add? If so, I could integrate this code to classy blocks. However, I suppose it would need some final editing by you since you know all the ins and outs of the class blocks framework.
What would be your idea to integrate this code to classy blocks. Should this code create multiple loft operations which can be added to the mesh, or should this code be directly added to the mesh class?
multiHex.zip

@FranzBangar
Copy link
Member

This multi-block idea falls under you other proposal of universal sketches that users will define. Editing is done afterwards (see examples) but finding which vertex by their location in blocking structure is a yet-to-be-done "Finder" object. Will definitely consider. Do you have an example geometry (possibly something real-life-ish, a bit more serious than the attached multiHex) that I can use as a reference and example?

@FranzBangar FranzBangar self-assigned this Sep 27, 2023
@FranzBangar FranzBangar added the enhancement New feature or request label Sep 27, 2023
@bjnieuwboer
Copy link
Author

You are right, that another way of creating such a multi hex block is via an user defined sketch. For an end user, this would still be more work than defining the block with its x,y,z vertex coordinates.
I don’t know what your plans are for the Finder object. I think the ease of finding an index would still be more work than via the proposed indexing method. This method gives the user a different way of designing a mesh. Namely by starting with all the blocks and deleting/editing these.

Some real life examples are
• Flow over an inclined plate (modeling using Finite Area or VOF)
• Flow in an enlarged duct
• Flow in a diffusor
• Modeling flow around a body:
◦ Sphere/cylinder
◦ Multiple spheres/cylinders
• Flow around buildings
• Heat sink

Let me know if you are interested in implementing this and if you would like my help in any way.

@FranzBangar
Copy link
Member

If I understand you correctly, you'd like something like this:

array = cb.CartesianArray(point_1, point_2, count_x=3, count_y=3, count_z=3)
array.lofts[1][1][1].points[0].translate(0, 0, 0.1)
array.delete(1, 1, 0)

Apart from "cartesian addressing" and block deletion, is there anything else this array should be capable of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants