CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Non stationary simulation of a 2D cylinder

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

Like Tree1Likes
  • 1 Post By vkrastev

Reply
 
LinkBack Thread Tools Display Modes
Old   March 21, 2012, 18:35
Default Non stationary simulation of a 2D cylinder
  #1
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Hi all;
I'm trying to run a non stationary simulation of a 2D circular cylinder and I have some questions:

1. If I use icoFoam (can I use it in my case?) I have a floating point exception due to the courant number. I can avoid that but I need to lower my time step below 0.000001.

2. If I use pisoFoam it complies about the empty patches…

3. [Warning - stupid question!] what's the different between using simpleFoam and saving the result at different time steps and using a non stationary solver? Even with simpleFoam I can get the vortex shedding…

Thank you!

Last edited by lovecraft22; April 3, 2012 at 10:13.
lovecraft22 is offline   Reply With Quote

Old   March 23, 2012, 12:36
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 285
Rep Power: 9
kmooney is on a distinguished road
If you tar up the case I wouldn't mind taking a look at it.
kmooney is offline   Reply With Quote

Old   March 23, 2012, 13:39
Default
  #3
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Thank you kmooney.
Had to do a .zip file instead of a .tar because of the size allowance by the forum…I hope that's fine…
Attached Files
File Type: zip 5_cilindro.zip (31.7 KB, 14 views)
lovecraft22 is offline   Reply With Quote

Old   April 3, 2012, 10:05
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 285
Rep Power: 9
kmooney is on a distinguished road
The high Co numbers appear to be a result of some bad cells generated by snappyHexMesh. I added a little code to CoNumber.H to write out the local Courant numbers:

Code:
//Compute and write Co field
        scalar CoNum = 0.0;
        scalar meanCoNum = 0.0;

        volScalarField CoField
        (
        IOobject
        (
            "CoField",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        fvc::surfaceSum(mag(phi))()
        );

        if (mesh.nInternalFaces())
        {
            scalarField sumPhi
            (
            fvc::surfaceSum(mag(phi))().internalField()
            );

            CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

                    CoField.internalField() = 0.5*(CoField/mesh.V().field())*runTime.deltaTValue();

            meanCoNum =
            0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();

        }
        Info<< "Courant Number mean: " << meanCoNum
            << " max: " << CoNum << endl;
//END Co Number
Those bad cells cause a 3 order of magnitude variation of Co throughout the domain. (Images attached!) It may just be easier to use something else to mesh it or work with your snappyHexMesh settings to avoid the bad cells. I hope that helps!
Attached Images
File Type: jpg CoField_largeView.jpg (58.7 KB, 63 views)
File Type: jpg CoField_zoomView.jpg (53.7 KB, 70 views)
kmooney is offline   Reply With Quote

Old   April 3, 2012, 10:21
Default
  #5
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Thank you Kyle, I really appreciate you help.

I had noticed indeed that my extruded mesh was bad on the cylinder surface so I played a little bit with the snappyHexMesh parameters and eventually I got a really good looking surface mesh but, again, no look with the convergence…

Could you please have a look at this case as well and see if the problem may be the same? The runScript is included. I got rid of the feature edges as it makes no differences for a 2D case like mine.

Those lines you posted, is that just something you need to add at the bottom of your controlDict?

Also, could you please explain the difference between running simpleFoam and looking at the flow at different time steps and doing the same thing with icoFoam? I know simpleFoam is a steady state solver but yet I can get the vortex shedding… is that just some numerical stuff?

Thank you again for your help!
Attached Files
File Type: zip 5_cilindro.zip (33.1 KB, 5 views)
lovecraft22 is offline   Reply With Quote

Old   May 4, 2012, 05:01
Default
  #6
New Member
 
Anne Severt
Join Date: May 2012
Posts: 4
Rep Power: 5
Anne Severt is on a distinguished road
Hey Kyle,

I´m new to CFD and OpenFoam, but I´m very much interested in your CoField implementation. Could you explain to me how you created the pictures? I edited the CourantNo.H file as you described, but I can´t create the images of CoField.

Thank you!

I was able to get a pic, but they don´t change in time. Aren´t they supposed to change?

Last edited by Anne Severt; May 7, 2012 at 10:21.
Anne Severt is offline   Reply With Quote

Old   May 4, 2012, 08:19
Default
  #7
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
vkrastev is on a distinguished road
Quote:
Originally Posted by lovecraft22 View Post
Also, could you please explain the difference between running simpleFoam and looking at the flow at different time steps and doing the same thing with icoFoam? I know simpleFoam is a steady state solver but yet I can get the vortex shedding… is that just some numerical stuff?
In one word, yes. The "transient" solution you got from simpleFoam is just a numerical transitory till the algorithm goes convergent and generally speaking it does not have any physical meaning (although it could qualitatively seem so).

Regards

V.
lovecraft22 likes this.
vkrastev is offline   Reply With Quote

Old   May 7, 2012, 14:18
Default
  #8
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 285
Rep Power: 9
kmooney is on a distinguished road
Quote:
Originally Posted by Anne Severt View Post
Hey Kyle,

I´m new to CFD and OpenFoam, but I´m very much interested in your CoField implementation. Could you explain to me how you created the pictures? I edited the CourantNo.H file as you described, but I can´t create the images of CoField.

Thank you!

I was able to get a pic, but they don´t change in time. Aren´t they supposed to change?
Hi Anne,

As far as I can tell the Co field should be changing as long as U or deltaT is changing. The values are only valid on the internal field however so the patch values aren't accurate. It's always possible there is a bug but I haven't spent much time at all on it.
kmooney is offline   Reply With Quote

Old   May 8, 2012, 02:06
Default
  #9
New Member
 
Anne Severt
Join Date: May 2012
Posts: 4
Rep Power: 5
Anne Severt is on a distinguished road
Hey Kyle,

thanks for your answer. Is there a way to plot accurate patch values? How can I access the volScalarField to keep track of the values while time is running?

Could you explain, why the patch values aren´t accurate? Thus, why is ().internalField() used?

Thanks!

Last edited by Anne Severt; May 11, 2012 at 05:32.
Anne Severt is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
benchmark: flow over a circular cylinder goodegg Main CFD Forum 12 January 22, 2013 12:47
k-omega SST simulation of turbulent flow around a circular cylinder DanM OpenFOAM Running, Solving & CFD 16 December 12, 2012 14:39
Boundary condition setting regarding turbine simulation using CFX Lacerlacer CFX 11 March 12, 2012 10:32
modification for rotating cylinder simulation zonexo Main CFD Forum 3 July 21, 2006 14:24
Simulation of the Flow past a circular cylinder using STAR-CD M. S. GUEROUACHE Main CFD Forum 0 October 1, 1998 10:51


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