/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     upstreamFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         63072000;

deltaT          3600;

writeControl    adjustableRunTime;

writeInterval   12614400;

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.01324997e+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 p_rghc );
        interpolationScheme cell;
        probeLocations  1 ( ( 500.0426667 500 199 ) );
        region          well0;
    }
    Q_w0_liner0
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          well0;
        regionType      faceZone;
        name            w0_liner0;
        operation       sum;
        scaleFactor     40.52347978;
        fields          ( alphaRhoPhi.oil );
    }
    Q_w0_liner0_reserv
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          well0;
        regionType      faceZone;
        name            w0_liner0;
        operation       sum;
        scaleFactor     39127.608;
        fields          ( alphaPhi.oil );
    }
    Qdot_reserv
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          well0;
        regionType      patch;
        name            outlet_well0;
        operation       sum;
        scaleFactor     39127.608;
        fields          ( alphaPhi.oil );
    }
    Qdot
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          well0;
        regionType      patch;
        name            outlet_well0;
        operation       sum;
        scaleFactor     40.52347978;
        fields          ( alphaRhoPhi.oil );
    }
}

timeStepControl localCo;

localCoCoeffs
{
    reservCtrl      no;
    maxCo           0.8;
}


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