
[Sponsors] 
September 15, 2010, 11:51 
Cylindrical coordinates ?

#1 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi Guys, i am new to openfoam, my question is that:
If i want to the solve the NavierStokes equations in cylindrical coordinates, i must just define my coordinates system to cylindrical one (r, theta,z)? if so, what about the operators like "laplacian","divergence", for example: div(phi), they will be automatically used in cylindrical coordinates? or we must write new definitions for them in cylind. coord.? thanks a lot 

September 16, 2010, 10:05 

#2 
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17 
Hi T.D.,
please search the forum before opening a new thread. I think you will get more than 100 matches on this topic. 

September 16, 2010, 10:42 

#3 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi Herbert,
yes indeed i searched and found many matches, but they were not clear. I wish i will get a clear answer to my question. at least if you know, can you help me? i will be so thankful to you thanks a lot 

September 17, 2010, 02:01 
Cylindrical coordinates?

#4 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
I hope you are doing very well. As I know in OF equations are discretised in Cartesian coordinate. Would you please tell me why you are so interested in cylindrical coordinate? May be you can solve your problem in Cartesian coordinate. Best regards Good luck Ata 

September 17, 2010, 04:29 
Hi

#5 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi ata,
this is my model in the attached image yes indeed i just need to solve it in (r,z) only because it is a flow between two parallel disks, one is rotating and the other is stationary.(axisymmetric) Can you help me how to do that? Thanks a lot for you 

September 18, 2010, 01:54 

#6 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
How are you? I hope you are doing very well. As I know you can solve your problem in Cartesian coordinate with rotating BC on walls. If you want an analytical solution then cylindrical coordinate is proper for you but in numerical solution it is no matter. Are you agree with me? Best regards Ata 

September 18, 2010, 14:00 
Hi ata

#7 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi ata,
thanks a lot, you are so kindful how are you, i attached an image , if you see you will understand what i need exactly. can you help me exactly what to do? thanks a lot my brother rk: i am new to openfoam 

September 20, 2010, 02:51 

#8 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
How are you? I hope you are doing very well. Excuse me for delay. I think i can help you. As I see you can use Cartesian coordinate and for wall 1 must use rotating wall. As I know rotating wall boundary condition has been implemented in OpenFOAM previously. For wall 3 you can use stationary wall as boundary condition and there is no need to cylindrical coordinate. In your picture boundary conditions for walls 2 and 4 are not clear. But if they are rotating or stationary there is no problem. You can see http://www.cfdonline.com/Forums/ope...cylinder.html may be it was useful for you. Best regards Good luck bro. Ata 

September 20, 2010, 05:07 
Hi ata

#9 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi ata,
How are you? Thank you so much, yes indeed 2, and 4 are also rotating. But I still have a question, what about the Value [V_setta = Omega * r]? How can i put that value for the boundary condition at rotating wall(1)? since it is equal to a constant Omega times the spatial coordinates r? Another Question, i want to compute the strain tensor E: E=(1/2)*(grad(U)+transpose(grad(U))) i found in programmers guide that it is: symm(fvc::grad(U)) but when i write in my .C file E=fvm::symm(fvc::grad(U)); i get this error: error: 'symm' is not a member of 'Foam::fvm' by the way i defined also E as a VolTensorField Help me please Thanks a lot 

September 20, 2010, 06:55 

#10 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
I'm fine and I hope you are too. About your first question. In rotating wall BC you give omega, axis of rotation and its origin not linear velocity. It will be computed by the solver. About your second question. Examine volSymmTensorField E = fvc::grad(U); I hope this works. Good luck Be happy Best regards Ata 

September 20, 2010, 09:44 

#11 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi ata,
thanks a lot, but E is not aqual to grad(U) as you said E=(1/2)*(grad(U)+transpose(grad(U))); and i saw in guide that there exists already a functions that computes (grad(U)+transpose(grad(U))) and is called "symm" but when i use it like E=fvm::symm(fvc::grad(U)); i get error: error: error: 'symm' is not a member of 'Foam::fvm' so i think i have a problem calling the already installed functions in openfoam like sqrt, or mag, you see i hope you understood me now thanks a lot you are so kind T.D. Last edited by T.D.; September 20, 2010 at 10:41. 

September 21, 2010, 01:03 

#12 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
How are you? I hope you are doing very well. You are true. Examine: volTensorField Gr=fvc::grad(U); volSymmTensorField E = symm(Gr); volTensorField GrTr=Gr.T(); volSymmTensorField Tr = symm(GrTr); E=E+Tr; Good luck Best regards Ata 

September 21, 2010, 07:20 
U r Great

#13 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi ata,
i am fine, you, how are you? thanks a lot, yes it works now, but if symm(Gr) is = 1/2 (Gr + Gr.T() ) then why you defined and added Tr tensor, i don't understand why ? it will be suffiecient at line E=symm(Gr) only , no? I have a question please, later how can i view E values in paraView, how to export them? thanks a lot for your patience and help yours, T.D. Last edited by T.D.; September 21, 2010 at 08:02. 

September 21, 2010, 08:29 

#14 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
If you did not get error it is true. Use it. For your second question. Beside any solver source code (i.e. icoFoam) there is a file createFields. In it pressure. velocity and other things creates. You can use it. May this is true for your case: Info<< "Reading field E\n" << endl; volSymmTensorField E ( IOobject ( "E", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Add it to the end of your createFields file of your solver. Then at your case (problem) in folder "0" similar to file "U" build a file. Name it "E". With contents like this: dimensions [0 0 1 0 0 0 0]; internalField uniform (0 0 0 0 0 0); boundaryField { inlet { type fixedValue; value uniform (0 0 0 0 0 0); } fixedWalls { type zeroGradient; } outlet { type zeroGradient; } simetry { type symmetryPlane; } frontAndBack { type empty; } } Maybe there is better ways but I know this way. Good luck Bets regards Ata 

September 21, 2010, 08:52 
Thanks

#15 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
hi
thanks brother yes it worked fine thank you so much see you later yours, T.D. Last edited by T.D.; September 21, 2010 at 11:21. 

September 22, 2010, 04:56 
to simlify last message

#16 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi to simlify my last message
here is My model what i need to write is the syntax for the last term at write of equation 2 see attached file 

September 25, 2010, 03:08 

#17 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 
Hi T.D.
I'm fine. How are you? hope you are doing very well. For your first question define nu_new in the create field as a volscalerfield and calcaulate it before using it in the code. For your second question see the boundary conditions for pressure in one tutorial. For your third question it is not clear for me. Please explain more. Good luck Best regards Ata 

September 26, 2010, 15:37 
Thanks

#18 
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 
Hi ata,
how are you? i am fine, and thank you so much i will try what you told me, you can forget about the third question , its ok thank you so much T.D. 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Finite Volume Method For Cylindrical Coordinates  falopsy  Main CFD Forum  45  August 14, 2023 21:14 
working in cylindrical coordinates in fluent  Randheer Yadav  FLUENT  2  January 18, 2015 16:25 
SIMPLE algorithm in 3D cylindrical coordinates  zouchu  Main CFD Forum  1  January 20, 2014 17:02 
Unit Vector profile, cylindrical coordinates  Felix  CFX  3  February 6, 2009 07:34 
Calculation in cylindrical coordinates  Franz Wingelhofer  CFX  0  December 28, 1999 07:46 