reactingEulerFoam: Minor improvements to populationBalanceModel
Changed to using of UPtrList<Type> instead of List<*Type> for storing reference to size and velocity groups, as this removes de-referencing clutter. Fixed lookup of critical film thickness in PrinceBlanch coalescence model. Added functionality calculating the overall diameter, void fraction and void fraction weighted velocity for multiple velocity groups. Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
This commit is contained in:
@ -161,8 +161,6 @@ void Foam::functionObjects::sizeDistribution::initialise
|
||||
<< " total cells = " << nCells_ << nl
|
||||
<< " total volume = " << volume_
|
||||
<< nl << endl;
|
||||
|
||||
Info<< nl << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -203,11 +201,6 @@ void Foam::functionObjects::sizeDistribution::setCellZoneCells()
|
||||
<< regionTypeNames_ << nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Selected region size = " << cellId_.size() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -312,7 +305,7 @@ void Foam::functionObjects::sizeDistribution::writeFileHeader
|
||||
forAll(popBal_.sizeGroups(), sizeGroupi)
|
||||
{
|
||||
const diameterModels::sizeGroup& fi =
|
||||
*popBal_.sizeGroups()[sizeGroupi];
|
||||
popBal_.sizeGroups()[sizeGroupi];
|
||||
|
||||
switch (abszissaType_)
|
||||
{
|
||||
@ -426,8 +419,7 @@ bool Foam::functionObjects::sizeDistribution::write()
|
||||
|
||||
forAll(N_, i)
|
||||
{
|
||||
const Foam::diameterModels::sizeGroup& fi =
|
||||
*popBal_.sizeGroups()[i];
|
||||
const Foam::diameterModels::sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
const volScalarField& alpha = fi.VelocityGroup().phase();
|
||||
|
||||
@ -463,7 +455,7 @@ bool Foam::functionObjects::sizeDistribution::write()
|
||||
forAll(N_, i)
|
||||
{
|
||||
const Foam::diameterModels::sizeGroup& fi =
|
||||
*popBal_.sizeGroups()[i];
|
||||
popBal_.sizeGroups()[i];
|
||||
|
||||
switch (abszissaType_)
|
||||
{
|
||||
@ -494,7 +486,7 @@ bool Foam::functionObjects::sizeDistribution::write()
|
||||
forAll(popBal_.sizeGroups(), i)
|
||||
{
|
||||
const Foam::diameterModels::sizeGroup& fi =
|
||||
*popBal_.sizeGroups()[i];
|
||||
popBal_.sizeGroups()[i];
|
||||
|
||||
scalar result(0.0);
|
||||
scalar delta(0.0);
|
||||
|
||||
@ -71,7 +71,7 @@ addToBinaryBreakupRate
|
||||
const label j
|
||||
)
|
||||
{
|
||||
const sizeGroup& fj = *popBal_.sizeGroups()[j];
|
||||
const sizeGroup& fj = popBal_.sizeGroups()[j];
|
||||
|
||||
binaryBreakupRate.primitiveFieldRef() +=
|
||||
pow(fj.x().value(), power_)*2.0/fj.x().value();
|
||||
|
||||
@ -78,7 +78,7 @@ Foam::diameterModels::breakupModels::LaakkonenAlopaeusAittamaa::setBreakupRate
|
||||
)
|
||||
{
|
||||
const phaseModel& continuousPhase = popBal_.continuousPhase();
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
breakupRate =
|
||||
C1_*cbrt(popBal_.continuousTurbulence().epsilon())
|
||||
|
||||
@ -63,9 +63,10 @@ Description
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
C1 | Coefficient C1 | no | 6.0
|
||||
C2 | Coefficient C2 | no | 0.04
|
||||
C3 | Coefficient C3 | no | 0.01
|
||||
C1 | coefficient C1 | no | 6.0
|
||||
C2 | coefficient C2 | no | 0.04
|
||||
C3 | coefficient C3 | no | 0.01
|
||||
daughterSizeDistributionModel | inh. from breakupModel | inherited |
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
|
||||
@ -63,7 +63,7 @@ void Foam::diameterModels::breakupModels::exponential::setBreakupRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
breakupRate.primitiveFieldRef() =
|
||||
C_*exp(exponent_*fi.x().value());
|
||||
|
||||
@ -62,7 +62,7 @@ void Foam::diameterModels::breakupModels::powerLaw::setBreakupRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
breakupRate.primitiveFieldRef() = pow(fi.x().value(), power_);
|
||||
}
|
||||
|
||||
@ -74,8 +74,8 @@ addToCoalescenceRate
|
||||
)
|
||||
{
|
||||
const phaseModel& continuousPhase = popBal_.continuousPhase();
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fj = *popBal_.sizeGroups()[j];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fj = popBal_.sizeGroups()[j];
|
||||
|
||||
coalescenceRate +=
|
||||
C1_*(pow(fi.x(), 2.0/3.0) + pow(fj.x(), 2.0/3.0))
|
||||
|
||||
@ -61,10 +61,10 @@ PrinceBlanch
|
||||
coalescenceModel(popBal, dict),
|
||||
C1_("C1", dimless, dict.lookupOrDefault<scalar>("C1", 0.356)),
|
||||
h0_("h0", dimLength, dict.lookupOrDefault<scalar>("h0", 1e-4)),
|
||||
hf_("hf", dimLength, dict.lookupOrDefault<scalar>("h0", 1e-8)),
|
||||
turbulentCollisions_(dict.lookup("turbulentCollisions")),
|
||||
buoyantCollisions_(dict.lookup("buoyantCollisions")),
|
||||
laminarShearCollisions_(dict.lookup("laminarShearCollisions"))
|
||||
hf_("hf", dimLength, dict.lookupOrDefault<scalar>("hf", 1e-8)),
|
||||
turbulence_(dict.lookup("turbulence")),
|
||||
buoyancy_(dict.lookup("buoyancy")),
|
||||
laminarShear_(dict.lookup("laminarShear"))
|
||||
{}
|
||||
|
||||
|
||||
@ -79,8 +79,8 @@ addToCoalescenceRate
|
||||
)
|
||||
{
|
||||
const phaseModel& continuousPhase = popBal_.continuousPhase();
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fj = *popBal_.sizeGroups()[j];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fj = popBal_.sizeGroups()[j];
|
||||
const uniformDimensionedVectorField& g =
|
||||
popBal_.mesh().lookupObject<uniformDimensionedVectorField>("g");
|
||||
|
||||
@ -100,7 +100,7 @@ addToCoalescenceRate
|
||||
)
|
||||
);
|
||||
|
||||
if (turbulentCollisions_)
|
||||
if (turbulence_)
|
||||
{
|
||||
coalescenceRate +=
|
||||
(
|
||||
@ -111,7 +111,7 @@ addToCoalescenceRate
|
||||
*collisionEfficiency;
|
||||
}
|
||||
|
||||
if (buoyantCollisions_)
|
||||
if (buoyancy_)
|
||||
{
|
||||
dimensionedScalar Sij(pi/4.0*sqr(fi.d() + fj.d()));
|
||||
|
||||
@ -135,7 +135,7 @@ addToCoalescenceRate
|
||||
*collisionEfficiency;
|
||||
}
|
||||
|
||||
if (laminarShearCollisions_)
|
||||
if (laminarShear_)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Laminar shear collision contribution not implemented for "
|
||||
|
||||
@ -110,7 +110,12 @@ Description
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
C1 | Coefficient C1 | no | 0.089
|
||||
C1 | coefficient C1 | no | 0.089
|
||||
h0 | initial film thickness | no | 1e-4m
|
||||
hf | critical film thickness | no | 1e-8m
|
||||
turbulence | Switch for collisions due to turbulence | yes | none
|
||||
buoyancy | Switch for collisions due to buoyancy | yes | none
|
||||
laminarShear | Switch for collisions due to laminar shear | yes | none
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
@ -152,13 +157,13 @@ class PrinceBlanch
|
||||
dimensionedScalar hf_;
|
||||
|
||||
//- Switch for considering turbulent collisions
|
||||
Switch turbulentCollisions_;
|
||||
Switch turbulence_;
|
||||
|
||||
//- Switch for considering buoyancy-induced collisions
|
||||
Switch buoyantCollisions_;
|
||||
Switch buoyancy_;
|
||||
|
||||
//- Switch for considering buoyancy-induced collisions
|
||||
Switch laminarShearCollisions_;
|
||||
Switch laminarShear_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -62,8 +62,8 @@ void Foam::diameterModels::coalescenceModels::hydrodynamic::addToCoalescenceRate
|
||||
const label j
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fj = *popBal_.sizeGroups()[j];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fj = popBal_.sizeGroups()[j];
|
||||
|
||||
coalescenceRate.primitiveFieldRef() +=
|
||||
pow3((fi.d().value() + fj.d().value()));
|
||||
|
||||
@ -77,13 +77,13 @@ LaakkonenAlopaeusAittamaaDsd::calcNik
|
||||
const label k
|
||||
) const
|
||||
{
|
||||
const dimensionedScalar& xi = breakup_.popBal().sizeGroups()[i]->x();
|
||||
const dimensionedScalar& xk = breakup_.popBal().sizeGroups()[k]->x();
|
||||
const List<sizeGroup*>& sizeGroups = breakup_.popBal().sizeGroups();
|
||||
const dimensionedScalar& xi = breakup_.popBal().sizeGroups()[i].x();
|
||||
const dimensionedScalar& xk = breakup_.popBal().sizeGroups()[k].x();
|
||||
const UPtrList<sizeGroup>& sizeGroups = breakup_.popBal().sizeGroups();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
const dimensionedScalar& xii = sizeGroups[i+1]->x();
|
||||
const dimensionedScalar& xii = sizeGroups[i+1].x();
|
||||
|
||||
return
|
||||
(
|
||||
@ -95,7 +95,7 @@ LaakkonenAlopaeusAittamaaDsd::calcNik
|
||||
}
|
||||
else if (i == k)
|
||||
{
|
||||
const dimensionedScalar& x = sizeGroups[i-1]->x();
|
||||
const dimensionedScalar& x = sizeGroups[i-1].x();
|
||||
|
||||
return
|
||||
(
|
||||
@ -107,8 +107,8 @@ LaakkonenAlopaeusAittamaaDsd::calcNik
|
||||
}
|
||||
else
|
||||
{
|
||||
const dimensionedScalar& x = sizeGroups[i-1]->x();
|
||||
const dimensionedScalar& xii = sizeGroups[i+1]->x();
|
||||
const dimensionedScalar& x = sizeGroups[i-1].x();
|
||||
const dimensionedScalar& xii = sizeGroups[i+1].x();
|
||||
|
||||
return
|
||||
(
|
||||
|
||||
@ -76,21 +76,21 @@ Foam::diameterModels::daughterSizeDistributionModels::uniformBinary::calcNik
|
||||
const label k
|
||||
) const
|
||||
{
|
||||
const dimensionedScalar& xi = breakup_.popBal().sizeGroups()[i]->x();
|
||||
const dimensionedScalar& xk = breakup_.popBal().sizeGroups()[k]->x();
|
||||
const List<sizeGroup*>& sizeGroups = breakup_.popBal().sizeGroups();
|
||||
const dimensionedScalar& xi = breakup_.popBal().sizeGroups()[i].x();
|
||||
const dimensionedScalar& xk = breakup_.popBal().sizeGroups()[k].x();
|
||||
const UPtrList<sizeGroup>& sizeGroups = breakup_.popBal().sizeGroups();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
return (sizeGroups[i+1]->x() - xi)/xk;
|
||||
return (sizeGroups[i+1].x() - xi)/xk;
|
||||
}
|
||||
else if (i == k)
|
||||
{
|
||||
return (xi - sizeGroups[i-1]->x())/xk;
|
||||
return (xi - sizeGroups[i-1].x())/xk;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (sizeGroups[i+1]->x() - xi)/xk + (xi - sizeGroups[i-1]->x())/xk;
|
||||
return (sizeGroups[i+1].x() - xi)/xk + (xi - sizeGroups[i-1].x())/xk;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ void Foam::diameterModels::driftModels::constantDrift::correct()
|
||||
|
||||
forAll(popBal_.sizeGroups(), i)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
N_ += fi*fi.phase()/fi.x();
|
||||
}
|
||||
@ -86,7 +86,7 @@ void Foam::diameterModels::driftModels::constantDrift::addToDriftRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
phaseModel& phase = const_cast<phaseModel&>(fi.phase());
|
||||
volScalarField& rho = phase.thermoRef().rho();
|
||||
|
||||
|
||||
@ -65,11 +65,11 @@ void Foam::diameterModels::driftModels::densityChangeDrift::addToDriftRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
volScalarField& rho = const_cast<volScalarField&>(fi.phase().rho()());
|
||||
|
||||
driftRate -= (fvc::ddt(rho) + (fvc::grad(rho)&popBal_.U()))
|
||||
*popBal_.sizeGroups()[i]->x()/rho;
|
||||
*popBal_.sizeGroups()[i].x()/rho;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ void Foam::diameterModels::driftModels::phaseChange::correct()
|
||||
|
||||
forAll(popBal_.sizeGroups(), i)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
N_ += fi*max(fi.phase(), small)/fi.x();
|
||||
}
|
||||
@ -113,7 +113,7 @@ void Foam::diameterModels::driftModels::phaseChange::addToDriftRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
|
||||
driftRate += iDmdt_/(N_*fi.phase().rho());
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ Foam::diameterModels::nucleationModels::constantNucleation::addToNucleationRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
phaseModel& phase = const_cast<phaseModel&>(fi.phase());
|
||||
volScalarField& rho = phase.thermoRef().rho();
|
||||
|
||||
|
||||
@ -150,7 +150,7 @@ Foam::diameterModels::nucleationModels::wallBoiling::addToNucleationRate
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *popBal_.sizeGroups()[i];
|
||||
const sizeGroup& fi = popBal_.sizeGroups()[i];
|
||||
const phaseModel& phase = fi.phase();
|
||||
const volScalarField& rho = phase.rho();
|
||||
const tmp<volScalarField> talphat(turbulence_.alphat());
|
||||
|
||||
@ -51,13 +51,19 @@ Foam::diameterModels::populationBalanceModel::registerVelocityAndSizeGroups()
|
||||
|
||||
if (velGroup.popBalName() == this->name())
|
||||
{
|
||||
velocityGroups_.append(&const_cast<velocityGroup&>(velGroup));
|
||||
velocityGroups_.resize(velocityGroups_.size() + 1);
|
||||
|
||||
velocityGroups_.set
|
||||
(
|
||||
velocityGroups_.size() - 1,
|
||||
&const_cast<velocityGroup&>(velGroup)
|
||||
);
|
||||
|
||||
forAll(velGroup.sizeGroups(), i)
|
||||
{
|
||||
this->add
|
||||
(
|
||||
&const_cast<sizeGroup&>(velGroup.sizeGroups()[i])
|
||||
const_cast<sizeGroup&>(velGroup.sizeGroups()[i])
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -66,26 +72,24 @@ Foam::diameterModels::populationBalanceModel::registerVelocityAndSizeGroups()
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
void
|
||||
Foam::diameterModels::populationBalanceModel::add(sizeGroup& group)
|
||||
{
|
||||
if
|
||||
(
|
||||
sizeGroups_.size() != 0
|
||||
&&
|
||||
group->x().value() <= sizeGroups_.last()->x().value()
|
||||
group.x().value() <= sizeGroups_.last().x().value()
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"populationBalance::add"
|
||||
"(sizeGroup* group)"
|
||||
) << "Size groups must be entered according to their representative"
|
||||
FatalErrorInFunction
|
||||
<< "Size groups must be entered according to their representative"
|
||||
<< " size"
|
||||
<< endl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
sizeGroups_.append(group);
|
||||
sizeGroups_.resize(sizeGroups_.size() + 1);
|
||||
sizeGroups_.set(sizeGroups_.size() - 1, &group);
|
||||
|
||||
// Grid generation over property space
|
||||
if (sizeGroups_.size() == 1)
|
||||
@ -97,7 +101,7 @@ void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
new dimensionedScalar
|
||||
(
|
||||
"v",
|
||||
sizeGroups_.last()->x()
|
||||
sizeGroups_.last().x()
|
||||
)
|
||||
);
|
||||
|
||||
@ -108,7 +112,7 @@ void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
new dimensionedScalar
|
||||
(
|
||||
"v",
|
||||
sizeGroups_.last()->x()
|
||||
sizeGroups_.last().x()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -119,8 +123,8 @@ void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
v_.last() =
|
||||
0.5
|
||||
*(
|
||||
sizeGroups_[sizeGroups_.size()-2]->x()
|
||||
+ sizeGroups_.last()->x()
|
||||
sizeGroups_[sizeGroups_.size()-2].x()
|
||||
+ sizeGroups_.last().x()
|
||||
);
|
||||
|
||||
// Set the last sizeGroup boundary to the representative size of the
|
||||
@ -130,7 +134,7 @@ void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
new dimensionedScalar
|
||||
(
|
||||
"v",
|
||||
sizeGroups_.last()->x()
|
||||
sizeGroups_.last().x()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -148,12 +152,7 @@ void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"Su",
|
||||
inv(dimTime),
|
||||
0.0
|
||||
)
|
||||
dimensionedScalar("Su", inv(dimTime), 0)
|
||||
)
|
||||
);
|
||||
|
||||
@ -168,12 +167,7 @@ void Foam::diameterModels::populationBalanceModel::add(sizeGroup* group)
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"SuSp",
|
||||
inv(dimTime),
|
||||
0.0
|
||||
)
|
||||
dimensionedScalar("SuSp", inv(dimTime), 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -183,11 +177,11 @@ void Foam::diameterModels::populationBalanceModel::createPhasePairs()
|
||||
{
|
||||
forAll(velocityGroups_, i)
|
||||
{
|
||||
const phaseModel& phasei = velocityGroups_[i]->phase();
|
||||
const phaseModel& phasei = velocityGroups_[i].phase();
|
||||
|
||||
forAll(velocityGroups_, j)
|
||||
{
|
||||
const phaseModel& phasej = velocityGroups_[j]->phase();
|
||||
const phaseModel& phasej = velocityGroups_[j].phase();
|
||||
|
||||
if (&phasei != &phasej)
|
||||
{
|
||||
@ -225,7 +219,7 @@ void Foam::diameterModels::populationBalanceModel::correct()
|
||||
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
velocityGroups_[v]->preSolve();
|
||||
velocityGroups_[v].preSolve();
|
||||
}
|
||||
|
||||
forAll(coalescence_, model)
|
||||
@ -264,8 +258,8 @@ birthByCoalescence
|
||||
const label k
|
||||
)
|
||||
{
|
||||
const sizeGroup& fj = *sizeGroups_[j];
|
||||
const sizeGroup& fk = *sizeGroups_[k];
|
||||
const sizeGroup& fj = sizeGroups_[j];
|
||||
const sizeGroup& fk = sizeGroups_[k];
|
||||
|
||||
dimensionedScalar Gamma;
|
||||
dimensionedScalar v = fj.x() + fk.x();
|
||||
@ -277,7 +271,7 @@ birthByCoalescence
|
||||
|
||||
if (Gamma.value() == 0) continue;
|
||||
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
// Avoid double counting of events
|
||||
if (j == k)
|
||||
@ -341,8 +335,8 @@ deathByCoalescence
|
||||
const label j
|
||||
)
|
||||
{
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fj = *sizeGroups_[j];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
const sizeGroup& fj = sizeGroups_[j];
|
||||
|
||||
SuSp_[i] += coalescenceRate_()*fi.phase()*fj*fj.phase()/fj.x();
|
||||
|
||||
@ -360,11 +354,11 @@ birthByBreakup
|
||||
const label model
|
||||
)
|
||||
{
|
||||
const sizeGroup& fk = *sizeGroups_[k];
|
||||
const sizeGroup& fk = sizeGroups_[k];
|
||||
|
||||
for (label i = 0; i <= k; i++)
|
||||
{
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
Sui_ =
|
||||
fi.x()*breakupRate_()*breakup_[model].dsdPtr()().nik(i, k)
|
||||
@ -393,7 +387,7 @@ birthByBreakup
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::deathByBreakup(const label i)
|
||||
{
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
SuSp_[i] += breakupRate_()*fi.phase();
|
||||
}
|
||||
@ -419,14 +413,14 @@ void Foam::diameterModels::populationBalanceModel::calcDeltas()
|
||||
|
||||
if
|
||||
(
|
||||
v_[i].value() < 0.5*sizeGroups_[j]->x().value()
|
||||
v_[i].value() < 0.5*sizeGroups_[j].x().value()
|
||||
&&
|
||||
0.5*sizeGroups_[j]->x().value() < v_[i+1].value()
|
||||
0.5*sizeGroups_[j].x().value() < v_[i+1].value()
|
||||
)
|
||||
{
|
||||
delta_[i][j] = mag(0.5*sizeGroups_[j]->x() - v_[i]);
|
||||
delta_[i][j] = mag(0.5*sizeGroups_[j].x() - v_[i]);
|
||||
}
|
||||
else if (0.5*sizeGroups_[j]->x().value() <= v_[i].value())
|
||||
else if (0.5*sizeGroups_[j].x().value() <= v_[i].value())
|
||||
{
|
||||
delta_[i][j] *= 0.0;
|
||||
}
|
||||
@ -443,8 +437,8 @@ birthByBinaryBreakup
|
||||
const label j
|
||||
)
|
||||
{
|
||||
const sizeGroup& fj = *sizeGroups_[j];
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fj = sizeGroups_[j];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
Sui_ = fi.x()*binaryBreakupRate_()*delta_[i][j]*fj*fj.phase()/fj.x();
|
||||
|
||||
@ -476,12 +470,12 @@ birthByBinaryBreakup
|
||||
|
||||
if (Gamma.value() == 0) continue;
|
||||
|
||||
const sizeGroup& fk = *sizeGroups_[k];
|
||||
const sizeGroup& fk = sizeGroups_[k];
|
||||
|
||||
volScalarField& Suk = Sui_;
|
||||
|
||||
Suk =
|
||||
sizeGroups_[k]->x()*binaryBreakupRate_()*delta_[i][j]*Gamma
|
||||
sizeGroups_[k].x()*binaryBreakupRate_()*delta_[i][j]*Gamma
|
||||
*fj*fj.phase()/fj.x();
|
||||
|
||||
Su_[k] += Suk;
|
||||
@ -516,7 +510,7 @@ deathByBinaryBreakup
|
||||
const label i
|
||||
)
|
||||
{
|
||||
const volScalarField& alphai = sizeGroups_[i]->phase();
|
||||
const volScalarField& alphai = sizeGroups_[i].phase();
|
||||
|
||||
SuSp_[i] += alphai*binaryBreakupRate_()*delta_[j][i];
|
||||
}
|
||||
@ -524,73 +518,73 @@ deathByBinaryBreakup
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::drift(const label i)
|
||||
{
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
rx_() = pos(driftRate_())*sizeGroups_[i+1]->x()/sizeGroups_[i]->x();
|
||||
rx_() = pos(driftRate_())*sizeGroups_[i+1].x()/sizeGroups_[i].x();
|
||||
}
|
||||
else if (i == sizeGroups_.size() - 1)
|
||||
{
|
||||
rx_() = neg(driftRate_())*sizeGroups_[i-1]->x()/sizeGroups_[i]->x();
|
||||
rx_() = neg(driftRate_())*sizeGroups_[i-1].x()/sizeGroups_[i].x();
|
||||
}
|
||||
else
|
||||
{
|
||||
rx_() =
|
||||
pos(driftRate_())*sizeGroups_[i+1]->x()/sizeGroups_[i]->x()
|
||||
+ neg(driftRate_())*sizeGroups_[i-1]->x()/sizeGroups_[i]->x();
|
||||
pos(driftRate_())*sizeGroups_[i+1].x()/sizeGroups_[i].x()
|
||||
+ neg(driftRate_())*sizeGroups_[i-1].x()/sizeGroups_[i].x();
|
||||
}
|
||||
|
||||
SuSp_[i] +=
|
||||
(neg(1 - rx_()) + neg(1 - rx_()/(1 - rx_())))*driftRate_()
|
||||
*fi.phase()/((rx_() - 1)*sizeGroups_[i]->x());
|
||||
*fi.phase()/((rx_() - 1)*sizeGroups_[i].x());
|
||||
|
||||
rx_() *= 0.0;
|
||||
rdx_() *= 0.0;
|
||||
|
||||
if (i < sizeGroups_.size() - 2)
|
||||
{
|
||||
rx_() += pos(driftRate_())*sizeGroups_[i+2]->x()/sizeGroups_[i+1]->x();
|
||||
rx_() += pos(driftRate_())*sizeGroups_[i+2].x()/sizeGroups_[i+1].x();
|
||||
|
||||
rdx_() +=
|
||||
pos(driftRate_())
|
||||
*(sizeGroups_[i+2]->x() - sizeGroups_[i+1]->x())
|
||||
/(sizeGroups_[i+1]->x() - sizeGroups_[i]->x());
|
||||
*(sizeGroups_[i+2].x() - sizeGroups_[i+1].x())
|
||||
/(sizeGroups_[i+1].x() - sizeGroups_[i].x());
|
||||
}
|
||||
else if (i == sizeGroups_.size() - 2)
|
||||
{
|
||||
rx_() += pos(driftRate_())*sizeGroups_[i+1]->x()/sizeGroups_[i]->x();
|
||||
rx_() += pos(driftRate_())*sizeGroups_[i+1].x()/sizeGroups_[i].x();
|
||||
|
||||
rdx_() +=
|
||||
pos(driftRate_())
|
||||
*(sizeGroups_[i+1]->x() - sizeGroups_[i]->x())
|
||||
/(sizeGroups_[i]->x() - sizeGroups_[i-1]->x());
|
||||
*(sizeGroups_[i+1].x() - sizeGroups_[i].x())
|
||||
/(sizeGroups_[i].x() - sizeGroups_[i-1].x());
|
||||
}
|
||||
|
||||
if (i == 1)
|
||||
{
|
||||
rx_() +=
|
||||
neg(driftRate_())*sizeGroups_[i-1]->x()
|
||||
/sizeGroups_[i]->x();
|
||||
neg(driftRate_())*sizeGroups_[i-1].x()
|
||||
/sizeGroups_[i].x();
|
||||
|
||||
rdx_() +=
|
||||
neg(driftRate_())
|
||||
*(sizeGroups_[i]->x() - sizeGroups_[i-1]->x())
|
||||
/(sizeGroups_[i+1]->x() - sizeGroups_[i]->x());
|
||||
*(sizeGroups_[i].x() - sizeGroups_[i-1].x())
|
||||
/(sizeGroups_[i+1].x() - sizeGroups_[i].x());
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
rx_() += neg(driftRate_())*sizeGroups_[i-2]->x()/sizeGroups_[i-1]->x();
|
||||
rx_() += neg(driftRate_())*sizeGroups_[i-2].x()/sizeGroups_[i-1].x();
|
||||
|
||||
rdx_() +=
|
||||
neg(driftRate_())
|
||||
*(sizeGroups_[i-1]->x() - sizeGroups_[i-2]->x())
|
||||
/(sizeGroups_[i]->x() - sizeGroups_[i-1]->x());
|
||||
*(sizeGroups_[i-1].x() - sizeGroups_[i-2].x())
|
||||
/(sizeGroups_[i].x() - sizeGroups_[i-1].x());
|
||||
}
|
||||
|
||||
if (i != sizeGroups_.size() - 1)
|
||||
{
|
||||
const sizeGroup& fj = *sizeGroups_[i+1];
|
||||
const sizeGroup& fj = sizeGroups_[i+1];
|
||||
volScalarField& Suj = Sui_;
|
||||
|
||||
Suj =
|
||||
@ -619,7 +613,7 @@ void Foam::diameterModels::populationBalanceModel::drift(const label i)
|
||||
|
||||
if (i != 0)
|
||||
{
|
||||
const sizeGroup& fh = *sizeGroups_[i-1];
|
||||
const sizeGroup& fh = sizeGroups_[i-1];
|
||||
volScalarField& Suh = Sui_;
|
||||
|
||||
Suh =
|
||||
@ -650,9 +644,7 @@ void Foam::diameterModels::populationBalanceModel::drift(const label i)
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::nucleation(const label i)
|
||||
{
|
||||
dimensionedScalar volume("volume", dimVolume, 1.0);
|
||||
|
||||
Su_[i] += sizeGroups_[i]->x()*nucleationRate_();
|
||||
Su_[i] += sizeGroups_[i].x()*nucleationRate_();
|
||||
}
|
||||
|
||||
|
||||
@ -679,15 +671,15 @@ void Foam::diameterModels::populationBalanceModel::sources()
|
||||
// terms as required
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
const sizeGroup& fi = *sizeGroups_[i];
|
||||
const sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
if (coalescence_.size() != 0)
|
||||
{
|
||||
for (label j = 0; j <= i; j++)
|
||||
{
|
||||
const sizeGroup& fj = *sizeGroups_[j];
|
||||
const sizeGroup& fj = sizeGroups_[j];
|
||||
|
||||
if (fi.x() + fj.x() > sizeGroups_.last()->x()) break;
|
||||
if (fi.x() + fj.x() > sizeGroups_.last().x()) break;
|
||||
|
||||
coalescenceRate_() *= 0.0;
|
||||
|
||||
@ -776,17 +768,17 @@ void Foam::diameterModels::populationBalanceModel::dmdt()
|
||||
{
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
velocityGroup& VelocityGroup = *velocityGroups_[v];
|
||||
velocityGroup& velGroup = velocityGroups_[v];
|
||||
|
||||
velocityGroups_[v]->dmdt() *= 0.0;
|
||||
velGroup.dmdt() *= 0.0;
|
||||
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
if (&sizeGroups_[i]->phase() == &VelocityGroup.phase())
|
||||
if (&sizeGroups_[i].phase() == &velGroup.phase())
|
||||
{
|
||||
sizeGroup& fi = *sizeGroups_[i];
|
||||
sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
VelocityGroup.dmdt() += fi.phase().rho()*(Su_[i] - SuSp_[i]*fi);
|
||||
velGroup.dmdt() += fi.phase().rho()*(Su_[i] - SuSp_[i]*fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -795,24 +787,57 @@ void Foam::diameterModels::populationBalanceModel::dmdt()
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::calcAlphas()
|
||||
{
|
||||
alphas_ *= 0.0;
|
||||
alphas_() *= 0.0;
|
||||
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
alphas_ += velocityGroups_[v]->phase();
|
||||
const phaseModel& phase = velocityGroups_[v].phase();
|
||||
|
||||
alphas_() += max(phase, phase.residualAlpha());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::diameterModels::populationBalanceModel::calcDsm()
|
||||
{
|
||||
tmp<volScalarField> tInvDsm
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"invDsm",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("invDsm", inv(dimLength), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& invDsm = tInvDsm.ref();
|
||||
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
const phaseModel& phase = velocityGroups_[v].phase();
|
||||
|
||||
invDsm += max(phase, phase.residualAlpha())/(phase.d()*alphas_());
|
||||
}
|
||||
|
||||
return 1.0/tInvDsm;
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::calcVelocity()
|
||||
{
|
||||
U_ *= 0.0;
|
||||
U_() *= 0.0;
|
||||
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
const phaseModel& phase = velocityGroups_[v]->phase();
|
||||
const phaseModel& phase = velocityGroups_[v].phase();
|
||||
|
||||
U_ += phase*phase.U()/max(alphas_, phase.residualAlpha());
|
||||
U_() += max(phase, phase.residualAlpha())*phase.U()/alphas_();
|
||||
}
|
||||
}
|
||||
|
||||
@ -831,17 +856,17 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
IOobject
|
||||
(
|
||||
name,
|
||||
fluid.mesh().time().constant(),
|
||||
fluid.time().constant(),
|
||||
fluid.mesh()
|
||||
)
|
||||
),
|
||||
fluid_(fluid),
|
||||
pDmdt_(pDmdt),
|
||||
mesh_(fluid.mesh()),
|
||||
mesh_(fluid_.mesh()),
|
||||
name_(name),
|
||||
dict_
|
||||
(
|
||||
fluid.subDict("populationBalanceCoeffs").subDict(name_)
|
||||
fluid_.subDict("populationBalanceCoeffs").subDict(name_)
|
||||
),
|
||||
pimple_(mesh_.lookupObject<pimpleControl>("solutionControl")),
|
||||
continuousPhase_
|
||||
@ -862,8 +887,8 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
IOobject
|
||||
(
|
||||
"Sui",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Sui", inv(dimTime), Zero)
|
||||
@ -900,42 +925,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
nucleationModel::iNew(*this)
|
||||
),
|
||||
nucleationRate_(),
|
||||
alphas_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alpha", this->name()),
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar
|
||||
(
|
||||
IOobject::groupName("alpha", this->name()),
|
||||
dimless,
|
||||
Zero
|
||||
)
|
||||
),
|
||||
U_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("U", this->name()),
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedVector
|
||||
(
|
||||
IOobject::groupName("U", this->name()),
|
||||
dimVelocity,
|
||||
Zero
|
||||
)
|
||||
)
|
||||
alphas_(),
|
||||
dsm_(),
|
||||
U_()
|
||||
{
|
||||
this->registerVelocityAndSizeGroups();
|
||||
|
||||
@ -944,26 +936,25 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
if (sizeGroups_.size() < 3)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "The populationBalance " << name_
|
||||
<< " requires a minimum number of three sizeGroups to be"
|
||||
<< " specified."
|
||||
<< exit(FatalError);
|
||||
<< "The populationBalance " << name_
|
||||
<< " requires a minimum number of three sizeGroups to be specified."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
if (coalescence_.size() != 0)
|
||||
{
|
||||
coalescenceRate_.reset
|
||||
coalescenceRate_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"coalescenceRate",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar("coalescenceRate", dimVolume/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
@ -971,17 +962,17 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
|
||||
if (breakup_.size() != 0)
|
||||
{
|
||||
breakupRate_.reset
|
||||
breakupRate_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"breakupRate",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
fluid_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar("breakupRate", inv(dimTime), Zero)
|
||||
)
|
||||
);
|
||||
@ -989,17 +980,17 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
|
||||
if (binaryBreakup_.size() != 0)
|
||||
{
|
||||
binaryBreakupRate_.reset
|
||||
binaryBreakupRate_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"binaryBreakupRate",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
fluid_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"binaryBreakupRate",
|
||||
@ -1012,47 +1003,47 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
|
||||
if (drift_.size() != 0)
|
||||
{
|
||||
driftRate_.reset
|
||||
driftRate_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"driftRate",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
fluid_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar("driftRate", dimVolume/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
rx_.reset
|
||||
rx_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"r",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
fluid_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar("r", dimless, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
rdx_.reset
|
||||
rdx_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"r",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
fluid_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar("r", dimless, Zero)
|
||||
)
|
||||
);
|
||||
@ -1060,17 +1051,17 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
|
||||
if (nucleation_.size() != 0)
|
||||
{
|
||||
nucleationRate_.reset
|
||||
nucleationRate_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nucleationRate",
|
||||
fluid.time().timeName(),
|
||||
fluid.mesh()
|
||||
fluid_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
fluid.mesh(),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"nucleationRate",
|
||||
@ -1080,6 +1071,60 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (velocityGroups_.size() > 1)
|
||||
{
|
||||
alphas_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alpha", this->name()),
|
||||
fluid_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("alpha", dimless, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
dsm_.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("d", this->name()),
|
||||
fluid_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("d", dimLength, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
U_.set
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("U", this->name()),
|
||||
fluid_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedVector("U", dimVelocity, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
@ -1112,7 +1157,7 @@ Foam::diameterModels::populationBalanceModel::gamma
|
||||
{
|
||||
dimensionedScalar lowerBoundary(v);
|
||||
dimensionedScalar upperBoundary(v);
|
||||
const dimensionedScalar& xi = sizeGroups_[i]->x();
|
||||
const dimensionedScalar& xi = sizeGroups_[i].x();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -1120,7 +1165,7 @@ Foam::diameterModels::populationBalanceModel::gamma
|
||||
}
|
||||
else
|
||||
{
|
||||
lowerBoundary = sizeGroups_[i-1]->x();
|
||||
lowerBoundary = sizeGroups_[i-1].x();
|
||||
}
|
||||
|
||||
if (i == sizeGroups_.size() - 1)
|
||||
@ -1129,7 +1174,7 @@ Foam::diameterModels::populationBalanceModel::gamma
|
||||
}
|
||||
else
|
||||
{
|
||||
upperBoundary = sizeGroups_[i+1]->x();
|
||||
upperBoundary = sizeGroups_[i+1].x();
|
||||
}
|
||||
|
||||
if (v < lowerBoundary || v > upperBoundary)
|
||||
@ -1188,9 +1233,6 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
)
|
||||
);
|
||||
|
||||
calcAlphas();
|
||||
calcVelocity();
|
||||
|
||||
if (!solveOnFinalIterOnly || pimple_.finalIter())
|
||||
{
|
||||
label nCorr(readLabel(solutionControls.lookup("nCorr")));
|
||||
@ -1223,7 +1265,7 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
sizeGroup& fi = *sizeGroups_[i];
|
||||
sizeGroup& fi = sizeGroups_[i];
|
||||
const phaseModel& phase = fi.phase();
|
||||
const volScalarField& alpha = phase;
|
||||
const dimensionedScalar& residualAlpha = phase.residualAlpha();
|
||||
@ -1264,18 +1306,25 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
{
|
||||
forAll(velocityGroups_, i)
|
||||
{
|
||||
velocityGroups_[i]->postSolve();
|
||||
velocityGroups_[i].postSolve();
|
||||
}
|
||||
}
|
||||
|
||||
if (velocityGroups_.size() > 1)
|
||||
{
|
||||
calcAlphas();
|
||||
dsm_() = calcDsm();
|
||||
calcVelocity();
|
||||
}
|
||||
|
||||
volScalarField fAlpha0
|
||||
(
|
||||
*sizeGroups_.first()*sizeGroups_.first()->phase()
|
||||
sizeGroups_.first()*sizeGroups_.first().phase()
|
||||
);
|
||||
|
||||
volScalarField fAlphaN
|
||||
(
|
||||
*sizeGroups_.last()*sizeGroups_.last()->phase()
|
||||
sizeGroups_.last()*sizeGroups_.last().phase()
|
||||
);
|
||||
|
||||
Info<< this->name() << " sizeGroup phase fraction first, last = "
|
||||
|
||||
@ -211,10 +211,10 @@ class populationBalanceModel
|
||||
const phaseModel& continuousPhase_;
|
||||
|
||||
//- velocityGroups belonging to this populationBalance
|
||||
List<velocityGroup*> velocityGroups_;
|
||||
UPtrList<velocityGroup> velocityGroups_;
|
||||
|
||||
//- sizeGroups belonging to this populationBalance
|
||||
List<sizeGroup*> sizeGroups_;
|
||||
UPtrList<sizeGroup> sizeGroups_;
|
||||
|
||||
//- List of unordered phasePairs in this populationBalance
|
||||
phasePairTable phasePairs_;
|
||||
@ -270,18 +270,21 @@ class populationBalanceModel
|
||||
//- Zeroeth order rate
|
||||
autoPtr<volScalarField> nucleationRate_;
|
||||
|
||||
//- Total void fraction of phases belonging to this populationBalance
|
||||
volScalarField alphas_;
|
||||
//- Total void fraction
|
||||
autoPtr<volScalarField> alphas_;
|
||||
|
||||
//- Mean Sauter diameter
|
||||
autoPtr<volScalarField> dsm_;
|
||||
|
||||
//- Average velocity
|
||||
volVectorField U_;
|
||||
autoPtr<volVectorField> U_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
void registerVelocityAndSizeGroups();
|
||||
|
||||
void add(sizeGroup* group);
|
||||
void add(sizeGroup& group);
|
||||
|
||||
void createPhasePairs();
|
||||
|
||||
@ -311,6 +314,8 @@ class populationBalanceModel
|
||||
|
||||
void calcAlphas();
|
||||
|
||||
tmp<volScalarField> calcDsm();
|
||||
|
||||
void calcVelocity();
|
||||
|
||||
|
||||
@ -389,10 +394,10 @@ public:
|
||||
inline const phaseModel& continuousPhase() const;
|
||||
|
||||
//- Return the velocityGroups belonging to this populationBalance
|
||||
inline const List<velocityGroup*>& velocityGroups() const;
|
||||
inline const UPtrList<velocityGroup>& velocityGroups() const;
|
||||
|
||||
//- Return the sizeGroups belonging to this populationBalance
|
||||
inline const List<sizeGroup*>& sizeGroups() const;
|
||||
inline const UPtrList<sizeGroup>& sizeGroups() const;
|
||||
|
||||
//- Return list of unordered phasePairs in this populationBalance
|
||||
inline const phasePairTable& phasePairs() const;
|
||||
|
||||
@ -53,14 +53,14 @@ Foam::diameterModels::populationBalanceModel::continuousPhase() const
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::diameterModels::velocityGroup*>&
|
||||
inline const Foam::UPtrList<Foam::diameterModels::velocityGroup>&
|
||||
Foam::diameterModels::populationBalanceModel::velocityGroups() const
|
||||
{
|
||||
return velocityGroups_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::diameterModels::sizeGroup*>&
|
||||
inline const Foam::UPtrList<Foam::diameterModels::sizeGroup>&
|
||||
Foam::diameterModels::populationBalanceModel::sizeGroups() const
|
||||
{
|
||||
return sizeGroups_;
|
||||
@ -84,14 +84,28 @@ Foam::diameterModels::populationBalanceModel::v() const
|
||||
inline const Foam::volScalarField&
|
||||
Foam::diameterModels::populationBalanceModel::alphas() const
|
||||
{
|
||||
return alphas_;
|
||||
if (velocityGroups_.size() > 1)
|
||||
{
|
||||
return alphas_();
|
||||
}
|
||||
else
|
||||
{
|
||||
return velocityGroups_.first().phase();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volVectorField&
|
||||
Foam::diameterModels::populationBalanceModel::U() const
|
||||
{
|
||||
return U_;
|
||||
if (velocityGroups_.size() > 1)
|
||||
{
|
||||
return U_();
|
||||
}
|
||||
else
|
||||
{
|
||||
return velocityGroups_.first().phase().U();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -183,9 +183,6 @@ wallLubrication
|
||||
turbulentDispersion
|
||||
();
|
||||
|
||||
bubbleInducedTurbulence
|
||||
();
|
||||
|
||||
// Minimum allowable pressure
|
||||
pMin 10000;
|
||||
|
||||
|
||||
@ -184,9 +184,6 @@ wallLubrication
|
||||
turbulentDispersion
|
||||
();
|
||||
|
||||
bubbleInducedTurbulence
|
||||
();
|
||||
|
||||
// Minimum allowable pressure
|
||||
pMin 10000;
|
||||
|
||||
|
||||
@ -225,9 +225,6 @@ wallLubrication
|
||||
turbulentDispersion
|
||||
();
|
||||
|
||||
bubbleInducedTurbulence
|
||||
();
|
||||
|
||||
// Minimum allowable pressure
|
||||
pMin 10000;
|
||||
|
||||
|
||||
@ -189,9 +189,6 @@ wallLubrication
|
||||
turbulentDispersion
|
||||
();
|
||||
|
||||
bubbleInducedTurbulence
|
||||
();
|
||||
|
||||
// Minimum allowable pressure
|
||||
pMin 10000;
|
||||
|
||||
|
||||
@ -156,9 +156,6 @@ wallLubrication
|
||||
turbulentDispersion
|
||||
();
|
||||
|
||||
bubbleInducedTurbulence
|
||||
();
|
||||
|
||||
// Minimum allowable pressure
|
||||
pMin 10000;
|
||||
|
||||
|
||||
@ -150,9 +150,6 @@ wallLubrication
|
||||
turbulentDispersion
|
||||
();
|
||||
|
||||
bubbleInducedTurbulence
|
||||
();
|
||||
|
||||
// Minimum allowable pressure
|
||||
pMin 10000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user