CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

Write interval not in exact number

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By cwang5
  • 1 Post By musahossein

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2011, 09:09
Default Write interval not in exact number
  #1
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
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).
M.W.G. likes this.
cwang5 is offline   Reply With Quote

Old   April 30, 2011, 03:23
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Maybe post your controlDict settings. It would be of help.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 3, 2011, 07:06
Default
  #3
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
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:
application     pimpleDyMFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         10;

deltaT          2e-06;

writeControl runTime;

writeInterval   0.1;

purgeWrite      0;

writeFormat     binary;

writePrecision  12;

writeCompression uncompressed;

timeFormat      general;

timePrecision   12;

runTimeModifiable yes;

adjustTimeStep  no;

maxCo           0.05;

maxDeltaT       1e-6;
cwang5 is offline   Reply With Quote

Old   May 4, 2011, 01:03
Default
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Try:

writeControl adjustableRunTime;

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 31, 2011, 21:43
Default
  #5
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
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
cwang5 is offline   Reply With Quote

Old   November 28, 2014, 17:35
Default writeInterval in OpenFOAM does not always write at the desired time
  #6
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18
musahossein is on a distinguished road
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
Gunnern likes this.
musahossein is offline   Reply With Quote

Old   December 13, 2014, 21:41
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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

Last edited by wyldckat; December 14, 2014 at 08:30. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   December 15, 2014, 09:11
Default
  #8
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18
musahossein is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
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
I am using version 2.2.1.
musahossein is offline   Reply With Quote

Old   August 31, 2018, 14:26
Smile Clarification
  #9
New Member
 
Université de Sherbrooke
Join Date: Jul 2015
Posts: 6
Rep Power: 11
Jason_Duguay is on a distinguished road
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:
  1. set writeControl to ajustableRunTime
  2. set writePrecision to 12
  3. set timePrecision to 12

Maybe setting both writePrecision and timePrecision to 12 might be a bit of overkill, but it worked for me.
Jason_Duguay 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
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 01:52
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 10:01
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36


All times are GMT -4. The time now is 15:03.