|
[Sponsors] |
variable writeInterval and purgeWirte in controlDict |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
May 1, 2018, 09:42 |
variable writeInterval and purgeWirte in controlDict
|
#1 |
New Member
Boram
Join Date: Mar 2018
Posts: 1
Rep Power: 0 |
Hello,
I need some help on how to modify "controlDict" to have variable "writeInterval" and "purgeWrite". I am solving from 0 to 100 seconds, and want to have written results every 10 seconds at the end of the simulation. But I also want to temporarily save intermediate results as well, in case the simulation ends before the specified end time and can be restarted from not too many time steps ago. For example, with dt = 1, every time step is saved, so I will have time directories of 0, 1, 2, 3, ... and when the solver passes 10 seconds, the directory 10 is created and the rest (1 to 9) are removed. Subsequently, 11 to 20 directories are created and then 11-19 are removed when the solver successfully converges at t=20 sec. This way, I have results every 10 seconds if the simulation ends normally. But when the simulation is stopped, let's say, at 17 sec, for some reasons (e.g., wall time exceeds in HPC), I can restart the simulation from the latest stored time, which is 16 sec, instead of 10 sec. Is there anyone who runs simulations in this way by modifying "controlDict" or maybe source code? Any suggestions would be much appreciated! Thank you! |
|
May 2, 2018, 04:21 |
|
#2 |
Senior Member
|
Hi,
You may want to use the writeObjects functionObject. However I am not sure if there is a purgeWrite functionality. It may work like writing objects normally every 1 second and using purgewrite 1 or purgewrite 2 and than have the writeObjects write every 10 seconds. You may want to test this with one of the smaller tutorials. Regards, Tom |
|
April 3, 2020, 08:33 |
|
#3 |
Senior Member
|
Hi,
did you succeed with writeObjects? I am also interested in having a more customizable output frequency. I was thinking an alternative (maybe simpler because it avoids possible double writes) would be to execute a systemCall, something like this in controlDict: Code:
functions { mySysCall { type systemCall; libs ( "utilityFunctionObjects" ); master true; executeCalls 1("./saveTimes.sh"); writeControl none; executeControl runTime; executeInterval 1; } } Anyone tried something like this? |
|
|
|