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

variable writeInterval and purgeWirte in controlDict

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By detectivegu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2018, 09:42
Default variable writeInterval and purgeWirte in controlDict
  #1
New Member
 
Boram
Join Date: Mar 2018
Posts: 1
Rep Power: 0
detectivegu is on a distinguished road
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!
louisgag likes this.
detectivegu is offline   Reply With Quote

Old   May 2, 2018, 04:21
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
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
tomf is offline   Reply With Quote

Old   April 3, 2020, 08:33
Default
  #3
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
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;
    }
 }
where you set executeInterval to the rate at which you want your saveTimes.sh script to run and do something like renaming or copying a selection of matching output folders...


Anyone tried something like this?
louisgag is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 05:29.