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

[Commercial meshers] Import Surface from HyperMesh to snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2008, 06:10
Default Import Surface from HyperMesh to snappyHexMesh
  #1
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
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: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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: 530
Rep Power: 20
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: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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: 530
Rep Power: 20
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: 530
Rep Power: 20
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


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 surface refinement bugs wc34071209 OpenFOAM Meshing & Mesh Conversion 9 October 7, 2018 07:53
CFD-Post User Surface STL Import Shifted? denbjornen FLUENT 0 November 16, 2017 18:49
[snappyHexMesh] SnappyHexMesh castellation stage creates hole in surface where mesh flows into domain Dav3dum OpenFOAM Meshing & Mesh Conversion 0 August 30, 2017 05:19
[snappyHexMesh] problem with snappyHexMesh kanes OpenFOAM Meshing & Mesh Conversion 10 January 26, 2016 07:11
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 08:05


All times are GMT -4. The time now is 01:38.