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:
centre (0 0 0); //by default (0 0 0)
axis (0 0 1);
value uniform (0 77 133);
Were you able to get the information about axis and center?
I dont know if the axis is in cartesion cordinate system or cylindrical.
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,
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.
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?
cylindricalInletVelocity needs revision
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()
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 =
//recall: hatAxis^hatRadial=hatTangential, therefore tangVelo = omega*hatTangential
operator==(tangVelo + axis_*axialVelocity_ + radialVelocity_*d);
//splice xyz components from tangential-axial-radial
The modified library allows for a more convenient specification, namely
axis (0 0 1);
centre (0 0 0);
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
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!
OpenFoam 2.1 version version
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
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
Use of classical cylindricalInletVelocity in OF 2.0.x
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 :
Anyone has an idea? I am no OF expert, so I don't even understand what the error means...
Thanks in advance !
What does your initial condition file for U look like?
The cylindricalInletVelocity of OF2.x should work.
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
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
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:
(rpm*constant::mathematical::pi/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.
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.
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 ;)?
you can find the appropriate file for OF-1.6-ext at
How would you proceed if your inlet velocity components were all functions of the radial direction:
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)
were you able to adapt the BC with the radius dependant values? I would also need such a BC.
|All times are GMT -4. The time now is 23:30.|