CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > ANSA

From STL to OpenFOAM mesh

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

Like Tree2Likes
  • 1 Post By Gerry Kan
  • 1 Post By rmaries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2019, 08:24
Default From STL to OpenFOAM mesh
  #1
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10
Gerry Kan is on a distinguished road
Howdy folks:

I have a watertight STL geometry and would like to use ANSA to produce an OpenFOAM mesh. The documentation covers this process using other (already vectorized) CAD format, but did not mention STL. I am wondering if anyone has experience in this and be willing to provide hints as of how I should proceed.

Thank you very much in advance, Gerry.
Gerry Kan is offline   Reply With Quote

Old   October 23, 2019, 04:45
Default
  #2
Member
 
Andrew
Join Date: Mar 2018
Posts: 82
Rep Power: 8
Astan is on a distinguished road
Hi Gerry Kan, i have the same your problem.

Have you succeded in meshing an .stl in ansa for openfoam?

If yes, could you kindly explain how have you solved?

Astan
Astan is offline   Reply With Quote

Old   October 23, 2019, 12:16
Default
  #3
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10
Gerry Kan is on a distinguished road
Dear Andrew:

Kind of.

I tried to follow the ANSA tutorial for external aerodynamics (hybrid volume mesh) but this seems to work only with vectorized CAD models. Also it seemed to be written for bureaucrats, which made it very easy to get lost in the details.

In the end I did the following (I don't know ANSA very well so you might need to fill in the details yourself). I am assuming you are doing a wind tunnel type simulation, where you only have the model for the object but not the wind tunnel itself.

1. Load STL for the object into ANSA and perform wrapping (Mesh > Octree > Wrapping) to improve triangle quality. Export model as STL again.

2. Create wind tunnel. Resample surface where the original object intersects the tunnel (e.g., wheels of a vehicle). Export as STL.

3. Boolean subtract the object STL from the wind tunnel STL with a third-party tool. Identify all boundaries. I kept having problems with doing the Boolean operation in ANSA with STLs. Maybe it tried to Boolean every single triangle, which might take a very long time.

4. Reimport combined STL with PIDs already identified into ANSA. Do surface mesh check.

5. Create all necessary size boxes and mesh.

Sorry for the very brief description. I am still learning the ropes myself and there are certain things I don't quite get either.

Gerry.
Gerry Kan is offline   Reply With Quote

Old   October 24, 2019, 02:02
Default
  #4
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Hi Gerry,

Wrapping is not used to improve mesh quality. It is used to make the geometry cleanup faster. You can do the whole openfoam setup in ansa. There is a tutorial for this in ansa. I forgot the name of the tutorial. If you don't want to do whole openfoam setup in ansa and if your stl geometry is airtight, you can use the stl mesh directly in openfoam and create the volume mesh there.

It is upto you to choose which way suits for you.

Best Regards
Maries
rmaries is offline   Reply With Quote

Old   October 24, 2019, 04:08
Default
  #5
Member
 
Andrew
Join Date: Mar 2018
Posts: 82
Rep Power: 8
Astan is on a distinguished road
Hi Gerry Kan and rmaries, thanks you very much for your replies.

I tried to follow the instruction without success due to my very very limited experience in ANSA, i'm not able to find the "buttons" needed to perform those operations, the problem i'm trying to face with is also of external aerodynamics.

I have created the external domain but i'm not able to separate the domain from the geometry.

Could you kindly be a little bit more precise (a sort of step by step) or could you suggest me a guide for new user written in simple words?.


Astan
Astan is offline   Reply With Quote

Old   October 24, 2019, 04:29
Default
  #6
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Hi Astan,

There is a tutorial available in ansa. It is tutorial/cfd folder. file name is external_aero.pdf. There is very good explanation in that tutorial for your need.
rmaries is offline   Reply With Quote

Old   October 24, 2019, 05:21
Default
  #7
Member
 
Andrew
Join Date: Mar 2018
Posts: 82
Rep Power: 8
Astan is on a distinguished road
Hi rmaries, yes i have seen it, but unfortunately the stl geometry case is not explained.

Astan
Astan is offline   Reply With Quote

Old   October 24, 2019, 07:46
Default
  #8
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10
Gerry Kan is on a distinguished road
Quote:
Originally Posted by rmaries View Post
Wrapping is not used to improve mesh quality. It is used to make the geometry cleanup faster. You can do the whole openfoam setup in ansa. There is a tutorial for this in ansa. I forgot the name of the tutorial. If you don't want to do whole openfoam setup in ansa and if your stl geometry is airtight, you can use the stl mesh directly in openfoam and create the volume mesh there.
Hallo rmaries,

I know what geometry wrapping is used for. The incoming STL file was in very poor quality. Even though I had to do a lot of manual work outside of ANSA to at least get it in a reasonable form (i.e., no gaps and as many slivers removed as possible), I wanted a quick way to resample the STL surface. ANSA's wrapping did a pretty nice job.

Incidentally, I went through the 3000-odd page ANSA user guide. It was comprehensive, but hunting the right button still took some time. I have to admit I am a bit better at it than a few weeks ago.

If you remember the name of the ANSA / OpenFOAM tutorial that would be great. You probably saw my post on cyclic boundary condition. I still can't figure out how this could be done.

Having said that, the mesh that came out of ANSA was absolutely beautiful. Quality-wise, this is something I still have to struggle with snappyhexmesh or even in Star-CCM+.

For the moment I am falling back to snappyhexmesh as I am already investing too much time on learning ANSA (as opposed to getting my simulations started). At least I got far enough with ANSA to go further at this moment.

Sincerely, Gerry.

Last edited by Gerry Kan; October 24, 2019 at 11:33.
Gerry Kan is offline   Reply With Quote

Old   October 24, 2019, 07:53
Default
  #9
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10
Gerry Kan is on a distinguished road
Quote:
Originally Posted by Astan View Post
Hi rmaries, yes i have seen it, but unfortunately the stl geometry case is not explained.
Astan
Dear Andrew:

For STL, it is already a surface mesh. So all that part in the tutorial about generating the surface mesh is not necessary. What you need to do is to improve the triangulation quality (in my case through surface wrapping), just define the size boxes, and then generate the layers and mesh. This chops down about 30-odd pages from that external aerodynamics tutorial.

I agree, it takes a lot of patience to learn ANSA. This is my third attempt in over 10 years and I got a bit further than the previous two (i.e., looked at the ANSU GUI for 5 minutes and moved on). The dominance of their industrial customer base permeates through their design and documentation (I am being polite).

Gerry.
rmaries likes this.

Last edited by Gerry Kan; October 24, 2019 at 11:31.
Gerry Kan is offline   Reply With Quote

Old   October 24, 2019, 08:53
Default
  #10
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
If one plans to use snappyhex, ccm .. for volume mesh, there is no need for good quality surface mesh. They can run with elements with worst quality. Important things one need to take care is the gaps and holes. It should be filled properly. Also the proximity of two surfaced may affect the volume mesh, if the surface is too close.

Quality of surface mesh is important when you use tgrid as your volume mesher.

Maries
Gerry Kan likes this.
rmaries is offline   Reply With Quote

Old   October 24, 2019, 11:25
Default
  #11
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10
Gerry Kan is on a distinguished road
Quote:
Originally Posted by rmaries View Post
If one plans to use snappyhex, ccm .. for volume mesh, there is no need for good quality surface mesh.
Quality of surface mesh is important when you use tgrid as your volume mesher.
Hi rmaries:

This is extremely good to know (I have always assumed I needed nice quality STL for anything). The quality I needed was for the Boolean operation ... that's another story, however.

On second thought, if you are planning on creating good a tetra- or polyhedral mesh, you will definitely need to have a nicely resampled triangulated surface with a good resolution and low distortion.

Gerry.

Last edited by Gerry Kan; October 26, 2019 at 18:19.
Gerry Kan 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
[snappyHexMesh] SnappyHexMesh/splitMeshRegion : region1 in zone "-1" GuiMagyar OpenFOAM Meshing & Mesh Conversion 3 August 4, 2023 13:38
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 05:24
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 08:52.