/*--------------------------------*- 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    "constant";
    object      cloudProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "$FOAM_CASE/constant/variables"

type        collidingCloud;

solution
{
    coupled         true; //true for influence of lagr. on euler. phase
    transient       true; //true for transient sim.
    cellValueSourceCorrection on; //correction of momentum transfer to Eulerian

    interpolationSchemes
    {
        rho.air         cell;
        U.air           cellPoint;
        mu.air          cell;
        alpha.air       cellPoint;
        //curlUcDt        cell; //used for lift force calc.
        //DucDt.air cell; //used for pressure Gradient force calc.
        /*Available schemes: cell, cellPoint, cellPatchConstranined,
                             cellPointFace, cellPointWallModified, pointMVC*/
    }

    averagingMethod dual; //only for MPPIC

    integrationSchemes
    {
        U               Euler; //Euler or analytical
    }

    sourceTerms
    {
        schemes
        {
            U           semiImplicit 1;
            //explicit or semiImplicit, relax.coeff for each field
        }
    }
}

constantProperties
{
    //parcelTypeId    1;

    //rhoMin          1e-15;
    //minParcelMass   1e-15;

    rho0            7980;
    youngsModulus   2.1e7;//2.1e9; 2.1e11;
    poissonsRatio   0.3;

    constantVolume  false;

    //alphaMax        0.99; //not needed by collidingCloud
}

subModels
{
    particleForces
    {
        //sphereDrag;
        gravity;
        ErgunWenYuDrag
        {
            alphac    alpha.air;
        }
    }

    injectionModels
    {
        model0
        {
            type            coneInjection;
 
            // Times
            SOI             0;
            duration        1;
 
            // Quantities
            massTotal                       0; // <-- not used with these settings
            parcelBasisType             fixed;
            parcelsPerSecond  $varInjParcel_s;
            flowRateProfile        constant 1;
            nParticle                       1;
 
            sizeDistribution
            {
                type      RosinRammler;
                RosinRammlerDistribution
                {
                    d         63.65e-6;
                    n            5.177;
                    minValue     40e-6;
                    maxValue    150e-6;
                }
                normalDistribution
                {
                    expectation 100e-6;    //4.1888e-12m^3 -> 33.426e-9kg steel
                    variance     10e-6;
                    minValue     45e-6;
                    maxValue    150e-6;
                }
            }
 
            // Geometry
            position        (0 0 0);
            direction       (0 0 1);
            thetaInner      0;
            thetaOuter      0;
 
            // - Inject at a point
            injectionMethod point;
            //injectionMethod disc;
            //dInner          0;
            //dOuter          1e-3;
 
            // Velocity
 
            // - Inject with constant velocity
            flowType        constantVelocity;
            Umag            $varVelocity;
 
            //flowType        flowRateAndDischarge;
            //Cd              0.9;
 
            //flowType        pressureDrivenVelocity;
            //Pinj            10e5;
        }
        #include "$FOAM_CASE/constant/pointInjectors"
        model0 {duration 0;}
    }

    dispersionModel none;

    patchInteractionModel localInteraction;

    localInteractionCoeffs
    {
        patches
        (
            walls
            {
                type rebound;
                e    0.9;
                mu   0.1;
            }

            "inlet|outlet"
            {
                type escape;
            }
        );
    }

    heatTransferModel none;

    surfaceFilmModel none;

    collisionModel pairCollision;

    pairCollisionCoeffs
    {
        maxInteractionDistance  100e-6;

        writeReferredParticleCloud no;

        pairModel pairSpringSliderDashpot;

        pairSpringSliderDashpotCoeffs
        {
            useEquivalentSize   no;
            alpha               0.12; //function of restitution coeff
            b                   1.5;  //=1->linear =3/2->Hertz
            mu                  0.52; //friction coeff
            cohesionEnergyDensity 0;
            collisionResolutionSteps 24;
        };

        wallModel wallLocalSpringSliderDashpot;

        wallLocalSpringSliderDashpotCoeffs
        {
            useEquivalentSize no;
            collisionResolutionSteps 24;
            walls
            {
                youngsModulus   1e7;
                poissonsRatio   0.23;
                alpha           0.12; //function of restitution coeff
                b               1.5;  //=1->linear =3/2->Hertz
                mu              0.43; //friction coeff
                cohesionEnergyDensity 0;
                }
        };

        U     U.air;
    }

    stochasticCollisionModel none;

    radiation off;
}


cloudFunctions
{}


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