Variational formulation in cylindrical co ordinates

Dear professor,

I want to simulate the flow throught pipe using full 3D NS equations. I wanted to write the varional formulation in cylindrical coordinates. I was able to map ‘r’ coordinates with y and ‘z’ coordinates with x. But I’m facing a problem while mapping ‘theta’ coordinates to z. I have searched for this problem in discussions, but I didn’t find any information. Your input will be highly valuable for my research. Kindly let me know any available resources on this topic.

Best regards,
sumen.

Dear Sumenchalla,
In the theta coordinate you have to set periodic boundary conditions. Apart from that I don’t see what problem could occur, until having a particular piece of code.

Dear professor,

I genuinely unable to get what you’re trying to emphasize. That is the reason why I took 2 days to read online what is periodic boundary condition is and how to map cylindrical to Cartesian, but I was not able to gather any useful information. I’m add the snippet of variational formulational I have used to simulate axisymmetric pipe flow, please have a look

	varf  NS ([ur,ut,uz,p],[vr,vt,vz,q])=
    		 int2d(th)(
        	    	 (y^2*ur*vr+y^2*ut*vt+y^2*uz*vz)/dt
			+ nu*(y^2*dx(ur)*dx(vr)+y^2*dy(ur)*dy(vr)+ur*vr+y*dy(ur)*vr
			+ y^2*dy(ut)*dy(vt)+y^2*dx(ut)*dx(vt)+ut*vt+y*dy(ut)*vt
			+ y^2*dx(uz)*dx(vz)+y^2*dy(uz)*dy(vz)+y*dy(uz)*vz)
			- p*(y^2*dy(vr)+2*y*vr+y^2*dx(vz))
            		+ q*(ur+y*dy(ur)+y*dx(uz))  )

Here I used nondimensional NS equations in cylindrical coordinates, where y represents the radial direction and x represents the axial direction. Now I want to implement non-axisymmetric pipe flow for which delta(u)/delta(theta) will be there. How can I incorporate that term in my variational formulation? Your help will be highly useful for my research

Thanks and regrads,
sumen.

Dear Sumen,
I think it should be

real H=2.;
real R=0.5;
mesh3 Th=cube(2,2,3,[x*H,y*R,z*2*pi]);

fespace Vh(Th,[P2,P2,P2,P1],periodic=[[5,x,y],[6,x,y]]);

real dt=0.01,nu=0.4;

varf  NS ([ur,ut,uz,p],[vr,vt,vz,q])=
   int3d(Th)(
      y*(ur*vr+ut*vt+uz*vz)/dt
      + nu*(y*dy(ur)*dy(vr)+(dz(ur)-ut)*(dz(vr)-vt)/y+y*dx(ur)*dx(vr)
      + y*dy(ut)*dy(vt)+(dz(ut)+ur)*(dz(vt)+vr)/y+y*dx(ut)*dx(vt)
      + y*dy(uz)*dy(vz)+dz(uz)*dz(vz)/y+y*dx(uz)*dx(vz))
      - p*(y*dy(vr)+vr+dz(vt)+y*dx(vz))
      - q*(y*dy(ur)+ur+dz(ut)+y*dx(uz))
      - 1.e-8*y*p*q  );

The periodic nature has to be put in the space Vh.
I took the formulas for the divergence, vector gradient and differential volume in

I have not tested the result.

Thank you very much for your information, Professor. I will try to implement this variational formulation with my mesh, which was imported from Gmesh.