CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   functionObject to control run time (http://www.cfd-online.com/Forums/openfoam-programming-development/132085-functionobject-control-run-time.html)

marc.immer March 25, 2014 11:43

functionObject to control run time
 
Hi!

I created a functionObject that helps me run computations on a cluster queue that has a limited run time.

The functionObject stops the solver 10 minutes before the cpu time reaches the cluster time limit using a time.stopAt(Time::saWriteNow); command in the execute() function.

After that it calls a script in the end() call and resubmits the run on the cluster queue.

The Problem is: if the openFoam run finishes normally, the last time step is not written to disk. I would like to solve this.

My idea so far: detect in execute() if the next time step is the last one and call time.stopAt(Time::saWriteNow); However this does not work, as functionObjects are then not called at the last time step. I though of just increasing endTime by one timestep. But I cant access the function Foam::Time::setEndTime from a function object?

I'm happy for any ideas...

Regards
Marc


All times are GMT -4. The time now is 13:48.