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

Finite Volume Method For Cylindrical Coordinates

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2010, 00:38
Default For Point 4
  #21
Member
 
Ramesh K
Join Date: Dec 2009
Location: Bangalore
Posts: 73
Rep Power: 17
RameshK is on a distinguished road
Send a message via Yahoo to RameshK
Hi,

I have developed a compressible flow FVM solver in the manner u have explained in point 4. My grid is in cylindrical coordinates and the solver in Cartesian. I have worked on a cylindrical domain (flow through pipe). I did not get any issue of singularity at the cylindrical axis, both my Euler code and NS code work fine.
RameshK is offline   Reply With Quote

Old   July 17, 2010, 07:56
Default
  #22
New Member
 
Akinola
Join Date: Jul 2010
Posts: 25
Rep Power: 16
falopsy is on a distinguished road
Quote:
Originally Posted by RameshK View Post
Hi,

I have developed a compressible flow FVM solver in the manner u have explained in point 4. My grid is in cylindrical coordinates and the solver in Cartesian. I have worked on a cylindrical domain (flow through pipe). I did not get any issue of singularity at the cylindrical axis, both my Euler code and NS code work fine.
Hi Ramesh, good to hear your code is working fine. I now have my equations but am having issues with convergence. I am at present not using any under-relaxation and think that may be the reason my code is not converging. What values of under-relaxation should I use? Are you working in 3D or 2D? Should I send my equations to you to help me check? I understand you will be very busy but any help will be highly appreciated. Thanks
falopsy is offline   Reply With Quote

Old   July 17, 2010, 16:45
Default Hi
  #23
Member
 
Ramesh K
Join Date: Dec 2009
Location: Bangalore
Posts: 73
Rep Power: 17
RameshK is on a distinguished road
Send a message via Yahoo to RameshK
I did 3D, compressible NS solver, but tested it only for laminar case only. I didnot add any of the relaxation factors.
RameshK is offline   Reply With Quote

Old   July 19, 2010, 21:19
Default
  #24
New Member
 
Akinola
Join Date: Jul 2010
Posts: 25
Rep Power: 16
falopsy is on a distinguished road
Quote:
Originally Posted by nicoledc109 View Post
I also think so.
I tried to use openFOAM as you suggestd but it is also not as easy as that as it will involve me learning C#, linux and then trying to understand the code as well. I believe writing my own code will give me better control if I want to add other physics/models to the code. I also think the purpose of the project is to learn how to do something and not just use what has been done by others. If we keep discouraging people from trying things out then in the next ten years when those people who wrote openFOAM are retired, we will have no one to develop new codes . That is just a joke by the way.

Anyway, I just finished implementing SIMPLE (collocated grid, Rhie-chow) algorithm in the code with good convergence and I am now ready to add a turbulence model? Like you advice, any idea on the implementation of k-epsilon will be highly appreciated so i dont re-invent the wheel.

Thanks.
falopsy is offline   Reply With Quote

Old   July 19, 2010, 21:32
Default
  #25
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by falopsy View Post
I tried to use openFOAM as you suggestd but it is also not as easy as that as it will involve me learning C#, linux and then trying to understand the code as well. I believe writing my own code will give me better control if I want to add other physics/models to the code. I also think the purpose of the project is to learn how to do something and not just use what has been done by others. If we keep discouraging people from trying things out then in the next ten years when those people who wrote openFOAM are retired, we will have no one to develop new codes . That is just a joke by the way.

Anyway, I just finished implementing SIMPLE (collocated grid, Rhie-chow) algorithm in the code with good convergence and I am now ready to add a turbulence model? Like you advice, any idea on the implementation of k-epsilon will be highly appreciated so i dont re-invent the wheel.

Thanks.
I am sorry you took it the wrong way. But since you say you have implemented SIMPLE with Rhie-Chow you probably would be able to understand what i am saying now:

1. Writing a CFD code is lot of work. Plus writing a stable CFD code is even more difficult.
2. For larger meshes simple matrix solvers do not cut it. The best would be AMG but that is also very difficult in itself. So the next best is BiCGStab which is relatively easy. (but hinders convergence for very large meshes).


Now given (1) and (2) ask yourself - would you suggest someone to write solver code if he wants to do small things???

About your idea of learning and encouraging is good. But do you think companies should make it mandatory for every person who work on CFD to first write a working CFD code. After all it encourages learning isn't it.

It is lot of work. On net it is difficult to know who wants to go to what levels to learn. This is why first suggestion is - not to reinvent the wheel.

PS: I wrote inavier because i wanted to learn. So yes , in that case i re-invented the wheel, but i knew what i am getting into.

And about openFOAM , i also found it difficult and could not make it work. (I am not that intellegent i guess).
arjun is offline   Reply With Quote

Old   July 19, 2010, 21:36
Default
  #26
New Member
 
Akinola
Join Date: Jul 2010
Posts: 25
Rep Power: 16
falopsy is on a distinguished road
Quote:
Originally Posted by arjun View Post
I am sorry you took it the wrong way. But since you say you have implemented SIMPLE with Rhie-Chow you probably would be able to understand what i am saying now:

1. Writing a CFD code is lot of work. Plus writing a stable CFD code is even more difficult.
2. For larger meshes simple matrix solvers do not cut it. The best would be AMG but that is also very difficult in itself. So the next best is BiCGStab which is relatively easy. (but hinders convergence for very large meshes).


Now given (1) and (2) ask yourself - would you suggest someone to write solver code if he wants to do small things???

About your idea of learning and encouraging is good. But do you think companies should make it mandatory for every person who work on CFD to first write a working CFD code. After all it encourages learning isn't it.

It is lot of work. On net it is difficult to know who wants to go to what levels to learn. This is why first suggestion is - not to reinvent the wheel.

PS: I wrote inavier because i wanted to learn. So yes , in that case i re-invented the wheel, but i knew what i am getting into.

And about openFOAM , i also found it difficult and could not make it work. (I am not that intellegent i guess).
Hi arjun,

I did not take your advice the wrong way. In fact I fully understand it. My comments was because of nicoledc109 who mentioned it again and I even understand it. A professor in my school shares the same idea. I'm sorry if it sounds like that. I meant it as a joke. Hope you get my drift. Thanks
falopsy is offline   Reply With Quote

Old   July 19, 2010, 22:41
Default
  #27
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by falopsy View Post
Hi arjun,

I did not take your advice the wrong way. In fact I fully understand it. My comments was because of nicoledc109 who mentioned it again and I even understand it. A professor in my school shares the same idea. I'm sorry if it sounds like that. I meant it as a joke. Hope you get my drift. Thanks
Its alright. No probie.

I am glad that you are type of person who does not cut corners. And it is nice that you are not afraid of working. It is good trait.

Edited to remove typo.
arjun is offline   Reply With Quote

Old   August 14, 2010, 02:01
Default
  #28
Member
 
Javed
Join Date: Mar 2010
Location: Mumbai,India
Posts: 32
Rep Power: 16
Javed is on a distinguished road
Hi falopsy,

I am just completed writing NS code in cartesian and going to shift to cylindericals cordinates, the pbm is i dont know much abt cyl cordinates , its discretization methods and calculation of Coedd(aE,aW etc).

Could u plz help me
1) is there any book or document which will clear my concepts regarding CFD in cyliderical cordinates.
2) i m so confude , dont know how to start, plz help me

Thanks in advance
Javed
Javed is offline   Reply With Quote

Old   August 16, 2010, 15:57
Default
  #29
New Member
 
Akinola
Join Date: Jul 2010
Posts: 25
Rep Power: 16
falopsy is on a distinguished road
Quote:
Originally Posted by Javed View Post
Hi falopsy,

I am just completed writing NS code in cartesian and going to shift to cylindericals cordinates, the pbm is i dont know much abt cyl cordinates , its discretization methods and calculation of Coedd(aE,aW etc).

Could u plz help me
1) is there any book or document which will clear my concepts regarding CFD in cyliderical cordinates.
2) i m so confude , dont know how to start, plz help me

Thanks in advance
Javed
@javed,

the discretisation is quite similar to the one for rectangular coordinates just that the face areas and volume will no longer be constant as in rectangular coordinates. I was quite initially confused myself but you will find a 2D example in the book by Patankar (Numerical heat transfer and fluid flow) pp 72-73. If you study that closely, you should easily derive the coefficients. I am so sorry for my late reply, I am very busy nowadays. hope this is not too late.
falopsy is offline   Reply With Quote

Old   August 17, 2010, 02:17
Default
  #30
Member
 
Javed
Join Date: Mar 2010
Location: Mumbai,India
Posts: 32
Rep Power: 16
Javed is on a distinguished road
Thanks falopsy,
I will surely look into that.
Javed is offline   Reply With Quote

Old   August 17, 2010, 05:05
Default
  #31
New Member
 
Louis le Grange
Join Date: Sep 2009
Posts: 9
Rep Power: 17
Louis Le Grange is on a distinguished road
Quote:
Originally Posted by arjun View Post
Is mesh motion involved??
If it is there then how will you handle that in cylindrical coordinates?


PS: I have written a code for cylindrical coordinate but can not comment much on it as lots of patents etc are still pending. At the year end, there will be some publications that time probably you will find out.
Hallo Arjun

What are the advantages of having a finite volume code witten and discretized in cylindrical coordinates versus one in Cartesian coordinates? Is it about faster convergence when using cylindrical geometries? Can you comment on the comparisson of FV codes written in Cartesian coordinates compared to cylindrical coordinates for pipe flow with and without swirl?

Thanks,
Louis
Louis Le Grange is offline   Reply With Quote

Old   August 17, 2010, 14:35
Default
  #32
otd
Member
 
private
Join Date: Mar 2009
Posts: 74
Rep Power: 17
otd is on a distinguished road
Folks above have asked for NS equations in cylindrical and spherical coordinates.

A classic text that (I think) is still in print is
Bird, Stewart, and Lightfoot, "Transport Phenomena". It's aimed at Chemical Engineers, but Mechanical and Civil and many scientific disciplines will feel comfortable with it, especially graduate students.

Good luck to all.
otd is offline   Reply With Quote

Old   August 17, 2010, 22:20
Default
  #33
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Louis Le Grange View Post
Hallo Arjun

What are the advantages of having a finite volume code witten and discretized in cylindrical coordinates versus one in Cartesian coordinates? Is it about faster convergence when using cylindrical geometries? Can you comment on the comparisson of FV codes written in Cartesian coordinates compared to cylindrical coordinates for pipe flow with and without swirl?

Thanks,
Louis
The biggest dis-advantage that i could think of descretisation in cylindrical coordinate is that equations have 1/r terms in them. What it means is if you are using very fine mesh this contribution would be very large when r is near 0. IN MY OPINION this do create problem. But i have no proof to prove it.

If the equations are discretisized in finite volume sense than you are only dealing with Area of face and cell to cell distance. Plus no cell center falls on cylindrical axis. In a way it is much more well behaved than the ones that involve 1/r terms.

I wanted to avoid this 1/r related issue so discretized as finite volume and just like unstructured mesh. After i treated it as unstructured grid, i have access to lot of literature, more importantly peric's book which could help me with all my doubts. I can just follow this book and done with solver.

There are two advantage of using Cartesian type meshes.:

A) you can construct direct Poisson solvers on them by using FFT and tri-diagonal algorithms or by using FFT and block cyclic reduction algorithms.

B) If mesh is regular like cartsian mesh then searching a point inside it is easier than normal unstructured mesh. what it means is that if you are using immersed boundary type methods you could save good amount of time.

Both points A and B impact efficiency very much.
arjun is offline   Reply With Quote

Old   August 18, 2010, 11:48
Default Advantages of using cylindrical coordinates
  #34
New Member
 
Louis le Grange
Join Date: Sep 2009
Posts: 9
Rep Power: 17
Louis Le Grange is on a distinguished road
Quote:
Originally Posted by arjun View Post
The biggest dis-advantage that i could think of descretisation in cylindrical coordinate is that equations have 1/r terms in them. What it means is if you are using very fine mesh this contribution would be very large when r is near 0. IN MY OPINION this do create problem. But i have no proof to prove it.

If the equations are discretisized in finite volume sense than you are only dealing with Area of face and cell to cell distance. Plus no cell center falls on cylindrical axis. In a way it is much more well behaved than the ones that involve 1/r terms.

I wanted to avoid this 1/r related issue so discretized as finite volume and just like unstructured mesh. After i treated it as unstructured grid, i have access to lot of literature, more importantly peric's book which could help me with all my doubts. I can just follow this book and done with solver.

There are two advantage of using Cartesian type meshes.:

A) you can construct direct Poisson solvers on them by using FFT and tri-diagonal algorithms or by using FFT and block cyclic reduction algorithms.

B) If mesh is regular like cartsian mesh then searching a point inside it is easier than normal unstructured mesh. what it means is that if you are using immersed boundary type methods you could save good amount of time.

Both points A and B impact efficiency very much.
Hi Arjun

Thanks for your explanation - I am however very much and more interested in the advantages of working in cylindrical coordinates - so could you please elaborate on the reasons why you have decided to write a 3D FV code in cylindrical coordinates? What are the advantages over the Cartesian FV method - such codes are readily available, e.g. OpenFOAM?

Thanks, Louis
Louis Le Grange is offline   Reply With Quote

Old   August 18, 2010, 18:29
Default
  #35
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Louis Le Grange View Post
Hi Arjun

Thanks for your explanation - I am however very much and more interested in the advantages of working in cylindrical coordinates - so could you please elaborate on the reasons why you have decided to write a 3D FV code in cylindrical coordinates? What are the advantages over the Cartesian FV method - such codes are readily available, e.g. OpenFOAM?

Thanks, Louis
I already mentioned (A) and (B). Other than that we have point (C) too. Which is it is easy to make parallel code. I do not think OpenFOAM could handle meshes of sizes more than 1 billion very easily.
arjun is offline   Reply With Quote

Old   August 19, 2010, 04:27
Default
  #36
New Member
 
Louis le Grange
Join Date: Sep 2009
Posts: 9
Rep Power: 17
Louis Le Grange is on a distinguished road
Quote:" There are two advantage of using Cartesian type meshes.:

A) you can construct direct Poisson solvers on them by using FFT and tri-diagonal algorithms or by using FFT and block cyclic reduction algorithms.

B) If mesh is regular like cartsian mesh then searching a point inside it is easier than normal unstructured mesh. what it means is that if you are using immersed boundary type methods you could save good amount of time. "

end quote.

Louis: Do you mean by the above: "There are two advantage of using structured type meshes"?

I'm sorry Arjun - I think there is a misunderstanding or a type error - above you listed (A) and (B) as advantages of using a Cartesian type mesh - Do you really mean that A and B are advantages of a code written in cylindrical coordinates above a code written in Cartesian coordinates? A and B are advantages of a structured mesh - if I understand correctly. A code written by discretizing the NS equations in cylindrical coordinates can still be constructed structured or unstructed regarding your matrix array storing system.

If you say that you have written a 3D cylindrical code I understand by that that you have written the NS equations in cylindrical coordinates and then discretized those equations and then implemented that into a code. My question is - why did you not considered the NS equations in Cartesian coordinates and discretized them - also on a structured grid.

What are the particular advantages of discretizing the NS equations in cylindrical coordinates versus considering the Cartesian form of the NS equations? My guess is to handle swirl better in pipe flow - can you confirm this? Cylindrical coordinates has the ability to map a cake slice mesh into a rectangular mesh in the computational space... in effect taking out the problem of the thin wedge elements, which are not very friendly to Cartesian coordinate discretized solution methods - but again - this advantage only for swirl type flows? Please support or reject this notion?

Kind regards,
Louis
Louis Le Grange is offline   Reply With Quote

Old   August 21, 2010, 04:56
Default
  #37
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Sorry Louis for confusing.

The reason for confusing other than me being not very clear is that use of word Cartesian mesh.

many times this word is simply used to mean regular meshes of type NI x NJ x NZ, this means they could be cylindrical meshes, spherical or simple cartesian meshes. I used the word structured mesh to say this type of mesh.

The second part of confusion is stemming from catesian system (x,y,z) and cylindrical system (r,theta, z). I am assuming that we are discussing solving navier stokes in cartesian system and in cylindrical system.

What i have been saying that cylindrical mesh of type NI x NJ x NZ where NI NJ and NZ are distributions in r , theta and z could be solved in Cartesian system (x,y,z) if we just treat them as untructured meshes (again in (x,y,z) system). So even though mesh is given in r,theta,z variables are stored as Ux,Uy, Uz and pressure as opposed to Ur, Utheta, Uz and pressure of cylindrical system.


Further


Quote:
Originally Posted by Louis Le Grange View Post
Quote:" There are two advantage of using Cartesian type meshes.:

A) you can construct direct Poisson solvers on them by using FFT and tri-diagonal algorithms or by using FFT and block cyclic reduction algorithms.

B) If mesh is regular like cartsian mesh then searching a point inside it is easier than normal unstructured mesh. what it means is that if you are using immersed boundary type methods you could save good amount of time. "

end quote.

Louis: Do you mean by the above: "There are two advantage of using structured type meshes"?

I'm sorry Arjun - I think there is a misunderstanding or a type error - above you listed (A) and (B) as advantages of using a Cartesian type mesh - Do you really mean that A and B are advantages of a code written in cylindrical coordinates above a code written in Cartesian coordinates? A and B are advantages of a structured mesh - if I understand correctly. A code written by discretizing the NS equations in cylindrical coordinates can still be constructed structured or unstructed regarding your matrix array storing system.

I mean that if the meshes are in NI x NJ x NZ format (Cartesian , spherical and cylindrical) direct poisson solvers could be constructed. So while descretization is handles as unstructured mesh pressure correction or pressure equation could be directly solved by such solvers.



Quote:
Originally Posted by Louis Le Grange View Post
If you say that you have written a 3D cylindrical code I understand by that that you have written the NS equations in cylindrical coordinates and then discretized those equations and then implemented that into a code. My question is - why did you not considered the NS equations in Cartesian coordinates and discretized them - also on a structured grid.
What i mean is grid is stored as normal NI x NJ x NZ mesh, it could be all of the above mentioned three forms. When decretization is applied it is done treating as unstructured mesh in Cartesian (x,y,z) system.


Quote:
Originally Posted by Louis Le Grange View Post
What are the particular advantages of discretizing the NS equations in cylindrical coordinates versus considering the Cartesian form of the NS equations? My guess is to handle swirl better in pipe flow - can you confirm this? Cylindrical coordinates has the ability to map a cake slice mesh into a rectangular mesh in the computational space... in effect taking out the problem of the thin wedge elements, which are not very friendly to Cartesian coordinate discretized solution methods - but again - this advantage only for swirl type flows? Please support or reject this notion?

Kind regards,
Louis
Treating and decretizing in cylindrical form has advantages that you can apply finite difference method similar to what is so far developed for Cartesian (NI x NJ x NZ ) system mesh. But it has 1/r terms. Plus some of the terms do not exist on axis. And axis treatment is problematic. Still it could be done.

Sorry for confusion though.
arjun is offline   Reply With Quote

Old   October 14, 2010, 08:11
Default
  #38
Senior Member
 
Join Date: Apr 2009
Posts: 118
Rep Power: 17
lost.identity is on a distinguished road
Quote:
Originally Posted by falopsy View Post
@javed,

the discretisation is quite similar to the one for rectangular coordinates just that the face areas and volume will no longer be constant as in rectangular coordinates. I was quite initially confused myself but you will find a 2D example in the book by Patankar (Numerical heat transfer and fluid flow) pp 72-73. If you study that closely, you should easily derive the coefficients. I am so sorry for my late reply, I am very busy nowadays. hope this is not too late.
Hi Falopsy

I followed Patankar's method for spherical coordinates (the method seems similar to cylindrical) to a spherically symmetric system. The Navier-Stokes equations in cylindrical and spherical coordinates have extra terms for which there is no analogue in the Cartesian case. I treated these geometric terms as part of my source term. Is this what you did as well?

For a spherically symmetric system someone suggested applying the FVM to the full N-S equations. When I do this I don't get these extra source terms (for 1-D). Is this correct? What I mean by this is that for the coordinate independent form of the N-S equations you integrate it over a volume and then apply the divergence theorem and carry on in this way.
lost.identity is offline   Reply With Quote

Old   October 14, 2010, 11:16
Default
  #39
Member
 
Javed
Join Date: Mar 2010
Location: Mumbai,India
Posts: 32
Rep Power: 16
Javed is on a distinguished road
@ lost.identity

Handle those extra terms as source terms only. But if u take the integration of conservative form of the governing equations, u wont get any of the extra term.This is wat i have done in my code.
Javed is offline   Reply With Quote

Old   October 14, 2010, 19:24
Default
  #40
Senior Member
 
Join Date: Apr 2009
Posts: 118
Rep Power: 17
lost.identity is on a distinguished road
Quote:
Originally Posted by Javed View Post
@ lost.identity

Handle those extra terms as source terms only. But if u take the integration of conservative form of the governing equations, u wont get any of the extra term.This is wat i have done in my code.
Thanks very much for the info Javed! I'm trying to apply FVM to the governing equations in spherical coordinates and I'm struggling in determining the normal vectors of a spherically symmetric system. Could you please guide me on how you did it for the cylindrical case so I can have a look at see how it could be applied to the spherical case?

Once I integrate the conversation laws I get the following standar equation after applying the divergence theorem

\frac{\partial}{\partial{t}}\int_{\Omega}\,\rho\boldsymbol{u}\,d\Omega + \boldsymbol{F}\cdot\boldsymbol{n}\,dS  = \int_{\Omega}\,\nabla{p}\,d\Omega

where F are the flux terms collected together.
lost.identity is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is C.V. based finite element method C-H Kuo Main CFD Forum 4 September 19, 2022 15:06
finite volume VS finite element solomon FLUENT 4 April 3, 2015 01:10
Finite Difference Vs. Finite Volume elankov Main CFD Forum 43 December 18, 2010 17:30
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
ALE in finite volume method littlelz Main CFD Forum 5 June 21, 2003 13:50


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