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

application     multiphaseEulerFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.5;

deltaT          0.0001;

writeControl    adjustableRunTime;

writeInterval   0.5;

purgeWrite      0;

writeFormat     ascii;

writePrecision  9;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           0.5;

maxDeltaT       0.001;

functions
{
   outflow
    {
        type            surfaceFieldValue;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        log             yes;
        writeFields     false;
        regionType      patch;
        name            outlet;
        operation       sum;
        fields          ( alphaRhoPhi.gas  alphaRhoPhi.liquid);
    }
    inflow
    {
        type            surfaceFieldValue;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        log             yes;
        writeFields     false;
        regionType      patch;
        name            inlet;
        operation       sum;
        fields          ( alphaRhoPhi.gas alphaRhoPhi.liquid);
    }
    outletGas
    {
        type            surfaceFieldValue;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        log             yes;
        writeFields     false;
        regionType      patch;
        name            outlet;
        operation       weightedSum;
        weightField     alphaRhoPhi.gas;
        fields          ( h.gas );
    }
    outletLiquid
    {
        type            surfaceFieldValue;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        log             yes;
        writeFields     false;
        regionType      patch;
        name            outlet;
        operation       weightedSum;
        weightField     alphaRhoPhi.liquid;
        fields          ( h.liquid );
    }
    inletGas
    {
        type            surfaceFieldValue;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        log             yes;
        writeFields     false;
        regionType      patch;
        name            inlet;
        operation       weightedSum;
        weightField     alphaRhoPhi.gas;
        fields          ( h.gas );
    }
    inletLiquid
    {
        type            surfaceFieldValue;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        log             yes;
        writeFields     false;
        regionType      patch;
        name            inlet;
        operation       weightedSum;
        weightField     alphaRhoPhi.liquid;
        fields          ( h.liquid );
    }
    #includeFunc writeObjects(d.gas)
}


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