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/)
-   -   Have only process 0 write data (https://www.cfd-online.com/Forums/openfoam-solving/162056-have-only-process-0-write-data.html)

syavash November 2, 2015 09:15

Have only process 0 write data
 
Hi Foamers,

In my calculation using pisoFoam solver, I need to write a variable at each time step. This is done through adding the following line to pisoFoam solver:

Code:

word patchName = "inlet";
label patchID = mesh.boundary().findPatchID(patchName);   
 
  IOField<vector> U2
(
    IOobject
    (
        "U",
        mesh.time().constant(),
        "boundaryData/inlet"/runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    U.boundaryField()[ patchID ]
);

U2.write();

This block makes the solver to write the velocity boundary data for inlet bc.
The number of time steps is very huge! So many many files are generated.

The problem is that when I decompose my case to run in parallel mode, every process generates its own files while I only want process 0 to write data into file. Now this is my question:

How can I have only process 0 to write data into files and exclude the other processes?!

Thanks
Syavash

syavash November 3, 2015 06:05

No body wants to help??!:p


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