
[Sponsors] 
June 28, 2006, 04:57 
Hallo,
I have solved with i

#1 
Guest
Posts: n/a

Hallo,
I have solved with icoFOAM a problem into a cylindrical geometry and I need to visualize the radial and angular velocity components. Please, can somebody tell me how to extract from the cartezian velocity the polar components? Thanks, Nicoleta 

June 28, 2006, 19:51 
See http://www.opencfd.co.uk/o

#2 
Senior Member
Srinath Madhavan (a.k.a pUl)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 14 

June 29, 2006, 01:55 
Hi,
thank you pUl for the

#3 
Guest
Posts: n/a

Hi,
thank you pUl for the link, but my question is not answered. With "Ucomponents" one can extract the x,y,z components of the velocity field, and I need the U_r component. Is there a function to extract the cylindrical or sperical components of the velocity? Or my I construct such a function? I need for that the angles of the cell centers ... Nicoleta 

June 29, 2006, 17:39 
Hi,
I wrote a simple dirty

#4 
New Member
Os N
Join Date: Mar 2009
Posts: 2
Rep Power: 0 
Hi,
I wrote a simple dirty program to calc angular velocity. It is from OpenFOAM1.3/applications/utilities/postProcessing/velocityFi eld/magU/magU.C. So I show diff output of magU.C and my code below. Thanks. 55a56,59 > tensor t1(0.0, 1.0, 0.0, > 1.0, 0.0, 0.0, > 0.0, 0.0, 0.0); > 78,80c82,88 < Info<< " Calculating magU" << endl; < volScalarField magU < (  > Info<< " Calculating tanU" << endl; > > volVectorField p1 = t1 & mesh.C(); > volVectorField p2 = p1/mag(p1); > > volScalarField tanU > ( 83c91 < "magU",  > "tanU", 87,89c95,102 < ), < mag(U) < );  > ), > U & p2 > ); > > Info << "tan(U): max: " << max(tanU.internalField()) > << " min: " << min(tanU.internalField()) << endl; > > tanU.write(); 91,94d103 < Info << "mag(U): max: " << max(magU.internalField()) < << " min: " << min(magU.internalField()) << endl; < < magU.write(); 

June 30, 2006, 04:05 
Dear Osamu
that's what I n

#5 
Guest
Posts: n/a

Dear Osamu
that's what I needed. Thank you, it works. Nicoleta 

June 30, 2006, 04:25 
A thousand time easier: OpenFO

#6 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,790
Rep Power: 23 
A thousand time easier: OpenFOAM has got some coordinate system classes. You will need a cylindrical one  the class is called cylindricalCS (have a search through the source or Doxygen).
So: 1) make yourself a coordinate system cylindricalCS( const word & name, const vector & origin, const vector & axis, const vector & direction ) or any of the other constructors. 2) transform the (internal) field to the new cs using the toLocal function 3) if you want a radial component, use vector::y Thus (something like this, I'm not compiling): // This cs would be in the xy plane, with "x" pointing up and cylindrical axis in the blobal x direction cylindricalCS ccs ( "ccs", vector(0, 0, 0), vector(1, 0, 0), vector(0, 1, 0) ); Info << "Ur: " << ccs.toLocal(U)().component(vector::Y) << endl; (one line). Currently, cs does not have a member to convert the whole geometric field, but I can add one for you if you wish. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

July 6, 2006, 04:57 
I've been trying to learn how

#7 
Senior Member
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 196
Rep Power: 10 
I've been trying to learn how to use the cylindricalCS class, and I thought that I might share my experiences. No warranties to what I write though, and I guess that all of it can be made much simpler if you know what you are doing.
The example requires that you have a mesh and a velocity field U, and that you have defined inletPatchID. You also need to do #include "cylindricalCS.H". If your base code writes out the velocity field U you can then visualize the radial, tangential and axial coordinates as U at the inlet patch using for instance paraFoam. The example was developed for OF1.3. //Test of cylindricalCS //Find the Cartesian positions at the patch const fvPatchVectorField& cartFaceCentres = mesh.Cf().boundaryField()[inletPatchID]; //Put the results in U at the patch so that you can visualize the result fvPatchVectorField& CCSin = U.boundaryField()[inletPatchID]; //Define your cylindrical coordinate system cylindricalCS ccs ( "ccs", vector(0, 0, 0), //center point of ccs vector(0, 0, 1), //axis of ccs vector(1, 1, 0) //base axis for cylindrical angle ); //It doesn't seem to be possible to do the whole field at once, so //loop through all the patch faces and set the radial, tangential and //axial position forAll(CCSin, facei) { CCSin[facei] = ccs.toLocal(cartFaceCentres[facei]); //Make sure that you have only positive angles and that the //angle is zero at the base axis: CCSin[facei][1] = CCSin[facei][1] + neg(CCSin[facei][1])*360; } //You can also look at a single cylindrical component, here radial: Info << "ccs.toLocal(cartFaceCentres[0]).component(vector::X)" << endl; Info << ccs.toLocal(cartFaceCentres[0]).component(vector::X) << endl; Håkan 

August 17, 2007, 05:25 
ok I finally found that ccs.to

#8 
Guest
Posts: n/a

ok I finally found that ccs.toLocal(U)().component(vector::Y) has for type Field<double> but the member write() does not work with it.
I guess that I have to convert Uz_cyl into a variable of volScalarField type. i.e (Foam::GeometricField<double,>::GeometricField(Foa m::IOobject, Foam::Field<double>&)) but I dunno how to fill the three first items... Does anyone knows where is the source that manage the "write" member? Cheers pvc 

August 17, 2007, 07:09 
Did you try something like thi

#9 
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 797
Rep Power: 20 
Did you try something like this?
volScalarField Uz ( IOobject ( "Uz_cyl", runTime.timeName(), mesh, IOobject::NO_READ ), ccs.localVector(U)().component(vector::Y) ); Uz.write(); BTW: in 1.4.1, toLocal() has been eliminated in favour of localPosition() and localVector() If you are using an older version (with toLocal), be certain that the origin == (0,0,0) or you will have very funny results! 

August 20, 2007, 03:49 
Hi mark,
Thanks for answer

#10 
Guest
Posts: n/a

Hi mark,
Thanks for answering... Actually, I am on OF1.4 and .localVector() is not working. I have seen in the User manual (p32) that it was possible to convert Field<type> into volField<type> using fvc::~~ and mesh.~(). So I guess that converting ccs.toLocal(U)() which is a vectorField into volVectorField should be feasible, but I have not found yet how to make it... If I am wrong please let me know, otherwise any idea? Cheers pvc 

October 1, 2009, 05:04 

#11 
Senior Member
Florian Krause
Join Date: Mar 2009
Location: Munich
Posts: 103
Rep Power: 10 
Hi guys!
the last post in this thread is more then 2 years old and related to the use of cylindrical CS in OF1.4 . I am working now with OF1.6.x on a turbulent pipe flow (RANS & LES) with cylindrical cross section. I also want to visualize my fields in a cylindrical CS, lets say (r,teta,z). My question  Are there any changes from OF1.4 to OF1.6.x in how to use the cylindrical CS or can I just try the way Hakan or Hrv explained ??? thanks! Florian 

October 11, 2010, 03:56 
HI

#12 
Senior Member
Join Date: Sep 2010
Location: France
Posts: 224
Rep Power: 9 
Hi me too, i'd like to know if i set in version 1.7 my coord system to cylindrical CS, then all my values will be automatically in (r, teta, and z) directions?
help please 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
RSM value of fluctuating component of velocity  Kushagra  CFX  5  April 10, 2008 15:20 
Gravity component and inlet velocity  Vidya  FLUENT  8  July 31, 2006 08:28 
Radial velocity  Milo  FLUENT  0  February 11, 2006 14:26 
HOW to GET FLUCTUATING VELOCITY COMPONENT at FLUEN  Seyfettin  FLUENT  2  December 1, 2005 04:51 
UDF component in Cyliderical Velocity?  Hongchan Kim  FLUENT  3  April 24, 2001 12:20 