/*--------------------------------*- C++ -*----------------------------------*\
  ==  == ====== ====   ====    |
                    \\     ||  | Multiphase Cases Repository by HZDR
  ======   //   ||  || ===//   | Website: https://doi.org/10.14278/rodare.811
  ||  ||  //    ||  // || \\   | License: Creative Commons Attribution 4.0
  ==  == ====== ====   ==  ==  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      functions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#includeFunc    residuals(p_rgh,k.water,omega.water,funcName=residuals)
#includeFunc    timeStep
#includeFunc    cellMax(Co)
#includeFunc    cellMax(Co.air)
#includeFunc    cellMax(Co.water)
#includeFunc    addonPhaseForces(phase=water)
#includeFunc    CourantNo(phi, result=Co)
#includeFunc    CourantNo(phi.air, result=Co.air)
#includeFunc    CourantNo(phi.water, result=Co.water)
#includeFunc    yPlus(phase=water)
#includeFunc    writeObjects
(
    continuityError.water,
    continuityError.air,
    degassingBC:rho.air:Sp,
    d.air
)

#includeFunc    turbulenceFields
(
    epsilon,
    phase=water,
    executeControl=timeStep
)

#includeFunc    fieldAverage
(
    U.water,
    U.air,
    p,
    p_rgh,
    k.water,
    omega.water,
    nut.water,
    epsilon.water,
    alpha.air,
    timeStart=10,
    prime2Mean=yes,
    name=fieldAverage
)

#includeFunc    probes
(
    name=probesUWaterTP,
    points=
    (
        (0.050 0.040 0.120)
        (0.050 0.040 0.200)
        (0.000 0.000 0.070)
    ),
    fields=
    (
        U.water
        UMean.water
        U.air
        UMean.air
    )
)

#includeFunc    volIntegrate
(
    name=volIntegrateEpsWater,
    field=epsilon.water,
    weightField=alpha.water
)

#includeFunc    volIntegrate
(
    name=volIntegrateAlphaAir,
    field=alpha.air
)

#includeFunc    volIntegrate
(
    name=volIntegrateDegassingSp,
    field=degassingBC:rho.air:Sp
)

#includeFunc    forcesCompressible
(
    patches=(wall-stirrer),
    phase=water, p=p, U=U.water,
    rho=rho.water,
    CofR=(0 0 0),
    pitchAxis=(0 0 1),
    funcName=forcesRotatingPatchesWater
)

#includeFunc    forcesCompressible
(
    patches=(wall-stirrer),
    phase=air, p=p, U=U.air,
    rho=rho.air,
    CofR=(0 0 0),
    pitchAxis=(0 0 1),
    funcName=forcesRotatingPatchesAir
)

#includeFunc    forcesCompressible
(
    patches=(wall-tank wall-sparger wall-baffles),
    phase=water, p=p, U=U.water,
    rho=rho.water,
    CofR=(0 0 0),
    pitchAxis=(0 0 1),
    funcName=forcesStationaryPatchesWater
)

#includeFunc    forcesCompressible
(
    patches=(wall-tank wall-sparger wall-baffles),
    phase=air, p=p, U=U.air,
    rho=rho.air,
    CofR=(0 0 0),
    pitchAxis=(0 0 1),
    funcName=forcesStationaryPatchesAir
)

#includeFunc graphCell
(
    name=Z0.50,
    start=(0.000 0.0590 0.000),
    end=(0.000 0.0590 0.236),
    axis=z,
    setFormat=csv,
    separator=" ",
    fields=
    (
        U.water
        U.air
        UMean.water
        UMean.air
    )
)

#includeFunc graphCell
(
    name=Z0.52,
    start=(0.000 0.0614 0.000),
    end=(0.000 0.0614 0.236),
    axis=z,
    setFormat=csv,
    separator=" ",
    fields=
    (
        U.water
        U.air
        UMean.water
        UMean.air
    )
)

#includeFunc graphCell
(
    name=Z0.85,
    start=(0.05015 0.08686 0.000),
    end=(0.05015 0.08686 0.236),
    axis=z,
    setFormat=csv,
    separator=" ",
    fields=
    (
        U.water
        U.air
        UMean.water
        UMean.air
    )
)

#includeFunc graphCell
(
    name=Z0.92,
    start=(0.0543 0.09405 0.000),
    end=(0.0543 0.09405 0.236),
    axis=z,
    setFormat=csv,
    separator=" ",
    fields=
    (
        U.water
        U.air
        UMean.water
        UMean.air
    )
)

#includeFunc    stopAtTimeStep(minDeltaT=1e-8, action=writeNow)
#includeFunc    stopAtFile(file="stop", action=writeNow)
#includeFunc    writeAtFile(file="write")

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