Foam::forceSuSp Foam::PlessisMasliyahDragForce<CloudType>::calcCoupled
(
    const typename CloudType::parcelType& p,
    const scalar dt,
    const scalar mass,
    const scalar Re,
    const scalar muc
) const
{
    scalar alphac(alphac_[p.cell()]);

    scalar cbrtAlphap(pow(1.0 - alphac, 1.0/3.0));

    scalar A =
        26.8*pow3(alphac)
       /(
            sqr(cbrtAlphap)
           *(1.0 - cbrtAlphap)
           *sqr(1.0 - sqr(cbrtAlphap))
          + SMALL
        );

    scalar B =
        sqr(alphac)
       /sqr(1.0 - sqr(cbrtAlphap));

    return forceSuSp
    (
        vector::zero,
        (mass/p.rho())
       *(A*(1.0 - alphac) + B*Re)*muc/(alphac*sqr(p.d()))
    );
}
Ejemplo n.º 2
0
Foam::forceSuSp Foam::DPMDragModels::ErgunWenYu<CloudType>::calcCoupled
(
    const typename CloudType::parcelType& p,
    const scalar dt,
    const scalar mass,
    const scalar Re,
    const scalar muc
) const
{
    scalar alphac(alphac_[p.cell()]);

    if (alphac < 0.8)
    {
        return forceSuSp
        (
            vector::zero,
            (mass/p.rho())
           *((150.0*(1.0 - alphac) + 1.75*Re)*muc/(alphac*sqr(p.d())))
        );
    }
    else
    {
        return forceSuSp
        (
            vector::zero,
            (mass/p.rho())
           *0.75*CdRe(alphac*Re)*muc*pow(alphac, -2.65)/sqr(p.d())
        );
    }
}
Ejemplo n.º 3
0
Foam::vector Foam::DampingModels::Relaxation<CloudType>::velocityCorrection
(
    typename CloudType::parcelType& p,
    const scalar deltaT
) const
{
    const tetIndices
        tetIs(p.cell(), p.tetFace(), p.tetPt(), this->owner().mesh());

    const scalar x =
        deltaT*oneByTimeScaleAverage_->interpolate(p.position(), tetIs);

    const vector u = uAverage_->interpolate(p.position(), tetIs);

    return (u - p.U())*x/(x + 2.0);
}
Ejemplo n.º 4
0
Foam::forceSuSp Foam::BrownianMotionForce<CloudType>::calcCoupled
(
    const typename CloudType::parcelType& p,
    const scalar dt,
    const scalar mass,
    const scalar Re,
    const scalar muc
) const
{
    forceSuSp value(vector::zero, 0.0);

    const scalar dp = p.d();
    const scalar Tc = p.Tc();

    const scalar eta = rndGen_.sample01<scalar>();
    const scalar alpha = 2.0*lambda_/dp;
    const scalar cc = 1.0 + alpha*(1.257 + 0.4*exp(-1.1/alpha));

    const scalar sigma = physicoChemical::sigma.value();

    scalar f = 0.0;
    if (turbulence_)
    {
        const label cellI = p.cell();
        const volScalarField& k = *kPtr_;
        const scalar kc = k[cellI];
        const scalar Dp = sigma*Tc*cc/(3*mathematical::pi*muc*dp);
        f = eta/mass*sqrt(2.0*sqr(kc)*sqr(Tc)/(Dp*dt));
    }
    else
    {
        const scalar rhoRatio = p.rho()/p.rhoc();
        const scalar s0 =
            216*muc*sigma*Tc/(sqr(mathematical::pi)*pow5(dp)*(rhoRatio)*cc);
        f = eta*sqrt(mathematical::pi*s0/dt);
    }

    const scalar sqrt2 = sqrt(2.0);
    for (label i = 0; i < 3; i++)
    {
        const scalar x = rndGen_.sample01<scalar>();
        const scalar eta = sqrt2*erfInv(2*x - 1.0);
        value.Su()[i] = mass*f*eta;
    }

    return value;
}
Ejemplo n.º 5
0
Foam::forceSuSp Foam::WenYuDragForce<CloudType>::calcCoupled
(
    const typename CloudType::parcelType& p,
    const scalar dt,
    const scalar mass,
    const scalar Re,
    const scalar muc
) const
{
    scalar alphac(alphac_[p.cell()]);

    return forceSuSp
    (
        vector::zero,
        (mass/p.rho())
       *0.75*CdRe(alphac*Re)*muc*pow(alphac, -2.65)/(alphac*sqr(p.d()))
    );
}
Ejemplo n.º 6
0
Foam::forceSuSp Foam::BrownianMotionForce<CloudType>::calcCoupled
(
    const typename CloudType::parcelType& p,
    const typename CloudType::parcelType::trackingData& td,
    const scalar dt,
    const scalar mass,
    const scalar Re,
    const scalar muc
) const
{
    forceSuSp value(Zero, 0.0);

    const scalar dp = p.d();
    const scalar Tc = td.Tc();

    const scalar alpha = 2.0*lambda_/dp;
    const scalar cc = 1.0 + alpha*(1.257 + 0.4*exp(-1.1/alpha));

    // Boltzmann constant
    const scalar kb = physicoChemical::k.value();

    scalar f = 0;
    if (turbulence_)
    {
        const label celli = p.cell();
        const volScalarField& k = *kPtr_;
        const scalar kc = k[celli];
        const scalar Dp = kb*Tc*cc/(3*mathematical::pi*muc*dp);
        f = sqrt(2.0*sqr(kc)*sqr(Tc)/(Dp*dt));
    }
    else
    {
        const scalar s0 =
            216*muc*kb*Tc/(sqr(mathematical::pi)*pow5(dp)*sqr(p.rho())*cc);
        f = mass*sqrt(mathematical::pi*s0/dt);
    }


    // To generate a cubic distribution (3 independent directions) :
    // const scalar sqrt2 = sqrt(2.0);
    // for (direction dir = 0; dir < vector::nComponents; dir++)
    // {
    //     const scalar x = rndGen_.sample01<scalar>();
    //     const scalar eta = sqrt2*erfInv(2*x - 1.0);
    //     value.Su()[dir] = f*eta;
    // }


    // To generate a spherical distribution:

    Random& rnd = this->owner().rndGen();

    const scalar theta = rnd.scalar01()*twoPi;
    const scalar u = 2*rnd.scalar01() - 1;

    const scalar a = sqrt(1 - sqr(u));
    const vector dir(a*cos(theta), a*sin(theta), u);

    value.Su() = f*mag(rnd.scalarNormal())*dir;

    return value;
}