CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

pimpleFoam - Flow across an oscillating cylinder simulation crashing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2019, 17:42
Default pimpleFoam - Flow across an oscillating cylinder simulation crashing
  #1
New Member
 
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8
iceman53y is on a distinguished road
Hi,

I am an openFoam newbie. So please be kind.

I am trying to determine the lift and drag coefficients of an oscillating cylinder located inside a bundle of static cylinders.

This what I have done so far:

1. I have created a geometry and mesh through GMSH and exported to OpenFoam using gmshToFoam. My meshing strategy was to have a structured mesh close to the cylinders that I want to monitor and the rest of the domain has an unstructured mesh.
2. I used a pointDisplacement method to oscillate the cylinder that I wanted to oscillate. I used the displacementLaplacian solver for my dynamicmeshDict.
3. Setup my boundary conditions, in the U and P files. (shared at the bottom of the post)
4. I setup my fvSolution and fvschemes files using a tutorial I found online for an oscillating object. I donot fully understand these files and I feel the problem lies here.

My simulation seems to run fine for some time. The time depends on the size of the mesh and the frequency of the oscillating cylinder. The finer the mesh , the smaller the time the simulation is able to run. The courant number starts to increase gradually, till it explodes or the timestep size decreases to very very low values that the simulation gets stuck. My drag coefficients start to increase exponentially as well when the courant number increases.
I have tried to increase the mesh size, decrease the frequency and amplitude of the oscillating cylinder. I get results that are ok for some time then eventually the courant number starts to increase.

My folder files are larger than the limit of this forum. So I'm sharing a downloadable link below, Additionally at the end of this post I have copied some of my files files.

https://drive.google.com/file/d/1U7m...ew?usp=sharing

Appreciate if someone can take a look and let me know what I am doing wrong.

Oh yes, I am using the pimplefoam solver for this application.

This is what my polyMesh boundary file and the U, P and pointDisplacement files look like.

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

12
(
Frontandback
{
type empty;
physicalType empty;
inGroups 1(empty);
nFaces 31380;
startFace 25646;
}
Tube_NW
{
type patch;
physicalType patch;
nFaces 56;
startFace 57026;
}
Tube_W
{
type patch;
physicalType patch;
nFaces 56;
startFace 57082;
}
Tube_NE
{
type patch;
physicalType patch;
nFaces 56;
startFace 57138;
}
Tube_C
{
type patch;
physicalType patch;
nFaces 56;
startFace 57194;
}
Tube_SW
{
type patch;
physicalType patch;
nFaces 56;
startFace 57250;
}
Tube_E
{
type patch;
physicalType patch;
nFaces 56;
startFace 57306;
}
Tube_SE
{
type patch;
physicalType patch;
nFaces 56;
startFace 57362;
}
Wall
{
type patch;
physicalType patch;
nFaces 300;
startFace 57418;
}
Outlet
{
type zeroGradient;
physicalType zeroGradient;
inGroups 1(zeroGradient);
nFaces 23;
startFace 57718;
physicalType zeroGradient;
}
Inlet
{
type patch;
physicalType patch;
nFaces 23;
startFace 57741;
}
Remaining_tubes
{
type patch;
physicalType patch;
nFaces 528;
startFace 57764;
}
)

// ************************************************** *********************** //
Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (2 0 0);

boundaryField
{
Frontandback
{
type empty;
}
Tube_NW
{
type fixedValue;
value uniform (0 0 0);
}
Tube_W
{
type fixedValue;
value uniform (0 0 0);
}
Tube_NE
{
type fixedValue;
value uniform (0 0 0);
}
Tube_C
{
type movingWallVelocity;
value uniform (0 0 0);
}
Tube_SW
{
type fixedValue;
value uniform (0 0 0);
}
Tube_E
{
type fixedValue;
value uniform (0 0 0);
}
Tube_SE
{
type fixedValue;
value uniform (0 0 0);
}
Wall
{
type fixedValue;
value uniform (0 0 0);
}
Outlet
{
type zeroGradient;
}
Inlet
{
type fixedValue;
value uniform (0.1 0 0);
}
Remaining_tubes
{
type fixedValue;
value uniform (0 0 0);
}
}


// ************************************************** *********************** //
Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
Frontandback
{
type empty;
}
Tube_NW
{
type zeroGradient;
}
Tube_W
{
type zeroGradient;
}
Tube_NE
{
type zeroGradient;
}
Tube_C
{
type zeroGradient;
}
Tube_SW
{
type zeroGradient;
}
Tube_E
{
type zeroGradient;
}
Tube_SE
{
type zeroGradient;
}
Wall
{
type zeroGradient;
}
Outlet
{
type fixedValue;
value uniform 0;
}
Inlet
{
type zeroGradient;
}
Remaining_tubes
{
type zeroGradient;
}
}


// ************************************************** *********************** //
Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
location "0";
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 0 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
Frontandback
{
type empty;
}
Tube_NW
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Tube_W
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Tube_NE
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Tube_C
{
type oscillatingDisplacement;
omega 69.934;
amplitude ( 0.002 0 0 );
value uniform ( 0 0 0 );
}
Tube_SW
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Tube_E
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Tube_SE
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Wall
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Outlet
{
type zeroGradient;
}
Inlet
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
Remaining_tubes
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}
}


// ************************************************** *********************** //
Following is my dynamicMeshDict

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ( "libfvMotionSolvers.so" );

solver displacementLaplacian;


displacementLaplacianCoeffs
{
diffusivity inverseDistance 1(Tube_C);
}
//Trying to oscillate Tube_C here




// ************************************************** *********************** //
Following is the fvSolution file.

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
pcorrFinal
{
solver GAMG;
tolerance 0.02;
relTol 0;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration no;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

p
{
solver GAMG;
tolerance 0;
relTol 0.01;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration no;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

pFinal
{
$p;
tolerance 1e-06;
relTol 0;
}

U
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-05;
relTol 0.1;
}

UFinal
{
$U;
tolerance 1e-05;
relTol 0;
}

cellMotionUx
{
solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0;
}
cellMotionUxFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0;
}

"cellDisplacement.*"
{
solver GAMG;
tolerance 1e-5;
relTol 0;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

}

PIMPLE
{
correctPhi yes;
nOuterCorrectors 2;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 1001;
pRefValue 0;
}

relaxationFactors
{
fields
{
}
equations
{
"U.*" 1;
}
}

// ************************************************** *********************** //
Thank you.
iceman53y is offline   Reply With Quote

Old   September 5, 2019, 23:42
Default
  #2
New Member
 
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8
iceman53y is on a distinguished road
Fixed it.

Embarrassing error
iceman53y is offline   Reply With Quote

Old   November 27, 2019, 06:13
Default
  #3
New Member
 
Daniel Duque
Join Date: Jan 2011
Location: ETSIN, Madrid
Posts: 28
Rep Power: 15
dduque is on a distinguished road
So, what was the error ??
dduque is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag force coefficient too low for a flow past cylinder at Re= 1e05 Scabbard STAR-CCM+ 2 June 5, 2020 15:44
Drag Coefficient calculation for flow over a 2D Cylinder at High Reynodls Numbers DanielBarreiro CFX 13 February 26, 2019 10:40
Incorrect Drag and Drag Coefficient for flow over a cylinder ozzythewise Main CFD Forum 8 June 13, 2012 07:24
Oscillating Cylinder in Parallel Flow: Analytical Solution startingcfd Main CFD Forum 7 March 23, 2012 06:49
Simulation of the Flow past a circular cylinder using STAR-CD M. S. GUEROUACHE Main CFD Forum 0 October 1, 1998 11:51


All times are GMT -4. The time now is 15:50.