CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

Import Surface from HyperMesh to snappyHexMesh

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 27, 2008, 06:10
Default Hi all, so far I have been
  #1
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 462
Rep Power: 10
bastil is on a distinguished road
Hi all,

so far I have been struggling to import an triangular surface mesh from Hypermesh to snappyHexMesh. It works with limitations doing the following in Hypermesh9.0:
Export -> Nastran -> Standard (not long!). This can be read into snappyHexMesh, however components are not kept (neither names nor groups, it is a single group). The same happens for the stl export.
Using HM "long" or "CFD" nastran export does not even read in the surface because it is double precision.
I looked at the sources - it seems to be prepared for ANSA and T-Grid but not for Hypermesh.
Anybody having similar problems? Any solutions so far? (Mark you're using Hpermesh, right?)

BastiL
bastil is offline   Reply With Quote

Old   September 29, 2008, 05:46
Default I haven't had time to work wit
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 17
olesen will become famous soon enough
I haven't had time to work with the auto-hex-mesh yet and thus don't know how well it all works. For writing out ASCII files from hypermesh for OpenFOAM surfaces, you might find the Alias wavefront format to be quite convenient. I've attached an HyperMesh template for exporting it. You'll need to add it a button in your userpage.mac that looks something like this:

*beginmacro("WaveFront_export")
*evaltclscript("/export/home/olesenm/Star-CD/hypermesh/exportStarCD.tcl",0)
*evaltclstring("::hmstarcd::export::WaveFront_expo rt", 0);
*endmacro()

and the corresponding tcl snippet looks like this:
#
# Alias/WaveFront export:
#
proc ::hmstarcd::export::WaveFront_export {} {
variable exportDir;
variable templateDir;

set objFile [file join $exportDir "hmexport.obj"]
set objTmplt [file join $templateDir "wavefrontExport.tpl" ]

# make nodes 1-based
*createmark nodes 1 all
*renumber nodes 1 1 1 0 0
catch { *feoutput "$objTmplt" "$objFile" 1 1 0 }
}

It is probably possible to move lots of the tcl directly into the button, but like this you can update the tcl at will, without needing to exit from hypermesh.

wavefrontExport.tpl
olesen is offline   Reply With Quote

Old   September 29, 2008, 06:05
Default PS: use the hypermesh Tool/
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 17
olesen will become famous soon enough
PS:

use the hypermesh Tool/edges and Tool/normals to check that your surfaces are closed and correctly oriented before exporting.
olesen is offline   Reply With Quote

Old   September 30, 2008, 18:05
Default Thanks Mark, I will try thi
  #4
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 462
Rep Power: 10
bastil is on a distinguished road
Thanks Mark,

I will try this out.
However for our workflow it would be best if we could read your Nastran-Files ("CFD"-Typ HM Nastran) into OpenFOAM. I have understand where the problems are:
- Hypermesh uses double precision (GRID*)
- It has a continuation Symbol (*) at the end of the first line. TGrid doesnt - that is a problem
- It has another continuation symbol than ANSA (+)
- Name Mapping from ANSA has to be modified.

Maybe I will put some work into this.

Regards.
bastil is offline   Reply With Quote

Old   October 1, 2008, 04:26
Default As luck would have it, I poste
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 17
olesen will become famous soon enough
As luck would have it, I posted a buggy version. Wavefront actually uses 1-based addressing: wavefrontExport.tpl

Re: the Nastran format. I wouldn't think it should be too difficult to change the code to skip a trailing continuation symbol with "GRID*" and handle the "$HMNAME" hypermesh extension .. just nobody else has needed it before. If you get it done, please post it as a "bug fix" so that it can get integrated into OpenFOAM-1.5.x git repository.
olesen is offline   Reply With Quote

Old   October 1, 2008, 09:46
Default If you take a look at the git
  #6
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 17
olesen will become famous soon enough
If you take a look at the git repo, it looks like OpenCFD has already updated this. If this works for you, it would probably be much easier than my obj export approach.
olesen is offline   Reply With Quote

Old   October 2, 2008, 08:30
Default Thanks once more to you guys a
  #7
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 462
Rep Power: 10
bastil is on a distinguished road
Thanks once more to you guys also for fast implementation. this looks good, I will try it next week.

Regards
bastil is offline   Reply With Quote

Old   October 7, 2008, 08:32
Default I have tied the new version. I
  #8
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 462
Rep Power: 10
bastil is on a distinguished road
I have tied the new version. It works fine, everything looks the way I want it to have. Thanks.
bastil is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chemkin mechanism import of surface chemistry Claud FLUENT 2 August 5, 2013 09:03
Surface boundary mesh in snappyHexMesh bastil OpenFOAM Mesh Utilities 7 February 3, 2012 08:37
SnappyHexMesh plane surface bounding box podallaire OpenFOAM Bugs 22 August 26, 2009 08:34
Tool for Surface Preparation for SnappyHexMesh bastil OpenFOAM Mesh Utilities 18 November 17, 2008 17:49
Internal surface import from gambit mighelone OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 February 6, 2008 19:07


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