CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Non stationary simulation of a 2D cylinder (http://www.cfd-online.com/Forums/openfoam/98911-non-stationary-simulation-2d-cylinder.html)

lovecraft22 March 21, 2012 19:35

Non stationary simulation of a 2D cylinder
 
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!

kmooney March 23, 2012 13:36

If you tar up the case I wouldn't mind taking a look at it.

lovecraft22 March 23, 2012 14:39

1 Attachment(s)
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…

kmooney April 3, 2012 11:05

2 Attachment(s)
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!

lovecraft22 April 3, 2012 11:21

1 Attachment(s)
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!

Anne Severt May 4, 2012 06:01

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?

vkrastev May 4, 2012 09:19

Quote:

Originally Posted by lovecraft22 (Post 352927)
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.

kmooney May 7, 2012 15:18

Quote:

Originally Posted by Anne Severt (Post 359250)
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.

Anne Severt May 8, 2012 03:06

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!


All times are GMT -4. The time now is 18:26.