CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   scalarIOList auto_write doesn't' write (https://www.cfd-online.com/Forums/openfoam-programming-development/169854-scalariolist-auto_write-doesnt-write.html)

zhulianhua April 18, 2016 20:48

scalarIOList auto_write doesn't' write
 
Dear Foamers,

While does the scalarIOList constructed by the following code doesn't write automatically as other field variables like U and p ?
Code:

    scalarIOList df
    (
        IOobject
        (
            "DF"+convert.str(),
            time_.time().timeName(),
            mesh_,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        )
    )

It only writes if I explicitly call df.write().

Thanks,


Lianhua

zhulianhua April 19, 2016 02:44

The following pseudo solver can reproduce same problem:

Code:


#include "fvCFD.H"
#include "scalarIOList.H"

int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"
    scalarIOList df
    (
        IOobject
        (
            "DF",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        )
    );
    while(runTime.run())
    {
        runTime++;
        df = df + 1;
    }
    df.write();
    return 0;
}

The solver doesn't write the "DF" file at each write time specified in controlDict.

Lianhua


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