OpenFOAM中的particle,parcel和cloud

OpenFOAM中particleparcelcloud,可以从其构造函数,或者成员函数中看出三者的区别:

  • parcel中可能包含一个或者多个particle,这与算例文件夹下constant/*Cloud1PropertiesinjectionModelsparcelBasisType选用有关:
    const word parcelBasisType = this->coeffDict().lookup("parcelBasisType");

    if (parcelBasisType == "mass")
    {
        parcelBasis_ = pbMass;
    }
    else if (parcelBasisType == "number")
    {
        parcelBasis_ = pbNumber;
    }
    else if (parcelBasisType == "fixed")
    {
        parcelBasis_ = pbFixed;
template<class CloudType>
Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
(
    const label parcels,
    const scalar volumeFraction,
    const scalar diameter,
    const scalar rho
)
{
    scalar nP = 0.0;
    switch (parcelBasis_)
    {
        case pbMass:
        {
            scalar volumep = pi/6.0*pow3(diameter);
            scalar volumeTot = massTotal_/rho;

            nP = (volumeFraction*volumeTot + delayedVolume_)/(parcels*volumep);
            break;
        }
        case pbNumber:
        {
            nP = massTotal_/(rho*volumeTotal_);
            break;
        }
        case pbFixed:
        {
            nP = nParticleFixed_;
            break;
        }
        default:
        {
            nP = 0.0;
            FatalErrorIn
            (
                "Foam::scalar "
                "Foam::InjectionModel::setNumberOfParticles"
                "("
                    "const label, "
                    "const scalar, "
                    "const scalar, "
                    "const scalar"
                ")"
            )<< "Unknown parcelBasis type" << nl
             << exit(FatalError);
        }
    }
    return nP;
}

/opt/OpenFOAM/OpenFOAM-2.3.x/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
根据如上的代码块可以看出parcelparticle的多少是在parcel生成阶段(injection)更具选用方法计算而来,他们拥有相同的物理性质以及位置。在代码运行过程中parcel指定的性质不会发生变化。

  • 而Cloud则是一系列的具有不同物理属性的parcels
    然而Cloud的构造函数更多是获得流体的信息,从其成员函数forces()来看在该类下计算不同parcel的受力情况:
    /src/largrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
            //- Return the optional particle forces
            inline forceType& forces();

而从内连函数nParcels()可以看出Cloud类的大小为parcels.

            //- Total number of parcels
            inline label nParcels() const;
template<class CloudType>
inline Foam::label Foam::KinematicCloud<CloudType>::nParcels() const
{
    return this->size();
}

注意cloud和parcel文件夹下包含了不同的子类型,我分析了较为简单的Kinematic,在此基础上患有Thermo,Reacting等

你可能感兴趣的:(openfoam,notes)