CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Questions to create polymesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2012, 12:27
Cool Questions to create polymesh
  #1
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14
danny123 is on a distinguished road
Hello,

I have a problem building a mesh. My intended solver is MRFSimpleFoam. I used the example "MixerVessel2D" in the tutorial as starting point. The disadvantage of the example is that the mesh resolution diminishes with the radius. So, I build a mesh, which does not have that disadvantage. Since the stirrer geometry is also quite more complex, I decided to build a blockMeshDic file entirely on my own. There is no grading, but everything is 1 1 1 simplegrading.

The resulting blockMeshDic file is at minimum 150 MB big up to 1 GB. This did not please the blockMesh utility, but lead to a system crash. I filed a bug report to OpenFoam and was advised to write out the polymesh directly, since 90 % of that work is already done.

I looked into this option, but there is no manual how to write the polymesh. Instruction by OpenFoam are very basic. So, I looked at a compiled case (compiled by blockMesh) and tried to identify how blockMesh builds a polymesh. There I have some questions:

1. Is there a manual available to build the polymesh in the 1st place?
2. The file "points" seems basically to be the same as the vertice definition in m with 10 valid digits. But the order between that chosen in the source file blockMeshDic and that generated by blockMesh differs. Why? Does it matter if I keep my original order? Is there any logic why the order is changed?
3. Once the file "points" is built, the file "faces" is pretty much straight forward as is the file "owner". "owner" seems to patch the faces together that then is a cell. However I do not get what the numbers in "neighbours" mean. To what do they refer? Every face has obviously plenty of neighbors (above, below, right, left, before and below at least). What is the point of this file?
4. There is a file called cellZones, which has an entry of 0 to some big number. I have put the blocks into order (rotor first, than stator blocks). Are these block numbers from blockMeshDic?

If anybody could help, I would apreciate.
danny123 is offline   Reply With Quote

Old   February 10, 2012, 04:16
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Daniel,

I saw your post and bug reports several days ago, but I was unable to look into this sooner, nor have I been able to confirm things yet... but I think that Discretizer's code might help you:
It's programmed in Ruby and the main program helps design the geometry and take into account the resulting mesh at the same time. It pretty much only generates meshes for OpenFOAM. If you look into the code, you might be able to figure out how to solve your problem.

The author of Discretizer, Björn Bergqvist, might also be able to help you: http://www.discretizer.org/node/6

Good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 10, 2012, 05:47
Default thanks for reply
  #3
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14
danny123 is on a distinguished road
Hello Bruno,

Thanks for your input. I had looked into discretizer. It would mean that I have to build my mesh from ground up again whereas I have created the blockMeshDic file already. All I need is that final step to get the polymesh. But you suggested to look into the source code trying to understand what the program does. So far, just looking at the result text files, I was always able to understand what is required. This is how I had built the blockMeshDic file after all using an Excel sheet and some visual basic code to handle the enormous amount of generated data. The polymesh files are not so straight forward as said in the documentation of OpenFoam. I think it is because of the cellzones "rotor" which is necessary to define for MRF problems. The m4 utility, which is in the tutorial, is pretty much useless since it builds a blockMeshDic file and than calls blockMesh as one would do anyway.

I will now try to use the mergeMesh utility after having created several submeshes that blockMesh is still able to handle. I let you know if this works. My fear is that I might run into the same troubles again, since I do not know if mergeMesh is more powerful than blockMesh, since it will have to handle the same amount of data again the advantage being that it uses polymesh data and not the blockMeshDic file to generate the unified mesh.

I will post again if I succeed.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   February 17, 2012, 06:01
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Daniel,

A colleague of mine told me today:
Code:
Why not simply generate the file in Star-CD ".vrt"? Because that format is a lot simpler and there is already an importer on OpenFOAM!
Best regards and good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 17, 2012, 11:43
Default
  #5
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14
danny123 is on a distinguished road
Hi Bruno,

Thanks, this is an idea, but I do not have Star-CD. However, I did a first trial using mergeMeshes and it worked increditably fast (compared to blockMesh). I found a small mistake on my mesh and also have to remove the interface between the two meshes. This will take at least until next week. I will post if it works.

Have a nice weekend,

Daniel
danny123 is offline   Reply With Quote

Old   February 18, 2012, 07:08
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Daniel,

Sorry, I was in a hurry and hoped you would have gotten the idea. I'll try to make it more clear:
  1. With a small test case, you can convert an existing OpenFOAM mesh by running foamToStarMesh. It will generate a few files, two of which have the extensions ".vrt" and the ".cell".
  2. See how the mesh is defined on those files, which should prove to be more intuitive than OpenFOAM's mesh.
  3. Then when you've got something to work with in this format, you can convert back to OpenFOAM by running star4ToFoam! For more:
    Code:
    star4ToFoam -help
  4. You might even want to then pick up on the code of star4ToFoam to do your own converter!
Nonetheless, it's good to know that mergeMesh can do a very good job on this issue!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 20, 2012, 04:06
Default star4toFoam
  #7
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14
danny123 is on a distinguished road
Hi Bruno,

Your idea seems worth a trial especially if I want to generate even larger meshes (the case I am working on is the smallest that I can imagine, still it is about 1 GB).

Currently, since I am very close to the solution I want, I have to put your idea beside, since I really need results fast. The next step is an extension of my current design. So, the mergeMeshes tool should work too.

As promissed, I will post if I succeed. If I use your approach, I will post too. But this will take a couple months.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   February 28, 2012, 07:06
Default
  #8
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14
danny123 is on a distinguished road
Hi Bruno,

Finally I got my mesh! I tried the mergeMeshes utility, but since the original mesh was cut into 2 pieces, each of the pieces had an undefined patch on one side. BlockMesh set this interface to defaultFaces. Unfortunatly this new patch is not set at the beginning of the patch list, but at the end. So, deleting this patch in the boundary file leads to undefined faces since they are just ignored. Obviously one can copy these faces over, but my faces file is very big, meaning this will be difficult. I propably would have to define a new patch and putting it before "rotor" and "stator" in the blockMeshDict file. Still, I do not like this, since the boundary faces between the two merged meshes will be apperaing at the end of the internal faces list although they are situated in the center. I do not know if this is a problem, but I want a performend mesh to speed up CFD calculation.

I had a small error where the mesh was undefined, set by blockMesh to defaultFaces. I corrected this error. I decided then to rerun blockMesh on the entire mesh once again hoping that will work this time. I shut off all cores except one to stabilize blockMesh. It ran 3 days, but ultimatly I got the mesh created.

Thanks for the support. I know now what to do next time I get the same problem.

Regards,

Daniel

PS: Now MRFSimpleFoam runs, but makes mistakes. I will post this separatly since this problem seems unrelated to the mesh generation.
danny123 is offline   Reply With Quote

Old   February 28, 2012, 08:52
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Daniel,

Quote:
Originally Posted by danny123 View Post
I had a small error where the mesh was undefined, set by blockMesh to defaultFaces. I corrected this error. I decided then to rerun blockMesh on the entire mesh once again hoping that will work this time. I shut off all cores except one to stabilize blockMesh. It ran 3 days, but ultimatly I got the mesh created.

Thanks for the support. I know now what to do next time I get the same problem.
You're welcome and I'm glad you got it working!
3 whole days... I assume with the case with 150MB worth of "blockMeshDict"? The people at SGI/OpenCFD might like to know that

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 27, 2017, 01:51
Default
  #10
New Member
 
LAKSHMIPRIYA
Join Date: Jun 2017
Posts: 7
Rep Power: 8
poyilil is on a distinguished road
I have polymesh files generated for a simulation using pointwise. It's a pretty fine mesh. How can I write the blockmeshdict file for the same?
Is it possible in anyway to convert internally the data from polymesh into blockmeshdict?
poyilil is offline   Reply With Quote

Old   June 27, 2017, 04:08
Default
  #11
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14
danny123 is on a distinguished road
Hi poyilil,

You do not need a blockMeshDic file if you already have a polyMesh. The blockMeshDic file is the source file to generate a polyMesh out of basic geometric data. This file has to be compiled to polymesh files. After this is done, you can delete it without harming the CFD calculation (even though I would not recommend to do so).

The polyMesh files have names like "owner", "neigbour", "points", "faces" and "boundary". Only the "boundary" file needs to be looked at and configured, I would guess, if you use a third party product. There are a number of different boundary types if you look into the documentation, the most basic one is "wall".

Good luck,

Daniel
danny123 is offline   Reply With Quote

Old   June 28, 2017, 05:10
Default
  #12
New Member
 
LAKSHMIPRIYA
Join Date: Jun 2017
Posts: 7
Rep Power: 8
poyilil is on a distinguished road
Thank you so much Daniel
poyilil is offline   Reply With Quote

Reply

Tags
blockmesh polymesh manual

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFoam "Permission denied" and "command not found" problems. iyidaniel@yahoo.co.uk OpenFOAM Running, Solving & CFD 11 January 2, 2018 07:47
first steps and many questions rollmops94 OpenFOAM Pre-Processing 1 October 4, 2017 15:34
[gmsh] How to create a 3D volume mesh using a existing surface mesh?! RobertHB Mesh Generation & Pre-Processing 0 July 20, 2017 09:12
[ICEM] How can I create prism mesh for a 3D domain surrounded by a torus? lzgwhy ANSYS Meshing & Geometry 5 May 18, 2017 18:10
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 02:07


All times are GMT -4. The time now is 18:32.