# Time-Varying Cylinder Motion in Cross-flow: timeVaryingFixedUniformValue

This post is a simple demonstration of the timeVaryingFixedUniformValue boundary condition. This boundary condition allows a Dirichlet-type boundary condition to be varied in time. To demonstrate, we will modify the oscillating cylinder case.

## Set-Up

Instead of using the oscillating boundary condition for point displacement. We will have the cylinder do two things:

• Move in a circular motion
• Move in a sinusoidal decay motion

The basics of this boundary condition are extremely simple. Keep in mind that although (here) we are modifying the pointDisplacement boundary condition for the cylinder, the basics of this BC would be the same if you were doing a time varying boundary condition for say pressure or velocity.

In the pointDisplacement file:

 cylinder
{
type timeVaryingUniformFixedValue;
fileName "prescribedMotion";
outOfBounds clamp;
}

fileName points to the file where the time varying boundary condition is defined. Here we used a file called prescribedMotion however you can name it whatever you want. The outOfBounds variable dictates what the simulation should do if the simulation time progresses outside of the time domain defined in the file.

The additional file containing the desired motion prescribedMotion is formatted in the following way:

(
( 0 (0 0 0))
( 0.005 (-0.0000308418795848531 0.00392682932795517 0))
( 0.01 (-0.0001233599085671 0.00785268976953207 0))
( 0.015 (-0.000277531259507496 0.0117766126774107 0))
( 0.02 (-0.00049331789293211 0.0156976298823283 0))
...
( 9.99 (-0.0001233599085671 -0.00785268976953189 0))
( 9.995 (-0.0000308418795848531 -0.00392682932795479 0))
( 10 (0 -3.06161699786838E-016 0))
)

The first column is the time in seconds, and the vector defines the point displacement. In the present tutorial, these points were calculated in libreOffice and then exported into the text file.  I arbitrarily made up the motions purely for the sake of making this blog post.

The circular motion was defined as:

$x=0.25\cos\left(\pi t\right)-0.25$ and $y=0.25\sin\left(\pi t\right)$

Decaying sinusoidal motion was:

$y=\sin(\pi t) \exp\left(-t/2\right)$

The rest of the set-up is identical to the set-up in the oscillating cylinder example. The solver pimpleDyMFoam is then run.

## Conclusions

This post demonstrated how a more complicated motion can be prescribed by using a little math and the timeVaryingUniformFixedValue boundary condition. Always like to hear questions and comments! Has anybody else done something like this?

Categories

Tags

## 5 thoughts on “Time-Varying Cylinder Motion in Cross-flow: timeVaryingFixedUniformValue” Leave a comment ›

1. Elaud says:

I did the same thing by modify your previous example. But me I just execute the simulation for 0.1 second. After 0.1 second, I modify the amplitude and omega and execute the simulation again for 0.1 second.

2. deepthi says:

Thank you for a useful tutorial.
Can the circular motion be given as an expression instead of giving the coordinates at every instant?
Kindly give the format.

• I’m not actually sure. If not you could create your own boundary condition. This would require you to familiarize yourself with the code. I think using the list of points is a simpler option.

• deepthi says:

Thank you. I will check it.

• I’m new enough to OpenFOAM that I’m not sure where the prescribedMotion file ought to be located. In what directory should the prescribedMotion file be placed? Also, on the topic of using an expression rather than a list of coordinates, could this be easily accomplished with swak4Foam?

This site uses Akismet to reduce spam. Learn how your comment data is processed.