CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   How to import NACA 0012 Profile in Gridgen (http://www.cfd-online.com/Forums/main/84810-how-import-naca-0012-profile-gridgen.html)

maplepink February 9, 2011 06:05

How to import NACA 0012 Profile in Gridgen
 
Hello,

I need some help with the Gridgen software.

I want to import the NACA 0012 airfoil geometry in Gridgen. I have the profile points of NACA 0012 (x and y coordinates), but I am not able to import it in Gridgen. (I know we can import this kind of file in Gambit but I am not able to do it in Gridgen.)

How I do import this profile in Gridgen?

Does anyone have the NACA 0012 profile file which can be imported in Gridgen?

Thank you very much in advance.

Maple

rmatus February 9, 2011 08:09

Use the Gridgen Segment file format
 
Maple:

You can import the airfoil coordinates in Gridgen segment file format. You can import the segment file as either grid or database. Go the Input/Output menu and choose either Database Import or Grid Pts import. If you choose Grid Pts Import, then choose Curves on the next menu. Select your segment file in the file browser and you are all set.

The following piece of pseudo-code describes the format the data found in a segment file should take:
c.....nmax is the number of segments
c.....ni(n) is the number of points on segment n
c.....imax is the number of points
integer nmax
integer ni(nmax)
real x(imax), y(imax), z(imax)
do n = 1, nmax
write(1,*) ni(n)
do i = 1, ni(n)
write(1,*) x(i,n), y(i,n), z(i,n)
end do
end do

Hope this helps,
Rick

Far February 14, 2011 12:12

there is no need to do this , this is useful for programming but not for this task

DoHander February 14, 2011 12:22

You can try to use the procedure described at this link:

http://www.pointwise.com/glyph/airfoilGen/

This will do the job for you.
However if you want to be able to import any kind of curve defined by points the Fortran snippet suggested by Rmatus is the way to go, you can easily convert the code to any programming language you are more familiar.

Do

rmatus February 14, 2011 12:23

Not necessary, but illustrative
 
Far:

You are correct about the pseudo-code. It is not necessary to write code to make a segment file. But the pseudo-code listing is a concise way to show the file format.

Hope this helps,
Rick

Far February 14, 2011 12:31

simple way is to write the coordinates in x, y and z (make it zero for two dimensional cases) and one at the top of files with total no of coordinates. e.g.


3
1.0 0.0 0.0
2.0 2.0 0.0
2.5 2.5 0.0

for 4 coordinates write
4
1.0 0.0 0.0
2.0 2.0 0.0
2.5 2.5 0.0
3.0 3.5 0.0

hope this helps

Far February 14, 2011 12:33

I appreciate rick comments. this code is very much useful for the long data base

DoHander February 14, 2011 12:34

@Far

You mean to write the file by hand ? :)

Do

Far February 14, 2011 13:54

I have made the three dimensional geometries by this trick :) :D

sayeem February 27, 2011 21:01

Quote:

Originally Posted by Far (Post 295217)
simple way is to write the coordinates in x, y and z (make it zero for two dimensional cases) and one at the top of files with total no of coordinates. e.g.


3
1.0 0.0 0.0
2.0 2.0 0.0
2.5 2.5 0.0

for 4 coordinates write
4
1.0 0.0 0.0
2.0 2.0 0.0
2.5 2.5 0.0
3.0 3.5 0.0

hope this helps

i need to know the file extension for this type of files.
and can i import this file to the gridgen?

rmatus February 28, 2011 09:15

Default extension for a segment file is .dat
 
The default extension for the segment file is .dat, but you can make it whatever you want and Gridgen and Pointwise will both still read it.

Use File, Import, Grid to import it into Pointwise.

Hope this helps,
Rick

j_h_86 May 7, 2013 11:33

1 Attachment(s)
Sorry to bring up this thread again.

I always get the error message: "Could not read file" file when selecting
→Input/Output
→Grid
→PTs Import
→Curves
and choosing the attached file.

Any help would be much appreciated ;)

rmatus May 7, 2013 11:59

601 is a lot of control points for a connector
 
1 Attachment(s)
Johannes:

The file imported just fine in Pointwise (see attachment). In Gridgen, I think you may be running into a limit on the number of control points allowed on a connector. You can work around this by first importing it as a database curve (I/O, Database Import, filename, Type Segment), and then using Create Connectors on DB entities to make a connector with that shape.

Hope this helps,
Rick

j_h_86 May 7, 2013 12:26

Quote:

Originally Posted by rmatus (Post 425896)
Johannes:

The file imported just fine in Pointwise (see attachment). In Gridgen, I think you may be running into a limit on the number of control points allowed on a connector. You can work around this by first importing it as a database curve (I/O, Database Import, filename, Type Segment), and then using Create Connectors on DB entities to make a connector with that shape.

Hope this helps,
Rick

Wow, this was quick - thank you very much Rick!!

Your suggested approach works fine :) Inserting an Akima spline connector takes pretty long though but at least I do not have to import each point manually :)

I tried now a simple case (Far's example from above):

3
1.0 0.0 0.0
2.0 2.0 0.0
2.5 2.5 0.0

And this one did neither get imported (via grid points)?! Pretty strange...

rmatus May 7, 2013 12:36

Quote:

I tried now a simple case (Far's example from above):

3
1.0 0.0 0.0
2.0 2.0 0.0
2.5 2.5 0.0

And this one did neither get imported (via grid points)?! Pretty strange...
That one worked fine for me in both Gridgen and Pointwise importing as grid points (connector). What kind of error message are you getting?

j_h_86 May 7, 2013 12:40

1 Attachment(s)
Quote:

Originally Posted by rmatus (Post 425902)
That one worked fine for me in both Gridgen and Pointwise importing as grid points (connector). What kind of error message are you getting?

ERROR:
Could not read file.

-Hit any key to continue-




...(see attached image).

rmatus May 7, 2013 12:43

Try this file.
 
1 Attachment(s)
Here is the file I was able to import. Give it a try and see if you still get an error.

Thanks,
Rick

j_h_86 May 7, 2013 13:01

Quote:

Originally Posted by rmatus (Post 425904)
Here is the file I was able to import. Give it a try and see if you still get an error.

Thanks,
Rick

Rick, thanks to your effort, I found the error.

Actually there is an error in a local manual I used for the import. It is written, that there has to be an empty line at the end of the file. But actually the import does not work with this empty line.

Anyway Rick, thank you very much and your effort helped me a lot! Maybe somebody in the future won't have as much problems as me because of this thread.

Have a nice evening!


All times are GMT -4. The time now is 08:28.