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

[snappyHexMesh] How to draw a 3D-Drawing for Meshing

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

Like Tree2Likes
  • 1 Post By AtoHM
  • 1 Post By otaolafr

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 29, 2021, 00:58
Default How to draw a 3D-Drawing for Meshing
  #1
Member
 
Join Date: Feb 2018
Posts: 58
Rep Power: 8
Kahnbein.Kai is on a distinguished road
Hello,

i have a problem with a 3D-Geometry with an interior, SHM generates Patches on surfaces who allready have a patch...

First Question: How you draw your OpenFoam Geometrys with or without a wallthickness ?

Due to the fact that i need the interior i cant do it without a wallthickness*. I draw it on onshape, everything is fine until it comes to the meshingpart. I downloaded it as an obj Format and execute the following commands before meshing. "surfaceAutoPatch bla.obj bla.obj 90" and "surfacePointMerge bla.obj bla.obj 0"

At a first look i get nice GroupIDs (Picture GroupIDs) to generate my custome patch names and do surface refinements and thinks like that, but at the second its a little bit messed up. You can see it on GroupIDs_2. Why is this like this ? The green Patch vertical for example ? I proceed, and on GroupIDs_3 you can see the IDs, for the Manhole, the pipe from the right and the pipe from the bottom. For testing i define this GroupIDs in the region section:
Code:
    {
           patch1 {name Manhole;}
           patch15 {name Pipe_right;}
           patch24 {name Pipe_bottom;}  
        }
Now openFoam displays "Unknown region name patch15 for surface CAD", the other two are working.... but patch15, is clearly available.
This is my second question. Why i cant assign patch15 ?


When i delete patch15 and pipe_right SHM will mesh the geometry.
But then its get worse and worse.

If i show it in vtkBlockColors, even the pipes get two patches, on the top side.



In OnShape its possbile to delete all outside surfaces, i did this. I execute the two commands above and try to mesh it. But then OpenFoam shows this message:


"Shell CAD does not support testing for inside Probably it is not closed."


So this is also a dead end.


Do i need to draw a new geometry, or is it savable ?



Best reagrds Kai
Attached Images
File Type: png GoupIDs_2.png (93.0 KB, 17 views)
File Type: jpg GroupIDs_3.jpg (89.0 KB, 14 views)
File Type: png GroupIDS.png (40.5 KB, 11 views)
File Type: png vtkBlockColors.png (83.5 KB, 12 views)
File Type: png OnShape.png (137.9 KB, 13 views)
Kahnbein.Kai is offline   Reply With Quote

Old   May 30, 2021, 13:09
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 659
Rep Power: 12
AtoHM is on a distinguished road
Its a bit hard to follow what you are actually doing, at least for me.

Regarding question one: why would you build it with a wall thickness, if you are only interested in what happens inside? Instead of building the actual pipes (like, the solid part of it), build the volume it encloses. That's all you need (I assume.)
I think what you are experiencing is, that you gave some kind of small wall thickness. When it comes to meshing, some of these small gaps might be meshed, some might collapse while snappy is running and then it probably creates that mess of regions you see there.

Doesn't look like you have to rebuild the geometry, if build in a good way, you should be able to make some boolean operations on the bodies you have and extract the relevant volume in no time. Just carefully rethink what parts of the volume you really need.
Kahnbein.Kai likes this.
AtoHM is offline   Reply With Quote

Old   June 3, 2021, 02:20
Default
  #3
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by Kahnbein.Kai View Post
Hello,

i have a problem with a 3D-Geometry with an interior, SHM generates Patches on surfaces who allready have a patch...

First Question: How you draw your OpenFoam Geometrys with or without a wallthickness ?

Due to the fact that i need the interior i cant do it without a wallthickness*. I draw it on onshape, everything is fine until it comes to the meshingpart. I downloaded it as an obj Format and execute the following commands before meshing. "surfaceAutoPatch bla.obj bla.obj 90" and "surfacePointMerge bla.obj bla.obj 0"

At a first look i get nice GroupIDs (Picture GroupIDs) to generate my custome patch names and do surface refinements and thinks like that, but at the second its a little bit messed up. You can see it on GroupIDs_2. Why is this like this ? The green Patch vertical for example ? I proceed, and on GroupIDs_3 you can see the IDs, for the Manhole, the pipe from the right and the pipe from the bottom. For testing i define this GroupIDs in the region section:
Code:
    {
           patch1 {name Manhole;}
           patch15 {name Pipe_right;}
           patch24 {name Pipe_bottom;}  
        }
Now openFoam displays "Unknown region name patch15 for surface CAD", the other two are working.... but patch15, is clearly available.
This is my second question. Why i cant assign patch15 ?


When i delete patch15 and pipe_right SHM will mesh the geometry.
But then its get worse and worse.

If i show it in vtkBlockColors, even the pipes get two patches, on the top side.



In OnShape its possbile to delete all outside surfaces, i did this. I execute the two commands above and try to mesh it. But then OpenFoam shows this message:


"Shell CAD does not support testing for inside Probably it is not closed."


So this is also a dead end.


Do i need to draw a new geometry, or is it savable ?



Best reagrds Kai
hello kai,
well here you have another onshape user (i recognize the last screen shot)
as they mentioned before if you need to simulate for example the liquid inside a pipe you dont need the geometry of the pipe, you need to create the thing INSIDE the pipe, so a commun cylinder.
the workflow that you should take is the following:
1. create your geometry in onshape
2. export it in STEP
3. import it in salome-platform , geometry module (salome-platform.org)
4. generate faces groups for each different patch you want
5. go to the mesh module (inside salome) and mesh it in a 2D mesh geometry, and export each group you created SEPARATLY in different .stls
6. you combine them in one cat *.stl >> model.stl
7. you use a stl region setup in snappy hex mesh (snappyHexMesh does not remove internal cells)

some documentation about this to lear further than my simplified scheme that I just explained:
tobias holzmann video tutorial: https://www.youtube.com/watch?v=CeuFdBqPebc
ppt explenation of Wolfdynamics: http://www.wolfdynamics.com/wiki/meshing_OF_SHM.pdf
all credits to them for their great work.


edit: PS you can also export each surface directly from onshape in different stls (you create an offset surface (it is a feature of onshape) of each patch you want and then export the surface as stl in onshape) but i do not recommend to do this as it will have highly long triangles that can bring problems in the snappying phase (see Creating waterproof STL using snappyHexMesh or salome).
best regards.
Kahnbein.Kai likes this.
otaolafr is offline   Reply With Quote

Old   June 3, 2021, 04:55
Default
  #4
Member
 
Join Date: Feb 2018
Posts: 58
Rep Power: 8
Kahnbein.Kai is on a distinguished road
Hello,
thank you for your replies and your detailed Salome Manuel .


I draw a new geometry only with "solid" interior.

Of course i can do it like this, i was wrong .


At the next time, i will try it with salome, its also an interesting way.
Here are two screenshots.


Best regards
Kai
Attached Images
File Type: png Bildschirmfoto vom 2021-06-03 10-48-06.png (39.4 KB, 6 views)
File Type: jpg Bildschirmfoto vom 2021-06-03 10-51-32.jpg (35.1 KB, 7 views)
Kahnbein.Kai is offline   Reply With Quote

Old   June 15, 2021, 12:16
Default
  #5
Member
 
Join Date: Feb 2018
Posts: 58
Rep Power: 8
Kahnbein.Kai is on a distinguished road
Hello,
i encountered a problem, with my patches .

Im tried to assign three inletpatches and one outletpatch.
First of all, the outlet patch is generated flawlessly, with the groupid0 maybe the number 0 is related to it and made it work.

In Pic_1 you can see the geometryfile loaded in Paraview, the groupids of the inlets are shown in the tabel an the left side.

This is the Code i used for that:
Code:
patch83 {name inlet;}
patch84 {name inlet1;}
patch82 {name inlet2;}
 patch0 {name outlet;}
In the Meshing progress i get these message:
Code:
Adding patches for surface regions
 ----------------------------------

Patch Type                Region                        
----- ----                ------                        
CAD:

1     patch               outlet                        
2     wall                CAD_patch1                    
3     wall                CAD_patch2                    
4     wall                CAD_patch3                    
5     wall                CAD_patch4                    
6     wall                CAD_patch5                    
7     wall                CAD_patch6                    
8     wall                CAD_patch7                    
9     wall                CAD_patch8                    
10    wall                CAD_patch9                    
11    wall                CAD_patch10                   
12    wall                CAD_patch11                   
13    wall                CAD_patch12                   
14    wall                CAD_patch13                   
15    wall                CAD_patch14                   
16    wall                CAD_patch15                   
17    wall                CAD_patch16                   
18    wall                CAD_patch17                   
19    wall                CAD_patch18                   
20    wall                CAD_patch19                   
21    wall                CAD_patch20                   
22    wall                CAD_patch21                   
23    wall                CAD_patch22                   
24    wall                CAD_patch24                   
25    wall                CAD_patch25                   
26    wall                CAD_patch26                   
27    wall                CAD_patch27                   
28    wall                CAD_patch28                   
29    wall                CAD_patch30                   
30    wall                CAD_patch31                   
31    wall                CAD_patch32                   
32    wall                CAD_patch34                   
33    wall                CAD_patch35                   
34    wall                CAD_patch37                   
35    wall                CAD_patch38                   
36    wall                CAD_patch39                   
37    wall                CAD_patch40                   
38    wall                CAD_patch41                   
39    wall                CAD_patch42                   
40    wall                CAD_patch43                   
41    wall                CAD_patch44                   
42    wall                CAD_patch45                   
43    wall                CAD_patch46                   
44    wall                CAD_patch47                   
45    wall                CAD_patch48                   
46    wall                CAD_patch49                   
47    wall                CAD_patch50                   
48    wall                CAD_patch51                   
49    wall                CAD_patch52                   
50    wall                CAD_patch53                   
51    wall                CAD_patch54                   
52    wall                CAD_patch55                   
53    wall                CAD_patch57                   
54    wall                CAD_patch58                   
55    wall                CAD_patch60                   
56    wall                CAD_patch61                   
57    wall                CAD_patch62                   
58    wall                CAD_patch63                   
59    wall                CAD_patch64                   
60    wall                CAD_patch65                   
61    wall                CAD_patch66                   
62    wall                CAD_patch67                   
63    wall                CAD_patch68                   
64    wall                CAD_patch69                   
65    wall                CAD_patch70                   
66    wall                CAD_patch71                   
67    wall                CAD_patch72                   
68    wall                CAD_patch73                   
69    wall                CAD_patch74                   
70    wall                CAD_patch75                   
71    wall                CAD_patch76                   
72    wall                CAD_patch77                   
73    wall                CAD_patch78                   
74    wall                CAD_patch79                   
75    wall                CAD_patch80                   
76    wall                CAD_patch81                   
77    patch               inlet2                        
78    patch               inlet                         
79    patch               inlet1                        
80    wall                CAD_patch85                   
81    wall                CAD_patch86                   
82    wall                CAD_patch87                   
83    wall                CAD_patch88                   
84    wall                CAD_patch89                   
85    wall                CAD_patch90                   

  Added patches in = 0.04 s
Everything seems ok, but when the mesh is ready, you are able to see that the patches are on the wrong faces. On Pic_2 you can see the assigned faces (yellow), but these are only walls not inlets.


So my questions are:


Why is SHM messing up my groupid system delivered from the obj file ?



Can i stop SHM doing that and assign the right faces with custom names ?





For now, i change the names afterwards the meshing process in the boundary file and nSurfaceLayerDict.


Best regards
Kai
Attached Images
File Type: jpg Pic_1.jpg (102.8 KB, 6 views)
File Type: jpg Pic_2.jpg (81.2 KB, 6 views)
Kahnbein.Kai is offline   Reply With Quote

Reply

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
[General] Drawing a cylindrical object for viewing in Paraview jeosol ParaView 1 May 23, 2017 03:08
Hi everyone, My draw is duct with wall thickness . when i draw wall thickness in geo reslan FLUENT 0 March 6, 2016 08:09
heat exchanger drawing in Ansys Geometry flyEmirates ANSYS Meshing & Geometry 1 June 7, 2011 08:01
What a Strange Drawing in GAMBIT... teguhtf ANSYS Meshing & Geometry 3 October 5, 2009 11:17
drawing of contour plots chinthakindi Main CFD Forum 1 April 27, 2004 04:33


All times are GMT -4. The time now is 13:09.