# A problem about the coordinate singularity at r=0 for axisymmetric problme

**URL:** https://community.freefem.org/t/a-problem-about-the-coordinate-singularity-at-r-0-for-axisymmetric-problme/3034
**Category:** General Discussion
**Created:** [March 13, 2024, 10:26am UTC](https://community.freefem.org/t/a-problem-about-the-coordinate-singularity-at-r-0-for-axisymmetric-problme/3034 "2024-03-13T10:26:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![clthu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clthu](https://community.freefem.org/u/clthu)
#### Post date: [March 13, 2024, 10:26am UTC](https://community.freefem.org/t/a-problem-about-the-coordinate-singularity-at-r-0-for-axisymmetric-problme/3034/1 "2024-03-13T10:26:47Z")

</div>

Dear all,  
These days I meet a problem about the axisymmetric NS equations. I solve [u,p] with test function[v,phi] and when I wrote the weak form I found a problem, for example the term of pressure gradient on the right hand side.  
For an axisymmetric function F(r,z), we can write that:

 ![f6823f4a79c2c5710b2c942f1d7fe1d](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/4/464c17ed3e2417e2f1223cc3c1821000990cf8b8.png)  
However, I could not find the difference between the following two results, the boundary terms vanish according to the boundary conditions:  
 ![5f7350cea7179b9238509dfda9013dd](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/d/de46d3b1c5552453be6146529f13406e1a8d822f.jpeg)  
And in FreeFem++, I write

```
      int2d(th)(p*(div(u))*y)  

```

or

```
      int2d(p*div(u*y)) ?

```

(the macro div is for the divergence operator in the cylindrical coordinate, here just to make sense)

I found both ways in some literature or code, but I don’t quite understand.  
(One reason I think is that in the two results, the div operator is defined in the cylindrical coordinate for the first form and in the Cartesian for the second form , but I am not so sure now)

Thanks very much~

---

<div class="post-metadata">

### Author: ![clthu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clthu](https://community.freefem.org/u/clthu)
#### Post date: [March 13, 2024, 10:32am UTC](https://community.freefem.org/t/a-problem-about-the-coordinate-singularity-at-r-0-for-axisymmetric-problme/3034/2 "2024-03-13T10:32:03Z")

</div>

And another problem is that: in some literature, some author wrote that the singularity is treated with multiplication by r (or even r^2). But I think the r is naturally arising from the integral in cylindrical coordinates ( the Jacobian matrix for coordinate transformation). I don’t know if I understand right…

---

<div class="post-metadata">

### Author: ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)
#### Post date: [March 13, 2024, 10:56am UTC](https://community.freefem.org/t/a-problem-about-the-coordinate-singularity-at-r-0-for-axisymmetric-problme/3034/3 "2024-03-13T10:56:32Z")

</div>

This r is part of the differential volume and should not be confused as part of the integral argument during integration by parts.

I agree that the wording “pre multiplication by r^2” is probably an innocent mistake, that has now been repeated a few times in the literature. The factor of r in the Jacobian of the coordinate transformation removes all inviscid (1/r) singularities by itself. An additional factor of r introduced to the strong form before deriving the weak form (ie premultiplied by r) can be helpful to remove the viscous singularities (1/r^2). You can see an example of this in [one of my papers](https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/nonlinear-dynamics-of-fully-developed-swirling-jets/FE28A6F2254BAE7A97058457F4C9E3E5). However, it should be noted that either approach can cause problems along the central axis depending on how BCs are enforced. Personally, I have moved to favor the former approach over the latter.

---

<div class="post-metadata">

### Author: ![clthu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clthu](https://community.freefem.org/u/clthu)
#### Post date: [March 13, 2024, 11:39am UTC](https://community.freefem.org/t/a-problem-about-the-coordinate-singularity-at-r-0-for-axisymmetric-problme/3034/4 "2024-03-13T11:39:35Z")

</div>

I have found that sometimes I misunderstand the r from the Jacobian or pre multiplied to the strong form, but now I get it. Thank you very much for your reply!
