CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Resetting a simulation (https://www.cfd-online.com/Forums/openfoam/116903-resetting-simulation.html)

Traib April 28, 2013 02:19

Resetting a simulation
 
Hi,

Just a quick, dump question- is it possible to pause a solution at any instant and reset a few solution control parameters (for e.g. max Co, time step, etc.), without having to totally stop the calculation and start at the last written timestep??? I have done this in Fluent where its very simple so I think this can also be done in OpenFOAM as well.

I am running it on Ubuntu 12.04 if it is of any relevance.

Thanks.

wyldckat April 28, 2013 06:55

Greetings Traib,

There are several possible ways to do this in OpenFOAM; to name a few... er, several:
  1. No need to stop. Simply change the dictionary files and OpenFOAM will automatically read them when they are changed.
  2. On Linux, if you're running directly from the command line, you could hit the "Ctrl+Z" key combination for freezing the application, then run fg or bg to unfreeze. For more information: http://linuxreviews.org/beginner/jobs/
  3. You could also stopping and continuing by running:
    Code:

    # to pause
    kill -s STOP <pid number>
    # to continue
    kill -s CONT <pid number>

    Source: http://www.articleworld.org/index.ph...x-like_systems
  4. Or rely on a shell script that assists you in pausing things when you want: http://openfoamwiki.net/index.php/Ti...ect_systemCall - i.e, the script you take care of pausing...
  5. :eek: I didn't know about this one: "timeActivatedFileUpdate" -> http://foam.sourceforge.net/docs/cpp...4.html#details
  6. You could do it with C++ source code, if you want something more automatic that changes depending on a certain condition: "codedFunctionObject" -> http://foam.sourceforge.net/docs/cpp/a00247.html
  7. With swak4Foam+pythonFlu, you could do the same but with Python: http://openfoamwiki.net/index.php/Contrib/swak4Foam + http://pythonflu.wikidot.com/
  8. You could even create a variant of the function object "abortCalculation": http://foam.sourceforge.net/docs/cpp/a00003.html - the variant could pause indefinitely while a file exists.
Best regards,
Bruno

Traib April 28, 2013 08:42

Wow, I wouldn't have imagined I had that many options.

Method-1 and 2 is what I need most of the time. But method-5 seems useful for lengthy simulation that I sometimes need to do in separate steps, like turning chemistry/combustion on/off during the simulation. But I should look into it more to use it in my setup. Thanks.


All times are GMT -4. The time now is 20:10.