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

[mesh manipulation] Hex mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2012, 07:51
Default
  #21
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi

Your setup is really not good. Looking at the boundaries in paraview from the file you have provided give me the following view.


If I use autoPatch 5 on the other hand I get the last picture.
Then you can always rename the patch names in the boundary file in the new time folder.

So its no wonder why checkMesh and setFields complains.

To avoid autoPatch you need to export the BC names from Salome using "create groups from geometry" option in the mesh module.

You need to define your groups in the GEO module. Right click the geo and select "Create group" use faces, select each face for the individual BC's and then in Mesh module use create groups from geometry and use the groups in the geo module in the tree structure.
Attached Images
File Type: png BCWrong.png (23.4 KB, 35 views)
File Type: png autoPatch.png (12.6 KB, 31 views)
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 18, 2012, 00:47
Default
  #22
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
Hello,

Given your last post, I must divide the parabolic curve into 2 parts (2 half parabolas) with a box in the middle to allow me to create a group on the geometry for the inlet see images for clarification (underside shows the inlet and middle box more clearly)..

This makes meshing the entire domain more difficult as I need to create many submeshes to ensure relatively uniform cell sizes when using the nb segments 1d hypothesis for wire dicretisation algorithm.

As you can understand this is very tedious.. so what I would like to know is can I mesh the 2 volumes either side of the box in the middle with salome and use blockmesh to generate the middle box and then use mergeMesh to create the overall mesh?

OR is there a more efficient way of doing this problem in Salome?

Also a question regarding export of salome mesh to unv.. there are certain cell type the export utility in salome does not handle, is this correct? If so what are they?- Mainly concerned with triangular prisms, since quadrangle mapping the geometry shown creates some triangles

I am struggling!! I have been working on this for weeks now and have been unable to find a good solution.. There must be an easier way to do this in salome!!!

Kind Regards

Matt
Attached Images
File Type: jpg Screenshot-7.jpg (11.4 KB, 16 views)
File Type: jpg underside.jpg (19.7 KB, 15 views)
matt.mech.eng is offline   Reply With Quote

Old   July 18, 2012, 02:45
Default
  #23
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi

You can also use the mesh as is and use surfaceToPatch command.

This takes an stl/obj as input and will convert the faces that matches the surface file into a patch.

You might have to play with the -tol option so that it doesnt pick faces that are part of the cyclic patches.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 18, 2012, 03:19
Default
  #24
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi

You can also use the mesh as is and use surfaceToPatch command.

This takes an stl/obj as input and will convert the faces that matches the surface file into a patch.

You might have to play with the -tol option so that it doesnt pick faces that are part of the cyclic patches.

By use the mesh "as is" do you mean the mesh I sent you (.py dump) or my new mesh without any groups of faces added to the mesh?

I have tried surfaceToPatch with no success im not sure if I am using it correctly?- I just exported my mesh to both unv and stl then converted the unv mesh and ran surfaceToPatch with the stl file I created.

I also tried creating groups from geometry in the mesh module- this does not work either I still have issues with face match tolerance for front and back faces!!
matt.mech.eng is offline   Reply With Quote

Old   July 18, 2012, 03:25
Default
  #25
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Yes to the first.

You need to make stl files that only cover the BC's, so for the inlet you would export only the face to an stl that has the inlet faces.

You can export directly to stl from the geo module. So just explode the geometry in your previous post into faces and export the small strip which I assume is the inlet to an stl.

If you just export one stl for the whole geometry it will create a patch with all the boundary faces.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 18, 2012, 03:53
Default
  #26
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
So just to clarify..

I should use the geometry with no groups of faces and then create stl files for each boundary and then use surfaceToPatch to name the boundaries?
I have tried this but every time I run surfaceToPatch i get a new time directory with a new polyMesh dir, can I merge them all into 1?

Or do use the original geometry (ie the a single parabolic curve for the curved profile) i sent you with named groups for all boundaries except for inlet (which does not yet exist) and then use surfaceToPatch for the inlet only?
matt.mech.eng is offline   Reply With Quote

Old   July 18, 2012, 04:04
Default
  #27
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
I would go for the last method.

And you just move the new polyMesh from the new time directory back into constant. Just remember to rename constant/polyMesh to constant/polyMesh.bak that way you have a backup if something gets screwed up.

You can also use paraview to select the faces you want to be in the inlet bc and then triangulate those cells using a filter then go to files save data and you can save to stl.

This way you wont have to use Salome to create the stl and you are sure that the stl lies exactly on the faces you want.

http://www.vgtc.org/PDF/slides/2008/..._selection.pdf
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 18, 2012, 04:15
Default
  #28
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
So I have used Paraview to generate the stl file for the inlet and everything works well except for one problem I use setFields to initialize alpha I get the following error:

--> FOAM FATAL ERROR:
More than six unsigned transforms detected:
6(((2.18444 0 -0.15) (1 0 0 0 1 0 0 0 1) 0) ((2.18702 0 -0.15) (1 0 0 0 1 0 0 0 1) 0) ((2.18952 0 -0.15) (1 0 0 0 1 0 0 0 1) 0) ((2.19195 0 -0.15) (1 0 0 0 1 0 0 0 1) 0) ((2.19431 0 -0.15) (1 0 0 0 1 0 0 0 1) 0) ((2.1966 0 -0.15) (1 0 0 0 1 0 0 0 1) 0))

From function void Foam::globalIndexAndTransform::determineTransforms ()
in file primitives/globalIndexAndTransform/globalIndexAndTransform.C at line 185.

FOAM exiting

Last edited by matt.mech.eng; July 18, 2012 at 04:57.
matt.mech.eng is offline   Reply With Quote

Old   July 18, 2012, 04:55
Default
  #29
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
I just set up the case using the autoPatch approach and renamed the BC's and ran bubbleFoam on it without an inlet and it runs fine for a couple of iterations without any cyclic errors.

I think your patches have just been defined wrong so that front patch does not match back patch because faces from the wall/outlet etc is also in the cyclic patches.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 18, 2012, 05:00
Default
  #30
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
sorry.. I edited the post above. It now works only problem is with paraview as mentioned above after running setFields
matt.mech.eng is offline   Reply With Quote

Old   July 18, 2012, 05:42
Default
  #31
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
I dont get any errors after running setFields.

Here is the final case. I've disabled turbulence as it make it run very unstable.

https://dl.dropbox.com/u/15968063/case.tar.gz

I think something is wrong with your specification of the densities as is seems alpha1 mixes in a strange way, see the pics.

EDIT: Its not the densities its the BC specification in the 0 folder, look to the bubbleColumn tutorial case for the right setup.

EDIT2: I would also consider making the mesh more "straight" and refine around the interface. Having these coarse cells which are angled to the alpha interface is bound to give you stability issues.
Also is the mesh in m or mm, because checkMesh says it has the extend of roughly 2.24m wide and 1.5m high, and the mesh seems quite coarse for such large dimensions.
Attached Images
File Type: png time0.png (8.1 KB, 16 views)
File Type: png time1.8.png (15.3 KB, 18 views)
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.

Last edited by linnemann; July 18, 2012 at 06:23.
linnemann is offline   Reply With Quote

Old   July 19, 2012, 00:32
Default
  #32
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
Hello,

Thank you for supplying the mesh,

I have a customized version of bubbleFoam to account for turbulence when the phases are separated ie where the phase fraction approaches 1. I have run this solver on a column geometry meshed with blockMesh and it is quite stable with turbulence ON. When I come to running on this parabolic geometry it is not so stable and I have tried on tet meshes and the hex mesh you have posted.

In regards to EDIT 2, yes I agree, I have been having trouble with this for the last few weeks and the mesh you got working for me was only an initial first run... However it proved unstable also. Yes the mesh is very coarse- the domain is in m.

Can you suggest a more appropriate solution for meshing this domain?
It apparently more difficult than it seems!

Ps I can send you the modified bubbleFoam solver if you would like to have a look


Kind Regards,

Matt
matt.mech.eng is offline   Reply With Quote

Old   July 19, 2012, 02:40
Default
  #33
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi

After using a laminar approach for the case with modified BC's and ran it for about 40s I can see that the domain is filling with alpha0. Since you have alpha0 set as 0.6 at the inlet you will start filling the domain.

Don't know if this is what you intended?

To get this case being more stable you can try the following things.
  • Refine mesh at interface
  • Make the mesh to be more parallel to the interface, at the interface
  • Change the fvSchemes to upwind for k/epsilon and maybe even for Ua and Ub
  • Change the cyclics to symmetryPlanes, just to see if it influences stability.
  • Make the height of the alpha1 portion bigger to help numerics at the outlet
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 19, 2012, 08:58
Default
  #34
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi, tried changing all but the cyclic option in my list and no change in convergence (maybe a little but still crashes).

After changing the cyclics to symmetryPlanes there is absolutely no issues.
So somehow the cyclics are screwing with the convergence.

We have discussed a similar behaviour here.

http://www.cfd-online.com/Forums/ope...lgorithms.html
Attached Images
File Type: jpg mesh.jpg (86.4 KB, 27 views)
File Type: jpg start.jpg (14.2 KB, 9 views)
File Type: jpg time0.9.jpg (15.2 KB, 12 views)
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 19, 2012, 22:30
Default
  #35
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi

After using a laminar approach for the case with modified BC's and ran it for about 40s I can see that the domain is filling with alpha0. Since you have alpha0 set as 0.6 at the inlet you will start filling the domain.

Don't know if this is what you intended?

To get this case being more stable you can try the following things.
  • Refine mesh at interface
  • Make the mesh to be more parallel to the interface, at the interface
By alpha0 I assume you mean the phase fraction alpha (dispersed/gas phase) to be 0?

The reason for setting to 0.6 at the inlet was to increase the flow rate of air into the domain without having to increase the velocity.. Should I leave this as 0.5 and then alter velocity only to achieve the desire inlet flow rate?

REgarding refinement at the interface would you suggest having "straight/parallel" cells below and above the interface or will it suffice to have this refinement only above the interface?

Quote:
Originally Posted by linnemann View Post
Hi, tried changing all but the cyclic option in my list and no change in convergence (maybe a little but still crashes).

After changing the cyclics to symmetryPlanes there is absolutely no issues.
So somehow the cyclics are screwing with the convergence.

We have discussed a similar behaviour here.

http://www.cfd-online.com/Forums/ope...lgorithms.html

So it appears that the cyclic boundaries were causing the issues..

I looked at your mesh and would like to reproduce it using the autoPatch method. Every time I run autoPatch I am unable to determine which patch has been allocated to which face since paraview crashes every time I run paraFoam..
Could you outline the way you do it?

Just an aside, I also tried running with symmetryPlane patches on a relatively coarse tet mesh without any improvements in stability, (note I had also changed gradschemes to cellLimited leastSquares in fvSchemes- to improve stability on the unstructured grid)

Thanks for your help with everything I very much appreciate it!

Kind Regards

Matt
matt.mech.eng is offline   Reply With Quote

Old   July 20, 2012, 03:15
Default
  #36
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi

Well I do it the way you were trying to do it with paraview, if that don't work your back at guessing or you need to make a stl for every surface and run surfaceToPatch on all of them.

I would highly recommend getting paraview to work though.
just Install paraview manually and skip the whole paraFoam stuff.

Just open paraview and open system/controlDict and if it asks about file type just choose openfoam, as paraview > 3.12 has native support for OF.

Setting alpha to 0.6 is fine, after thinking a little about the physics its clear that the domain has to start filling since alpha0 has no where to go until it hits the outlet so probably adding outlets as shown in the pics (black bars) will be a good idea.

I've also made the case available to you and the study dump for Salome.
I had to create a 2D mesh and extrude it. If I didn't I got the OF errors about the cyclics not matching, but if you are to use symmetryPlanes it does not matter.

https://dl.dropbox.com/u/15968063/Case2.tar.gz
Attached Images
File Type: jpg start.jpg (15.4 KB, 6 views)
Attached Files
File Type: txt parabolicDump.txt (16.3 KB, 2 views)
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 20, 2012, 04:57
Default
  #37
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi


I've also made the case available to you and the study dump for Salome.
I had to create a 2D mesh and extrude it. If I didn't I got the OF errors about the cyclics not matching, but if you are to use symmetryPlanes it does not matter.

How do you create a 2d mesh and then extrude? I have been trying to do this for a while but the method I have used instead (due to lack of knowledge on extruding a mesh) is to use quadrangle mapping and then Hexahedron(i,j,k) algorithm.

Thanks for helping me out with this! It look like I'm going to have to play around with salome and ill most likely use autoPatch to name the boundaries.

One other point; I downloaded the latest Paraview (3.14.1) and tried to open the first case you sent me.. it seemed to have trouble with the fact that there were multiple entries for walls in the boundary file, however using paraFoam to open the case from the case directory had no issues. This wont really matter because after running autoPatch there wont be any duplicated entries in the boundary file, and after I name them I will be able to view them using paraFoam.


Kind Regards,

Matt
matt.mech.eng is offline   Reply With Quote

Old   July 20, 2012, 07:04
Default
  #38
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Go to the mesh module.

Mesh -> create mesh -> assign a set of hypotheses -> 2d: Automatic quadrangulation -> specify number of segments -> apply and close

Mesh -> Compute

Modification -> extrusion -> select triangle at top -> tick select whole mesh, submesh or group (select mesh if not already selected in the tree) -> Extrusion to distance -> Z = 0.01 -> Number of steps = 15 -> Apply and close
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   July 21, 2012, 01:00
Default
  #39
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 14
matt.mech.eng is on a distinguished road
Thank you!

That makes meshing so much easier!!

I have a question regarding naming patches- Using paraFoam to view the mesh allows the mesh to be read even though there are multiple patches with the same name however it only displays the first one in the list in the boundary file. Using the latest version of paraview and opening the controlDict will not display the mesh since there are multiple patches with the same name.

My question is when solving does OpenFOAM recognise multiple wall patches with the same name?

Kind Regards

Matt
matt.mech.eng is offline   Reply With Quote

Old   July 21, 2012, 04:12
Default
  #40
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
It can for serial run.

For parallel runs you need to use wildcards and name each wall patch by itself.

You can see how I have used wildcards in the Case2.tar.gz case.

So look in the boundary file and f.ex the 0/U file you will see how wildcards work.

If you want them all in one singular partch you can use the createPatch utility.

There is a sample dict for that in the OF install folder just do this under the OF install folder

Code:
cd OFinstallFolder
find ./ -name createPatchDict
Should get you the location of it
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Reply

Tags
hex mesh, hexahedral mesh, meshing 3d


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[blockMesh] --> FOAM FATAL ERROR: Trying to specify a boundary face A.A. OpenFOAM Meshing & Mesh Conversion 41 June 26, 2020 08:06
[snappyHexMesh] Snappy Hex Mesh External Domain willindsey OpenFOAM Meshing & Mesh Conversion 2 June 9, 2017 23:03
Mesh motion with Translation & Rotation Doginal CFX 2 January 12, 2014 07:21
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 19:10


All times are GMT -4. The time now is 02:52.