CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] OpenFoam Flow over a Circular Cylinder

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By niklas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 10, 2010, 10:18
Question OpenFoam Flow over a Circular Cylinder
  #1
New Member
 
Wolfgang Strauss
Join Date: Nov 2010
Location: Germany / Bavaria / Eichstätt
Posts: 15
Rep Power: 16
WolfgangS. is on a distinguished road
hi guys!

I am doing my first steps to openfoam .. and i need yours help!

I like to simulate a laminar and turbulent flow over a circular cylinder (RANS k-w-Modell, LES). Later i want to simulate the magnus (flow over a rotating circlar cylinder) and inverse magnus effect (maby you know it from sports) for a studyproject.

First i made a big block (will be meshed with blockMesh) in OpenFoam and i want a smaler block, which will be meshed with sappyHexMesh. The cylinder will lie in smaler block.

So i started:

FoamFile
{ version 2.0; format ascii; class dictionary; object blockMeshDict;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(110 0 -200) //0 front circle
(77.781746 77.781746 -200) //1 45 Degrees
(0 110 -200) //2
(-77.781746 77.781746 -200) //3
(-110 0 -200) //4
(-77.781746 -77.781746 -200) //5
(0 -110 -200) //6
(77.781746 -77.781746 -200) //7
(110 0 200) //8 back circle
(77.781746 77.781746 200) //9
(0 110 200) //10
(-77.781746 77.781746 200) //11
(-110 0 200) //12
(-77.781746 -77.781746 200) //13
(0 -110 200) //14
(77.781746 -77.781746 200) //15
(-1100 -1100 -200) //16 front big block
(3300 -1100 -200) //17
(3300 1100 -200) //18
(-1100 1100 -200) //19
(-1100 -1100 200) //20 back big block
(3300 -1100 200) //21
(3300 1100 200) //22
(-1100 1100 200) //23
);

blocks
(
hex (16 17 18 19 20 21 22 23) (1 1 1) simpleGrading (1 1 1)
);

edges
(
arc 0 1 (95.262794 55 -200) //front circle
arc 1 2 (55 95.262794 -200) //30 and 60 Degrees ( cos() and sin() )
arc 2 3 (-55 95.262794 -200)
arc 3 4 (-95.262794 55 -200)
arc 4 5 (-95.262794 -55 -200)
arc 5 6 (-55 -95.262794 -200)
arc 6 7 (55 -95.262794 -200)
arc 7 0 (95.262794 -55 -200)
arc 0 1 (95.262794 55 -200) //back circle
arc 1 2 (55 95.262794 -200)
arc 2 3 (-55 95.262794 -200)
arc 3 4 (-95.262794 55 -200)
arc 4 5 (-95.262794 -55 -200)
arc 5 6 (-55 -95.262794 -200)
arc 6 7 (55 -95.262794 -200)
arc 7 0 (95.262794 -55 -200)
);

patches
(
patch outlet
(
(18 22 21 17)
)
patch inlet
(
(16 20 23 19)
)
patch fixedWalls
(
(19 23 22 18)
(17 21 20 16)
)
patch frontAndBack
(
(16 19 18 17)
(20 21 22 23)
)
patch hole // I think it must be here, where is something wrong
(
(2 1 9 10)
(1 0 8 9)
(0 7 15 8)
(7 6 14 15)
(6 5 13 14)
(5 4 12 13)
(4 3 11 12)
(3 2 10 11)
)
);

mergePatchPairs
(
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


Unfortunately it doesn´t work . I always get this information:

Default patch type set to emptyface 0 in patch 4 does not have neighbour cell face: 4(2 1 9 10)#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"#1 Foam::error::abort() in "/opt/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"#2 Foam::Ostream& Foam:perator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/opt/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/blockMesh"#3 Foam:olyMesh::facePatchFaceCells(Foam::List<Foam ::face> const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<Foam::face> > const&, int) const in "/opt/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"#4 Foam:olyMesh:olyMesh(Foam::IOobject const&, Foam::Xfer<Foam::Field<Foam::Vector<double> > > const&, Foam::List<Foam::cellShape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::List<Foam::word> const&, Foam::word const&, Foam::word const&, Foam::List<Foam::word> const&, bool) in "/opt/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"#5 Foam::blockMesh::createTopology(Foam::IOdictionary &) in "/opt/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/blockMesh"#6 Foam::blockMesh::blockMesh(Foam::IOdictionary&) in "/opt/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/blockMesh"#7 main in "/opt/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/blockMesh"#8 __libc_start_main in "/lib64/libc.so.6"#9 _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116 From function polyMesh::facePatchFaceCells(const faceList& patchFaces,const labelListList& pointCells,const faceListList& cellsFaceShapes,const label patchID) in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 125.FOAM aborting
What´s wrong ? I do not realy understand where the problem is? I think it must be in the "patch hole".

Please! Could you help me!

!!!!!!!!!! I have a further question: !!!!!!!!!!!!!

Maby this Mesh i have created will run, how could i rotate the cylinder? or will i need there a flow around the cylinder, which will simulate the rotation?
Would it be better to simulate a flow over a CAD created cylinder (.stl) ????

maby there is somebody with experience with cylinders!

Thank you in anticipation!!


Wolfgang
WolfgangS. is offline   Reply With Quote

Old   November 10, 2010, 10:35
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
Before you start, may I point you towards Frank Bos's work here:

http://www.aero.lr.tudelft.nl/~frank...search/cfd/cfd

You can download his code which probably has meshes within it you can use and manipulate.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   November 11, 2010, 13:34
Default
  #3
New Member
 
Wolfgang Strauss
Join Date: Nov 2010
Location: Germany / Bavaria / Eichstätt
Posts: 15
Rep Power: 16
WolfgangS. is on a distinguished road
hi l_r_mcglashan!

Thank you for your quick reply. I hope this side will help me.

The download-files are unfortunately made with OpenFoam 1.3, the code-structure (especially the Mesh-code) is completely different to OpenFoam 1.6.
WolfgangS. is offline   Reply With Quote

Old   November 12, 2010, 05:53
Default
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
I think this setup should fit you pretty well
http://openfoamwiki.net/index.php/Be...coftac_ufr2-02

The only thing you need to add are the arc's for the cylinder.

EDIT: actually, I think you only need to modify the perl-script and remove the comments for the edges.
hua1015 likes this.
niklas is offline   Reply With Quote

Old   November 16, 2010, 09:29
Default
  #5
New Member
 
Wolfgang Strauss
Join Date: Nov 2010
Location: Germany / Bavaria / Eichstätt
Posts: 15
Rep Power: 16
WolfgangS. is on a distinguished road
hi niklas!

thanks for your advice!
the mesh works good.

Now i only need a capability to rotate the cyinder (patch: wall).
Where can i find a good way to do that?
(is the "swirlAndRotation" a good option to do that??)

Regards
Wolfgang
WolfgangS. is offline   Reply With Quote

Old   December 1, 2010, 05:54
Default problem with the perl script for circular cylinder
  #6
New Member
 
刘会星
Join Date: Nov 2010
Posts: 4
Rep Power: 16
chris Liu is on a distinguished road
HI, niklas. M and wolfgang. S

I want to simulate the flow around circular cylinder.
As niklas said, i modify the perl-script
and remove the comments for the arc's edges.
However when i run blockMesh with default parameters,
there were floating number exception when Creating curved edges:

#0 Foam::error:rintStack(Foam::Ostream&) in "/home/lhx/OpenFOAM/OpenFOAM-1.7.1/lib/linuxGccDPOpt/libOpenFOAM.so"
...

Could you give me a clue how to solve this problem,
and generate the mesh of circular cylinder?
Thank you very much!
chris Liu is offline   Reply With Quote

Old   December 1, 2010, 06:26
Default
  #7
New Member
 
Wolfgang Strauss
Join Date: Nov 2010
Location: Germany / Bavaria / Eichstätt
Posts: 15
Rep Power: 16
WolfgangS. is on a distinguished road
hi chris lui!

The arcs problem of http://openfoamwiki.net/index.php/Be...coftac_ufr2-02 is:

example:

edges
(

arc 5 6 ( 0 0.02 0 )

);

definition of 5 = ( -0.02 0.02 0 )
definition of 6 = ( 0.02 0.02 0 )

The points (0 0.02 0) , 5 and 6 lie on a line, and not a arc.
You have to create a new point instead of (0 0.02 0) use (0.02828 0).

For
http://openfoamwiki.net/index.php/Be...coftac_ufr2-02
set new edges:

edges
(

arc 5 6 ( 0 0.02828 0 )
arc 6 10 ( 0.02828 0 0 )
arc 9 10 ( 0 -0.02828 0 )
arc 9 5 ( -0.02828 0 0 )
arc 21 22 ( 0 0.02828 0.392 )
arc 26 22 ( 0.02828 0 0.392 )
arc 25 26 ( 0 -0.02828 0.392 )
arc 25 21 ( -0.02828 0 0.392 )

);

Now it should work

Best Regards and good luck

Wolfgang
WolfgangS. is offline   Reply With Quote

Old   December 1, 2010, 21:41
Default
  #8
New Member
 
刘会星
Join Date: Nov 2010
Posts: 4
Rep Power: 16
chris Liu is on a distinguished road
Hi wolfgang!

Yes, indeed. That helps me understand the blockMeshDict better.
Thank you for your detailed explanation.

Best regards!
chris Liu is offline   Reply With Quote

Old   December 2, 2010, 12:47
Default
  #9
New Member
 
Wolfgang Strauss
Join Date: Nov 2010
Location: Germany / Bavaria / Eichstätt
Posts: 15
Rep Power: 16
WolfgangS. is on a distinguished road
no prob!

Have fun


wolfi
WolfgangS. is offline   Reply With Quote

Old   March 5, 2012, 11:24
Default
  #10
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 14
Goutam is on a distinguished road
Quote:
Originally Posted by WolfgangS. View Post
hi chris lui!

edges
(

arc 5 6 ( 0 0.02 0 )

);

definition of 5 = ( -0.02 0.02 0 )
definition of 6 = ( 0.02 0.02 0 )

The points (0 0.02 0) , 5 and 6 lie on a line, and not a arc.
You have to create a new point instead of (0 0.02 0) use (0.02828 0).

edges
(

arc 5 6 ( 0 0.02828 0 )
arc 6 10 ( 0.02828 0 0 )
arc 9 10 ( 0 -0.02828 0 )
arc 9 5 ( -0.02828 0 0 )
arc 21 22 ( 0 0.02828 0.392 )
arc 26 22 ( 0.02828 0 0.392 )
arc 25 26 ( 0 -0.02828 0.392 )
arc 25 21 ( -0.02828 0 0.392 )

);

Wolfgang

Could you please explain how you get the coordinates (0 0.02828 0) and (0 0.02828 0.392)???
Goutam is offline   Reply With Quote

Old   March 7, 2012, 02:25
Default
  #11
Member
 
Vishal Achasrya
Join Date: Nov 2011
Posts: 38
Rep Power: 15
vishalsacharya is on a distinguished road
Goutam,

If you look in tutorials for potentialFoam, the circular cylinder is an example. the blockmesh file and the case are already setup. you can just start with that.
Also, for the rotating cylinder, you can use a velocity non-zero BC on the cylinder boundary patch. this can be easily done using some inbuilt features in OF.

~vishal
vishalsacharya is offline   Reply With Quote

Old   January 12, 2013, 18:00
Default using icoFoam
  #12
New Member
 
vanesa fernandez
Join Date: Jan 2013
Posts: 7
Rep Power: 13
yasmil is on a distinguished road
Hello,

I'm also trying to build a case for the flow around a circular cylinder problem. I've read the OpenFOAM tutorial on it and I 've also taken a look here http://openfoamwiki.net/index.php/Be...coftac_ufr2-02

Currently my boundary conditions are almost the same as the OpenFOAM tutorial (I added walls perpendicular to the cylinder), if I erase them it does not converge either. But I've also tried those in the above link, and it does not converge

I was wondering if this was a mesh problem, since I created the mesh in salome and exported it to openfoam.

this is the error that I get ;

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/icoFoam"
#5
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/icoFoam"
#6
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/icoFoam"
#7 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#8
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/icoFoam"
Floating point exception (core dumped)

Could someone please take a look at the case, and make some suggestions?

0.tar.gz

boundary.txt

system.tar.gz
yasmil is offline   Reply With Quote

Old   March 3, 2014, 11:53
Default Flow past a circular cylinder
  #13
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 14
Maimouna is on a distinguished road
Dear All OpenFOAM users,

I'm try to implement flow past circular cylinder in pimpleFoam solver. I attached the case that I'm looking for (pdf file). I blocked and checked mesh everything was fine. I run the case without any problem. But, when I plotted drag and lift forces (using Matlab), it gave me inconvenience result. I don't know where is my mistake.

Anyway, I attached my case if you could please go through all files and checked please what are my mistakes.

NT: D = 1, Re = 100. I'm trying to fix nu in transportProperties file and change u in the attached file because I didn't know where are my errors so I'm trying to do different ways. Also, might blockMeshDict affects my results if you could check please.

I'm looking forward your help.

Many thanks in advanced.
Attached Files
File Type: gz circularCylinder1.tar.gz (78.7 KB, 335 views)
File Type: pdf flow past cylinder.pdf (89.6 KB, 482 views)
Maimouna 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
2D flow around a circular cylinder case with interFoam solver shuoxue OpenFOAM Running, Solving & CFD 2 January 14, 2020 14:23
2D flow around a circular cylinder case with interFoam solver shuoxue OpenFOAM Running, Solving & CFD 0 August 31, 2013 06:04
Flow past 2 smooth circular cylinder slip FLUENT 0 July 8, 2010 19:45
[blockMesh] Grid generation cross flow over circular cylinder Yanma OpenFOAM Meshing & Mesh Conversion 0 July 7, 2010 09:02
3D FLOW OVER A CIRCULAR CYLINDER Srinivas Mettu FLUENT 2 April 4, 2010 23:11


All times are GMT -4. The time now is 07:39.