multiphaseEulerFoam/.../populationBalance: Changed sizeGroup equations to volumetric form
Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
This commit is contained in:
@ -80,9 +80,7 @@ PopulationBalancePhaseSystem
|
||||
this->phasePairs_[key]->name()
|
||||
),
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, 0)
|
||||
@ -202,24 +200,6 @@ Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::specieTransfer() const
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
bool Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::read()
|
||||
{
|
||||
if (BasePhaseSystem::read())
|
||||
{
|
||||
bool readOK = true;
|
||||
|
||||
// Models ...
|
||||
|
||||
return readOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
void Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::solve
|
||||
(
|
||||
@ -236,4 +216,34 @@ void Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::solve
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
void Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::correct()
|
||||
{
|
||||
BasePhaseSystem::correct();
|
||||
|
||||
forAll(populationBalances_, i)
|
||||
{
|
||||
populationBalances_[i].correct();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
bool Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::read()
|
||||
{
|
||||
if (BasePhaseSystem::read())
|
||||
{
|
||||
bool readOK = true;
|
||||
|
||||
// Read models ...
|
||||
|
||||
return readOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -97,15 +97,18 @@ public:
|
||||
virtual autoPtr<phaseSystem::specieTransferTable>
|
||||
specieTransfer() const;
|
||||
|
||||
//- Read base phaseProperties dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Solve all population balance equations
|
||||
virtual void solve
|
||||
(
|
||||
const PtrList<volScalarField>& rAUs,
|
||||
const PtrList<surfaceScalarField>& rAUfs
|
||||
);
|
||||
|
||||
//- Correct derived properties
|
||||
virtual void correct();
|
||||
|
||||
//- Read base phaseProperties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -196,7 +196,6 @@ void Foam::diameterModels::shapeModels::fractal::correct()
|
||||
const sizeGroup& fi = sizeGroup_;
|
||||
const phaseModel& phase = fi.phase();
|
||||
const volScalarField& alpha = phase;
|
||||
const volScalarField& rho = phase.thermo().rho();
|
||||
|
||||
const populationBalanceModel& popBal =
|
||||
sizeGroup_.mesh().lookupObject<populationBalanceModel>
|
||||
@ -204,32 +203,22 @@ void Foam::diameterModels::shapeModels::fractal::correct()
|
||||
sizeGroup_.VelocityGroup().popBalName()
|
||||
);
|
||||
|
||||
surfaceScalarField fAlphaRhoPhi
|
||||
surfaceScalarField fAlphaPhi
|
||||
(
|
||||
"fAlphaRhoPhi",
|
||||
max(fvc::interpolate(fi, "fi"), SMALL)*phase.alphaRhoPhi()
|
||||
"fAlphaPhi",
|
||||
max(fvc::interpolate(fi, "fi"), small)*phase.alphaPhi()
|
||||
);
|
||||
|
||||
fvScalarMatrix kappaEqn
|
||||
(
|
||||
fvc::ddt(alpha, rho, fi)*kappa_.oldTime()
|
||||
+ alpha*rho*fi*fvm::ddt(kappa_)
|
||||
+ fvm::div(fAlphaRhoPhi, kappa_)
|
||||
+ fvm::SuSp
|
||||
(
|
||||
fi
|
||||
*(
|
||||
fi.VelocityGroup().dmdt()
|
||||
- (fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi()))
|
||||
),
|
||||
kappa_
|
||||
)
|
||||
fvm::ddt(alpha, fi, kappa_)
|
||||
+ fvm::div(fAlphaPhi, kappa_)
|
||||
==
|
||||
- sinteringModel_->R()
|
||||
+ fvc::Su(Su_*rho, kappa_)
|
||||
- fvm::SuSp(popBal.SuSp(fi.i()())*fi*rho, kappa_)
|
||||
+ fvc::ddt(fi.phase().residualAlpha()*rho, kappa_)
|
||||
- fvm::ddt(fi.phase().residualAlpha()*rho, kappa_)
|
||||
+ Su_
|
||||
- fvm::SuSp(popBal.SuSp(fi.i()())*fi, kappa_)
|
||||
+ fvc::ddt(fi.phase().residualAlpha(), kappa_)
|
||||
- fvm::ddt(fi.phase().residualAlpha(), kappa_)
|
||||
);
|
||||
|
||||
kappaEqn.relax();
|
||||
|
||||
@ -108,7 +108,6 @@ Foam::diameterModels::shapeModels::sinteringModels::KochFriedlander::R() const
|
||||
const sizeGroup& fi = fractal_.SizeGroup();
|
||||
const volScalarField& kappai = fractal_.fld();
|
||||
const volScalarField& alpha = fi.phase();
|
||||
const volScalarField& rho = fi.phase().thermo().rho();
|
||||
|
||||
volScalarField::Internal R
|
||||
(
|
||||
@ -119,14 +118,14 @@ Foam::diameterModels::shapeModels::sinteringModels::KochFriedlander::R() const
|
||||
fi.mesh()
|
||||
),
|
||||
fi.mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, 0)
|
||||
dimensionedScalar(inv(dimTime), 0)
|
||||
);
|
||||
|
||||
volScalarField::Internal tau(this->tau());
|
||||
|
||||
forAll(R, celli)
|
||||
{
|
||||
R[celli] = fi[celli]*alpha[celli]*rho[celli]/tau[celli];
|
||||
R[celli] = fi[celli]*alpha[celli]/tau[celli];
|
||||
}
|
||||
|
||||
return fvm::Sp(R, kappai) - 6.0/fi.dSph()*R;
|
||||
|
||||
@ -135,27 +135,6 @@ void Foam::diameterModels::velocityGroup::scale()
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::fv::convectionScheme<Foam::scalar>>
|
||||
Foam::diameterModels::velocityGroup::mvconvection() const
|
||||
{
|
||||
tmp<fv::convectionScheme<Foam::scalar>> mvConvection
|
||||
(
|
||||
fv::convectionScheme<Foam::scalar>::New
|
||||
(
|
||||
phase().mesh(),
|
||||
fields_,
|
||||
phase().alphaRhoPhi(),
|
||||
phase().mesh().divScheme
|
||||
(
|
||||
"div(" + phase().alphaRhoPhi()().name() + ",f)"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return mvConvection;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
@ -226,24 +205,8 @@ Foam::diameterModels::velocityGroup::velocityGroup
|
||||
diameterProperties.lookup("sizeGroups"),
|
||||
sizeGroup::iNew(phase, *this)
|
||||
),
|
||||
d_(dRef()),
|
||||
dmdt_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("source", phase.name()),
|
||||
phase.time().timeName(),
|
||||
phase.mesh()
|
||||
),
|
||||
phase.mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
)
|
||||
d_(dRef())
|
||||
{
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
fields_.add(sizeGroups_[i]);
|
||||
}
|
||||
|
||||
d_ = dsm();
|
||||
}
|
||||
|
||||
@ -256,14 +219,13 @@ Foam::diameterModels::velocityGroup::~velocityGroup()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::velocityGroup::preSolve()
|
||||
void Foam::diameterModels::velocityGroup::correct()
|
||||
{
|
||||
mvConvection_ = mvconvection();
|
||||
}
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
sizeGroups_[i].correct();
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::velocityGroup::postSolve()
|
||||
{
|
||||
if
|
||||
(
|
||||
phase().mesh().solverDict(popBalName_).lookupOrDefault<Switch>
|
||||
|
||||
@ -110,15 +110,6 @@ class velocityGroup
|
||||
//- Sauter-mean diameter of the phase
|
||||
volScalarField& d_;
|
||||
|
||||
//- Multivariate convection scheme
|
||||
tmp<fv::convectionScheme<scalar>> mvConvection_;
|
||||
|
||||
//- Table of fields for multivariate convection
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields_;
|
||||
|
||||
//- Mass transfer rate
|
||||
volScalarField dmdt_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -130,8 +121,6 @@ class velocityGroup
|
||||
|
||||
void scale();
|
||||
|
||||
tmp<Foam::fv::convectionScheme<Foam::scalar>> mvconvection() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@ -175,20 +164,8 @@ public:
|
||||
//- Return sizeGroups belonging to this velocityGroup
|
||||
inline const PtrList<sizeGroup>& sizeGroups() const;
|
||||
|
||||
//- Return const-reference to multivariate convectionScheme
|
||||
inline const tmp<fv::convectionScheme<scalar>>& mvConvection() const;
|
||||
|
||||
//- Return const-reference to the mass transfer rate
|
||||
inline const volScalarField& dmdt() const;
|
||||
|
||||
//- Return reference to the mass transfer rate
|
||||
inline volScalarField& dmdtRef();
|
||||
|
||||
//- Corrections before populationBalanceModel::solve()
|
||||
void preSolve();
|
||||
|
||||
//- Corrections after populationBalanceModel::solve()
|
||||
void postSolve();
|
||||
//- Correct the diameter field
|
||||
virtual void correct();
|
||||
|
||||
//- Read diameterProperties dictionary
|
||||
virtual bool read(const dictionary& diameterProperties);
|
||||
|
||||
@ -46,24 +46,4 @@ Foam::diameterModels::velocityGroup::sizeGroups() const
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::tmp<Foam::fv::convectionScheme<Foam::scalar>>&
|
||||
Foam::diameterModels::velocityGroup::mvConvection() const
|
||||
{
|
||||
return mvConvection_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField& Foam::diameterModels::velocityGroup::
|
||||
dmdt() const
|
||||
{
|
||||
return dmdt_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volScalarField& Foam::diameterModels::velocityGroup::dmdtRef()
|
||||
{
|
||||
return dmdt_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -104,7 +104,7 @@ addToBinaryBreakupRate
|
||||
*exp(-sqrt(2.0)/pow3(fj.dSph()/L))
|
||||
*6.0/pow(pi, 1.5)/pow3(fi.dSph()/L)
|
||||
*exp(-9.0/4.0*sqr(log(pow(2.0, 0.4)*fi.dSph()/L)))
|
||||
/max(1.0 + erf(1.5*log(pow(2.0, 1.0/15.0)*fj.dSph()/L)), SMALL)
|
||||
/max(1.0 + erf(1.5*log(pow(2.0, 1.0/15.0)*fj.dSph()/L)), small)
|
||||
/(T*pow3(L));
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ Foam::diameterModels::binaryBreakupModels::LuoSvendsen::LuoSvendsen
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::binaryBreakupModels::LuoSvendsen::correct()
|
||||
void Foam::diameterModels::binaryBreakupModels::LuoSvendsen::precompute()
|
||||
{
|
||||
kolmogorovLengthScale_ =
|
||||
pow025
|
||||
|
||||
@ -202,8 +202,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to binary breakupRate
|
||||
virtual void addToBinaryBreakupRate
|
||||
|
||||
@ -78,7 +78,7 @@ Foam::diameterModels::binaryBreakupModel::binaryBreakupModel
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::binaryBreakupModel::correct()
|
||||
void Foam::diameterModels::binaryBreakupModel::precompute()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -135,8 +135,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to binary breakupRate
|
||||
virtual void addToBinaryBreakupRate
|
||||
|
||||
@ -81,7 +81,7 @@ Foam::diameterModels::breakupModel::breakupModel
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::breakupModel::correct()
|
||||
void Foam::diameterModels::breakupModel::precompute()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -159,8 +159,8 @@ public:
|
||||
return dsd_;
|
||||
}
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Set total breakupRate
|
||||
virtual void setBreakupRate
|
||||
|
||||
@ -86,7 +86,7 @@ BrownianCollisions
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::coalescenceModels::BrownianCollisions::correct()
|
||||
void Foam::diameterModels::coalescenceModels::BrownianCollisions::precompute()
|
||||
{
|
||||
const volScalarField& T = popBal_.continuousPhase().thermo().T();
|
||||
const volScalarField& p = popBal_.continuousPhase().thermo().p();
|
||||
|
||||
@ -129,8 +129,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to coalescenceRate
|
||||
virtual void addToCoalescenceRate
|
||||
|
||||
@ -87,9 +87,9 @@ DahnekeInterpolation
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::coalescenceModels::DahnekeInterpolation::correct()
|
||||
void Foam::diameterModels::coalescenceModels::DahnekeInterpolation::precompute()
|
||||
{
|
||||
Brownian_().correct();
|
||||
Brownian_().precompute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -109,8 +109,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to coalescenceRate
|
||||
virtual void addToCoalescenceRate
|
||||
|
||||
@ -113,7 +113,7 @@ PrinceBlanch
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::coalescenceModels::PrinceBlanch::correct()
|
||||
void Foam::diameterModels::coalescenceModels::PrinceBlanch::precompute()
|
||||
{
|
||||
if (laminarShear_)
|
||||
{
|
||||
|
||||
@ -203,8 +203,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to coalescenceRate
|
||||
virtual void addToCoalescenceRate
|
||||
|
||||
@ -78,7 +78,7 @@ Foam::diameterModels::coalescenceModel::coalescenceModel
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::coalescenceModel::correct()
|
||||
void Foam::diameterModels::coalescenceModel::precompute()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -133,8 +133,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to coalescenceRate
|
||||
virtual void addToCoalescenceRate
|
||||
|
||||
@ -114,7 +114,7 @@ Foam::diameterModels::daughterSizeDistributionModel::nik
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::daughterSizeDistributionModel::correct()
|
||||
void Foam::diameterModels::daughterSizeDistributionModel::precompute()
|
||||
{
|
||||
if (nik_.size() == 0)
|
||||
{
|
||||
|
||||
@ -122,8 +122,8 @@ public:
|
||||
//- Return contribution to sizeGroup i due to breakup in sizeGroup k
|
||||
const dimensionedScalar& nik(const label i, const label k) const;
|
||||
|
||||
//- Correct field independent expressions
|
||||
void correct();
|
||||
//- Precompute field independent expressions
|
||||
void precompute();
|
||||
|
||||
//- Calculate contribution to sizeGroup i due to breakup in sizeGroup k
|
||||
virtual dimensionedScalar calcNik
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::diameterModels::driftModels::constantDrift::constantDrift
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::driftModels::constantDrift::correct()
|
||||
void Foam::diameterModels::driftModels::constantDrift::precompute()
|
||||
{
|
||||
N_ = Zero;
|
||||
|
||||
|
||||
@ -81,8 +81,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to driftRate
|
||||
virtual void addToDriftRate
|
||||
|
||||
@ -80,7 +80,7 @@ Foam::diameterModels::driftModel::driftModel
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::driftModel::correct()
|
||||
void Foam::diameterModels::driftModel::precompute()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -148,8 +148,8 @@ public:
|
||||
return dict_;
|
||||
}
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to driftRate
|
||||
virtual void addToDriftRate
|
||||
|
||||
@ -89,7 +89,7 @@ Foam::diameterModels::driftModels::phaseChange::phaseChange
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::driftModels::phaseChange::correct()
|
||||
void Foam::diameterModels::driftModels::phaseChange::precompute()
|
||||
{
|
||||
const phaseSystem& fluid = popBal_.fluid();
|
||||
|
||||
|
||||
@ -98,8 +98,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to driftRate
|
||||
virtual void addToDriftRate
|
||||
|
||||
@ -80,7 +80,7 @@ Foam::diameterModels::nucleationModel::nucleationModel
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::nucleationModel::correct()
|
||||
void Foam::diameterModels::nucleationModel::precompute()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -149,8 +149,8 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to nucleationRate
|
||||
virtual void addToNucleationRate
|
||||
|
||||
@ -77,7 +77,7 @@ wallBoiling
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModels::nucleationModels::wallBoiling::correct()
|
||||
void Foam::diameterModels::nucleationModels::wallBoiling::precompute()
|
||||
{
|
||||
const volScalarField& alphat =
|
||||
popBal_.mesh().lookupObject<volScalarField>
|
||||
|
||||
@ -86,8 +86,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diameter independent expressions
|
||||
virtual void correct();
|
||||
//- Precompute diameter independent expressions
|
||||
virtual void precompute();
|
||||
|
||||
//- Add to nucleationRate
|
||||
virtual void addToNucleationRate
|
||||
|
||||
@ -31,11 +31,8 @@ License
|
||||
#include "nucleationModel.H"
|
||||
#include "phaseSystem.H"
|
||||
#include "surfaceTensionModel.H"
|
||||
#include "fvmDdt.H"
|
||||
#include "fvm.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvmSup.H"
|
||||
#include "fvcSup.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "phaseCompressibleMomentumTransportModel.H"
|
||||
#include "shapeModel.H"
|
||||
|
||||
@ -227,40 +224,35 @@ void Foam::diameterModels::populationBalanceModel::createPhasePairs()
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::correct()
|
||||
void Foam::diameterModels::populationBalanceModel::precompute()
|
||||
{
|
||||
calcDeltas();
|
||||
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
velocityGroups_[v].preSolve();
|
||||
}
|
||||
|
||||
forAll(coalescence_, model)
|
||||
{
|
||||
coalescence_[model].correct();
|
||||
coalescence_[model].precompute();
|
||||
}
|
||||
|
||||
forAll(breakup_, model)
|
||||
{
|
||||
breakup_[model].correct();
|
||||
breakup_[model].precompute();
|
||||
|
||||
breakup_[model].dsdPtr()().correct();
|
||||
breakup_[model].dsdPtr()->precompute();
|
||||
}
|
||||
|
||||
forAll(binaryBreakup_, model)
|
||||
{
|
||||
binaryBreakup_[model].correct();
|
||||
binaryBreakup_[model].precompute();
|
||||
}
|
||||
|
||||
forAll(drift_, model)
|
||||
{
|
||||
drift_[model].correct();
|
||||
drift_[model].precompute();
|
||||
}
|
||||
|
||||
forAll(nucleation_, model)
|
||||
{
|
||||
nucleation_[model].correct();
|
||||
nucleation_[model].precompute();
|
||||
}
|
||||
}
|
||||
|
||||
@ -705,12 +697,9 @@ void Foam::diameterModels::populationBalanceModel::sources()
|
||||
phasePairIter
|
||||
)
|
||||
{
|
||||
pDmdt_(phasePairIter())->ref() = Zero;
|
||||
*pDmdt_(phasePairIter()) = Zero;
|
||||
}
|
||||
|
||||
// Since the calculation of the rates is computationally expensive,
|
||||
// they are calculated once for each sizeGroup pair and inserted into source
|
||||
// terms as required
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
if (coalescence_.size() != 0)
|
||||
@ -794,27 +783,6 @@ void Foam::diameterModels::populationBalanceModel::sources()
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::dmdt()
|
||||
{
|
||||
forAll(velocityGroups_, v)
|
||||
{
|
||||
velocityGroup& velGroup = velocityGroups_[v];
|
||||
|
||||
velGroup.dmdtRef() = Zero;
|
||||
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
if (&sizeGroups_[i].phase() == &velGroup.phase())
|
||||
{
|
||||
sizeGroup& fi = sizeGroups_[i];
|
||||
|
||||
velGroup.dmdtRef() += fi.phase().rho()*(Su_[i] - SuSp_[i]*fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::calcAlphas()
|
||||
{
|
||||
alphas_() = Zero;
|
||||
@ -1266,7 +1234,7 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
|
||||
if (nCorr > 0)
|
||||
{
|
||||
correct();
|
||||
precompute();
|
||||
}
|
||||
|
||||
int iCorr = 0;
|
||||
@ -1283,7 +1251,6 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
if (updateSources())
|
||||
{
|
||||
sources();
|
||||
dmdt();
|
||||
}
|
||||
|
||||
maxInitialResidual = 0;
|
||||
@ -1294,27 +1261,16 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
const phaseModel& phase = fi.phase();
|
||||
const volScalarField& alpha = phase;
|
||||
const dimensionedScalar& residualAlpha = phase.residualAlpha();
|
||||
const volScalarField& rho = phase.thermo().rho();
|
||||
|
||||
fvScalarMatrix sizeGroupEqn
|
||||
(
|
||||
fvm::ddt(alpha, rho, fi)
|
||||
+ fi.VelocityGroup().mvConvection()->fvmDiv
|
||||
(
|
||||
phase.alphaRhoPhi(),
|
||||
fi
|
||||
)
|
||||
+ fvm::SuSp
|
||||
(
|
||||
fi.VelocityGroup().dmdt()
|
||||
- (fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi())),
|
||||
fi
|
||||
)
|
||||
==
|
||||
fvc::Su(Su_[i]*rho, fi)
|
||||
- fvm::SuSp(SuSp_[i]*rho, fi)
|
||||
+ fvc::ddt(residualAlpha*rho, fi)
|
||||
- fvm::ddt(residualAlpha*rho, fi)
|
||||
fvm::ddt(alpha, fi)
|
||||
+ fvm::div(phase.alphaPhi(), fi)
|
||||
==
|
||||
Su_[i]
|
||||
- fvm::SuSp(SuSp_[i], fi)
|
||||
+ fvc::ddt(residualAlpha, fi)
|
||||
- fvm::ddt(residualAlpha, fi)
|
||||
);
|
||||
|
||||
sizeGroupEqn.relax();
|
||||
@ -1327,26 +1283,6 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
}
|
||||
}
|
||||
|
||||
if (nCorr > 0)
|
||||
{
|
||||
forAll(sizeGroups_, i)
|
||||
{
|
||||
sizeGroups_[i].correct();
|
||||
}
|
||||
|
||||
forAll(velocityGroups_, i)
|
||||
{
|
||||
velocityGroups_[i].postSolve();
|
||||
}
|
||||
}
|
||||
|
||||
if (velocityGroups_.size() > 1)
|
||||
{
|
||||
calcAlphas();
|
||||
dsm_() = calcDsm();
|
||||
calcVelocity();
|
||||
}
|
||||
|
||||
volScalarField fAlpha0
|
||||
(
|
||||
sizeGroups_.first()*sizeGroups_.first().phase()
|
||||
@ -1364,4 +1300,16 @@ void Foam::diameterModels::populationBalanceModel::solve()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::diameterModels::populationBalanceModel::correct()
|
||||
{
|
||||
if (velocityGroups_.size() > 1)
|
||||
{
|
||||
calcAlphas();
|
||||
dsm_() = calcDsm();
|
||||
calcVelocity();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -296,7 +296,7 @@ private:
|
||||
|
||||
void createPhasePairs();
|
||||
|
||||
void correct();
|
||||
void precompute();
|
||||
|
||||
void birthByCoalescence(const label j, const label k);
|
||||
|
||||
@ -455,6 +455,9 @@ public:
|
||||
|
||||
//- Solve the population balance equation
|
||||
void solve();
|
||||
|
||||
//- Correct derived quantities
|
||||
void correct();
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
The cases contained in this directory can be used for testing the
|
||||
populationBalanceModel class which is a part of the multiphaseEulerFoam framework.
|
||||
They represent single-cell setups, i.e. they solve the population balance
|
||||
equation without spatial transport. The cases can also be used to study the
|
||||
influence of certain parameters on the form of the size distribution, before
|
||||
running a simulation with spatial transport.
|
||||
@ -29,14 +29,9 @@ divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*)" Gauss vanLeer;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -29,14 +29,9 @@ divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*)" Gauss vanLeer;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -29,14 +29,9 @@ divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*)" Gauss vanLeer;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -29,14 +29,9 @@ divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*)" Gauss vanLeer;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -29,14 +29,9 @@ divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*)" Gauss vanLeer;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -29,14 +29,9 @@ divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*,alpha.*)" Gauss vanLeer;
|
||||
"div\(phir,alpha.*)" Gauss vanLeer;
|
||||
|
||||
"div\(phi,alpha.*)" Gauss vanLeer;
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -37,7 +37,8 @@ divSchemes
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(h|e|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,p\)" Gauss limitedLinear 1;
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ divSchemes
|
||||
|
||||
"div\(alphaRhoPhi.*,Yi\)" Gauss linearUpwind limited;
|
||||
"div\(alphaRhoPhi.*,(h|e).*\)" Gauss linearUpwind limited;
|
||||
"div\(alphaRhoPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(alphaRhoPhi.*,K.*\)" Gauss linearUpwind limited;
|
||||
"div\(alphaPhi.*,p\)" Gauss linearUpwind limited;
|
||||
"div\(phi.*,kappai.*\)" Gauss linearUpwind limited;
|
||||
|
||||
@ -38,7 +38,7 @@ divSchemes
|
||||
|
||||
"div\(alphaRhoPhi.*,Yi\)" Gauss linearUpwind limited;
|
||||
"div\(alphaRhoPhi.*,(h|e).*\)" Gauss linearUpwind limited;
|
||||
"div\(alphaRhoPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(alphaRhoPhi.*,K.*\)" Gauss linearUpwind limited;
|
||||
"div\(alphaPhi.*,p\)" Gauss linearUpwind limited;
|
||||
"div\(phi.*,kappai.*\)" Gauss linearUpwind limited;
|
||||
|
||||
@ -36,9 +36,10 @@ divSchemes
|
||||
"div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,(h|e|f).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,p\)" Gauss limitedLinear 1;
|
||||
"div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,p\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ divSchemes
|
||||
"div\(alphaRhoPhi.*,Y.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,p\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(fAlphaRhoPhi.*,kappa.*\)" Gauss linearUpwind limited;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(fAlphaPhi.*,kappa.*\)" Gauss linearUpwind limited;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ divSchemes
|
||||
"div\(alphaRhoPhi.*,Y.*\)" Gauss limitedLinear 1;
|
||||
"div\(alphaPhi.*,p\)" Gauss limitedLinear 1;
|
||||
|
||||
"div\(alphaRhoPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(fAlphaRhoPhi.*,kappa.*\)" Gauss linearUpwind limited;
|
||||
"div\(alphaPhi.*,f.*\)" Gauss upwind;
|
||||
"div\(fAlphaPhi.*,kappa.*\)" Gauss linearUpwind limited;
|
||||
|
||||
"div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user