/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2406                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}

application     rhoSimpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         25000;

deltaT          1;

writeControl    timeStep;

writeInterval   1000;
purgeWrite      1;

writeFormat     ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

functions
{
    forces_object
    {
        type forces;
        functionObjectLibs ("libforces.so");

        writeControl   timeStep;
        writeInterval  1;

        enabled true;

        patches ("aerofoil");

        pName p;
        Uname U;

        rhoInf 0.8984926;

        CofR (0 0 0);
    }

    forceCoeffs_object
    {
        type forceCoeffs;
        functionObjectLibs ("libforces.so");

        enabled true;

        patches ("aerofoil");

        pName p;
        Uname U;

        rhoInf 0.8984926;

        log true;

        CofR (0.0 0 0);

        pitchAxis (0 0 1);
        magUInf 236;
        lRef 1;
        Aref 1;

        writeControl   timeStep;
        writeInterval  1;

        liftDir     (-0.02705 0.99963 0);
        dragDir     (0.99963 0.02705 0);
    }

    yplus
    {
        type            yPlus;
        libs            ("libfieldFunctionObjects.so");
        writeFields     yes;
        executeControl  timeStep;
        executeInterval 1;
        writeControl    writeTime;
        enabled         true;
        log             true;
    }

    residuals1
    {
        type            solverInfo;
        libs            ("libutilityFunctionObjects.so");

        writeControl    timeStep;
        writeInterval   1;

        log             true;

        fields          (U p h k omega);
    }

    fieldAverage1
    {
        type            fieldAverage;
        libs            ("libfieldFunctionObjects.so");

        timeStart       18000;
        writeControl    onEnd;

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            p
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            nut
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            yPlus
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        );
    }
};
