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

Increase of time precision for no apparent reason

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By donQi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2019, 07:30
Default Increase of time precision for no apparent reason
  #1
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
I am running version 6 using pimpleFoam with moving mesh approach for a single degree of freedom oscillator using the sixDoFRigidBodyMotion motion solver.

For some reason during the simulations the time step is increased by a small fraction of a second. This only occurs when a time directory is saved, but not always. See the log file below where the time precision is increased. As seen in the controlDict, I saved every 0.1 s and this error does not happen before.

log
Code:
Courant Number mean: 0.002564148895 max: 0.1649508419
Time = 2.5998

DILUPBiCGStab:  Solving for Ux, Initial residual = 8.307715646e-06, Final residual = 5.457379364e-11, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0001085460707, Final residual = 5.567109289e-10, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.0003191223452, Final residual = 9.993025692e-07, No Iterations 295
time step continuity errors : sum local = 2.019717706e-14, global = 3.776739315e-19, cumulative = -1.087971441e-14
GAMG:  Solving for p, Initial residual = 1.50933371e-05, Final residual = 9.964163161e-07, No Iterations 69
time step continuity errors : sum local = 2.01384706e-14, global = -7.272087935e-21, cumulative = -1.087972168e-14
DICPCG:  Solving for p, Initial residual = 2.204037405e-06, Final residual = 7.118914613e-07, No Iterations 3
time step continuity errors : sum local = 1.438800795e-14, global = -7.589848255e-21, cumulative = -1.087972927e-14
DILUPBiCGStab:  Solving for omega, Initial residual = 1.91174456e-08, Final residual = 4.461310168e-13, No Iterations 1
DILUPBiCGStab:  Solving for k, Initial residual = 1.423291787e-05, Final residual = 1.849474695e-10, No Iterations 1
ExecutionTime = 78669.41 s  ClockTime = 78673 s

forceCoeffs forceCoeffs write:
    Cm    = 0.001284594055
    Cd    = 0.5949713365
    Cl    = 0.5009830253
    Cl(f) = 0.2517761067
    Cl(r) = 0.2492069186

Courant Number mean: 0.002564149541 max: 0.164955811
Time = 2.5999

DILUPBiCGStab:  Solving for Ux, Initial residual = 8.307161053e-06, Final residual = 5.457128227e-11, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0001084944939, Final residual = 5.559463251e-10, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.0003200943941, Final residual = 9.99987852e-07, No Iterations 343
time step continuity errors : sum local = 2.021074814e-14, global = 4.3653377e-19, cumulative = -1.087929274e-14
GAMG:  Solving for p, Initial residual = 1.530951502e-05, Final residual = 9.957109959e-07, No Iterations 67
time step continuity errors : sum local = 2.012390427e-14, global = -1.195950975e-19, cumulative = -1.087941233e-14
DICPCG:  Solving for p, Initial residual = 2.155977715e-06, Final residual = 5.701118378e-07, No Iterations 3
time step continuity errors : sum local = 1.15223302e-14, global = -1.137824087e-19, cumulative = -1.087952612e-14
DILUPBiCGStab:  Solving for omega, Initial residual = 1.911982862e-08, Final residual = 4.466050479e-13, No Iterations 1
DILUPBiCGStab:  Solving for k, Initial residual = 1.423253972e-05, Final residual = 1.849486654e-10, No Iterations 1
ExecutionTime = 78671.24 s  ClockTime = 78675 s

forceCoeffs forceCoeffs write:
    Cm    = 0.001284459483
    Cd    = 0.5948828932
    Cl    = 0.5005281342
    Cl(f) = 0.2515485266
    Cl(r) = 0.2489796076

Courant Number mean: 0.002564150185 max: 0.164960765
--> FOAM Warning :
    From function virtual Foam::Time& Foam::Time::operator++()
    in file db/Time/Time.C at line 1165
    Increased the timePrecision from 12 to 13 to distinguish between timeNames at time 2.600000000001
Time = 2.600000000001

DILUPBiCGStab:  Solving for Ux, Initial residual = 8.30658941e-06, Final residual = 5.457173062e-11, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0001084429694, Final residual = 5.551517951e-10, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.000320768177, Final residual = 9.981170949e-07, No Iterations 296
time step continuity errors : sum local = 2.017264711e-14, global = 3.901644047e-19, cumulative = -1.087913595e-14
GAMG:  Solving for p, Initial residual = 1.509991922e-05, Final residual = 9.961712709e-07, No Iterations 69
time step continuity errors : sum local = 2.013291779e-14, global = -6.690361398e-21, cumulative = -1.087914264e-14
DICPCG:  Solving for p, Initial residual = 2.203102016e-06, Final residual = 7.080096225e-07, No Iterations 3
time step continuity errors : sum local = 1.430912571e-14, global = -7.698028795e-21, cumulative = -1.087915034e-14
DILUPBiCGStab:  Solving for omega, Initial residual = 1.912221084e-08, Final residual = 4.470801305e-13, No Iterations 1
DILUPBiCGStab:  Solving for k, Initial residual = 1.423206746e-05, Final residual = 1.849505766e-10, No Iterations 1
bounding k, min: -1.157402645e-05 max: 13.35907961 average: 0.6225275873
ExecutionTime = 78673.22 s  ClockTime = 78677 s

forceCoeffs forceCoeffs write:
    Cm    = 0.001284324281
    Cd    = 0.5947965983
    Cl    = 0.5000798827
    Cl(f) = 0.2513242656
    Cl(r) = 0.2487556171

Courant Number mean: 0.002564150812 max: 0.1649657022
Time = 2.600100000001

DILUPBiCGStab:  Solving for Ux, Initial residual = 8.306014969e-06, Final residual = 5.457017724e-11, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0001083915613, Final residual = 5.543940179e-10, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.0003231393917, Final residual = 9.988857532e-07, No Iterations 343
time step continuity errors : sum local = 2.018783972e-14, global = 4.221641296e-19, cumulative = -1.087872818e-14
GAMG:  Solving for p, Initial residual = 1.534288233e-05, Final residual = 9.974160871e-07, No Iterations 67
time step continuity errors : sum local = 2.015769887e-14, global = -1.015018641e-19, cumulative = -1.087882968e-14
DICPCG:  Solving for p, Initial residual = 2.158725482e-06, Final residual = 5.703330564e-07, No Iterations 3
time step continuity errors : sum local = 1.15264168e-14, global = -9.572388487e-20, cumulative = -1.08789254e-14
DILUPBiCGStab:  Solving for omega, Initial residual = 1.912449372e-08, Final residual = 4.475582672e-13, No Iterations 1
DILUPBiCGStab:  Solving for k, Initial residual = 1.424083279e-05, Final residual = 1.856565846e-10, No Iterations 1
ExecutionTime = 78675.05 s  ClockTime = 78678 s

forceCoeffs forceCoeffs write:
    Cm    = 0.001284188432
    Cd    = 0.5947078698
    Cl    = 0.4996237702
    Cl(f) = 0.2510960735
    Cl(r) = 0.2485276967

controlDict

Code:
application     pimpleFoam;

startFrom       latestTime;

startTime       latestTime;

stopAt          endTime;

endTime         500;

deltaT          0.0001;

writeControl    runTime;

writeInterval   0.1;

purgeWrite      10;

writeFormat     ascii;

writePrecision  10;

writeCompression off;

timeFormat      general;

timePrecision   12;

runTimeModifiable true;
Bazinga is offline   Reply With Quote

Old   July 4, 2022, 05:16
Default
  #2
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 14
donQi is on a distinguished road
I had a similar issue when using in controlDict the following settings:

Code:
writePrecision  10;
timeFormat      general;
timePrecision   8;
I was getting

Code:
Increased the timePrecision from 8 to 12 to distinguish between timeNames at time 2600.00000001
2600.00000001 instead of 2600. To avoid that .00000001 (= 1e-8) I changed the values to a number > 1e-8:

Code:
writePrecision  7;
timeFormat      general;
timePrecision   7;
and the problem disappeared, it writes 2600 without trailing decimal digits. An explanation of this behaviour can be found in a little user manual by Holzinger, at page 40:
Quote:
Pitfall: timePrecision
OpenFOAM is able to automatically increase the value of timePrecision parameter if need arises, e.g. due to a reduction in (dynamic) time step size22. This is typically the case when a simulation diverges and the (dynamic) time step gets decreased by orders of magnitudes. However, simulations that do not diverge may also create the need for an increase in time precision.

Increased the timePrecision from 6 to 7 to distinguish between timeNames at time 4.70884
Listing 41: Exemplary solver output in the case of an automatic increase of the timePrecision value.

If a simulation that increased its time precision is to be restarted or continued from the latest time step, then the chosen time precision may not be sufficient to represent the present time step values, i.e. a timePrecision of 3 is not sufficient to represent the latest time step at t = 0.1023 s. OpenFOAM will apply rounding to the reach the selected number of digits behind the comma. Consequently, OpenFOAM will fail to find files at time t = 0.102 s.
Hughtong likes this.
donQi 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
LES, Courant Number, Crash, Sudden Alhasan OpenFOAM Running, Solving & CFD 5 November 22, 2019 03:05
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 23:29
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
what's wrong about my code for 2d burgers equation morxio Main CFD Forum 3 April 27, 2007 11:38


All times are GMT -4. The time now is 01:41.