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

how to accurately simulate flow around cylinder

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2014, 07:58
Default
  #21
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
It seems that you've got diverging solution (at 1.4 s it just blows up). Can you post the output of the solver?

Also I've got several question about your BCs:

1. You set fixed velocity at the outlet and yet you'd like to plot outlet velocity over time. Though you can plot velocity at the inlet boundary.

2. You've got symmetry BC at sides patch, though if you like to simulate flow past ONE cylinder, it should be wall.

3. For some reason you've decided to set symmetry plane also on walls patch (surface of the cylinder), though it again should be wall with non-slip BC.

This is just quick look at the case files. What you've described with your initial conditions and boundary conditions is very different from what you've written in attached PDF file.

Also I'm not quite sure it is good idea to simulate this flow using symmetry BCs as the flow itself is not symmetric (for example http://youtu.be/57-URbKeWME).

Last edited by alexeym; March 4, 2014 at 08:28. Reason: addition
alexeym is offline   Reply With Quote

Old   March 4, 2014, 08:42
Default
  #22
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Dear Alexey,

I tried to attached all output, but unfortunately the size of the folder doesn’t accepted so I will post for one time step for p file

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

internalField nonuniform List<scalar>
2000
(zY\BAB\DCT1\C0\AC-\91*!1\C0\DCB`m\85 1\C0-\D1kI\A11\C0\B4Ɲ\D9 1\C0 \90\FA\C2R1\C0\B1W\A1J\B8\001\C0O\BFǙm\FD0\C0e/\8B \FD0\C0\86.\C4\CE\D8\FC0\C0 ¯Qr1\C0\89\DB[\F0\EB61\C0?\E0^\A851\C0?\B8n\BE"1\C0QV\E2\E6d1 \C0%\8A{\CEz1\C0\9D\94\99w 1\C0\A7Rt\A3\A8 1\C0v\A5gop1\C0\BD(R1\C0\DB\F3Z\D1\8F1\C0\BA# XGML1\C0\FC\A2\90\9EdJ1\C0\A2\BF\8EO31\C0ܭҞ(1\C0 V\95Z* 1\C0\CFb'\E41\C0\B8~p\D51\C0\E3\A0"\9D\C71\C0 \A47ܗ\C71\C0\F1\A2o\AA1\C0\E15ȶ`1\C0\D0A\AAQ^ 1\C0t\AB\FE \E7B1\C0\BD]r171\C0\EC
:-1\C0\E3\9Bs\BA\A2%1\C0]\8Dv#\971\C0N\ADI T1\C0u^\F0oH1\C0\D4.\BB\8F\94\C31\C0\B1\87\F7.\9 8s1\C0\BD\9B\FDJp1\C0-*{\C1Q1\C0n4\E6\C2\CBD1\C0\A3r\94\C8I91\C01\9Cz 01\C0Gϰ\B1m)1\C0\96\D2+4$1\C0\9DJK\9Ef1\C0\86\E C\C9\DA\D91\C0\9E\E8O!w\841\C0a\A0k\801\C0T\8EH \97]1\C0\AC\F8\*Q1\C0\A4\EF\C6D1\C0u:B1:1\C02\F5\B 1\A0D21\C0/\B0 @#,1\C0,\FC\E2o\B2&1\C0\A4\FC\99[\AB\EC1\C0\F1/t\E9\921\C0\B7\8E\E34\8E1\C0%J\89Kh1\C0*\EF\A8[\D4[1\C0\E7r\BB}UM1\C0Ó\9B\E7\8CB1\C0=\D9\F8[\E591\C0\A4\ACI31\C0\B5\E2~\E7-1\C0\F465

That is not whole but only part of p file because the post doesn't accepted more that 20000 characters. There is something error given in the output files. Same in other output files.

There are all output which I didn't post them give such that unclear samples. In addition to the attached uniform folder which is given in each timestep.
Attached Files
File Type: gz uniform.tar.gz (1.1 KB, 8 views)
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 08:46
Default
  #23
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Do you have another way to post large size of files to show you whole output?

Anyway, all output file give the same error (unclear samples). There is something wrong. I hope you can help me.

Kind regards
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 08:59
Default
  #24
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Actually I don't need whole log file, just lines before the crash, in other word - the output for the last time step.

Also I'd like to know your thoughts about:

Also I've got several question about your BCs:

1. You set fixed velocity at the outlet and yet you'd like to plot outlet velocity over time. Though you can plot velocity at the inlet boundary.

2. You've got symmetry BC at sides patch, though if you like to simulate flow past ONE cylinder, it should be wall.

3. For some reason you've decided to set symmetry plane also on walls patch (surface of the cylinder), though it again should be wall with non-slip BC.

This is just quick look at the case files. What you've described with your initial conditions and boundary conditions is very different from what you've written in attached PDF file. If you've got wrong boundary conditions not solver will get you right results.

Also I'm not quite sure it is good idea to simulate this flow using symmetry BCs as the flow itself is not symmetric (for example http://youtu.be/57-URbKeWME).
alexeym is offline   Reply With Quote

Old   March 4, 2014, 09:43
Default
  #25
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Dear Alexey,

many thanks for your help. Do you mean now I have to change sides and walls boundary conditions to wall instead of symmetryPlane?
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 09:53
Default
  #26
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, it depends

If you'd like to simulate the problem you've described in attached PDF (I guess development of von Karman vortex street), then I'd suggest you to create a mesh with a whole cylinder (not just a half of it). Set non-slip boundary conditions of the walls (cylinder and walls of a channel), constant inlet velocity, zero-gradient outlet velocity, constant value of outlet pressure (let's say 0), zero gradient of inlet pressure (and empty BCs for top and bottom planes as you'd like to do 2D simulation).

If you'd like to simulate something else, describe it more precisely.

Currently your boundary conditions describe rather bizarre system.
Mehrez likes this.
alexeym is offline   Reply With Quote

Old   March 4, 2014, 10:24
Default
  #27
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Dear Alexey,

that what I'm looking for exactly. I will try to do all what you post and then I will let you know about the result.

I have one more question please, what is the best way or software to create a mesh with whole cylinder?
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 10:34
Default
  #28
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
The best software is the one you know how to use

As the mesh if rather simple you can use blockMesh. If you'd like to have a "template" where you just need to correct sizes, you can start with the one I've made some time ago. Though the case files are rather messy, so you just can take a blockMeshDict from there.

If I needed to make the mesh now I'd use Gmsh (http://gmsh.info).
alexeym is offline   Reply With Quote

Old   March 4, 2014, 10:46
Default
  #29
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Thank you very much Alexey. I will try all possibilities now.:-)
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 11:11
Default
  #30
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Here's a file for Gmsh (I've created rather simple meshing, surely it can be enhanced).

After you open this file in Gmsh it will create channel-with-cylinder.msh file, which then can be converted to OpenFOAM format with gmshToFoam utility.

You can find the names of the boundaries in the file. Maybe after conversion you'll need to correct type of the boundary for walls, top, and bottom patches, cause converter will set type to patch. You can do it with changeDictionary utility and following changeDictionaryDict:

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

dictionaryReplacement
{
    boundary
    {
        walls
        {
            type            wall;
        }

        top
        {
            type            empty;
        }

        bottom
        {
            type            empty;
        }
    }
}

// ************************************************************************* //
Attached Files
File Type: gz 2D-cylinder.geo.gz (738 Bytes, 26 views)
alexeym is offline   Reply With Quote

Old   March 4, 2014, 11:48
Default
  #31
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Dear Alexy,

sorry, I'm still confused about changing the names of the boundaries. Could you try please to mach the boundaries that you suggests and the boundary that I have.

I never used Gmesh to create mesh or any of the software, all meshes that I have before were easy to create without using any program. So, what are these variable mean

CX = 4.5*D;
CY = 0.0;

S = 1.0/Sqrt(2);

N1 = 100;
N2 = 400;

Many thanks for your help.
Attached Files
File Type: gz 0.tar.gz (74.9 KB, 7 views)
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 12:31
Default
  #32
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
I've attached case files to the message. You need to correct velocity in 0/U to correspond to your case. Allprepare script assumes that you have gmsh in your PATH.

Also to plot drag force you have to wait until the flow develops otherwise you'll get something meaningless. I'd suggest you to run simulation for at least 2*L/U (where L is channel length and U is inlet velocity).

Concerning your questions:

I've tried to reproduce the channel from your PDF. So

1. D is a diameter of the cylinder.
2. CX, CY - coordinates of the center of the cylinder.
3. S is sin(pi/4), I need it for calculation of the coordinates of the points on the surface of the cylinder.
4. N1 and N2 is the densities of the different parts of the mesh.

Actually if you open GEO file in Gmsh, you'll be able to see how I've split the mesh.
Attached Files
File Type: gz circularCylinder.tar.gz (4.1 KB, 34 views)
alexeym is offline   Reply With Quote

Old   March 4, 2014, 13:03
Default
  #33
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Dear Alexy,

when executed gmshToFoam 2D-cylinder.geo in the command window it gives this error

Quote:
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : gmshToFoam 2D-cylinder.geo
Date : Mar 04 2014
Time : 16:47:48
Host : maimouna-desktop
PID : 5423
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Skipping tag D at line 2

Segmentation fault (core dumped)
maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$
what is the problem in D line 2?

and what do you mean by run simulation for at least 2*L/U?

Many thanks in advanced.
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 13:05
Default
  #34
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
First you have to convert GEO file to MSH file using Gmsh. Then you can use gmshToFoam. See Allprepare script for the command sequence.
alexeym is offline   Reply With Quote

Old   March 4, 2014, 13:18
Default
  #35
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Dear Alexey,

Now, the converting to foam is going fine. Then, execution of pimpleFoam gives
Quote:
maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$ pimpleFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : pimpleFoam
Date : Mar 04 2014
Time : 17:09:42
Host : maimouna-desktop
PID : 6668
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p



--> FOAM FATAL IO ERROR:
keyword defaultFaces is undefined in dictionary "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField from line 25 to line 46.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 456.

FOAM exiting

maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$
What does the problem again please.
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 13:25
Default
  #36
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
I guess it is funny feature of openfoam-extend-3.0, as with OpenFOAM 2.2.2 there's not defaultFaces patch after conversion of the MSH file.

You can add
Code:
    defaultFaces
    {
        type            empty;
    }
to boundaryField dictionary in 0/p and 0/U files.
alexeym is offline   Reply With Quote

Old   March 4, 2014, 13:33
Default
  #37
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
Again, this error
Quote:
maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$ pimpleFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : pimpleFoam
Date : Mar 04 2014
Time : 17:27:33
Host : maimouna-desktop
PID : 6728
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p



--> FOAM FATAL IO ERROR:

patch type 'patch' not constraint type 'empty'
for patch defaultFaces of field p in file "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField::defaultFaces from line 51 to line 51.

From function emptyFvPatchField<Type>::emptyFvPatchField
(
const fvPatch& p,
const Field<Type>& field,
const dictionary& dict
)

in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 100.

FOAM exiting
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 13:52
Default
  #38
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well,

you can add

Code:
        defaultFaces
        {
            type            empty;
        }
to boundary dictionary of changeDictionaryDict. Though I do not understand where is the defaultFaces boundary in the case after conversion as on my desktop there is no such boundary. Maybe you can attach screenshot of paraFoam with this boundary shown?
alexeym is offline   Reply With Quote

Old   March 4, 2014, 14:01
Default
  #39
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
paraFoam command gives the follwing fatal error

Quote:
maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$ paraFoam
created temporary 'circularCylinderLast1.OpenFOAM'


--> FOAM FATAL IO ERROR:

patch type 'patch' not constraint type 'empty'
for patch defaultFaces of field p in file "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField::defaultFaces from line 51 to line 51.

From function emptyFvPatchField<Type>::emptyFvPatchField
(
const fvPatch& p,
const Field<Type>& field,
const dictionary& dict
)

in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 100.

FOAM exiting
it was opened and closed directly.
Maimouna is offline   Reply With Quote

Old   March 4, 2014, 16:31
Default
  #40
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
It works perfect in OpenFOAM. I just go to p, U and changeDictionary files and commit
defaultFaces { type empty; }
and the visualization is shown in paraview. But I'm still being confused about lift and drag coefficients for Reynolds number 100? Any idea? What shall I change for Re = 100?
Maimouna is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Other] OpenFoam Flow over a Circular Cylinder WolfgangS. OpenFOAM Meshing & Mesh Conversion 12 March 3, 2014 11:53
benchmark: flow over a circular cylinder goodegg Main CFD Forum 12 January 22, 2013 12:47
Particle deposition on circular cylinder in turbulent flow Julian K. CFX 1 October 3, 2011 18:51
flow around a cylinder pXYZ Main CFD Forum 14 July 25, 2011 11:05
Flow induced vibration of a mobile cylinder Hooman Main CFD Forum 0 December 31, 2010 09:48


All times are GMT -4. The time now is 03:24.