|
[Sponsors] |
July 30, 2010, 01:13 |
GRID generation using fortran
|
#1 |
New Member
joojo
Join Date: Jul 2010
Posts: 2
Rep Power: 0 |
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 |
|
July 30, 2010, 07:35 |
|
#2 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 19 |
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 |
|
August 2, 2010, 00:18 |
|
#3 | |
New Member
joojo
Join Date: Jul 2010
Posts: 2
Rep Power: 0 |
Quote:
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 07:54. |
||
August 2, 2010, 08:37 |
|
#4 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 19 |
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 |
|
|
|
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 23: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 06:59 |
Latest news in mesh generation | Robert Schneiders | Main CFD Forum | 0 | March 2, 1999 05:07 |