CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Writing mesh in FORTRAN or C

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 28, 2012, 00:30
Default Writing mesh in FORTRAN or C
  #1
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
can anybody please tell me how to generate my own mesh with FORTRAN or C and then import into Fluent?
Ive read UDF manuals but couldnt find anything useful

I wanna know the structure and order of the code that fluent can work with
James Hetfield is offline   Reply With Quote

Old   June 28, 2012, 02:48
Default
  #2
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Are you talking about the script for automating the process or your own grid generation code?
Far is offline   Reply With Quote

Old   June 28, 2012, 04:25
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
The information you need is present in the User's guide manual.

However, if you are in need of a free mesh generator for Fluent i think you can use the ones present in the OpenFOAM suite (blockmesh and snappyhexmesh) and convert the mesh in Fluent format (i'm pretty sure there is also something to do that among the several applications)

As an example, you can find attached a simple, single-block, structured grid generator for Fluent. It is written in MATLAB but i am very FORTRAN oriented so it should be easily translated. Of course it is just an example, so do not go over 1-2 million cells. The code should be understandable as it is; you have:

- a routine to create a point distribution over a line (newgrid.m)

- a routine to create 3 matrix of points x(i,j,k), y(i,j,k) and z(i,j,k) (createmesh.m)

- a routine to convert the above matrix in a fluent readable .msh file (writemsh.m)

Hope it helps
Attached Files
File Type: zip gridgen.zip (2.4 KB, 183 views)
ssh123 likes this.
sbaffini is offline   Reply With Quote

Old   June 28, 2012, 13:19
Default
  #4
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
Quote:
Originally Posted by Far View Post
Are you talking about the script for automating the process or your own grid generation code?
I mean the process for my own grid
James Hetfield is offline   Reply With Quote

Old   June 28, 2012, 21:27
Default
  #5
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
The information you need is present in the User's guide manual.

However, if you are in need of a free mesh generator for Fluent i think you can use the ones present in the OpenFOAM suite (blockmesh and snappyhexmesh) and convert the mesh in Fluent format (i'm pretty sure there is also something to do that among the several applications)

As an example, you can find attached a simple, single-block, structured grid generator for Fluent. It is written in MATLAB but i am very FORTRAN oriented so it should be easily translated. Of course it is just an example, so do not go over 1-2 million cells. The code should be understandable as it is; you have:

- a routine to create a point distribution over a line (newgrid.m)

- a routine to create 3 matrix of points x(i,j,k), y(i,j,k) and z(i,j,k) (createmesh.m)

- a routine to convert the above matrix in a fluent readable .msh file (writemsh.m)

Hope it helps

I read UDF and mesh manuals
NOWHERE its been mentioned how to write a mesh code for fluent
James Hetfield is offline   Reply With Quote

Old   June 29, 2012, 03:38
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Of course, in the manual it's not written how to write a mesh but how Fluent is expecting the msh file (which is all you need to write it).

As i said, the reference part in the manual is:

User's guide - B.3 Case and Data File Formats - Grid Sections

This has nothing to do with the UDF
sbaffini is offline   Reply With Quote

Old   June 30, 2012, 18:20
Default
  #7
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
Of course, in the manual it's not written how to write a mesh but how Fluent is expecting the msh file (which is all you need to write it).

As i said, the reference part in the manual is:

User's guide - B.3 Case and Data File Formats - Grid Sections

This has nothing to do with the UDF
Ill check it
James Hetfield is offline   Reply With Quote

Old   June 30, 2012, 18:24
Default
  #8
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
What version of Fluent are you working on and what versions of the manuals do you have?
sbaffini is offline   Reply With Quote

Old   June 30, 2012, 18:26
Default
  #9
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
What version of Fluent are you working on and what versions of the manuals do you have?
sorry i made the wrong comment on your comment

I will check it
James Hetfield is offline   Reply With Quote

Old   July 1, 2012, 21:24
Default
  #10
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
The information you need is present in the User's guide manual.

However, if you are in need of a free mesh generator for Fluent i think you can use the ones present in the OpenFOAM suite (blockmesh and snappyhexmesh) and convert the mesh in Fluent format (i'm pretty sure there is also something to do that among the several applications)

As an example, you can find attached a simple, single-block, structured grid generator for Fluent. It is written in MATLAB but i am very FORTRAN oriented so it should be easily translated. Of course it is just an example, so do not go over 1-2 million cells. The code should be understandable as it is; you have:

- a routine to create a point distribution over a line (newgrid.m)

- a routine to create 3 matrix of points x(i,j,k), y(i,j,k) and z(i,j,k) (createmesh.m)

- a routine to convert the above matrix in a fluent readable .msh file (writemsh.m)

Hope it helps
thanks
it was useful
James Hetfield is offline   Reply With Quote

Old   July 2, 2012, 15:53
Default
  #11
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
You're welcome.

Still, i recently found some warnings related to some faces when using the above routines (actually just writemsh.m). This does not seem to be a major problem as Fluent can handle them correctly but means that something wrong is done somewhere. I was not aware of this or i wouldn't have shared them, i will share the correct version (as soon as i have it) if you still need it.

Regards
sbaffini is offline   Reply With Quote

Old   July 2, 2012, 15:56
Default
  #12
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 14
James Hetfield is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
You're welcome.

Still, i recently found some warnings related to some faces when using the above routines (actually just writemsh.m). This does not seem to be a major problem as Fluent can handle them correctly but means that something wrong is done somewhere. I was not aware of this or i wouldn't have shared them, i will share the correct version (as soon as i have it) if you still need it.

Regards
if u share the new version i really appreciate it

I believe that Ansys stuff is cool but they DO REALLY NEED to develop a good grid generator for their stuff
both Ansys Meshing and ICEM have serious grid issues specially when it comes to quadrilaterals and smoothing in boundary layers
James Hetfield 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
reading gambit mesh files using fortran zonexo FLUENT 4 December 15, 2020 12:39
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
[ICEM] Problem making structured mesh on a surface froztbear ANSYS Meshing & Geometry 4 November 10, 2011 08:52
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 19:43
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


All times are GMT -4. The time now is 10:23.