// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
FoamFile{
	version	 2.0;
	format	  ascii;
	class	   dictionary;
	location	"system";
	object	  controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs
(
	"libOpenFOAM.so"
	"libforces.so"
	"libOpenFOAM.so"
);

application	 olaDyMFlow;

startFrom	   latestTime;

startTime	   0.0;

stopAt		  endTime;

endTime		 1.0;

deltaT		  0.0005;

writeControl	adjustable;

writeInterval   0.001;

writeFormat	 ascii;

writePrecision  6;

writeCompression off;

timeFormat	  general;

timePrecision   12;

runTimeModifiable false;
adjustTimeStep false;

DebugSwitches
{
  level	2;
  lduMatrix 2;
  libs 2;
}
OptimisationSwitches
{
fileHandler collated;
maxThreadFileBufferSize 1e9; // v1712 default is 0;
maxMasterFileBufferSize 1e9;
}


maxCo		   0.5;
maxAlphaCo	  0.5;
maxDeltaT 0.0005;
functions 
{
			preCICE_Adapter
	{
	   type preciceAdapterFunctionObject;
		libs ("libpreciceAdapterFunctionObject.so");
	}
	
	freeSurfaceVTK
   {   
	   type			surfaces;
	   functionObjectLibs
	   (   
		   "libsampling.so" 
	   );  
	   outputControl   outputTime;
	   outputInterval  1;  
	   surfaceFormat  vtk;
	   fields
	   (   
		   alpha.water
	   );  
	   surfaces
	   (   
		   freeSurface
		   {   
			   type		isoSurfaceCell;
			   isoField	alpha.water;
			   isoValue	0.5;
			   interpolate false;
			   regularise  false;
		   }   
		   
	   );  
	   interpolationScheme cell;
   }
   XSec1
		{   
		   type			surfaces;
		   functionObjectLibs
		   (   
			   "libsampling.so" 
		   );  
		   outputControl   outputTime;
		   outputInterval  1;  
		   surfaceFormat  vtk;
		   fields
		   (   
			   p
				   U
				   alpha.water
				   
		   );  
		   surfaces
		   (   
			interpolatedSurface
			{
				// Cutingplane using iso surface
				type			cuttingPlane;
				planeType	   pointAndNormal;
				pointAndNormalDict
				{
					basePoint	   (0.1 0.01 0.01);
					normalVector	(0 0 1);
					}
				interpolate	 true;	   
				}	
		   );  
		   interpolationScheme cell;
	   }
	   structureInterface
	{   
	   type			surfaces;
	   functionObjectLibs
	   (   
		   "libsampling.so" 
	   );  
	   outputControl   outputTime;
	   outputInterval  1;  
	   surfaceFormat  vtk;
	   fields
	   (   
		   p
				   U
				   alpha.water
				   
	   );  
	   surfaces
	   (   
		interface
		{
			type			patch;
			patches	   (interface);	
			}	
	   );  
	   interpolationScheme cell;
   }
   
interface
	{
	type		  forces;
	libs		  ("libforces.so");
	writeControl  timeStep;
	timeInterval  1;
	log		   yes;
	patches	   (interface);
	rho		   rhoInf;	 // Indicates incompressible
	log		   true;
	rhoInf		1000;		  // Redundant for incompressible
	CofR		  (0.006 0.04 -0);	// Rotation around centroid of group
	pitchAxis	 (0 1 0);
	}

	#includeFunc  pressureSamplingPoints 
	#includeFunc  baseForces 
	#includeFunc  storyForces 

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