/*--------------------------------*- 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         100;

deltaT          1;

writeControl    adjustableRunTime;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  no;

maxDeltaT       1;

timeStepControl localCo;

localCoCoeffs
{
    reservCtrl      no;
    maxCo           0.8;
}

functions
{

    #includeFunc writeObjects(invD, thermo:rho.oil, thermo:mu.oil)

    p_rghc
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           p_rgh;
        result          p_rghc;
        scale           1.01971621297793E-05;
        writeControl    writeTime;
    }
    pc
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           p;
        result          pc;
        scale           1.01971621297793E-05;
        writeControl    writeTime;
    }
    q
    {
        type            scale;
        libs            ( "libfieldFunctionObjects.so" );
        field           phi;
        result          q;
        scale           4043578.081517;
        writeControl    writeTime;
    }

    QA
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          region0;
        regionType      faceZone;
        name            w0_icv1;
        operation       sum;
        scaleFactor     -1;
        fields          ( q );
    }
    QB
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          region0;
        regionType      faceZone;
        name            w0_icv2;
        operation       sum;
        scaleFactor     -1;
        fields          ( q );
    }
    QC
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          region0;
        regionType      faceZone;
        name            w0_fiv1;
        operation       sum;
        scaleFactor     1;
        fields          ( q );
    }
    Qtotal
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        region          region0;
        regionType      patch;
        name            outlet_region0;
        operation       sum;
        scaleFactor     1;
        fields          ( q );
    }
}

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