- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **Cylindrical coordinates ?**
(*http://www.cfd-online.com/Forums/openfoam-solving/80108-cylindrical-coordinates.html*)

Cylindrical coordinates ?Hi Guys, i am new to openfoam, my question is that:
If i want to the solve the Navier-Stokes 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 |

Hi T.D.,
please search the forum before opening a new thread. I think you will get more than 100 matches on this topic. |

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 |

Cylindrical coordinates?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 |

Hi1 Attachment(s)
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 |

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 |

Hi ata1 Attachment(s)
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 |

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.cfd-online.com/Forums/ope...-cylinder.html may be it was useful for you. Best regards Good luck bro. Ata |

Hi ataHi 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 |

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 |

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. |

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 |

U r GreatHi 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. |

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 |

Thankshi
thanks brother yes it worked fine thank you so much see you later yours, T.D. |

to simlify last message1 Attachment(s)
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 |

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 |

ThanksHi 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. |

All times are GMT -4. The time now is 07:53. |