Vortex shedding is a common phenomenon when a fluid flow passes around a body. Here, the vortex shedding of viscoelastic fluid around the oscillating cylinder is simulated. For simulation, a dynamic mesh library is added to OpenFOAM solver viscoelasticFluidFlow. The solver is available only in foam-extended versions.
DynamicMesh settings in OpenFOAM
In dynamicMesh library, there are different methods to handle the grid after cylinder displacement. I used displacementLaplacian in this simulation which solves a Laplace equation to relocate a cell’s vertices in the grid.
where diffusivity and C are the diffusivity coefficient and the position of vertices, respectively. There are several ways to assign diffusivity, here inversePointDistance is chosen where the diffusivity value has an inverse relation with distance to the patch
diffusivity inversePointDistance 1(cylinder);
The cylinder displacement is considered via the oscillatingDisplacement boundary condition. This BC needs two entries: oscillating velocity (omega) and amplitude.
Drag and lift force calculation
Also, the forces library is modified to compute lift and drag on viscoelastic fluid flow. The implemented code for forces is available here. The lift and drag coefficient is shown below.