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/)
-   -   writeFormat and timeFormat in functions subDict in controlDict (https://www.cfd-online.com/Forums/openfoam-solving/162270-writeformat-timeformat-functions-subdict-controldict.html)

cfdopenfoam November 7, 2015 04:53

writeFormat and timeFormat in functions subDict in controlDict
 
deal foamers,

i am wondering if we can set the writeFormat and timeFormat in functions sub-dictionary in the controlDict.

the functionObjects i am using are faceSource and cellSource. and i test with
Code:

writeFormat bababa;
timeFormat bababa;

both not work. no error message. and the timeFormat and writeFormat set in controlDict seem not valid for data output by functionObject.

if there is a method to do this, please give me some hints.

thanks for your attention.

wyldckat November 8, 2015 14:22

Quick answer: I've checked the source code and those controls are not available independently for each function object.

As for the format... yeah, it's hard-coded to a specific format: https://github.com/OpenFOAM/OpenFOAM...jectFile.C#L39

Please report this in the bug tracker: http://www.openfoam.org/bugs/

cfdopenfoam November 20, 2015 01:43

Quote:

Originally Posted by wyldckat (Post 572476)
Quick answer: I've checked the source code and those controls are not available independently for each function object.

As for the format... yeah, it's hard-coded to a specific format: https://github.com/OpenFOAM/OpenFOAM...jectFile.C#L39

Please report this in the bug tracker: http://www.openfoam.org/bugs/

thanks for your reply. too much current work made this belated.

i will report it right now.

lukasf March 5, 2021 08:29

Hi,


have there been any changes for the most recent versions?


I found a source for OpenFOAM V2006

(https://www.openfoam.com/documentati...8H_source.html)


which says to use


Code:

    surfaces
    {
 
        type            surfaces;
 
        fields          ( p );
 
        surfaceFormat  boundaryData;
 
        formatOptions
 
        {
 
            boundaryData
 
            {
 
                format  binary;
 
            }
 
        }
 
        surfaces
 
        {
 
            outlet
 
            {
 
                type            patch;
 
                patches        (outlet);
 
                interpolate    false;
 
            }
 
        }
 
    }

but it does not work for v1902 (the files are still in ASCII format).

I found the file OpenFOAM-v1912/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/controlDict

in which the same code is used for ensight. It works for e.g. the ensight format but not for boundaryData which is just written in ASCI.

Code:

    cuttingPlane
    {
        type            surfaces;
        libs            (sampling);
        writeControl    timeStep;
        writeInterval  1;
        timeStart      0;

        surfaceFormat  boundaryData; //ensight;
        formatOptions
        {
            boundaryData //ensight
            {
                format binary;
                collateTimes true;
            }
        }
        fields          (U);

        interpolationScheme cellPoint;

        surfaces
        (
            zNormal
            {
                type            cuttingPlane;
                planeType      pointAndNormal;
                pointAndNormalDict
                {
                    point      (0 0 -0.01);
                    normal      (0 0 1);
                }
                interpolate    false;
            }
        );
    }

I might give OpenFOAM V2006 a try.





Best regards,


Lukas


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