From 376b51b58b217acba3fe49b082e18f8b1ecf6bb0 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 29 Apr 2022 16:18:03 +0100 Subject: [PATCH] multiphaseEulerFoam::populationBalanceModel: improved dilatation treatment The population balance model considers dilatation originating from density change and mass transfer via source terms describing nucleation as well as "drift" of the size distribution to smaller or larger sizes. Numerically, the treatment does not necessarily equal the total dilatation, hence a correction is introduced to ensure boundedness of the size group fractions. Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR) and VTT Technical Research Centre of Finland Ltd. --- .../PopulationBalancePhaseSystem.C | 63 ++++++---- .../sizeGroup/shapeModels/fractal/fractal.C | 14 +-- .../velocityGroup/sizeGroup/sizeGroup.C | 6 +- .../velocityGroup/sizeGroup/sizeGroup.H | 4 +- .../driftModels/constantDrift/constantDrift.C | 4 +- .../driftModels/densityChange/densityChange.C | 4 +- .../driftModels/phaseChange/phaseChange.C | 23 ++-- .../populationBalanceModel.C | 115 +++++++++++++----- .../populationBalanceModel.H | 20 +-- .../populationBalanceModelI.H | 15 +-- .../populationBalance/drift/constant/fvModels | 49 +------- .../drift/constant/physicalProperties.air | 6 +- .../populationBalance/drift/system/fvSolution | 2 +- .../isothermalGrowth/validation/createGraphs | 1 - .../negativeDrift/constant/fvModels | 51 +------- .../constant/physicalProperties.air | 6 +- .../negativeDrift/system/fvSolution | 2 +- .../wallBoilingPolydisperse/system/fvSolution | 2 +- .../system/fvSolution | 2 +- 19 files changed, 183 insertions(+), 206 deletions(-) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C index 593ed919ab..86499a7827 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C @@ -46,20 +46,23 @@ PopulationBalancePhaseSystem const diameterModels::populationBalanceModel& popBal = populationBalances_[popBali]; - forAll(popBal.velocityGroups(), velGrp1i) + forAllConstIter + ( + HashTable, + popBal.velocityGroupPtrs(), + iter1 + ) { - const diameterModels::velocityGroup& velGrp1 = - popBal.velocityGroups()[velGrp1i]; + const diameterModels::velocityGroup& velGrp1 = *iter1(); - for + forAllConstIter ( - label velGrp2i = velGrp1i + 1; - velGrp2i < popBal.velocityGroups().size(); - ++ velGrp2i + HashTable, + popBal.velocityGroupPtrs(), + iter2 ) { - const diameterModels::velocityGroup& velGrp2 = - popBal.velocityGroups()[velGrp2i]; + const diameterModels::velocityGroup& velGrp2 = *iter2(); const phaseInterface interface ( @@ -67,28 +70,36 @@ PopulationBalancePhaseSystem velGrp2.phase() ); - this->template validateMassTransfer - (interface); - - dmdtfs_.insert + if ( - interface, - new volScalarField + &velGrp1 != &velGrp2 + && + !dmdtfs_.found(interface) + ) + { + this->template validateMassTransfer + (interface); + + dmdtfs_.insert ( - IOobject + interface, + new volScalarField ( - IOobject::groupName + IOobject ( - "populationBalance:dmdtf", - interface.name() + IOobject::groupName + ( + "populationBalance:dmdtf", + interface.name() + ), + this->mesh().time().timeName(), + this->mesh() ), - this->mesh().time().timeName(), - this->mesh() - ), - this->mesh(), - dimensionedScalar(dimDensity/dimTime, 0) - ) - ); + this->mesh(), + dimensionedScalar(dimDensity/dimTime, 0) + ) + ); + } } } } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/fractal.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/fractal.C index e56019fe73..b10e1f363c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/fractal.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/fractal.C @@ -26,9 +26,9 @@ License #include "fractal.H" #include "addToRunTimeSelectionTable.H" #include "sinteringModel.H" -#include "fvm.H" -#include "fvcDdt.H" -#include "fvcDiv.H" +#include "fvmDdt.H" +#include "fvmDiv.H" +#include "fvmSup.H" #include "mixedFvPatchField.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -122,7 +122,7 @@ Foam::diameterModels::shapeModels::fractal::fractal if ( - isA(kappa_.boundaryFieldRef()[patchi]) + isA(kappa_.boundaryField()[patchi]) ) { mixedFvPatchScalarField& kappa = @@ -205,12 +205,12 @@ void Foam::diameterModels::shapeModels::fractal::correct() fvScalarMatrix kappaEqn ( - fvm::ddt(alpha, fi, kappa_) + fvm::div(fAlphaPhi, kappa_) + fvm::ddt(alpha, fi, kappa_) + + fvm::div(fAlphaPhi, kappa_) == - sinteringModel_->R() + Su_ - - fvm::Sp(popBal.Sp(fi.i()())*fi, kappa_) - + - fvm::Sp(popBal.Sp(fi.i())*fi, kappa_) - correction ( fvm::Sp diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C index 7db66a5957..0f5a8b3477 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C @@ -75,7 +75,7 @@ Foam::diameterModels::sizeGroup::sizeGroup if ( - isA(this->boundaryFieldRef()[patchi]) + isA(this->boundaryField()[patchi]) ) { mixedFvPatchScalarField& f = @@ -108,7 +108,7 @@ Foam::diameterModels::sizeGroup::clone() const } -const Foam::autoPtr& Foam::diameterModels::sizeGroup::i() const +const Foam::label& Foam::diameterModels::sizeGroup::i() const { if (!i_.valid()) { @@ -127,7 +127,7 @@ const Foam::autoPtr& Foam::diameterModels::sizeGroup::i() const } } - return i_; + return i_(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H index 1fd317d8e4..43121086eb 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H @@ -192,8 +192,8 @@ public: //- Return const-reference to diameterModel of the phase inline const autoPtr& shapeModelPtr() const; - //- Return label of the sizeGroup within the population balance - const autoPtr