Write interval not in exact number
Hi guys,
I've been using OpenFOAM for a while, and this is the first time that I've encountered this minor but annoying problem. I have set my "writeControl" to "runTime" with interval of 0.1, which should write the simulation results in 0.1s intervals (0, 0.1, 0.2 etc.), but instead I'm getting folders for 0, 0.0999999999, 0.19999999 etc. It's rather easy, but time consuming to fix by renaming all the folders, but I'm wondering if there is a way to make sure all folders are named for the specified time in controlDict. Thanks, John p.s. I do not use adjustable time step option as it sometimes enforces very very small time steps (1e-9) and unnecessarily slow down the simulation process (compare to the same simulation using constant time step of 1e-6 without running into any problem). |
Maybe post your controlDict settings. It would be of help.
|
Sorry for the delay in reply, the email notification probably ended up in spammail box and I forgot to check the forum until today. The maxCo was required by the solver for some reason, but shouldn't effect the writeControl, right?
Here's my controlDict: Code:
|
Try:
writeControl adjustableRunTime; Best, |
Thanks for the input, tried that, same result, though =/
I've renamed all the folders manually already, anyway. On a side note, I really should check my thread subscription notification setting, I did not see your post until today. John |
writeInterval in OpenFOAM does not always write at the desired time
I have had problems with writeInterval as weel. Even if I specify 0.02 time for the writeInterval I may get a file that say instead of having the time stamp 21.20, will have a timeStamp of 21.219999. After fiddling around with the problem, I noted that in controlDcit if I change the precision to 7 in the following section of controlDict, I dont have that problem any more. I suppose that allowing more digits after the decimal, OpenFOAM as enough digits to upgrade to the next integer:
. . . stuff deleted writeInterval 0.02; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression compressed; timeFormat general; timePrecision 7; runTimeModifiable no; adjustTimeStep yes; maxCo 0.5; maxAlphaCo 0.5; maxDeltaT 1; . . . .stuff deleted |
Quick question @musahossein: Which specific OpenFOAM version are you using? Because the more recent versions are meant to have this issue already fixed.
edit: Looks like this is related to this thread: http://www.cfd-online.com/Forums/ope...tml#post520710 |
Quote:
|
Clarification
I was just playing around trying to get the simulation times of one of my simulations to output nicely (e.g. 0.05, 0.10, 0.15 ... etc.). The solution is a combination of suggestions provided by others on this thread. For those that might be interested, here are the steps to follow:
Maybe setting both writePrecision and timePrecision to 12 might be a bit of overkill, but it worked for me. |
All times are GMT -4. The time now is 06:32. |