CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Meshing (http://www.cfd-online.com/Forums/openfoam/81820-meshing.html)

Rickard.Solsjo November 8, 2010 03:19

Meshing
 
Hey dudes!
Putting my complex geometry into a simpler case; I want to have two boxes on top of each other and have some kind of interface between these, so that the wall disappears. Then I can refine the first box more than the second box and mesh without using to much PCU.
Should not be to hard right?

Thx
Rickard

akidess November 8, 2010 05:15

I'm not 100% sure if I understood you right: The interface you are mentioning is purely virtual? You can just make a block mesh with two hexa blocks that share a common face, and then you can have different meshes on each block.

Rickard.Solsjo November 10, 2010 04:05

Yeah of course
But if I want to put one of the sides as inlet and the other one as outlet, kind of like a channel or whatever, what should I do with the shared interface?
I tried some different setups but it doesnt work, any ideas?

akidess November 10, 2010 05:15

I think it would help if you drew a sketch, because I still don't see the problem. You don't even have to define a patch between both blocks, it should be recognized as an internal face.

akidess November 10, 2010 05:39

Ok, so your mistake is that the two blocks you defined do not have a common face. Even though they are at the same location, as far as I know blockMesh does not do any checks if it can merge two faces.

Here's an example of a cavity with refinement towards the interface. It should be straight forward to apply this to your case. Now I've only use blocks that are refined in a single, independent direction (here: y, where as x and z which lie in the common face are equal). I'm not sure if it's possible to have a different amount of cells on either side of the interface as that would require interpolation. Someone else will have to comment on that.

Code:

vertices       
(
        (0 0 -0.01)
        (0 1 -0.01)
        (1 1 -0.01)
        (1 0 -0.01)
        (0 0 0.01)
        (0 1 0.01)
        (1 1 0.01)
        (1 0 0.01)
              (0 1.2 -0.01)
              (1 1.2 -0.01)
              (0 1.2 0.01)
              (1 1.2 0.01)
);

blocks         
(
    hex (0 3 2 1 4 7 6 5) (60 50 1) simpleGrading (-4 0.25 1)
    hex (1 2 9 8 5 6 11 10) (60 12 1) simpleGrading (-4 2 1)
);

edges         
(
);

patches       
(
    patch bottom
    (
        (4 7 3 0)
    )
    patch top
    (
        (10 11 9 8)
    )
    patch left
    (
        (4 5 1 0)
              (5 10 8 1)
    )
    patch right
    (
        (7 6 2 3)
              (6 11 9 2)
    )

    empty default
    (
    )
);


Rickard.Solsjo November 10, 2010 06:14

Hi, thx man.
Tho it isnt working atm, but I get you aim.
Basically what you do is just to neglect the inner interface by leaving it undefined?

akidess November 10, 2010 06:26

I could add the inner face to the 'empty' default patch - the main point is to repeat the vertices that make up the shared face (here 1 2 5 6) in the block definition:

hex (0 3 2 1 4 7 6 5)
hex (1 2 9 8 5 6 11 10)

Btw, I noticed I had a negative number in the grading. That's because I used that mesh with an enhanced blockMesh tool (it's somewhere here on the forum) which applies a sort of parabolic grading when it comes across a negative number. It won't work with the standard blockMesh like this.

Rickard.Solsjo November 10, 2010 10:47

Wont you get the 2D 1D problem?
Also, I just leave the faces undefined and after running blockMesh i simply change in the boundary file from deafultFaces to walls. Should work..

akidess November 10, 2010 11:28

I'm sorry Rickard, but you lost me again...


All times are GMT -4. The time now is 07:26.