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

pimpleFoam adjustable timestep

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By bling
  • 1 Post By alexeym
  • 1 Post By piu58
  • 1 Post By piu58

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2016, 18:56
Default pimpleFoam adjustable timestep
  #1
New Member
 
Jeremy
Join Date: Jun 2016
Posts: 4
Rep Power: 9
bling is on a distinguished road
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;
amuzeshi likes this.
bling is offline   Reply With Quote

Old   November 8, 2016, 19:55
Default
  #2
Senior Member
 
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 9
khedar is on a distinguished road
Hi Jeremy,
Did you try to increase 'maxdeltaT'?
khedar is offline   Reply With Quote

Old   November 9, 2016, 16:09
Default
  #3
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
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.
amuzeshi likes this.
alexeym is offline   Reply With Quote

Old   December 2, 2017, 09:56
Default
  #4
New Member
 
anonymous
Join Date: Nov 2016
Posts: 29
Rep Power: 9
rr3245 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
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.
rr3245 is offline   Reply With Quote

Old   December 2, 2017, 14:11
Default
  #5
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
The time step will not be larger than write interval.
amuzeshi likes this.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   December 3, 2017, 07:17
Default
  #6
New Member
 
anonymous
Join Date: Nov 2016
Posts: 29
Rep Power: 9
rr3245 is on a distinguished road
Quote:
Originally Posted by piu58 View Post
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.
rr3245 is offline   Reply With Quote

Old   December 3, 2017, 09:44
Default
  #7
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
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.
amuzeshi likes this.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   June 15, 2022, 19:37
Default
  #8
New Member
 
Nikolaos Beratlis
Join Date: Jan 2010
Posts: 15
Rep Power: 16
nikosb is on a distinguished road
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?

Last edited by nikosb; June 15, 2022 at 21:42.
nikosb is offline   Reply With Quote

Old   April 13, 2023, 14:08
Exclamation
  #9
New Member
 
Join Date: Nov 2022
Posts: 2
Rep Power: 0
jaydarji395 is on a distinguished road
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.!
jaydarji395 is offline   Reply With Quote

Reply


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
No vortex shedding for flow over cylinder at Re = 59 using pimpleFoam kaszt OpenFOAM Running, Solving & CFD 9 March 15, 2022 07:34
error with smaller timestep ? Thomas MADELEINE FLUENT 0 August 8, 2016 13:02
Problems with adjustable timestep control and maxCo Number wolle1982 OpenFOAM Running, Solving & CFD 5 September 24, 2015 10:07
Modifying sonicFoam to run with variable timestep - strange results dalaron OpenFOAM Programming & Development 1 September 2, 2013 07:21
Restart 2-way FSI with different timestep? Lance CFX 10 April 17, 2013 00:37


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