From 889b811005a8ec885bcd03eceb2c67d4d4b7e884 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 6 Sep 2023 12:00:23 +0100 Subject: [PATCH] parcelCloud: Renamed volume and mass fractions A cloud's volume fraction is now generated with parcelCloud::alpha, and the mass fraction with parcelCloud::Y. This is consistent with the rest of OpenFOAM. --- .../incompressibleDenseParticleFluid.C | 4 +-- .../clouds/Templates/MPPICCloud/MPPICCloud.C | 4 +-- .../Templates/MomentumCloud/MomentumCloud.H | 4 +-- .../Templates/MomentumCloud/MomentumCloudI.H | 26 +++++++++---------- .../parcel/parcelCloud/parcelCloudBase.H | 6 ++--- .../parcel/parcelCloud/parcelCloudList.C | 8 +++--- .../parcel/parcelCloud/parcelCloudList.H | 4 +-- .../MPPIC/PackingModels/Implicit/Implicit.C | 4 +-- .../Drag/DenseDrag/DenseDragForce.C | 4 +-- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/applications/modules/incompressibleDenseParticleFluid/incompressibleDenseParticleFluid.C b/applications/modules/incompressibleDenseParticleFluid/incompressibleDenseParticleFluid.C index b2fcecf6fd..5adb9eb11d 100644 --- a/applications/modules/incompressibleDenseParticleFluid/incompressibleDenseParticleFluid.C +++ b/applications/modules/incompressibleDenseParticleFluid/incompressibleDenseParticleFluid.C @@ -225,7 +225,7 @@ incompressibleDenseParticleFluid momentumTransport->validate(); // Update alphac from the particle locations - alphac_ = max(1 - clouds.theta(), alphacMin); + alphac_ = max(1 - clouds.alpha(), alphacMin); alphac_.correctBoundaryConditions(); alphacf = fvc::interpolate(alphac); alphaPhic = alphacf*phic; @@ -288,7 +288,7 @@ void Foam::solvers::incompressibleDenseParticleFluid::prePredictor() clouds.evolve(); // Update continuous phase volume fraction field - alphac_ = max(1 - clouds.theta(), alphacMin); + alphac_ = max(1 - clouds.alpha(), alphacMin); alphac_.correctBoundaryConditions(); alphacf = fvc::interpolate(alphac); diff --git a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C index bd4a49f7be..9c78fc568a 100644 --- a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -309,7 +309,7 @@ void Foam::MPPICCloud::info() { CloudType::info(); - tmp alpha = this->theta(); + tmp alpha = this->alpha(); const scalar alphaMin = gMin(alpha().primitiveField()); const scalar alphaMax = gMax(alpha().primitiveField()); diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H index 374da570cc..1758671f35 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H @@ -518,11 +518,11 @@ public: //- Return the particle volume fraction field // Note: for particles belonging to this cloud only - inline const tmp theta() const; + inline const tmp alpha() const; //- Return the particle mass fraction field // Note: for particles belonging to this cloud only - inline const tmp alpha() const; + inline const tmp Y() const; //- Return the particle effective density field // Note: for particles belonging to this cloud only diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H index 05eb75344a..f852eb2dcb 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H @@ -488,30 +488,30 @@ Foam::MomentumCloud::vDotSweep() const template inline const Foam::tmp -Foam::MomentumCloud::theta() const +Foam::MomentumCloud::alpha() const { tmp ttheta ( volScalarField::New ( - this->name() + ":theta", + this->name() + ":alpha", this->mesh(), dimensionedScalar(dimless, 0), extrapolatedCalculatedFvPatchScalarField::typeName ) ); - volScalarField& theta = ttheta.ref(); + volScalarField& alpha = ttheta.ref(); forAllConstIter(typename MomentumCloud, *this, iter) { const parcelType& p = iter(); const label celli = p.cell(); - theta[celli] += p.nParticle()*p.volume(); + alpha[celli] += p.nParticle()*p.volume(); } - theta.primitiveFieldRef() /= this->mesh().V(); - theta.correctBoundaryConditions(); + alpha.primitiveFieldRef() /= this->mesh().V(); + alpha.correctBoundaryConditions(); return ttheta; } @@ -519,30 +519,30 @@ Foam::MomentumCloud::theta() const template inline const Foam::tmp -Foam::MomentumCloud::alpha() const +Foam::MomentumCloud::Y() const { - tmp talpha + tmp tY ( volScalarField::New ( - this->name() + ":alpha", + this->name() + ":Y", this->mesh(), dimensionedScalar(dimless, 0) ) ); - scalarField& alpha = talpha.ref().primitiveFieldRef(); + scalarField& Y = tY.ref().primitiveFieldRef(); forAllConstIter(typename MomentumCloud, *this, iter) { const parcelType& p = iter(); const label celli = p.cell(); - alpha[celli] += p.nParticle()*p.mass(); + Y[celli] += p.nParticle()*p.mass(); } - alpha /= (this->mesh().V()*rho_); + Y /= (this->mesh().V()*rho_); - return talpha; + return tY; } diff --git a/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H b/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H index 320fefe2ec..b489fdab7c 100644 --- a/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H +++ b/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,10 +90,10 @@ public: virtual const tmp vDotSweep() const = 0; //- Return the particle volume fraction field - virtual const tmp theta() const = 0; + virtual const tmp alpha() const = 0; //- Return the particle mass fraction field - virtual const tmp alpha() const = 0; + virtual const tmp Y() const = 0; //- Return the particle effective density field virtual const tmp rhoEff() const = 0; diff --git a/src/lagrangian/parcel/parcelCloud/parcelCloudList.C b/src/lagrangian/parcel/parcelCloud/parcelCloudList.C index 331e45507b..cb272603a1 100644 --- a/src/lagrangian/parcel/parcelCloud/parcelCloudList.C +++ b/src/lagrangian/parcel/parcelCloud/parcelCloudList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -154,13 +154,13 @@ Foam::parcelCloudList::~parcelCloudList() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -const Foam::tmp Foam::parcelCloudList::theta() const +const Foam::tmp Foam::parcelCloudList::alpha() const { tmp ttheta ( volScalarField::New ( - cloudNamesName + ":theta", + cloudNamesName + ":alpha", mesh_, dimensionedScalar(dimless, 0), extrapolatedCalculatedFvPatchScalarField::typeName @@ -168,7 +168,7 @@ const Foam::tmp Foam::parcelCloudList::theta() const ); forAll(*this, i) { - ttheta.ref() += operator[](i).theta(); + ttheta.ref() += operator[](i).alpha(); } return ttheta; } diff --git a/src/lagrangian/parcel/parcelCloud/parcelCloudList.H b/src/lagrangian/parcel/parcelCloud/parcelCloudList.H index 9b562e81f7..b56b231513 100644 --- a/src/lagrangian/parcel/parcelCloud/parcelCloudList.H +++ b/src/lagrangian/parcel/parcelCloud/parcelCloudList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,7 +136,7 @@ public: // Fields //- Return the particle volume fraction field - const tmp theta() const; + const tmp alpha() const; // Sources diff --git a/src/lagrangian/parcel/submodels/MPPIC/PackingModels/Implicit/Implicit.C b/src/lagrangian/parcel/submodels/MPPIC/PackingModels/Implicit/Implicit.C index b1984f4d6c..b5945f73da 100644 --- a/src/lagrangian/parcel/submodels/MPPIC/PackingModels/Implicit/Implicit.C +++ b/src/lagrangian/parcel/submodels/MPPIC/PackingModels/Implicit/Implicit.C @@ -64,7 +64,7 @@ Foam::PackingModels::Implicit::Implicit alphaMin_(this->coeffDict().template lookup("alphaMin")), rhoMin_(this->coeffDict().template lookup("rhoMin")) { - alpha_ = this->owner().theta(); + alpha_ = this->owner().alpha(); alpha_.oldTime(); } @@ -143,7 +143,7 @@ void Foam::PackingModels::Implicit::cacheFields(const bool store) // ~~~~~~~~~~~~~~~ // volume fraction field - alpha_ = max(this->owner().theta(), alphaMin_); + alpha_ = max(this->owner().alpha(), alphaMin_); alpha_.correctBoundaryConditions(); // average density diff --git a/src/lagrangian/parcel/submodels/Momentum/ParticleForces/Drag/DenseDrag/DenseDragForce.C b/src/lagrangian/parcel/submodels/Momentum/ParticleForces/Drag/DenseDrag/DenseDragForce.C index 086e36fce3..331d3cd261 100644 --- a/src/lagrangian/parcel/submodels/Momentum/ParticleForces/Drag/DenseDrag/DenseDragForce.C +++ b/src/lagrangian/parcel/submodels/Momentum/ParticleForces/Drag/DenseDrag/DenseDragForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,7 @@ void Foam::DenseDragForce::cacheFields(const bool store) { alphacPtr_.reset ( - new volScalarField(alphacName_, 1 - this->owner().theta()) + new volScalarField(alphacName_, 1 - this->owner().alpha()) ); }