CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Snappy : Multi-region meshing (https://www.cfd-online.com/Forums/openfoam-meshing/94413-snappy-multi-region-meshing.html)

aqua January 4, 2012 15:50

Quote:

Originally Posted by wyldckat (Post 337890)
Greetings Aqua,

I believe that what you are looking for is this tutorial:
Code:

tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater
Study it and you should be able to create the desired mesh.

This thread should also be useful to you: http://www.cfd-online.com/Forums/ope...oth-parts.html

Best regards,
Bruno

hi, Bruno, Thank you so much for your reply. I will try that.
Cheers!

Aqua

aqua January 9, 2012 05:51

Quote:

Originally Posted by Aurelien Thinat (Post 333231)
Hello Bruno,

Thank you for answering. I'll test the impact of the feature angles and of the tesselation of the stl file. I would be able to check if snappy is sensible to the triangle's size of the stl. I'll let you know about the results.

Then I don't think I can create a less complicated test case. I have already tested 2 cubes sharing 1 interface. This was successful. So now a cube inside another one seems like, to me at least, the natural next step.

I can upload the files if anyone wants them (even the whole case).

Aurélien

Hello Aurélien,

I am doing the same example: there are two cubes next to each other, cube1.stl and cube2.stl. but i couldn't make it to get the correct snappyhexmesh. Could you please, if possible, send me your case?
Thank you sooooo much!!!

Aqua

Aurelien Thinat January 10, 2012 07:08

Hi Aqua,

You should have a look to the tutorial of snappyHexMesh for CHT solver. Copy/paste the case directory and change the .stl file by your own. Then edit the snappyHexMeshDict and change the name of the .stl file too.

I don't have my first test case anymore.

Aurélien

aqua January 10, 2012 09:18

Quote:

Originally Posted by Aurelien Thinat (Post 338612)
Hi Aqua,

You should have a look to the tutorial of snappyHexMesh for CHT solver. Copy/paste the case directory and change the .stl file by your own. Then edit the snappyHexMeshDict and change the name of the .stl file too.

I don't have my first test case anymore.

Aurélien

Hello,Aurélien,
Thank you so much for your reply. what i did is:
1. modify the blockMeshDic to change the block;
2. put my iblock.stl and oblock.stl into the file "triSurface"
3. change bottomAir and topAir to iblock and oblock under the file "constant"
4. change regionProperties
5. change snappyHexMeshDict.
I would say, I did what i can think of. But only iblock has mesh, oblock doesn't....

Besides, there are some files named domain1 and domain2 created, I don't know why...

Even in the bounday file for iblock, something like this appeared:
iblock_to_domain1
{
type directMappedWall;
nFaces 1190;
startFace 127154;
sampleMode nearestPatchFace;
sampleRegion domain1;
samplePatch domain1_to_iblock;
offsetMode uniform;
offset (0 0 0);
}
iblock_to_domain2
{
type directMappedWall;
nFaces 2835;
startFace 128344;
sampleMode nearestPatchFace;
sampleRegion domain2;
samplePatch domain2_to_iblock;
offsetMode uniform;
offset (0 0 0);

I don't understand why something like iblock_to_domain2 would appear....

thank you so much!

Aqua

Aurelien Thinat January 10, 2012 09:22

Yes, try to refine your blockMesh and the surface mesh of the stl.

aqua January 10, 2012 10:28

Quote:

Originally Posted by Aurelien Thinat (Post 338632)
Yes, try to refine your blockMesh and the surface mesh of the stl.

Thank you so much for your reply. May I ask, which software do you use to edit stl file? I have proe, but it doesn't work...

Thank you!

Aqua

Aurelien Thinat January 10, 2012 10:30

I used starccm+

aqua January 10, 2012 11:04

2 Attachment(s)
Quote:

Originally Posted by Aurelien Thinat (Post 338648)
I used starccm+

Hello,
I tried starccm+ too, and created different boundaries for different surfaces. such as in the picture. Then right click "import", choose "export surface", to stl file. BUT, when I open the stl file in ICEM, all the boundaries disappeared and there is only ONE part, as you can see in another picture.

I am so struggling about this. Could you please tell me how to solve this?

Thank you so much!

Aqua

Aurelien Thinat January 10, 2012 11:22

- You have to create 1 region per boundary.
- Then export each one in a different stl file "boundary1.stl" boundary2.stl" etc.
- Open each boundary*.stl, rename it "solid boundary1 (...) endsolid boundary1"
- Copy paste everything in "cube.stl" : it should look like :
'solid boundary1
...
endsolid boundary1
solid boundary2
...
endsolid boundary2
solid boundary3
...'

And relaunch SHM.

aqua January 10, 2012 15:50

Quote:

Originally Posted by Aurelien Thinat (Post 338662)
- You have to create 1 region per boundary.
- Then export each one in a different stl file "boundary1.stl" boundary2.stl" etc.
- Open each boundary*.stl, rename it "solid boundary1 (...) endsolid boundary1"
- Copy paste everything in "cube.stl" : it should look like :
'solid boundary1
...
endsolid boundary1
solid boundary2
...
endsolid boundary2
solid boundary3
...'

And relaunch SHM.

Thank you so much!!!!! Finally I know how to do this!

All the best!!!

Aqua

aqua January 11, 2012 12:39

3 Attachment(s)
Quote:

Originally Posted by Aurelien Thinat (Post 338662)
- You have to create 1 region per boundary.
- Then export each one in a different stl file "boundary1.stl" boundary2.stl" etc.
- Open each boundary*.stl, rename it "solid boundary1 (...) endsolid boundary1"
- Copy paste everything in "cube.stl" : it should look like :
'solid boundary1
...
endsolid boundary1
solid boundary2
...
endsolid boundary2
solid boundary3
...'

And relaunch SHM.

Hello,Aurélien,
I got it managed to modify the stl file(two blocks next to each other: iblock and oblock, see the attachment). And after SHM, there is no error. But the weired thing is:
-two time step files were created, 0.001 and 0.002(see the attachment), in which there was the file polyMesh. in the tutorial case, under constant/bottomAir, there is polyMesh, under constant/topAir, there is also the polyMesh, etc.
-so i copied the polyMesh in file 0.002 to constant and check it in paraFoam, seems like the mesh is ok (see the attachment) .

I am not sure whether the mesh is right or not. Could you please help on this question: why i didn't get polyMesh under constant/iblock/, but i got it in the file 0.002?

Also, in paraFoam, under Mesh Parts, there is no iblock faceZone, why?

Thank you so much!

aqua January 12, 2012 08:15

Hello,Aurélien,
after SHM, I run splitMeshRegions, then under the file 0.002, there are the two files named iblock and oblock, including their own polyMesh! Is that right now?
Thank you so much!
Aqua

aqua January 12, 2012 09:47

Quote:

Originally Posted by wyldckat (Post 337890)
Greetings Aqua,

I believe that what you are looking for is this tutorial:
Code:

tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater
Study it and you should be able to create the desired mesh.

This thread should also be useful to you: http://www.cfd-online.com/Forums/ope...oth-parts.html

Best regards,
Bruno

Hi, Bruno,
I created a simple mesh for two stl files, named iblock.stl and oblock.stl. they are next to each other, having an interface.
But, do you remember what i want to do? I want to simulate two cars passing by each other, using moving mesh. So, the situation would be like in the picture as attachment. So, it's not a multiregion problem actually. there is only AIR. But in the case snappyMultiRegion, the mesh was created under each file named bottomAir, topAir, heater, leftsolid and right solid.
So, is there some way to put all the mesh in one file? in my case, it will be, how i can put polyMesh under iblock, and polyMesh under oblock together as in one polyMesh?
Thank you so much!

Aqua

wyldckat January 15, 2012 08:33

Hi Aqua,

Well, since you wanted two strictly defined environments, I thought that the easiest way would be to use the multi-region feature in snappyHexMesh.

OK, since you don't need a multi-region, then all you need is the two cubes representing the cars. Then just define the location point on the outer volume surrounding both cars.
As for having that wall dividing the two sides of the mesh, you don't need to strictly define it with an STL file; you can simply define the outer bounding box in two connected parts in the "blockMeshDict" file. snappyHexMesh will only change that mesh if the cubes are too close to that zone.

Best regards,
Bruno

aqua January 15, 2012 16:14

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 339380)
Hi Aqua,

Well, since you wanted two strictly defined environments, I thought that the easiest way would be to use the multi-region feature in snappyHexMesh.

OK, since you don't need a multi-region, then all you need is the two cubes representing the cars. Then just define the location point on the outer volume surrounding both cars.
As for having that wall dividing the two sides of the mesh, you don't need to strictly define it with an STL file; you can simply define the outer bounding box in two connected parts in the "blockMeshDict" file. snappyHexMesh will only change that mesh if the cubes are too close to that zone.

Best regards,
Bruno

Hello Bruno,
thank you so much for your reply. Sorry that I didn't make it clear: I have two cars, which would pass by each other in the simulation. Since I will use moving mesh, so, there has to be another two boxes, containing the two cars, and the two boxes will move towards each other. Like in the attachment:
icube and ocube stand for the two cars. block1 contains icube, block2 contains ocube. interface between block1 and block2 will be set as GGI, and block1 and block2 will move towards each other...
Do you have some good idea? Thank you so much!
Aqua

wyldckat January 15, 2012 16:24

Hi Aqua,

OK, then let's step back and look at existing examples. Which tutorial are you basing yourself for your case? Namely, which tutorial(s) are you going to base yourself for GGI?

Best regards,
Bruno

aqua January 15, 2012 16:56

Hi, Bruno,
For GGI, I want to use the tutorial "turbopassengerotating" in OF16ext. But I have to use SHM for the complicated cars. So, currently i am looking for how to creat the mesh first...
thank you!
Aqua

wyldckat January 15, 2012 18:55

Hi Aqua,

OK, the tutorial you are talking about is "incompressible/icoDyMFoam/turboPassageRotating". I haven't tested my theory yet, but I propose the following procedure:
  1. You create a "blockMeshDict" that has the two environments in a single box.
  2. Still on that "blockMeshDict", create "overlapGgi interface1" and "overlapGgi interface2" that define the wall that separates the two outer/environment boxes.
  3. After running blockMesh, you can now simply have the two cars in STL format and run snappyHexMesh! snappyHexMesh should be able to generate the surrounding mesh and preserve the wall between them!
Any other missing feature can later be generated by either using topoSet or setSet.

If creating the separation wall leads to snappyHexMesh only generating the mesh on one side, then remove that separation wall from "blockMeshDict". You can recreate that wall after the mesh has been created with snappyHexMesh, simply by using topoSet or setSet and/or createPatch.
It might also be possible to simply skip the dedicated separation wall if you create the cellZones manually... which again, you can create with at least setSet.

If you don't know how to use setSet, run it and type in the command:
Code:

help
Good luck!
Bruno

aqua January 16, 2012 04:39

Quote:

Originally Posted by wyldckat (Post 339454)
Hi Aqua,


OK, the tutorial you are talking about is "incompressible/icoDyMFoam/turboPassageRotating". I haven't tested my theory yet, but I propose the following procedure:
  1. You create a "blockMeshDict" that has the two environments in a single box.
  2. Still on that "blockMeshDict", create "overlapGgi interface1" and "overlapGgi interface2" that define the wall that separates the two outer/environment boxes.
  3. After running blockMesh, you can now simply have the two cars in STL format and run snappyHexMesh! snappyHexMesh should be able to generate the surrounding mesh and preserve the wall between them!
Any other missing feature can later be generated by either using topoSet or setSet.

If creating the separation wall leads to snappyHexMesh only generating the mesh on one side, then remove that separation wall from "blockMeshDict". You can recreate that wall after the mesh has been created with snappyHexMesh, simply by using topoSet or setSet and/or createPatch.
It might also be possible to simply skip the dedicated separation wall if you create the cellZones manually... which again, you can create with at least setSet.

If you don't know how to use setSet, run it and type in the command:
Code:

help
Good luck!
Bruno

Morning Bruno,
thank you so much for your reply!
Yes, for me the situation would be: "snappyHexMesh only generating the mesh on one side".
Another thing I want to confirm is, when you said " create a "blockMeshDict" that has the two environments in a single box." sorry I don't understand this part:
blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
hex (8 9 10 11 12 13 14 15) .....
);
you see, I may creat two hex as the outer envirment boxes. so there will be two hex boxed. But how to "creat them in a single box"?
Thank you so much!

wyldckat January 16, 2012 16:15

Hi Aqua,

Unfortunately I'm not experienced enough on this subject. My guess is that you should generate the mesh in two steps:
  1. Generate the mesh as if you weren't going to use GGI.
  2. Then after the mesh is completely made, use one (or more) of the mesh manipulation utilities, such as createPatch, topoSet or setSet.
I also suggest that you post your question in the forum at http://www.extend-project.de/ - simply because there you should find more people dedicated to using OpenFOAM 1.6-ext and GGI!

Good luck!
Bruno


All times are GMT -4. The time now is 17:27.