CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Not writing volScalarField to hard disk (https://www.cfd-online.com/Forums/openfoam/81044-not-writing-volscalarfield-hard-disk.html)

piccinini October 14, 2010 08:46

Not writing volScalarField to hard disk
 
Hello,

I've added the temperature to an incompressible solver (pisoFoam) as a volScalarField (adding the code below to createFields.H).

Code:

    volScalarField T
    (
        IOobject
        (
            "T",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
    mesh
    );

During the solver execution, I write to screen the maximum and minimum values of T (I also added the equation for T) with the following code:

Code:

        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl
            << "rho max/min : " << max(rho).value() << " " << min(rho).value()
            << nl
            << "T max/min : " << max(T).value() << " " << min(T).value()
            << nl << endl;

T max an T min are about 45 K different (315 and 270 K). When OpenFoam writes the T field to the hard disk, however, the T file remains always the same file as the initial one from the initial conditions. Does someone have a clue about what is going on?

Thanks.

Cyp October 14, 2010 13:26

It seems to come from the instruction runTime.write(); in your main file.

Are you sure it is correctly inserted ?


All times are GMT -4. The time now is 21:48.