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

libs            ("liboverset.so");

application     overPimpleDyMFoam;

startFrom       latestTime;//startTime;

startTime       0;//0;

stopAt          endTime;

endTime         2000;

deltaT          1;//0.00002;//0.0025;0.0001;

//writeControl    timeStep;
//writeInterval   10;

writeControl    adjustableRunTime;
writeInterval   50;//5.;0.05

purgeWrite      0;

writeFormat     ascii;

writePrecision  12;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

//adjustTimeStep  yes;

//maxCo           0.5;

functions
{
probes
        {
        type            probes;
        functionObjectLibs            ("libsampling.so");
        writeControl    timeStep;
        writeInterval   10;

        fields
        (
            Pp p U k
        );

        probeLocations
        (
         (-1 0 0)
        );

        }
cuttingPlane1
    {
    type            surfaces;
    functionObjectLibs            ("libsampling.so");
    writeControl    writeTime;

    surfaceFormat   vtk;
    fields          (Pp p U k);

    interpolationScheme cellPoint;

    surfaces
    (
        yNormal
        {
            type            cuttingPlane;
            planeType       pointAndNormal;
            pointAndNormalDict
            {
                point   (0 0 0);
                normal  (0 0 1);
            }
            interpolate     true;
        }
    );
    }
    forces
    {
        type                forces;
        libs                ("libforces.so");
        writeControl        timeStep;
        writeInterval       10;
        patches             (cylinder);
        rho                 rhoInf;
        log                 true;
        rhoInf              1;//1
        CofR                (0 0 0);
		liftDir             (0 1 0); 
        dragDir             (-1 0 0); 
    }
	
	forceCoeffs
   {
        type        forceCoeffs;
        //type      forces;

    functionObjectLibs ( "libforces.so" );

    outputControl   timeStep;
    timeInterval    10;

    log         yes;

    patches     (cylinder);
    pName       p;
    UName       U;
    rho         rhoInf;      // Indicates incompressible
    log         true;
    rhoInf      1;           // Redundant for incompressible
    liftDir     (0 0 1);
    dragDir     (-1 0 0);
    CofR        (0 0 0);  // Axle midpoint on ground
    pitchAxis   (0 0 1);
    magUInf     0.1;//0.03854;
    lRef        1;        // Wheelbase length
    Aref        0.1;        // Estimated

    /*binData
    {
        nBin        20;          // output data into 20 bins
        direction   (1 0 0);     // bin direction
        cumulative  yes;
    }*/
    }

}
// ************************************************************************* //
