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

Creating circular shape through programming

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 9, 2012, 13:20
Default Creating circular shape through programming
  #1
New Member
 
Lokesh Agarwal
Join Date: Feb 2012
Posts: 6
Rep Power: 5
lokeshagarwal.vitian is on a distinguished road
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
lokeshagarwal.vitian is offline   Reply With Quote

Old   June 10, 2012, 02:18
Default
  #2
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 284
Rep Power: 9
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
I can not catch what is the problem?
could you please detail it.
create a circle for what? grid generation?
ztdep is offline   Reply With Quote

Old   June 11, 2012, 11:47
Default
  #3
New Member
 
Lokesh Agarwal
Join Date: Feb 2012
Posts: 6
Rep Power: 5
lokeshagarwal.vitian is on a distinguished road
Yes, for grid generation and then computing in that points
lokeshagarwal.vitian is offline   Reply With Quote

Old   June 11, 2012, 18:52
Default
  #4
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 284
Rep Power: 9
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
try gmesh
http://geuz.org/gmsh/
ztdep is offline   Reply With Quote

Old   June 13, 2012, 12:50
Default
  #5
New Member
 
Lokesh Agarwal
Join Date: Feb 2012
Posts: 6
Rep Power: 5
lokeshagarwal.vitian is on a distinguished road
Thank you sir,
But gmesh is the software, i wanted to write my own C code to generate circle and then compute
lokeshagarwal.vitian is offline   Reply With Quote

Old   June 13, 2012, 17:54
Default
  #6
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
I guess you need to state your problem more clearly before we can try to help!
cfdnewbie is offline   Reply With Quote

Old   June 13, 2012, 18:29
Default
  #7
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 284
Rep Power: 9
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
Quote:
Originally Posted by lokeshagarwal.vitian View Post
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
ztdep is offline   Reply With Quote

Old   June 15, 2012, 12:07
Default
  #8
New Member
 
Lokesh Agarwal
Join Date: Feb 2012
Posts: 6
Rep Power: 5
lokeshagarwal.vitian is on a distinguished road
Quote:
Originally Posted by cfdnewbie View Post
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.
lokeshagarwal.vitian is offline   Reply With Quote

Old   June 15, 2012, 14:18
Default
  #9
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
So is your problem related to the meshing of the geometry, or to the solution of the associated PDEs?
cfdnewbie is offline   Reply With Quote

Old   June 15, 2012, 22:45
Default
  #10
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 497
Rep Power: 9
Martin Hegedus is on a distinguished road
?

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

It seems that way.
Martin Hegedus is offline   Reply With Quote

Old   June 16, 2012, 05:46
Default
  #11
New Member
 
Lokesh Agarwal
Join Date: Feb 2012
Posts: 6
Rep Power: 5
lokeshagarwal.vitian is on a distinguished road
Quote:
Originally Posted by cfdnewbie View Post
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.
lokeshagarwal.vitian is offline   Reply With Quote

Old   June 16, 2012, 06:30
Default
  #12
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
Quote:
Originally Posted by Martin Hegedus View Post
?

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!
cfdnewbie is offline   Reply With Quote

Old   June 16, 2012, 06:31
Default
  #13
Member
 
Ford Prefect's Avatar
 
Join Date: Mar 2009
Posts: 72
Rep Power: 8
Ford Prefect is on a distinguished road
Quote:
Originally Posted by lokeshagarwal.vitian View Post
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.
__________________
"Trying is the first step to failure." - Homer Simpson
Ford Prefect is offline   Reply With Quote

Old   June 16, 2012, 09:06
Default
  #14
New Member
 
Lokesh Agarwal
Join Date: Feb 2012
Posts: 6
Rep Power: 5
lokeshagarwal.vitian is on a distinguished road
Quote:
Originally Posted by cfdnewbie View Post
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.
lokeshagarwal.vitian is offline   Reply With Quote

Old   June 16, 2012, 09:37
Default
  #15
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
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...
cfdnewbie is offline   Reply With Quote

Reply

Tags
circle, programming

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
benchmark: flow over a circular cylinder goodegg Main CFD Forum 12 January 22, 2013 12:47
Fluent3DMeshToFoam simvun OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 May 14, 2012 05:20
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
+ shape circular pipe - meshing possible? Selina Tracy Main CFD Forum 2 January 16, 2003 14:31
CREATING A VERTICAL CIRCULAR PIPE sanjib das sharma CFX 15 August 2, 2001 06:11


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