CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

cylindricalInletVelocity OpenFOAM

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

Like Tree3Likes
  • 2 Post By AlanR
  • 1 Post By amwouden

Reply
 
LinkBack Thread Tools Display Modes
Old   November 23, 2010, 09:28
Default cylindricalInletVelocity OpenFOAM
  #1
Member
 
alessio.nz's Avatar
 
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 7
alessio.nz is on a distinguished road
Hi,

Is there a paper/document which explains the meaning of the cylindricalInletVelocity Boundary Condition for OpenFOAM? I need to set up an inlet velocity in a tube with the following features: 133 m/s axial velocity, 0 m/s radial, 77 m/s tangential (clockwise). I tried to use the following BC available but there are some lines I don't get, like: axis (0 0 1) , centre (0 0 0).

Can someone help me?

The BC is the following:

type cylindricalInletVelocity;
axialVelocity 133;
tangentialVelocity 77;
centre (0 0 0); //by default (0 0 0)
axis (0 0 1);
rpm 0;
radialVelocity 0;
value uniform (0 77 133);
alessio.nz is offline   Reply With Quote

Old   March 2, 2011, 21:23
Default
  #2
Member
 
N. A.
Join Date: May 2010
Posts: 64
Rep Power: 7
N. A. is on a distinguished road
Hey Alessio,

Were you able to get the information about axis and center?

I dont know if the axis is in cartesion cordinate system or cylindrical.

Thanks,
Nir
N. A. is offline   Reply With Quote

Old   March 3, 2011, 02:55
Default
  #3
Member
 
Alan Russell
Join Date: Aug 2009
Location: Boise, Idaho USA
Posts: 61
Rep Power: 7
AlanR is on a distinguished road
Alessio,

The best way to understand OF is to look at the source code. For your BC, look in src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity. Looking through the .C and .H files usually tells you a lot. I think the Center (0 0 0) is the center of your cylindrical inlet, which is set to (0 0 0) by default. If your mesh geometry is different, use the input vector to align it. The axis vector is to specify the direction of axial flow (0 0 1) being positive z.

I usually search the forum to see if there are relevant posts, then I will look through the source code. Good luck,

Alan
babakflame and Howard like this.
AlanR is offline   Reply With Quote

Old   March 3, 2011, 08:52
Default
  #4
Member
 
alessio.nz's Avatar
 
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 7
alessio.nz is on a distinguished road
Hi Nir, the system I was talking about was cylindrical. Axis and center refers to the mesh ones. The axis is the z, also considered as axial.
alessio.nz is offline   Reply With Quote

Old   March 3, 2011, 08:57
Default
  #5
Member
 
alessio.nz's Avatar
 
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 7
alessio.nz is on a distinguished road
Hi Alan, the problem was not so trivial: if you consider the situation, what I needed was a flow with axial and tangential velocity. The axial velocity of 133 m/s and tangential one of 77 m/s. The tangential obtained in the BC of Cyl BC was not the right one, because it is depented on the radius of the inlet tube, meaning that if I have a rpm value and a diameter, this tangential velocity is radius dependent, while, what I actually need, is a uniform tangential velocity (which has to recreate the swirler conditions). What I would like to set up a tangential velocity as I could do for the radial one (see the lines). Do you think is it possible?
alessio.nz is offline   Reply With Quote

Old   April 26, 2011, 11:41
Default cylindricalInletVelocity needs revision
  #6
New Member
 
Alex Wouden
Join Date: Jun 2010
Location: State College, PA
Posts: 5
Rep Power: 7
amwouden is on a distinguished road
Send a message via Skype™ to amwouden
Alex, the case you described is exactly what I've wanted from the cylindricalInletVelocity condition. The best way I found was to just modify the source code. The modified library is attached.

Firstly, there are a few things that I have learned.
1) the center point is in Cartesian coordinates; very few, if any, OpenFoam utilities are in Cylindrical coordinates

2) at no point in the library is a component defined in Cylindrical coordinates. Rather, radial and tangential are defined in the form (x-contribution, y-contribution, 0)

3) the specification for the radial and tangential velocities are incorrectly scaled. Note below that the variable "d" is the relative radial-tangential distance between the cell-face center and the "centre". The "d" used in subsequent calculations should be replaced with a "dhat" where

vectorfield dhat = d/mag(d)

This adjustment should clear the radial-dependent scaling on the components.

As contained in cylindricalInletVelocityFvPatchVectorField.C (I've added a few comments):

// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cylindricalInletVelocityFvPatchVectorField:: updateCoeffs()
{
if (updated())
{
return;
}
vector hatAxis = axis_/mag(axis_); //unit-vector of axial coordinate
vectorField r = (patch().Cf() - centre_); //relative distance vector
vectorField d = r - (hatAxis & r)*hatAxis; //subtract out axial component
vectorField tangVelo =
(rpm_*mathematicalConstant:: pi/30.0)*(hatAxis)^d;
//recall: hatAxis^hatRadial=hatTangential, therefore tangVelo = omega*hatTangential
operator==(tangVelo + axis_*axialVelocity_ + radialVelocity_*d);
//splice xyz components from tangential-axial-radial
fixedValueFvPatchField<vector>::updateCoeffs();
}


The modified library allows for a more convenient specification, namely
inlet
{
type cylindricalInletVelocity;
axis (0 0 1);
centre (0 0 0);
radialVelocity -10;
tangentVelocity 10;
axialVelocity 30;
value (0 0 0);
//the value is not really necessary for the condition but OpenFOAM give me an error if I don't include it.
}


I've attached the new library folder. Simply unzip the folder into a convenient place and run

wmake libso
Attached Files
File Type: zip cylindricalInletVelocity.zip (42.5 KB, 169 views)
amwouden is offline   Reply With Quote

Old   May 2, 2011, 12:01
Default
  #7
Member
 
alessio.nz's Avatar
 
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 7
alessio.nz is on a distinguished road
Thanks Alex, it is very usefull!

considering I am not very familiar with the libraries, if I compile this version you attached, which has got the same name of the default one in OF, do you suggest me to change the name, or simply shall I compile and then the previous default one will be replaced?

i will try to run simulation and check if it works, with the inlet values you gave me.

thanks for the help!

cheers,

alessio
alessio.nz is offline   Reply With Quote

Old   March 28, 2012, 14:33
Default OpenFoam 2.1 version version
  #8
New Member
 
Alex Wouden
Join Date: Jun 2010
Location: State College, PA
Posts: 5
Rep Power: 7
amwouden is on a distinguished road
Send a message via Skype™ to amwouden
In OpenFOAM 2.1, the compiling structure has changed to some degree. Attached is the drop-and-run source code for the cylindricalInletVelocity. Because OF2.1 has a native condition of the same name (which I have reservations against using for the reasons in a previous post), the name of the condition has been altered to cylindricalVelocityInlet.

1) uncompress the file to a convenient location. I use my openfoam user folder.

2) compile using: wmake libso

3) the boundary condition should compile smoothly. The condition can be applied to the velocity on a patch. in the initial condition specify

type cylindricalVelocityInlet;
axis (x y z); // axis of rotation
centre (x y z); // axial center
radialVelocity scalar; // V_r
tangentVelocity scalar; // V_theta
axialVelocity scalar; // V_z
value uniform (0 0 0); // not necessary, but paraView results in an
error without it
Attached Files
File Type: zip cylindricalVelocityInlet.zip (7.7 KB, 127 views)
S_teph_2000 likes this.
amwouden is offline   Reply With Quote

Old   March 25, 2013, 13:56
Default Use of classical cylindricalInletVelocity in OF 2.0.x
  #9
New Member
 
Gregory Paladin
Join Date: Jul 2012
Posts: 10
Rep Power: 4
paladin is on a distinguished road
Hi Foamers !

I am trying to simulate a swirling flow with an anular inlet, and therefore I'd like to use the cylindricalInlet Velocity. (OF 2.0.x)

I'll have to run my simulation on a cluster so I can't use any additional user library suggested above...

Does anyone knows if this boundary condition works properly?

Even when I change de rpm, the velocities, etc, i still get this error :

Code:
Starting time loop
Courant Number mean: 4.24721e-05 max: 0.0535831
deltaT = 2.85714e-06
Time = 2.85714e-06
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0

--> FOAM FATAL ERROR: 
attempted copy of a deallocated temporary
    From function Foam::tmp<T>::tmp(const tmp<T>&)
    in file /Volumes/OF/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/tmpI.H at line 63.
FOAM aborting
The same simulation with a simple "fixed value" condition and an axial component works just fine.

Anyone has an idea? I am no OF expert, so I don't even understand what the error means...

Thanks in advance !
paladin is offline   Reply With Quote

Old   March 25, 2013, 14:16
Default
  #10
New Member
 
Alex Wouden
Join Date: Jun 2010
Location: State College, PA
Posts: 5
Rep Power: 7
amwouden is on a distinguished road
Send a message via Skype™ to amwouden
What does your initial condition file for U look like?

The cylindricalInletVelocity of OF2.x should work.
amwouden is offline   Reply With Quote

Old   March 25, 2013, 14:55
Default
  #11
New Member
 
Gregory Paladin
Join Date: Jul 2012
Posts: 10
Rep Power: 4
paladin is on a distinguished road
Here is the burner geometry : http://cl.ly/NpGk

My swirling jet is between the bluff body (r=25mm) and the annular shroud (r=30mm)

The axial velocity is 16.3m/s and the tangential velocity 25.9m/s. Axis is in the X direction.

Here is my boundary condition in 0/U

Code:
	Pilot
	{
	
	type cylindricalInletVelocity;
	axis (1 0 0);
	centre (0 0 0);
	axialVelocity 16.3;
	rpm 8244; 
	radialVelocity 0;
	value uniform (0 0 0);
	}

RPM 8244 seems high but 25.9m/s tangential velocity for a 30mm annulus... I double checked the maths.

I had to put a "value" keyword, otherwise it doesn't run.


Thanks for your help
paladin is offline   Reply With Quote

Old   March 25, 2013, 16:01
Default
  #12
New Member
 
Alex Wouden
Join Date: Jun 2010
Location: State College, PA
Posts: 5
Rep Power: 7
amwouden is on a distinguished road
Send a message via Skype™ to amwouden
After looking into it a bit further, I am noticing the same error with the native bc that is available.

The error is associated with the handling of the tangential component. In the source code:

tmp<vectorField> tangVel
(
(rpm*constant::mathematical:i/30.0)*(hatAxis) ^ d
);

By some unknown reason, it is trying use this variable without allocating it properly.
Unless you can modify the source code or use one of the user libraries above. I don't know what to suggest.
amwouden is offline   Reply With Quote

Old   April 24, 2013, 17:25
Default
  #13
Member
 
Vishal Achasrya
Join Date: Nov 2011
Posts: 30
Rep Power: 5
vishalsacharya is on a distinguished road
Why cant you use the user libraries on a cluster?

I know the installation is in a non-default place and the env vars are set based on those. But the *_USER dirs can be set to you where you want your src and lib folders to be and then when you "wmake libso" user codes, it would put them there. Then you can just add the appropriate .so files to your controldict and it should work.
vishalsacharya is offline   Reply With Quote

Old   May 9, 2014, 04:02
Default
  #14
New Member
 
Join Date: May 2013
Posts: 1
Rep Power: 0
marcaurel is on a distinguished road
Hi Alex!

I'm using OpenFOAM 1.6-ext and I would also like to use your cylindricalInletVelocity BC. Have you already adjusted your version to OF 1.6-ext because there is a big difference to OF 2.x and my programming knowledge is a bit limited ?

BR
Markus
marcaurel is offline   Reply With Quote

Old   May 14, 2014, 04:16
Default
  #15
Member
 
don lenardo
Join Date: Nov 2010
Posts: 75
Rep Power: 6
lentschi is on a distinguished road
Hello Markus,

you can find the appropriate file for OF-1.6-ext at

http://www.cfd-online.com/Forums/ope...tml#post305143
lentschi is offline   Reply With Quote

Old   August 28, 2014, 01:28
Default help
  #16
New Member
 
Ndong-Mefane Stephane Boris
Join Date: Nov 2013
Location: Kawasaki (JAPAN)
Posts: 14
Rep Power: 3
S_teph_2000 is on a distinguished road
Quote:
Originally Posted by amwouden View Post
In OpenFOAM 2.1, the compiling structure has changed to some degree. Attached is the drop-and-run source code for the cylindricalInletVelocity. Because OF2.1 has a native condition of the same name (which I have reservations against using for the reasons in a previous post), the name of the condition has been altered to cylindricalVelocityInlet.

1) uncompress the file to a convenient location. I use my openfoam user folder.

2) compile using: wmake libso

3) the boundary condition should compile smoothly. The condition can be applied to the velocity on a patch. in the initial condition specify

type cylindricalVelocityInlet;
axis (x y z); // axis of rotation
centre (x y z); // axial center
radialVelocity scalar; // V_r
tangentVelocity scalar; // V_theta
axialVelocity scalar; // V_z
value uniform (0 0 0); // not necessary, but paraView results in an
error without it
Hello,

How would you proceed if your inlet velocity components were all functions of the radial direction:

type cylindricalVelocityInlet;
axis (x y z); // axis of rotation
centre (x y z); // axial center
radialVelocity scalar; // V_r =f1(r)
tangentVelocity scalar; // V_theta =f2(r)
axialVelocity scalar; // V_z=f3(r)

Stephane
S_teph_2000 is offline   Reply With Quote

Old   February 10, 2015, 05:21
Default cylindricalInletVelocity
  #17
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 129
Rep Power: 7
Chrisi1984 is on a distinguished road
Hello Stephane,

were you able to adapt the BC with the radius dependant values? I would also need such a BC.

Kind regards

Chrisi
Chrisi1984 is offline   Reply With Quote

Old   May 7, 2015, 11:58
Default
  #18
Member
 
Howar
Join Date: Mar 2015
Posts: 42
Rep Power: 2
Howard is on a distinguished road
Quote:
Originally Posted by AlanR View Post
Alessio,

The best way to understand OF is to look at the source code. For your BC, look in src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity. Looking through the .C and .H files usually tells you a lot. I think the Center (0 0 0) is the center of your cylindrical inlet, which is set to (0 0 0) by default. If your mesh geometry is different, use the input vector to align it. The axis vector is to specify the direction of axial flow (0 0 1) being positive z.

I usually search the forum to see if there are relevant posts, then I will look through the source code. Good luck,

Alan
Hello, Friends! I think what you said is quite meaningful. Could I ask how learn these information or skills, learning C++? And like this situation, how do you know to look up the SRC/...derived document? Thank you!
Howard 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 05:56
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


All times are GMT -4. The time now is 03:00.