CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Creating circular shape through programming (http://www.cfd-online.com/Forums/main/103057-creating-circular-shape-through-programming.html)

lokeshagarwal.vitian June 9, 2012 13:20

Creating circular shape through programming
 
Hello Everyone,

I want to create a circle with help of programming for computation.
I tried by equation of circle but i am not able to compute with the entire circle.

Can i get guidance on how to create circle and then compute around it

Thank you

ztdep June 10, 2012 02:18

I can not catch what is the problem?
could you please detail it.
create a circle for what? grid generation?

lokeshagarwal.vitian June 11, 2012 11:47

Yes, for grid generation and then computing in that points

ztdep June 11, 2012 18:52

try gmesh
http://geuz.org/gmsh/

lokeshagarwal.vitian June 13, 2012 12:50

Thank you sir,
But gmesh is the software, i wanted to write my own C code to generate circle and then compute

cfdnewbie June 13, 2012 17:54

I guess you need to state your problem more clearly before we can try to help!

ztdep June 13, 2012 18:29

Quote:

Originally Posted by lokeshagarwal.vitian (Post 366282)
Thank you sir,
But gmesh is the software, i wanted to write my own C code to generate circle and then compute

OK, then, you can choose the polar coordinate system. http://en.wikipedia.org/wiki/Polar_coordinate_system
if you try to generate the unstructured grid, try find some free procedure on this page
http://people.sc.fsu.edu/~jburkardt/...c/cpp_src.html
hope this help you

lokeshagarwal.vitian June 15, 2012 12:07

Quote:

Originally Posted by cfdnewbie (Post 366341)
I guess you need to state your problem more clearly before we can try to help!

Sir, I am trying to make my own C code to examine the flow over a cylinder and for the same i need to create a circle and then compute around it i.e, solve momentum and continuity equation.

cfdnewbie June 15, 2012 14:18

So is your problem related to the meshing of the geometry, or to the solution of the associated PDEs?

Martin Hegedus June 15, 2012 22:45

?

Is the answer as simple as this:
x = r*cos(theta)
y = r*sin(theta)

It seems that way.

lokeshagarwal.vitian June 16, 2012 05:46

Quote:

Originally Posted by cfdnewbie (Post 366708)
So is your problem related to the meshing of the geometry, or to the solution of the associated PDEs?

Sir,I am facing problem with the geometry itself. If i am able to make geometry then i can think of computing in that.

cfdnewbie June 16, 2012 06:30

Quote:

Originally Posted by Martin Hegedus (Post 366741)
?

Is the answer as simple as this:
x = r*cos(theta)
y = r*sin(theta)

It seems that way.

It seems to me as well....however, if that's truly the question, the guy has a very long and stony way to go before he can solve the NS equations....



Quote:

Sir,I am facing problem with the geometry itself. If i am able to make geometry then i can think of computing in that.
Yes, but what exactly is your problem? It can't be how to describe/draw a circle in a programming language.... can it??? If that's the case, then writing a code to solve the NS equations is way too ambitious for you.....

So please restate your problem and show us the steps you have taken to solve it, then we might help. just restating "I have a problem" won't enable us to help you!

Ford Prefect June 16, 2012 06:31

Quote:

Originally Posted by lokeshagarwal.vitian (Post 366695)
Sir, I am trying to make my own C code to examine the flow over a cylinder and for the same i need to create a circle and then compute around it i.e, solve momentum and continuity equation.

Do you accept a staircase shape of the circle? Then it is really really easy to create. I have a simple code that reads images that can be created in any drawing tool such as Paint or Gimp, using ImageMagick. Creating any object then becomes trivial and needs no change of your code.

If staircase shapes are not allowed then you could use grid transformation or unstructured grid.

lokeshagarwal.vitian June 16, 2012 09:06

Quote:

Originally Posted by cfdnewbie (Post 366773)
It seems to me as well....however, if that's truly the question, the guy has a very long and stony way to go before he can solve the NS equations....





Yes, but what exactly is your problem? It can't be how to describe/draw a circle in a programming language.... can it??? If that's the case, then writing a code to solve the NS equations is way too ambitious for you.....

So please restate your problem and show us the steps you have taken to solve it, then we might help. just restating "I have a problem" won't enable us to help you!

Sir,
I want to create a 2D rectangular unstructured grid with a circle of diameter 0.2 times the smallest side of the rectangle.

The circle is on the center of the rectangular grid

The grid is finer near the circle and coarse away from it.

So, i want to create this grid in x, y coordinate using "for" and other iterative loops in c programming (also using arrays)

After generating grid i will use these grid points to solve NS equations.

cfdnewbie June 16, 2012 09:37

Well, how do you want to create the grid? There are many ways to do it. You can use an elliptic solver, triangulate by Delauny.... what type of grid? structured hexas? triads?

I would recommend you do some reading up on grid generation and identify what requirements you have before starting with this...


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