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

GRID generation using fortran

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 30, 2010, 00:13
Smile GRID generation using fortran
  #1
New Member
 
joojo
Join Date: Jul 2010
Posts: 2
Rep Power: 0
eruptionjoojo is on a distinguished road
Hello everyone,

I'm wanting to make a grid as is indicated in the image attached, the problem is that i really don't have any idea how to do it ......... which compiler is needed etc. thus wanted others help in this regard ............

thnks in advance
Attached Images
File Type: png grid.png (3.2 KB, 52 views)
eruptionjoojo is offline   Reply With Quote

Old   July 30, 2010, 06:35
Default
  #2
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 10
DoHander is on a distinguished road
If you really want to generate this in Fortran you can use the gfortran compiler which is free and works perfectly on Windows, Linux and Mac.

A possible implementation will be:

dx=0.5
dy=0.05

do i=1,Nr_points_X
x(i)=i*dx;
enddo

do i=1,Nr_points_Y
y(i)=i*dy;
enddo
.........

However for such a toy grid you can basically use any language. If I remember correctly Matlab has a function that can generate this kind of grids for you (maybe ndgrid ...).

Do
DoHander is offline   Reply With Quote

Old   August 1, 2010, 23:18
Smile
  #3
New Member
 
joojo
Join Date: Jul 2010
Posts: 2
Rep Power: 0
eruptionjoojo is on a distinguished road
Quote:
Originally Posted by DoHander View Post
If you really want to generate this in Fortran you can use the gfortran compiler which is free and works perfectly on Windows, Linux and Mac.

A possible implementation will be:

dx=0.5
dy=0.05

do i=1,Nr_points_X
x(i)=i*dx;
enddo

do i=1,Nr_points_Y
y(i)=i*dy;
enddo
.........

However for such a toy grid you can basically use any language. If I remember correctly Matlab has a function that can generate this kind of grids for you (maybe ndgrid ...).

Do
thnks a lot for your response ...............

but while i copy pasted the code you provided i get errors,which are as listed below ........... i'm really a newbie and don't know anything about fortran programming from declaring the variables,etc.,so kindly help me, by providing the exact code as to be pasted in the .f90 file.the errors which i get are as listed below:-




C:\Documents and Settings\ISM\Desktop\Fortran>gfortran test.f90 -o code.exe
test.f90:7.10:

x(i)=i*dx;
1
Error: Unexpected STATEMENT FUNCTION statement at (1)
test.f90:11.10:

y(i)=i*dy;
1
Error: Unexpected STATEMENT FUNCTION statement at (1)
Error: Unexpected end of file in 'test.f90'




and yeah as you stated this could also be done in matlan infact i have already generated the grid in matlab using meshgrid as well as by using a simple loop program ........
but for some reasons i wanted to make the grid in fortran b'coz i need to further work on this grid and form various profiles like velocity profile,etc. and then apply N-S equation at all the nodal points to get the desired output ....

Last edited by eruptionjoojo; August 2, 2010 at 06:54.
eruptionjoojo is offline   Reply With Quote

Old   August 2, 2010, 07:37
Default
  #4
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 10
DoHander is on a distinguished road
What I've given you wasn't a complete program it was just a piece of code, a small example. You need to declare x and y as vectors if you want the code to run, also you need to add an "end" to the code.

I don't have a Fortran code for generating this mesh, this was just a suggestion for you of how you can implement this.

I recommend you to read a Fortran 77 or 90 tutorial.

(Based on your initial message I was under the impression you know a bit of Fortran or at least you plan to learn something. If you plan to implement a NS solver in Fortran you need to learn how to program in Fortran.)

Do
DoHander 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
need help for generation grid aya FLUENT 11 March 4, 2008 15:46
recommend grid generation software for fortran zonexo Main CFD Forum 0 May 16, 2006 22:42
To avoid Grid generation for FORTRAN CFD CODE Stephen Main CFD Forum 4 January 30, 2006 04:04
Combustion Convergence problems Art Stretton Phoenics 5 April 2, 2002 05:59
Latest news in mesh generation Robert Schneiders Main CFD Forum 0 March 2, 1999 05:07


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