/*--------------------------------*- 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     simpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         2000;

deltaT          1;

writeControl    runTime;

writeInterval   100;
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 ("slat" "airfoil" "flap");

        pName p;
        Uname U;

        rho rhoInf;
        rhoInf 1.0;

        CofR (0 0 0);
    }

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

        enabled true;

        patches ("slat" "airfoil" "flap");

        pName p;
        Uname U;

        rho rhoInf;
        rhoInf 1.0;

        log true;

        CofR (0.0 0 0);

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

        writeControl   timeStep;
        writeInterval  1;

        liftDir     (0 1 0);
        dragDir     (1 0 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 k omega);
    }

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

        timeStart       1000;
        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;
            }
        );
    }
};
