# Difference between revisions of "Inline oscillating cylinder by Michael Alletto"

Go back to Collection by authors.

Go back to Meshing.

Go back to Turbulence.

# Inline oscillating cylinder

## Introduction

In this tutorial we will examine the inline oscillatory motion of a cylinder in a uniform ow. Inline means that the cylinder is oscillating parallel to the incoming flow. This kind of configuration is often used to validate solvers aiming to simulate large body motions (see e.g. [1, 4, 5]). The reason is that that despite its simplicity this configuration is associated with a variety of complex physical phenomena.

One of this phenomena are frequency lock in: When the frequency of the oscillating cylinder is close to twice the shedding frequency of the stationary cylinder fst, the frequency of the vortices shed became equal to the one of the cylinder. The amplitude of the cylinder motion which is required to maintain the lock in regime is increasing with departure from twice the shedding frequency of a fixed cylinder [2].

Another interesting phenomena is the increase of the lift coefficient Cl when the cylinder is oscillating at 2fst [6]. For frequencies which are either lower or higher than 2fst Cl is much lower [6]. [3] made simulations with an in line oscillating cylinder at a Reynolds number of Re = 175. For this Re number the ow around a fixed cylinder is two dimensional. For an oscillation frequency fc of 2fst and an amplitude of 65% of the cylinder diameter the frequency spectrum of the lift force increases considerably. For lower amplitudes of the oscillation only a few peaks are present in the frequency spectrum. In order to simulate this kind of ow congurations, OpenFOAM offers two different approaches: the overset methodology and the morphing mesh method. The latter can be used if the cylinder motion is not to large to deteriorate the mesh quality. Regarding the overset method we have one or more meshes which displace relative to a background mesh. The coupling between the moving meshes and the background mesh is achieved via interpolation of the ow quantities. Regarding the morphing mesh, the connectivity between the cells remain unchanged.However the position of the points building a cell can move relative to each other.

Since both methods described above can be used to simulate the flow of an inline oscillating cylinder, both methods can be compared against each other besides the validation against experiments and other simulations. The comparison of this two methods and the validation against experiments is the purpose of this tutorial.

## Set up

The figure below shows the setup of the simulation: At the inflow a uniform velocity of Uinf = 1 m/s in x-direction is applied. The pressure is set to zero gradient at this boundary. At the top and bottom walls a slip boundary condition is applied. At the outlet the pressure is to be set equal to zero and for the velocity a zero gradient boundary condition is applied. The kinematic viscosity ν = 0.01 m^2/s is set in order that the Reynolds number Re = Uinf D / ν based on the cylinder diameter D = 1 m is equal to Re = 100. For this Reynolds number the flow over a stationary cylinder is two dimensional. For this reason the flow is assumed to be two dimensional. This is imposed by using only one cell in span wise direction and setting both boundary conditions in this direction to the type empty. At the cylinder wall a no slip boundary condition is applied for the velocity and zero gradient for the pressure. The cylinder oscillates in x-direction with a prescribed sinosoidal motion: xc = A sin(2π fc t) = A sin (ω t). Four different frequencies are computed: fc = 0, 0.16, 0.33, 0.66 s^(-1). The amplitude is set to A = 0.14m. The purpose of this tutorial was to check whether the increase of the lift at fc = 2fst can be captured and if both techniques to simulate moving bodies deliver comparable results.

## Mesh generation

The mesh used for the overset mesh simulation is shown in the figure below. We can see that it is formed by the mesh surrounding the cylinder and the background mesh. The mesh surrounding the cylinder is generated by simply stretching the circular form of the cylinder outward. The background mesh consist of a rectangular block mesh with different refinement zones. In the outer part of the rectangle where the gradients of the flow field are smaller, a coarser mesh is used. Closer to the region surrounding the cylinder the mesh is finer. Note that when generating an overset mesh, it has to be paid attention that the cells at the intersection of the moving and the background mesh should have roughly the same size to minimize the interpolation errors.

The figure below shows the morphing mesh. It is generated using the utility blockMesh. Note that the dictionary for the generation of the mesh was taken from here and slightly modified in order to adept it to the present test case. It is evident that the constitution of the mesh is much more complex compared to the overset mesh. The number of cells of both meshes are similar: roughly 10 000 for the overset mesh and roughly 12 000 for the morphing mesh.

## Simulation set up

Since the procedure how to set up a overset mesh is described in other tutorials, here we will concentrate on the difference on how to describe the body motion between the overset mesh and the morphing mesh.

Regarding the overset mesh the solid body motion has to be prescribed in the constant/dynamicMeshDict:

```motionSolverLibs ( "libfvMotionSolvers.so" );
solver          displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity     uniform 1;
}
dynamicFvMesh       dynamicOversetFvMesh;
dynamicOversetFvMeshCoeffs
{
//    layerRelax 0.3;
}
solver          multiSolidBodyMotionSolver;
multiSolidBodyMotionSolverCoeffs
{
movingzone
{
solidBodyMotionFunction oscillatingLinearMotion;
oscillatingLinearMotionCoeffs
{
amplitude ( -0.14 0 0);
omega 1.04;
}
}
}

```

The type of motion and the mesh zone which has to perform this prescribed motion has to be specified. In our case the mesh zone named movingzone has to describe an oscillatory motion in x-direction with an amplitude of A = 0.14 m and a frequency of ω = 1.04 rad/s.

Regarding the morphing mesh, the displacement is described via the boundary condition of the field pointDisplacement:

```
dimensions      [0 1 0 0 0 0 0];
internalField   uniform (0 0 0);
boundaryField
{
topAndBottom
{
type            uniformFixedValue;
uniformValue    (0 0 0);
}
inlet
{
type            uniformFixedValue;
uniformValue    (0 0 0);
}
outlet
{
type            uniformFixedValue;
uniformValue    (0 0 0);
}
cylinder
{
type            oscillatingDisplacement;
amplitude       ( -0.14 0 0 );
omega           1.04;
value           uniform (0 0 0);
}
frontAndBack
{
type            empty;
}
}

```

We see that the in this case the displacement of the cylinder is imposed by specifying the type of motion the boundary patch named cylinder has to perform. All other boundary patches do not move and hence the value of the field pointDisplacement is set to uniform (0 0 0).

The method used to relax the cylinder movement towards the fixed outer boundary is specified in the constant/dynamicMeshDict:

```
dynamicFvMesh   dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solver          displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity  inverseDistance 1(cylinder);
}

```

## References

[1] Dominic D Chandar, Bharathi Boppana, and Vasanth Kumar. A comparative study of different overset grid solvers between openfoam, star-ccm+ and ansys-fluent. In 2018 AIAA Aerospace Sciences Meeting, page 1564, 2018.

[2] Owen M Griffn and MS Hall. Vortex shedding lock-on and flow control in bluff body wakes. 1991.

[3] Justin S Leontini, David Lo Jacono, and Mark C Thompson. A numerical study of an inline oscillating cylinder in a free stream. Journal of Fluid Mechanics, 688:551-568, 2011.

[4] Chuan-Chieh Liao, Yu-Wei Chang, Chao-An Lin, and JM McDonough. Simulating flows with moving rigid boundary using immersed-boundary method. Computers & Fluids, 39(1):152-167, 2010. 11

[5] Shen-Wei Su, Ming-Chih Lai, and Chao-An Lin. An immersed boundary technique for simulating complex flows with rigid boundary. Computers & Fluids, 36(2):313-324, 2007.

[6] Y Tanida, A Okajima, and Y Watanabe. Stability of a circular cylinder oscillating in uniform ow or in a wake. Journal of Fluid Mechanics, 61(4):769-784, 1973.

[7] Charles HK Williamson. Vortex dynamics in the cylinder wake. Annual review of Fluid mechanics, 28(1):477-539, 1996.