CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to use rotatingWallVelocity boundary condition (https://www.cfd-online.com/Forums/openfoam/68046-how-use-rotatingwallvelocity-boundary-condition.html)

terrybarnaby September 4, 2009 04:14

How to use rotatingWallVelocity boundary condition
 
Does anyone know how to use the "rotatingWallVelocity" boundary condition ?
I can't see any info on this in the docs or forum.
I am trying to simulate a wheel. I currently have the following but simpleFoam is giving the error:

keyword omega is undefined in dictionary "/home/terry/vwt/vwt-wheels"/0/U::car_car

wheel
{
type rotatingWallVelocity;
origin (0 0 0.2);
axis (0 1 0);
rpm 600;
value uniform (0 0 0);
}

ngj September 4, 2009 04:33

Hi Terry

From the error message, it appears that it is the boundary car_car, which is the problem and not wheel.

Best regards,

Niels

terrybarnaby September 4, 2009 04:38

Sorry my fault with the patch name. I changed it when putting it onto the forum, the patch was actually named "car_car" not "wheel" as per the error message. I did this to make things clearer !!

ngj September 4, 2009 04:48

Hi Terry

Is this boundary condition by any chance from 1.6? I cannot find it in my 1.5-installation. The error message tells you that you need to specify "omega", and as I do not have the source, you need to dig into it yourself and find out what omega does.

Best regards,

Niels

terrybarnaby September 4, 2009 04:53

Yes, it is from 1.6.
I think I have found how to use it by looking at the source in rotatingWallVelocityFvPatchVectorField.C
It appears that I need to use omega rather than rpm for the rotational velocity. (rpm was used in another post on the 1.5-dev version).
So I think I need to use:

wheel
{
type rotatingWallVelocity;
origin (0 0 0.2);
axis (0 1 0);
omega 62; // Rotational speed in radians/sec
value uniform (0 0 0);
}

This looks like it works ...

terrybarnaby September 4, 2009 06:20

2 Attachment(s)
The rotatingWallVelocity boundary condition appears to work to some degree, but I am seeing some strange results. This may be me as I am a novice at this, but I wonder if anyone can shed some light.
I have a wind tunnel simulation with a rotating wheel in a 13m/s wind stream. Stream is in the X direction.
Looking at the results using paraview, the wheels surface appears to be rotating by looking at the velocity vector on the surface, see wheel-1.jpg (Looking at U's component in the X direction).
However when I look at U's component in the Y direction I see the view in wheel-2.jpg. (Y plane through wheels axis)

1. I would have thought that U's Y velocity would be the same either side of the wheel (Y) ?
2. The affect of the wheel rotation in th X and Z directions on the surrounding U field looks negligible, I would have thought it would be larger ?

As an aside I would like to caclucate the overall forces on the wheel while rotating. Is the OpenFOAM forces function going to give me correct results with the rotatingWallVelocity boundary condition ?

ngj September 4, 2009 07:14

Hi Terry

The only explanation I can come up with is that the inner product is taken between the surface normal and the axis of rotation (for some reason). This product changes sign between the two sides of the wheel and hence the direction of rotation changes.

See if you can find such a thing in the source.

One way to solve this issue could be to make two boundaries, one for each side of the wheel. This is cumbersome, however it might work.

Bests,

Niels

terrybarnaby September 4, 2009 16:41

Doh! I just thought about this and what I see is correct. There is a "road" below the wheel and the air is drawn downwards at the front of the wheel and goes out in the y+ direction on one side and the y- direction on the other side.

The only question now is if I can calcucate the overall forces on the wheel while rotating. Is the OpenFOAM forces function going to give me correct X direction results with the rotatingWallVelocity boundary condition ?

lth November 24, 2009 15:35

how can a 1.5 user get the source for movingRotatingWallVelocity?
 
I am running a screw chamber and would like to use movingRotatingWallVelocity as a boundary condition for my chamber velocity. Cannot find this code and assume it is in the latest version of 1.6 only, but is there an option for this b.c. in the 1.5 version of OF?

Sincerely, Lori Holmes:confused:

gpextra July 9, 2011 14:58

rotatingWallVelocity with wrong results
 
2 Attachment(s)
Dear colleagues,

I am making use of this post to show you a similar problem I have had using rotating walls with OpenFoam. I am a beginner (in OpenFoam) and this is the case:

It is a lid-driven cavity problem where the lid is not flat, but a rotating cylinder. The solver was icoFoam from OpenFoam 2.0.0. Conceptually this is exactly the same old 2D lid-driven cavity, but with this slightly different geometry. The internal flow details are unimportant and I will focus only on the wall velocity. This is part of the mesh dictionary to illustrate the very simple geometry:

convertToMeters 0.001;
vertices
(
(0 0 0) // 0
(1 0 0) // 1
(1 1 0) // 2
(0 1 0) // 3
(0 0 1) // 4
(1 0 1) // 5
(1 1 1) // 6
(0 1 1) // 7
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
);
edges
(
arc 3 2 (0.5 1.5 0)
arc 6 7 (0.5 1.5 1)
);

The velocity boundary condition for the (rotating) lid is is specified as

bump
{
type rotatingWallVelocity;
origin (0.5 1 0);
axis (0 0 1);
omega 0.001; // a rather small value!
}

Well, I would expect that the wall absolute velocity was constant, and the x and y-velocities were of sin or cos shaped. But no! The wall velocity profile, shown in the attached figure, has a misbehaving y-velocity component with one full period of a sine (the x-velocity component is not that bad).

In fact this is a simplified version of my real problem, where I identified this weird behavior, just to illustrate the essence of the problem with rotating walls. I have also attached a zipped file with all the other relevant files, in case someone wants to run the case.

I hope someone can help me with this weirs wall velocity profile.

Regrads,
G.Paulo.

Attesz March 1, 2012 09:14

Hi,

what is the dimension of omega finally? rad/s or rpm?

Attila

lth March 1, 2012 14:28

Quote:

Originally Posted by Attesz (Post 347086)
Hi,

what is the dimension of omega finally? rad/s or rpm?

Attila


answer: rad/s

Attesz March 2, 2012 02:59

Thanks! :)

Attesz March 2, 2012 06:33

I'm getting the following problem. What is wrong here?

--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 60 the doubleScalar 230.383

file: /nobackup/rm/felfoldi/OFsimulation/0/U::boundaryField::rotwall.*::omega at line 60.

From function operator>>(Istream&, word&)
in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting

my code is:

//rotating walls in stn frame

"rotwall.*"
{
type rotatingWallVelocity;
origin (0 0 0);
axis (0 1 0);
omega 230.3834; //rad per sec using 13200 deg/s=2200 rpm value
// type fixedValue;
// value uniform (0 0 0);
}

lth March 5, 2012 10:37

Hello Attesz,

Not sure, but it appears to be a syntax. Not ablet to view your code line numbers, but I would simplify the value of omega to 20.0 at first and rename your b.c. to test. Else follow the lines in the code to the error if you can to see what OpenFOAM is asking for.

Best, Lori

Attesz March 5, 2012 11:35

Hey Lori,

thanks! I already tried omega=1. But I found that I was using a 1 month old release of OF2.1.x, and the more recent version has a bugfix for this. So it was a bug actually.

Best,
Attila

calim_cfd March 5, 2012 20:39

Quote:

Originally Posted by Attesz (Post 347274)
I'm getting the following problem. What is wrong here?

--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 60 the doubleScalar 230.383

file: /nobackup/rm/felfoldi/OFsimulation/0/U::boundaryField::rotwall.*::omega at line 60.

From function operator>>(Istream&, word&)
in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting

my code is:

//rotating walls in stn frame

"rotwall.*"
{
type rotatingWallVelocity;
origin (0 0 0);
axis (0 1 0);
omega 230.3834; //rad per sec using 13200 deg/s=2200 rpm value
// type fixedValue;
// value uniform (0 0 0);
}

hi! your missing the word "constant" in front of omega!!!
Code:

"rotwall.*"
    {
    type        rotatingWallVelocity;
    origin        (0 0 0);
    axis        (0 1 0);
    omega      constant  230.3834;  //rad per sec using 13200 deg/s=2200 rpm value
//    type        fixedValue;
//    value        uniform (0 0 0);
    }

type Kconstant and check the other options, if any!

it might have sth to do with the fact that this bc now allows for time dependent values due to the new class DataEntry!

:D:D:D

lovecraft22 March 20, 2012 09:06

Thank you Mauricio, you really made my day!

Could you please explain how you found that out?

Thank again!

calim_cfd March 20, 2012 09:15

Hi!

i rly needed this bc so i spent some time on it.. OF's error messages follow a pattern and you know how they behave.. so if the error says you should have used a word, i.e., a string instead of a value , number, that's what you have to write in your files. Question is, which word? if you know OF error pattern you know that if you get the entry type right (number or word) it will give you the options if you chose a wrong word or misspelled it. that's what i did.. i gave it a word.. can't say the word i gave it the first time :D... but then it gave me the real options.. and there was the constant one :)

too bad we can't solve all our doubts and errors this one.. but it's a start

bhups45 June 16, 2012 07:17

Quote:

Originally Posted by calim_cfd (Post 350433)
Hi!

i rly needed this bc so i spent some time on it.. OF's error messages follow a pattern and you know how they behave.. so if the error says you should have used a word, i.e., a string instead of a value , number, that's what you have to write in your files. Question is, which word? if you know OF error pattern you know that if you get the entry type right (number or word) it will give you the options if you chose a wrong word or misspelled it. that's what i did.. i gave it a word.. can't say the word i gave it the first time :D... but then it gave me the real options.. and there was the constant one :)

too bad we can't solve all our doubts and errors this one.. but it's a start

Hello all,
I am also simulating the case of rotating cylinder using icoFoam solver.

But giving these boundary conditions are also not producing any difference in the results in OpenFoam 210I am quite new to openfoam... pls somebody help me

Thanx in advance...


All times are GMT -4. The time now is 20:32.