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.
This commit is contained in:
Will Bainbridge
2023-09-06 12:00:23 +01:00
parent b6883889ca
commit 889b811005
9 changed files with 32 additions and 32 deletions

View File

@ -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);

View File

@ -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<CloudType>::info()
{
CloudType::info();
tmp<volScalarField> alpha = this->theta();
tmp<volScalarField> alpha = this->alpha();
const scalar alphaMin = gMin(alpha().primitiveField());
const scalar alphaMax = gMax(alpha().primitiveField());

View File

@ -518,11 +518,11 @@ public:
//- Return the particle volume fraction field
// Note: for particles belonging to this cloud only
inline const tmp<volScalarField> theta() const;
inline const tmp<volScalarField> alpha() const;
//- Return the particle mass fraction field
// Note: for particles belonging to this cloud only
inline const tmp<volScalarField> alpha() const;
inline const tmp<volScalarField> Y() const;
//- Return the particle effective density field
// Note: for particles belonging to this cloud only

View File

@ -488,30 +488,30 @@ Foam::MomentumCloud<CloudType>::vDotSweep() const
template<class CloudType>
inline const Foam::tmp<Foam::volScalarField>
Foam::MomentumCloud<CloudType>::theta() const
Foam::MomentumCloud<CloudType>::alpha() const
{
tmp<volScalarField> 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<CloudType>, *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<CloudType>::theta() const
template<class CloudType>
inline const Foam::tmp<Foam::volScalarField>
Foam::MomentumCloud<CloudType>::alpha() const
Foam::MomentumCloud<CloudType>::Y() const
{
tmp<volScalarField> talpha
tmp<volScalarField> 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<CloudType>, *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;
}

View File

@ -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<volScalarField> vDotSweep() const = 0;
//- Return the particle volume fraction field
virtual const tmp<volScalarField> theta() const = 0;
virtual const tmp<volScalarField> alpha() const = 0;
//- Return the particle mass fraction field
virtual const tmp<volScalarField> alpha() const = 0;
virtual const tmp<volScalarField> Y() const = 0;
//- Return the particle effective density field
virtual const tmp<volScalarField> rhoEff() const = 0;

View File

@ -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::volScalarField> Foam::parcelCloudList::theta() const
const Foam::tmp<Foam::volScalarField> Foam::parcelCloudList::alpha() const
{
tmp<volScalarField> ttheta
(
volScalarField::New
(
cloudNamesName + ":theta",
cloudNamesName + ":alpha",
mesh_,
dimensionedScalar(dimless, 0),
extrapolatedCalculatedFvPatchScalarField::typeName
@ -168,7 +168,7 @@ const Foam::tmp<Foam::volScalarField> Foam::parcelCloudList::theta() const
);
forAll(*this, i)
{
ttheta.ref() += operator[](i).theta();
ttheta.ref() += operator[](i).alpha();
}
return ttheta;
}

View File

@ -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<volScalarField> theta() const;
const tmp<volScalarField> alpha() const;
// Sources

View File

@ -64,7 +64,7 @@ Foam::PackingModels::Implicit<CloudType>::Implicit
alphaMin_(this->coeffDict().template lookup<scalar>("alphaMin")),
rhoMin_(this->coeffDict().template lookup<scalar>("rhoMin"))
{
alpha_ = this->owner().theta();
alpha_ = this->owner().alpha();
alpha_.oldTime();
}
@ -143,7 +143,7 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
// ~~~~~~~~~~~~~~~
// volume fraction field
alpha_ = max(this->owner().theta(), alphaMin_);
alpha_ = max(this->owner().alpha(), alphaMin_);
alpha_.correctBoundaryConditions();
// average density

View File

@ -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<CloudType>::cacheFields(const bool store)
{
alphacPtr_.reset
(
new volScalarField(alphacName_, 1 - this->owner().theta())
new volScalarField(alphacName_, 1 - this->owner().alpha())
);
}