CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Is there any easy way to connect blocks of varying resolutions using blockMesh? (https://www.cfd-online.com/Forums/openfoam/89027-there-any-easy-way-connect-blocks-varying-resolutions-using-blockmesh.html)

murrdpirate June 1, 2011 14:02

Is there any easy way to connect blocks of varying resolutions using blockMesh?
 
Say I have two 1 m^3 blocks attached to each other, sharing a face. One block is filled with a mesh of 1 million 1 cm^3 cubes and the other is filled with a mesh of 1 thousand 10 cm^3 cubes. Is there any easy way to have blockMesh connect them?

murrdpirate June 1, 2011 14:15

Ah, I guess that is one major use of the grading function. I am thinking that I should create a block in between my two blocks and use a cell expansion ratio of 10 in all directions. Is that right?

Forgive me, I'm still a bit new.

mturcios777 June 2, 2011 12:47

There is a utility called stitchMesh, which has a case similar to what you want documented here:

http://openfoamwiki.net/index.php/Im...ith_interfaces

If you are working with blockMesh, then you don't need the import step. Abrupt changes in discretization can cause problems, so be careful. Increasing resolution tenfold may have adverse effects on your solution. Using grading is likely to be more stable.

murrdpirate June 2, 2011 18:33

Sweet, that does look like it will do exactly what I'm trying to do.

I wonder if it'll also solve another problem I'm having. I'm trying to figure out how to deal with multiple blocks that share a face with a single other block (see attached image). Even if the resolution is exactly the same, this doesn't seem to work. I also tried using mergePatchPairs...but that didn't seem to work either.

The only thing I know will work is making sure that each face of every block is connected exactly to a face of another block (i.e. chopping the domain into a bunch of cubes). At that point I might as well create the mesh by hand.

murrdpirate June 2, 2011 22:51

Oops, never posted the image. Here it is.http://i.imgur.com/Jbw2v.png

mturcios777 June 3, 2011 11:53

From my understanding of the stitching process, you'd have to first stitch the two smaller blocks and make sure the two faces that connect with the large block are defined as one face (not that hard), then stitch the resultant mesh with the large block.

There are places where this can go wrong in a general case (just off the top of my head, parallel faces can sometimes be a pain). With stuff like this, I've had success writing a script/program which places all the points and calculates all the proper cell expansion ratios and writes out your blockMeshDict; I use GNU Octave, but use whatever you are familiar with. It may seem like a whole lot of work, but you'd be doing that stuff anyway when doing it by hand, and this way if the result is wrong you can always debug the script/program which is a lot easier than analyzing the final mesh.

murrdpirate June 4, 2011 00:28

Ahh I knew I wouldn't be able to avoid any programming for too long. But I think you're right that that is the way to go. I think I have a pretty good idea in mind. Thanks.

mbeaudoin June 4, 2011 09:26

Hello,

The GGI interface was created exactly for handling such topology with non-conformal meshes. You might want to give it a try.

Martin

Quote:

Originally Posted by murrdpirate (Post 310306)
Sweet, that does look like it will do exactly what I'm trying to do.

I wonder if it'll also solve another problem I'm having. I'm trying to figure out how to deal with multiple blocks that share a face with a single other block (see attached image). Even if the resolution is exactly the same, this doesn't seem to work. I also tried using mergePatchPairs...but that didn't seem to work either.

The only thing I know will work is making sure that each face of every block is connected exactly to a face of another block (i.e. chopping the domain into a bunch of cubes). At that point I might as well create the mesh by hand.



All times are GMT -4. The time now is 01:42.