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

type    thermalPhaseChangePopulationBalanceMultiphaseSystem;

phases (gas gas2 liquid);

populationBalances (bubbles);

gas
{
    type            purePhaseModel;
    diameterModel   velocityGroup;

    velocityGroupCoeffs
    {
        populationBalance    bubbles;

        shapeModel  spherical;

        sizeGroups
        (
            f1  {dSph  1.0e-4; value 0     ;}
            f2  {dSph  1.2e-4; value 0     ;}
            f3  {dSph  1.44e-4; value 0    ;}
            f4  {dSph  1.728e-4; value 0   ;}
            f5  {dSph  2.074e-4; value 0   ;}
            f6  {dSph  2.49e-4; value 0    ;}
            f7  {dSph  2.99e-4; value 0    ;}
            f8  {dSph  3.6e-4; value 0     ;}
            f9  {dSph  4.3e-4; value 0     ;}
            f10 {dSph  5.16e-4; value 1    ;}
        );
    }

    residualAlpha   1e-6;
}

gas2
{
    type            purePhaseModel;
    diameterModel   velocityGroup;

    constantCoeffs
    {
        d               0.00045;
    }

    velocityGroupCoeffs
    {
        populationBalance    bubbles;

        shapeModel  spherical;

        sizeGroups
        (
            f11 {dSph  6.19e-4; value 1    ;}
            f12 {dSph  7.43e-4; value 0    ;}
            f13 {dSph  8.92e-4; value 0    ;}
            f14 {dSph  1.07e-3; value 0    ;}
            f15 {dSph  1.28e-3; value 0    ;}
            f16 {dSph  1.54e-3; value 0    ;}
            f17 {dSph  1.85e-3; value 0    ;}
            f18 {dSph  2.22e-3; value 0    ;}
            f19 {dSph  2.67e-3; value 0    ;}
            f20 {dSph  3.19e-3; value 0    ;}
            f21 {dSph  3.85e-3; value 0    ;}
            f22 {dSph  4.6e-3; value 0     ;}
            f23 {dSph  5.52e-3; value 0    ;}
            f24 {dSph  6.62e-3; value 0    ;}
            f25 {dSph  7.95e-3; value 0    ;}
            f26 {dSph  9.54e-3; value 0    ;}
            f27 {dSph  1.14e-2; value 0    ;}
        );
    }

    residualAlpha   1e-6;
}

liquid
{
    type            purePhaseModel;
    diameterModel   constant;
    constantCoeffs
    {
        d               0.00045;
    }
    Sc              0.7;

    residualAlpha   1e-6;
}

populationBalanceCoeffs
{
    bubbles
    {
        continuousPhase liquid;

        coalescenceModels
        (
            PrinceBlanch
            {
                turbulence on;
                buoyancy   on;
                laminarShear off;
                C1  0.1;
            }
        );

        binaryBreakupModels
        (
            LehrMilliesMewes{}
        );

        breakupModels
        ();

        driftModels
        (
            phaseChange
            {
                pairs ((gas and liquid) (gas2 and liquid));
                dmdtf thermalPhaseChange:dmdtf;
            }

            densityChange
            {
            }
        );

        nucleationModels
        (
            wallBoiling
            {
                velocityGroup gas;
            }
        );
    }
}

interfaceCompression
();

drag
(
    (gas in liquid)
    {
        type            IshiiZuber;

        swarmCorrection
        {
            type        none;
        }
    }

    (gas2 in liquid)
    {
        type            IshiiZuber;

        swarmCorrection
        {
            type        none;
        }
    }
);

virtualMass
(
    (gas in liquid)
    {
        type            constantCoefficient;
        Cvm             0.5;
    }

    (gas2 in liquid)
    {
        type            constantCoefficient;
        Cvm             0.5;
    }
);

heatTransfer.gas
(
    (gas in liquid)
    {
        type constantNu;
        Nu  1e1;
        residualAlpha 1e-4;
    }
);

heatTransfer.gas2
(
    (gas2 in liquid)
    {
        type constantNu;
        Nu  1e1;
        residualAlpha 1e-4;
    }
);

heatTransfer.liquid
(
    (gas in liquid)
    {
        type RanzMarshall;
        residualAlpha 1e-4;
    }

    (gas2 in liquid)
    {
        type RanzMarshall;
        residualAlpha 1e-4;
    }
);

lift
(
    (gas in liquid)
    {
        type wallDamped;

        lift
        {
            type Tomiyama;
            Cl 0.288;
        }

        wallDamping
        {
            type    cosine;
            Cd      1.0;
            zeroWallDist 0.0002;
        }
    }

    (gas2 in liquid)
    {
        type wallDamped;

        lift
        {
            type Tomiyama;
            Cl 0.288;
        }

        wallDamping
        {
            type    cosine;
            Cd      1.0;
            zeroWallDist 0.0002;
        }
    }
);

wallLubrication
(
   (gas in liquid)
    {
        type            Antal;
        Cw1             -0.01;
        Cw2             0.05;
    }

    (gas2 in liquid)
    {
        type            Antal;
        Cw1             -0.01;
        Cw2             0.05;
    }
);

turbulentDispersion
(
    (gas in liquid)
    {
        type                LopezDeBertodano;
        Ctd                 1.0;
        residualAlpha       1e-3;
    }

    (gas2 in liquid)
    {
        type                LopezDeBertodano;
        Ctd                 1.0;
        residualAlpha       1e-3;
    }
);

blending
{
    default
    {
        type            none;
        continuousPhase liquid;
    }
}

aspectRatio
();

saturation
(
    (gas and liquid)
    {
        type function1;

        function scale;
        functionCoeffs
        {
            xScale 1e-6;
            scale   1;
            value
            {
                type                tableFile;
                format              csv;
                nHeaderLine         1;
                refColumn           1;
                componentColumns    (0);
                separator           ";";
                mergeSeparators     no;
                file                "R12.csv";
                outOfBounds         clamp;
                interpolationScheme linear;
            }
        }
    }

    (gas2 and liquid)
    {
        type function1;

        function scale;
        functionCoeffs
        {
            xScale 1e-6;
            scale   1;
            value
            {
                type                tableFile;
                format              csv;
                nHeaderLine         1;
                refColumn           1;
                componentColumns    (0);
                separator           ";";
                mergeSeparators     no;
                file                "R12.csv";
                outOfBounds         clamp;
                interpolationScheme linear;
            }
        }
    }
);

surfaceTension
(
    (gas and liquid)
    {
        type            constant;
        sigma           0.00176574;
    }

    (gas2 and liquid)
    {
        type            constant;
        sigma           0.00176574;
    }
);

phaseTransfer
();

// Minimum allowable pressure
pMin            10000;


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