|
[Sponsors] |
November 8, 2020, 09:25 |
probes, time precision
|
#1 |
New Member
Březňák
Join Date: Jun 2020
Location: Prag
Posts: 21
Rep Power: 5 |
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) # Probe 1 (0 0.04 1.85) # Probe 2 (0.925 0.04 1.6) # Probe 3 (-0.15 0.04 0.01) # Probe 4 (0.045 0.04 0.02) # Probe 0 1 2 3 4 # Time 2000 1.78184 0.6442999 0.00558417 141.3473 -404.4807 2000 1.841377 0.686592 0.03120884 141.6884 -404.1845 2000 1.855883 0.695026 0.04811285 141.968 -404.1179 2000 1.888686 0.7184033 0.05930709 142.2264 -404.1271 2000 1.914136 0.7344452 0.06844439 142.4588 -404.1508 and so on... 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? |
|
November 15, 2020, 14:28 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 666
Rep Power: 14 |
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.
|
|
November 16, 2020, 05:06 |
|
#3 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10 |
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. |
|
June 9, 2021, 08:18 |
|
#4 |
Member
Tom Lauriks
Join Date: Apr 2020
Posts: 34
Rep Power: 6 |
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. |
|
June 10, 2021, 03:50 |
|
#5 |
Member
Tom Lauriks
Join Date: Apr 2020
Posts: 34
Rep Power: 6 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Elastic or Plastic Deformations in OpenFOAM | NickolasPl | OpenFOAM Pre-Processing | 36 | September 23, 2023 08:22 |
bash script for pseudo-parallel usage of reconstructPar | kwardle | OpenFOAM Post-Processing | 41 | August 23, 2023 02:48 |
Increase of time precision for no apparent reason | Bazinga | OpenFOAM Running, Solving & CFD | 1 | July 4, 2022 04:16 |
pressure in incompressible solvers e.g. simpleFoam | chrizzl | OpenFOAM Running, Solving & CFD | 13 | March 28, 2017 05:49 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 00:01 |