probes, time precision
Hello,
I did a steady state RANS simulation with 2000 iterations. After that, I tried to start LES from this 2000 folder, with collecting some variables with probes. but if I see the result file, Code:
# Probe 0 (-0.925 0.04 1.6) it should be 2000 2000.0000002 2000.0000004 2000.0000006 and so on... I already tried to change time and write precision in controlDict. Do you have any idea? |
What did you change the time precision to? It seems like you need something like 11 at least, which is rather high. Can you not just rename this to start at zero, and then you can deal with a more manageable precision level.
|
Ahoj Breznak:
Based on similar experience with I think there is some kind of hard-coded precision in reading and writing out time in OpenFOAM. I noticed that everything beyond the 6th sig. fig will be ignored, so 2000.0000002 and 2000.0000004 gets written to 2000 in your case. I don't know the part of the code which dictates this, though, as I kind of worked around it, as my time precision needed not be as high as you, but my problem occurred as I was defining a table value for a Function1 object for a boundary condition (uniformFixedValue). OpenFOAM returned an error because it thought I was defining two different values at the same time, as the difference in time was originally below the 6th sig. fig.. Perhaps this could give you a place to look for a solution. Gerry. |
I'm running into the same issue.
I've not yet tried to implement a solution, but I think that there should be 2 solutions. Firstly, my time step dirs are much more precise than what is written out by the probes. Hence, a more precise time specification should be available in openfoam. As a matter of fact, I've seen a couple of times in the log file in the past, that openfoam automaticaly increases the time accuracy if needed (e.g. if the Courant number becomes too high). Hence, the limited time accuracy in the probes output, if not adjustable by the controlDict, will be a consequence of the code in the sampling function object. A solution would be to adapt the code of this function object. As I find this rather cumbersome for such a minor glitch, I think that a quicker solution can be, to write a script (e.g. python, linux bash) that extracts the time steps from the log file, as these are more accurate. Then replace the time steps in the probes file with the extracted time steps. |
It seems like I answered to quickly. When I set "writePrecision 9;" in controlDict, I do indeed get the corresponding time precision in the probes output file, e.g. 0.000249586821 is one of my time steps in this file. (openfoam v2012).
I've noticed that setting "timePrecision" doesn't matter for this problem. "writePrecision" determines the writing precision. If it is set too low, time steps are written out not accurately, even if "timePrecision" is high. On the other hand, when using a variable time step size, openfoam will automatically increase the time step accuracy if needed. |
All times are GMT -4. The time now is 15:31. |