CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   pimpleFoam adjustable timestep (https://www.cfd-online.com/Forums/openfoam-solving/179857-pimplefoam-adjustable-timestep.html)

bling November 8, 2016 18:56

pimpleFoam adjustable timestep
 
Hi guys!

I was running a simulation with pimpleFoam. Everything is ok except the maximum Courant number remains small(~0.1) even if I set the maxco to be 1. The current time step is 0.02(it is stable and doesn't change) and it is also smaller than maxDeltaT that I set to be 0.1.
If I would like to increase my simulation speed, that is, to make the Maxco number close to 1, can anyone tell me what should I do?

Thanks a lot!
Jeremy

Code:

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

libs            ("libABLBC.so" "libturbulentABLBCInletVelocity.so");

application    pimpleFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        500;

deltaT          0.1;

writeControl    adjustableRunTime;

writeInterval  0.1;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

adjustTimeStep yes;

maxCo 1.0;

maxDeltaT 0.1;


khedar November 8, 2016 19:55

Hi Jeremy,
Did you try to increase 'maxdeltaT'?

alexeym November 9, 2016 16:09

Hi,

@bling

In general, OpenFOAM wants to make at least 5 time steps between saves, since you writeInterval is 0.1, your maximum time step is 0.02.

So, to increase time step, increase your writeInterval.

rr3245 December 2, 2017 09:56

Quote:

Originally Posted by alexeym (Post 624892)
Hi,

@bling

In general, OpenFOAM wants to make at least 5 time steps between saves, since you writeInterval is 0.1, your maximum time step is 0.02.

So, to increase time step, increase your writeInterval.

Old thread, but I have a problem with this.

I have set maxCo=10, however it starts low (1e-4) and doesn't increase. In fact it flat-lines. Why won't the Courant number increase if the solution isn't in trouble? RH.

piu58 December 2, 2017 14:11

The time step will not be larger than write interval.

rr3245 December 3, 2017 07:17

Quote:

Originally Posted by piu58 (Post 673692)
The time step will not be larger than write interval.

Thanks for your help, I understand now. I had lowered my writeInterval because I wanted to generate data right at the beginning of my simulation, not realising this was affecting my Courant number. Does the rule above apply? That is

deltaT \leq writeInterval/5,

where 5 is the number of saves OpenFOAM wants to make? RH.

piu58 December 3, 2017 09:44

I don't know form where you the "5" have. I would say

deltaT <= writeInterval

If you need soma valuses for the first steps you may change the write interval during the simulation. At least if you use only one processor it should change during the run.

nikosb June 15, 2022 19:37

I have the same issue, icoFoam runs with constant time step smaller than the maximum time step even though the Courant number is smaller than the max courant number. Here is the controlDict file:

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    icoFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        300;

deltaT          2e-03;

maxDeltaT      5e-03;

adjustTimeStep  yes;

maxCo          1.0;

writeControl    adjustableRunTime;

writeInterval  10;

purgeWrite      0;

writeFormat    binary;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;


runTimeModifiable true;

functions

{
    #include  "forceCoeffs"

    fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        enabled        true;
        timeStart      100;
        timeEnd        300;
        outputControl  outputTime;

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

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

    probes
    {
        type            probes;
        libs            ("libsampling.so");
        writeControl    timeStep;
        enable          false;
        probeLocations
        (
            (1 0 0)
            (1 0.6 0)
            (2.4 0.6 0)
            (3 0.6 0)
            (5 0.6 0)
        );
        fixedLocations  true;
        fields
        (
            U
        );
    }

}

Here is the output of the simulation

Code:

Time = 11.628

Courant Number mean: 0.0151234 max: 0.143464
smoothSolver:  Solving for Ux, Initial residual = 6.03065e-05, Final residual = 5.06024e-08, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 6.03038e-05, Final residual = 5.03623e-08, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 1.11447e-06, Final residual = 1.11447e-06, No Iterations 0
DICPCG:  Solving for p, Initial residual = 0.000156221, Final residual = 7.45208e-06, No Iterations 154
time step continuity errors : sum local = 1.41406e-13, global = -4.9692e-15, cumulative = 5.69836e-12
DICPCG:  Solving for p, Initial residual = 7.45005e-05, Final residual = 9.65905e-07, No Iterations 184
time step continuity errors : sum local = 1.83327e-14, global = 3.18384e-16, cumulative = 5.69868e-12
ExecutionTime = 152.05 s  ClockTime = 155 s


Time = 11.63

Courant Number mean: 0.0151234 max: 0.143464
smoothSolver:  Solving for Ux, Initial residual = 6.02107e-05, Final residual = 5.03845e-08, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 6.02125e-05, Final residual = 5.01549e-08, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 1.11191e-06, Final residual = 1.11191e-06, No Iterations 0
DICPCG:  Solving for p, Initial residual = 0.000155738, Final residual = 7.40201e-06, No Iterations 74
time step continuity errors : sum local = 1.40469e-13, global = -7.92162e-15, cumulative = 5.69076e-12
DICPCG:  Solving for p, Initial residual = 7.46332e-05, Final residual = 9.66485e-07, No Iterations 183
time step continuity errors : sum local = 1.83421e-14, global = 3.82859e-16, cumulative = 5.69114e-12
ExecutionTime = 152.21 s  ClockTime = 155 s

Time step is constant at 2e-3.

Could there be an issue with the field averaging or other operation?

Can anyone please help me?

jaydarji395 April 13, 2023 14:08

icoFoam does not support adjustable time stepping. You can actually check which solver application uses it, by checking its .C file and searching setDeltaT.H in that file. If it exists, the solver supports it.!


All times are GMT -4. The time now is 19:11.