|
[Sponsors] |
[blockMesh] Creating blockMeshDict from python |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 12, 2021, 18:25 |
|
#21 | |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Quote:
What's planned next: - a revolve on a collection of faces, creating multiple blocks - a loft/elbow or something where you can also specify number of blocks in the lofted/revolved direction. this would allow you to create, for instance, a 360 degree torus from <n> blocks. you can do that now but you have to manually create those segments. |
||
August 15, 2021, 19:10 |
|
#23 |
Senior Member
|
Greetings again.
Is there a function that allows to set in the file constant/polymesh/boundary the patch type entries for wall to "wall" instead of "patch" (as currently is the case)? Doing in manually is a bit of burden. Cheers, Domenico. |
|
August 16, 2021, 16:04 |
|
#24 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
No as there is no real need for that - just use the createPatch utility. Here's a sample system/createPatchDict that does just that. Also note that you can leave the most numerous faces out of the classy_blocks script - blockMesh will name them defaultFaces and you can capture them all with createPatch. Saves you quite a lot of lines of code!
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Do a synchronisation of coupled points after creation of any patches. // Note: this does not work with points that are on multiple coupled patches // with transformations (i.e. cyclics). pointSync false; // Patches to create. patches ( { name walls; patchInfo { type wall; } constructFrom patches; patches (defaultFaces); } ); // ************************************************************************* // |
|
August 22, 2021, 16:26 |
|
#25 |
Senior Member
|
Greetings again.
Question: is there an easy way to easily obtain doubly graded meshes (see e.g. Section 2.6 https://openfoamwiki.net/index.php/B..._blockMeshDict) using classy_blocks, other then editting the blockMeshDict file? Thanks, Domern |
|
August 23, 2021, 06:09 |
|
#26 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
As of this moment, unfortunately not. More sophisticated grading functions will be added later. If your geometry isn't too complicated and you don't want to edit grading, you can add more simple-graded blocks...
|
|
September 10, 2021, 09:51 |
|
#29 |
Member
Francisco T
Join Date: Nov 2011
Location: Melbourne, Australia
Posts: 64
Blog Entries: 1
Rep Power: 15 |
Greetings
I'm trying to build a geometry which has a cavity inside. Similar to the attached image. I guess I can figure out how to model the features outsid but I'm wondering about the cavity. The right image is a cut to see inside. How can we define a cavity? |
|
September 10, 2021, 11:46 |
|
#30 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
you need to slice your model into blocks. unfortunately with cavities, the number of blocks increases rapidly... but that's all i can help.
Unless you decide to use snappy/cfMesh and use blocks just to create geometry (inside): https://damogranlabs.com/2020/10/blo...xternal-flows/ |
|
September 10, 2021, 17:01 |
|
#31 |
Member
Francisco T
Join Date: Nov 2011
Location: Melbourne, Australia
Posts: 64
Blog Entries: 1
Rep Power: 15 |
Thanks for your reply!
I want to avoid the stl creation for this case, therefore I think I will use blockMesh and a combination of topoSet + subsetMesh commands to delete internal elements and create the cavity. Cheers |
|
July 10, 2023, 11:19 |
|
#32 |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
Hey,
I am working in Ubuntu 22.10, and I want to start using classy blocks to try and mesh the geometry in the atached picture. It is a turbopump, composed of a dual blade inducer, a radial impeller and a volute. The picture shown is of the fluid domain, not the actual pump solid. https://imgur.com/a/WpltVGL First question is, do you think that is doable or worth the time? Second question, and excuse me for the ignorance. I can't get the examples to run in the python script. It is giving me the following error: ModuleNotFoundError: No module named 'classy_blocks' when I copy the https://github.com/damogranlabs/classy_blocks into the examples folders, it gives me this new error https://github.com/damogranlabs/classy_blocks So, could you please do a quick explanation/guide on how to proceed to the setup of classy blocks on ubuntu? |
|
July 10, 2023, 17:11 |
|
#33 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Hi, thank you for your interest in classy_blocks.
In fact, this whole thing started because I needed a better mesh for a centrifugal pump. I first wrote a simple script that tracked block points for me, then expanded it to what it is now. I do use classy_blocks to create a mesh of an impeller as part of my job so I can tell it is doable but cannot share the code. For me it was a huge success because I need a proper parametric model for automatic optimization but it took me around a year to whip it up (besides other nuisances I'm responsible for ). Can't imagine working without this now, though. I use classy_blocks to to create a background mesh for a volute that fits inlet AMI ring and outlet mesh is oriented with the flow, but the spiral geometry is meshed with snappy. A volute can be meshed with pure-hexa blocks but at the moment I have no idea how. It's on my TODO list, though. Inducer is probably the easiest part but also most probably not worth the time. Just use snappy and feed it a cylindrical background mesh. About the examples: you probably didn't install the package correctly: see https://github.com/damogranlabs/clas...#how-to-use-it You can PM me if you decide to dive into this... but you have been warned |
|
July 11, 2023, 05:13 |
|
#34 |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
Hey, thank you for the quick reply.
Honestly, after reading your point of view, I don't think it is worth the time at the moment. Mostly because I am working on my master thesis in partnership with a rocket company, so both me and them want to finish this kind of fast. I liked your sugestion of the cylindrical background mesh. This is my first big CFD project, so I didn't even think about that possibility. I will implement that and let you know, in a few days/weeks how it turned out. Thank you |
|
July 11, 2023, 05:20 |
|
#35 |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
One question, the way you explained the stuff gave me the understanding that, usually, you mesh the components seperately. Is that right? If so, how do we make sure that the elements share the nodes between each other?
|
|
July 11, 2023, 06:58 |
|
#36 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Yeah, if you need one mesh promptly, you need an automatic mesher. Try snappy and cfMesh, they will do the job.
In turbomachinery and other moving machinery you can't keep nodes together so static and moving mesh parts must be coupled in another way, AMI (ESI-CFD version), NCC (Foundation version) or GGI (foam-extend). See the Code:
incompressible/pimpleFoam/RAS/propeller |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] Created a python package for generating blockMeshDict | grokkingStuff | OpenFOAM Meshing & Mesh Conversion | 3 | November 5, 2020 08:55 |
[blockMesh] Creating a blockmeshDict file | andrewlindsay | OpenFOAM Meshing & Mesh Conversion | 8 | August 15, 2020 10:56 |
[blockMesh] Creating an axisymmetric piston cylinder in blockMeshDict | foadsf | OpenFOAM Meshing & Mesh Conversion | 9 | August 23, 2018 08:54 |
[blockMesh] what commands should I use to start creating a blockMeshdict file? | Hojae | OpenFOAM Meshing & Mesh Conversion | 1 | November 12, 2014 17:58 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 10:28 |