Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > Methods: Chapter 19

Reply
 
Thread Tools Display Modes
  #1  
Old 11-10-2004, 11:06 AM
Demidov Demidov is offline
Member
 
Join Date: Nov 2004
Posts: 4
Boundary conditions in cylindrical coordinates.

Hello Everybody!

I've got a question about the implementation of the boundary conditions for the multi-dimensional equations in cylindrical coordinates.
Can you explain which boundary condition should we use for the point where r=0?
For example, we know that in F(r, fi) = 0 while r = R (at the boundary).
But what should we write at another boundary of the grid: where r = 0 ?
Should we state that R(0, fi) = R(0, fi+dfi) (i.e. R is equal for all the fi at the point r=0)?

The question is for all who have ever used five-point Laplas approximation in cylindrical coordinates.
Reply With Quote
  #2  
Old 11-18-2004, 02:27 PM
hernlund hernlund is offline
Member
 
Join Date: Feb 2003
Location: Santa Monica, CA
Posts: 12
Singular point, single value

Yes, as r=0 is an actual point, it can only have a single value. As the coordinate lines phi=constant (phi is the angular coordinate) converge toward r=0, the derivative of the dependent variable u (say) with respect to phi must become zero, so that u(r=0,phi)=constant. If you are solving a simple equation with finite differences, you might simply take this value to be the average of all the surrounding points at r+dr over phi. But this doesn't always work. Another option is to discretize at half-steps, e.g. 0.5dr, 1.5dr, 2.5dr, etc, and have a ghost point at -0.5dr for each phi to enforce the boundary conditions. Then the boundary condition is simpler to obtain: the average of u(-0.5dr,phi) and u(0.5dr) is equal to u(r=0) (which is second order), and if this is a flux conservative problem then also the radial derivative vanishes, i.e. u(-0.5dr)=u(0.5dr) since you can't have flux through a surface that has no finite area.

Also note that terms like 1/r becomes large near r=0, and it is convenient to multiply the governing equations through by factors of r until all such terms are gone.

It is also a good idea to coarsen the discretization in phi as one nears r=0...but this is a bit more complicated.
Reply With Quote
  #3  
Old 11-19-2004, 08:21 AM
Demidov Demidov is offline
Member
 
Join Date: Nov 2004
Posts: 4
hernlund , thank you very much for answer!

At the moment I'm trying to use slightly different scheme. What do you think of it?

I just state that near the poinr r=0 F(r,phi) is always equal F(r,phi + pi).
Actually this way is almost the same as your variant when you suggest to use ghost F(-.5dr, phi) point. Here I act the same way: my first node og the mesh is very close to zero, second node is r(first point) + dr of course, and my minus first node (I need it to write second derivative with respect to r) is -dr, so it is equal to the second node but for phi = phi+pi.
Of course first step from zero should be much smaller than regular step.

And another way of realization of your technique is to distribute the first node of the mesh at r=0+dr and then F(r-1,phi) which we again need for the second derivative is placed directly on r = 0 point. We dont need to calciulate it, but we state that it is equal to the average value of all phi-points of the first mesh node.

So, these are the two ways I'm going to try.
As for my equation it is (at the moment) quite simple: just Helmholz equation in cylindrical coordinates.
Reply With Quote
  #4  
Old 11-19-2004, 04:40 PM
hernlund hernlund is offline
Member
 
Join Date: Feb 2003
Location: Santa Monica, CA
Posts: 12
sounds about right

What you describe seems similar. You're right that there is a close correspondence in either case. As a rule, I usually use cell-centered discretizations when the coordinates contain a singularity, which avoids a lot of the problems associated with them.
Reply With Quote
Reply

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 Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.