CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Courant number (https://www.cfd-online.com/Forums/openfoam/97324-courant-number.html)

libra February 14, 2012 21:54

Courant number
 
Hi everyone
I am simulating the water flow in a pipe using LES with OpenFoam version 1.6.
It seems that there is something wrong with "courant number" in my computations. During the computations it gets bigger and bigger and finally the computation stops. The value I should choose for courant number is 5*10^-4 according to the calculations, but I have even chosen a smaller value: 10^-5. I am wondering why this number gets so big????? :confused:

niaz February 15, 2012 04:35

Dear libra
it is big problem in openfoam. but it has easy solution
you can limit your courant with "maxCo 0.2;"
it controls your courant and adapt your time steps.

libra February 15, 2012 22:56

Hi Niaz
Thanks for your comment. I limited the Courant number and my computation is running for now. I hope it works. :)

libra February 17, 2012 04:48

Quote:

Originally Posted by niaz (Post 344523)
Dear libra
it is big problem in openfoam. but it has easy solution
you can limit your courant with "maxCo 0.2;"
it controls your courant and adapt your time steps.

Dear Niaz
I changed my "controlDict" file to the following to limit the courant number:

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

application channelFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 1;

deltaT 1e-5;

writeControl adjustableRunTime;

writeInterval 100;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 0.5;

maxDeltaT 1;

functions
{
fieldAverage1
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true;
outputControl outputTime;
fields
(
U
{
mean on;
prime2Mean on;
base time;
}

p
{
mean on;
prime2Mean on;
base time;
}
);
}
}


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

But it didn't work and the courant number exceeds 0.5. :confused: Do you have any idea about this?
Thanks :)

niaz February 22, 2012 14:02

Libra
channelFoam cannot control courant number.
you should add setDeltaT.H to your solver.

niaz February 22, 2012 14:03

If you need help just look at pimpleFoam as an example.

libra February 23, 2012 21:25

Thanks Niaz. Problem solved. :)

DuarteMagalhaes April 9, 2014 07:06

Hi everyone. I'm using icoFoam and i want to control the Courant number. I've tried to insert "maxCo 0.5;" in the controlDict file, but it didn't work. Can anyone help me on this?

Bernhard April 9, 2014 07:40

Quote:

Originally Posted by DuarteMagalhaes (Post 484903)
Hi everyone. I'm using icoFoam and i want to control the Courant number. I've tried to insert "maxCo 0.5;" in the controlDict file, but it didn't work. Can anyone help me on this?

The solution is in this topic. Read carefully!


All times are GMT -4. The time now is 16:36.