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

Writing mesh in FORTRAN or C

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 28, 2012, 01:30
Default Writing mesh in FORTRAN or C
  #1
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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, 03:48
Default
  #2
Far
Super Moderator
 
Far's Avatar
 
Sijal Ahmed Memon (turboenginner@gmail.com)
Join Date: Mar 2009
Location: Islamabad Pakistan
Posts: 3,899
Blog Entries: 6
Rep Power: 37
Far will become famous soon enoughFar will become famous soon enough
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, 05:25
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 462
Blog Entries: 13
Rep Power: 14
sbaffini will become famous soon enough
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, 68 views)
sbaffini is offline   Reply With Quote

Old   June 28, 2012, 14:19
Default
  #4
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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, 22:27
Default
  #5
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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, 04:38
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 462
Blog Entries: 13
Rep Power: 14
sbaffini will become famous soon enough
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, 19:20
Default
  #7
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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, 19:24
Default
  #8
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 462
Blog Entries: 13
Rep Power: 14
sbaffini will become famous soon enough
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, 19:26
Default
  #9
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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, 22:24
Default
  #10
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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, 16:53
Default
  #11
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 462
Blog Entries: 13
Rep Power: 14
sbaffini will become famous soon enough
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, 16:56
Default
  #12
Member
 
Join Date: Oct 2011
Location: OH, USA
Posts: 77
Rep Power: 5
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

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
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52
[ICEM] Problem making structured mesh on a surface froztbear ANSYS Meshing & Geometry 4 November 10, 2011 09:52
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 19:10
reading gambit mesh files using fortran zonexo FLUENT 0 May 16, 2006 23:08


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