/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM:  The Open Source CFD Toolbox
   \\    /   O peration     | Version:   OpenFOAM-9 (f8d11b031) (openfoam.org)
    \\  /    A nd           | Upstream:  A Wikki Brasil project (wikki.com.br)
     \\/     M anipulation  | Version:   dev
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     upstreamFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         15768000;

deltaT          3600;

writeControl    adjustableRunTime;

writeInterval   3153600;

purgeWrite      0;

writeFormat     ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxDeltaT       86400;

functions
{
    progress
    {
        type            progress;
        libs            ( "libfunctionObjectsAddOn.so" );
        writeControl    timeStep;
        writeInterval   1;
    }
    pMean
    {
        type            pMean;
        libs            ( "libupstreamFoamFunctionObjects.so" );
        scaleFactor     1;
        writeControl    timeStep;
        writeInterval   1;
    }
//   noWriteObjects
//   {
//       type            noWriteObjects;
//       libs            ( "libfunctionObjectsAddOn.so" );
//       writeControl    writeTime;
//       objects         ( T.oil T.rock0 U U.oil reserv buoyancy invD phi.oil alpha0.rock0 S.oil invK.rock0 alpha.rock0 p p_rgh );
//   }
    calcPerm
    {
        type            inv;
        libs            ( "libfunctionObjectsAddOn.so" );
        writeControl    writeTime;
        scale           1.01325e+15;
        field           invK.rock0;
        result          K;
    }
    p_rghc.reservoir
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           p_rgh;
        result          p_rghc;
        scale           1.01972e-05;
        writeControl    writeTime;
    }
    pc.reservoir
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           p;
        result          pc;
        scale           1.01972e-05;
        writeControl    writeTime;
    }
    p_rghc.well0
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           p_rgh;
        result          p_rghc;
        scale           1.01972e-05;
        writeControl    writeTime;
        region          well0;
    }
    pc.well0
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           p;
        result          pc;
        scale           1.01972e-05;
        writeControl    writeTime;
        region          well0;
    }
//   noWriteObjects0
//   {
//       type            noWriteObjects;
//       libs            ( "libfunctionObjectsAddOn.so" );
//       writeControl    writeTime;
//       region          well0;
//       objects         ( T.oil reserv alpha.oil buoyancy invD phi.oil S.oil p p_rgh rDeltaT rDeltaTf porosity );
//   }
    Pout0
    {
        type            probes;
        libs            ( "libsampling.so" );
        name            probes;
        writeControl    timeStep;
        writeInterval   1;
        fields          ( p_rgh p );
        interpolationScheme cell;
        probeLocations  1 ( ( 100.072 99.999999 149 ) );
        region          well0;
    }
}

timeStepControl localCo;

localCoCoeffs
{
    reservCtrl      no;
    maxCo           0.8;
}


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