CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Changing writeInterval on the fly doesn work in parallel runs (https://www.cfd-online.com/Forums/openfoam-solving/140206-changing-writeinterval-fly-doesn-work-parallel-runs.html)

ssss August 10, 2014 16:48

Changing writeInterval on the fly doesn work in parallel runs
 
Hi,

I'm using OF210 and I implemented an automatic change the writeInterval depending on the time of the simulation. Here is the implementation in the solver :

Code:

int main(){
...
IOdictionary controlDict(IOobject("controlDict", runTime.system(),mesh,IOobject::MUST_READ,IOobject ::AUTO_WRITE));
...
while (runTime.loop()){
...
    if(runTime.value()>=0.05){
        Info<<"I enter"<<endl;
        controlDict.set("writeInterval",0.05);
        controlDict.Foam::regIOobject::write();
    }
...
}
}

It works as I expect during serial runs, the controlDict changes and the changes are notified right to the solver.

But once I make a parallel run, the controlDict which is in every /case/processor*/system/ changes, but the one in the case/system/ doesn't change, and I don't know why, but he uses the writeInterval which is in the main case folder.

Here is my controlDict:

Code:

startFrom      startTime;
startTime      0;
stopAt          endTime;
endTime        700;
deltaT          0.0005;
writeControl    adjustableRunTime;
writeInterval  0.01;

purgeWrite      0;
writeFormat    ascii;
writePrecision  6;
writeCompression off;
timeFormat      general;
timePrecision  6;

runTimeModifiable true;

maxCo          0.7;

adjustTimeStep yes; // Or no

maxDeltaT 1;

Anyone has an idea on how to fix this?

Thank you very much.

brugiere_olivier March 16, 2016 05:06

Hello everyone,

I have the same problem with version OF240. Does someone has an idea to fixe the problem?

thank you in advance

dupeng September 25, 2017 14:22

Hi, Have you solve this problem? I have this problem too recently and don't have a solution. Thanks.

piu58 September 26, 2017 00:43

It may be that that doesn't work. In parallel, the calculating task has to be splitted into tasks for each processor. Changing the control dict would lead to a compilation of the result so far an a new splitting. I don't think that this is implemented.

dupeng September 26, 2017 03:01

Thanks. I found another soluting using the timeactivatedfileupdate function object to copy and replace the controlDict reaching a specified time. It works great for serial simulations. But for parallel simulations, it only regIOobject for the first time. The controlDict is replaced after that but the changes are not updated. Very strange. I am using OpenFoam 3.0.


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