CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

Visualization of the radial velocity component

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 3 Post By hjasak
  • 1 Post By hani

Reply
 
LinkBack Thread Tools Display Modes
Old   June 28, 2006, 05:57
Default Hallo, I have solved with i
  #1
scurtu
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
  Reply With Quote

Old   June 28, 2006, 20:51
Default 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: 697
Rep Power: 10
msrinath80 is on a distinguished road
See http://www.opencfd.co.uk/openfoam/do...5-250002.1.5.7
msrinath80 is offline   Reply With Quote

Old   June 29, 2006, 02:55
Default Hi, thank you pUl| for the
  #3
scurtu
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
  Reply With Quote

Old   June 29, 2006, 18:39
Default Hi, I wrote a simple dirty
  #4
osn
New Member
 
Os N
Join Date: Mar 2009
Posts: 2
Rep Power: 0
osn is on a distinguished road
Hi,

I wrote a simple dirty program to calc angular velocity.
It is from OpenFOAM-1.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();
osn is offline   Reply With Quote

Old   June 30, 2006, 05:05
Default Dear Osamu that's what I n
  #5
scurtu
Guest
 
Posts: n/a
Dear Osamu

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

Nicoleta
  Reply With Quote

Old   June 30, 2006, 05:25
Default A thousand time easier: OpenFO
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,749
Rep Power: 20
hjasak will become famous soon enough
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 x-y 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
renyun0511, nygbook and mgg like this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 6, 2006, 05:57
Default I've been trying to learn how
  #7
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 185
Rep Power: 7
hani is on a distinguished road
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
calim_cfd likes this.
hani is offline   Reply With Quote

Old   August 17, 2007, 06:25
Default ok I finally found that ccs.to
  #8
pvc
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
  Reply With Quote

Old   August 17, 2007, 08:09
Default Did you try something like thi
  #9
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 17
olesen will become famous soon enough
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!
olesen is offline   Reply With Quote

Old   August 20, 2007, 04:49
Default Hi mark, Thanks for answer
  #10
pvc
Guest
 
Posts: n/a
Hi mark,

Thanks for answering...
Actually, I am on OF-1.4 and .localVector() is not working.

I have seen in the User manual (p-32) 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
  Reply With Quote

Old   October 1, 2009, 06:04
Default
  #11
Senior Member
 
Florian Krause
Join Date: Mar 2009
Location: Munich
Posts: 103
Rep Power: 7
florian_krause is on a distinguished road
Hi guys!

the last post in this thread is more then 2 years old and related to the use of cylindrical CS in OF-1.4 .

I am working now with OF-1.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 OF-1.4 to OF-1.6.x in how to use the cylindrical CS or can I just try the way Hakan or Hrv explained ???

thanks!
Florian
florian_krause is offline   Reply With Quote

Old   October 11, 2010, 04:56
Post HI
  #12
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 169
Rep Power: 0
T.D. is on a distinguished road
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
T.D. is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RSM value of fluctuating component of velocity Kushagra CFX 5 April 10, 2008 16:20
Gravity component and inlet velocity Vidya FLUENT 8 July 31, 2006 09: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 13:20


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