I’m running rather long FSI simulations using OpenFOAM and preCICE. Although I use the adjustableRunTime in the OpenFOAM configuration, OpenFOAM starts to name the solution directories according to an accumulated time step, e.g., 8.100000000001 instead of 8.1. Also, the time precision is with 12 already selected rather high in OpenFOAM. Is there an opportunity to prevent this?
Background: I use a script to postprocess my data and the unexpected naming destroys the functionality of the script.
I also noted that preCICE writes the time to a precision of 16 digits in my watchpoint file. Here, the time is also not exactly the specified time-window-size, i.e., 0.0810000000000001 instead of 0.081. I know that preCICE has the option to specifiy <time-window-size valid-digits="" time-window-size\> in the config file. But what is the impact. Does it just affect the writing of data or could it lead an undesired subcycling of participants due to truncated time-step sizes?
Could you please upload your controlDict? Also, which OpenFOAM version are you using?
I assume you are using implicit coupling. When we repeat a timestep, we need to force OpenFOAM to rewrite results, and this may be related. But this behavior could also be version-specific, as there are a few changes in the behavior of function objects in the past few years.
I am not sure I understand the question. You already set a high timePrecision, which is only for the result files. Wouldn’t simply reducing the time precision help? Do you really need to look into so high time precision?
I understand that you have two questions:
First question: Why at high precision you start getting rounding errors. I guess you are operating in the limits of machine precision and after a while, the error starts accumulating. We could analyze all the involved variables in preCICE and the OpenFOAM adapter, but I would not do that unless there is a clear use case.
Second question:
To this, maybe @uekerman knows more. Our XML Reference does not seem to help in this case.
Ok, there was a misinterpretation on my side. I thought it would affect the precision of the time handling in general for the whole computation, not for the writing procedure. Choosing a high precision should then prevent inaccuracies.
Lowering it will likely solve the problem here to some extend. Running the simulation longer will lead to the same issue at some time though.