CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Resetting a simulation (

Traib April 28, 2013 02:19

Resetting a simulation

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.


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:
  3. You could also stopping and continuing by running:

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

  4. Or rely on a shell script that assists you in pausing things when you want: - i.e, the script you take care of pausing...
  5. :eek: I didn't know about this one: "timeActivatedFileUpdate" ->
  6. You could do it with C++ source code, if you want something more automatic that changes depending on a certain condition: "codedFunctionObject" ->
  7. With swak4Foam+pythonFlu, you could do the same but with Python: +
  8. You could even create a variant of the function object "abortCalculation": - the variant could pause indefinitely while a file exists.
Best regards,

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 06:29.