/*--------------------------------*- 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;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


libs
(
    "liboverset.so"
    "libfishBodyMotion.so"
);

DebugSwitches
{
    overset                 0; 	//0 off - 1 give more information
    dynamicOversetFvMesh    0;
    cellVolumeWeight        0;
    inverseDistance	        0;	//2 Force dumping of cellInterpolationWeight
}



application     overPimpleDyMFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;
//stopAt          writeNow;

// endTime         3.5;
// deltaT          0.05;
// purgeWrite      0;
endTime         37.5;	//350;
deltaT          1e-06;
purgeWrite      5;

writeControl    timeStep;

writeInterval   10;

writeFormat     binary;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;
maxCo           0.5;
maxDeltaT       0.1;



// ************************************************************************* //


functions
{

///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////

    forces_object
    {
	type forces;
	libs ("libforces.so");

	//writeControl outputTime;
	writeControl   timeStep;
	writeInterval  1;

	//// Patches to sample
	//patches ("body1" "body2" "body3");
	patches ("wing.*");

	//// Name of fields
	pName p;
	Uname U;

	//// Density
	rho rhoInf;
	rhoInf 1026.021;

	//// Centre of rotation
	CofR (0.25 0 0);
    }

///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////

    forceCoeffs_object
    {
	// rhoInf - reference density
	// CofR - Centre of rotation
	// dragDir - Direction of drag coefficient
	// liftDir - Direction of lift coefficient
	// pitchAxis - Pitching moment axis
	// magUinf - free stream velocity magnitude
	// lRef - reference length
	// Aref - reference area
	type forceCoeffs;
	libs ("libforces.so");
	//patches ("body1" "body2" "body3");
	patches ("wing.*");

	pName p;
	Uname U;
	rho rhoInf;
	rhoInf 1026.021;

	//// Dump to file
	log true;

	CofR (0.25 0 0);
	liftDir (0 1 0);
	dragDir (1 0 0);
	pitchAxis (0 0 1);
	magUInf 1.0;
	lRef 1.0;         // reference lenght for moments!!!
	Aref 1.0;	//2.0;         // reference area 1 for 2d

        writeControl   timeStep;
        writeInterval  1;
    }
};

