Skip to content

Commit

Permalink
reactingEulerFoam: Improved Sauter mean diameter calculation
Browse files Browse the repository at this point in the history
The Sauter mean diameter calculation has been modified to be more stable
in the limit of vanishing phase fraction. The calculation of the overall
Sauter mean diameter for a populationBalance involving more than one
velocityGroup has been removed. This calculation depends upon the phase
fraction and it is not stable as the fractions tend to zero. The overall
Sauter mean diameter is only used for post-processing and can still be
recovered from the individual diameter fields of the involved
velocityGroups.

Some parts of the population balance modeling have also been renamed and
refactored.

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum
Dresden - Rossendorf (HZDR)
  • Loading branch information
Will Bainbridge committed Apr 23, 2018
1 parent af88b75 commit ee6216b
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 377 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ populationBalanceModel/breakupModels/exponential/exponential.C
populationBalanceModel/breakupModels/powerLaw/powerLaw.C

populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C
populationBalanceModel/daughterSizeDistributionModels/uniformBinaryDsd/uniformBinaryDsd.C
populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.C

populationBalanceModel/driftModels/driftModel/driftModel.C
populationBalanceModel/driftModels/constantDrift/constantDrift.C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,74 +49,33 @@ namespace diameterModels

// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

Foam::tmp<Foam::volScalarField>
Foam::diameterModels::velocityGroup::secondMoment() const
{
tmp<volScalarField> tm2
(
new volScalarField
(
IOobject
(
"m2",
phase_.time().timeName(),
phase_.mesh()
),
phase_.mesh(),
dimensionedScalar("m2", inv(dimLength), Zero)
)
);

volScalarField& m2 = tm2.ref();

forAll(sizeGroups_, i)
{
const sizeGroup& fi = sizeGroups_[i];

m2 += sqr(fi.d())*formFactor()*fi
*max(fi.phase(), small)/fi.x();
}

return tm2;
}


Foam::tmp<Foam::volScalarField>
Foam::diameterModels::velocityGroup::thirdMoment() const
Foam::tmp<Foam::volScalarField> Foam::diameterModels::velocityGroup::dsm() const
{
tmp<volScalarField> tm3
tmp<volScalarField> tInvDsm
(
new volScalarField
(
IOobject
(
"m3",
"invDsm",
phase_.time().timeName(),
phase_.mesh()
),
phase_.mesh(),
dimensionedScalar("m3", dimless, Zero)
dimensionedScalar("invDsm", inv(dimLength), Zero)
)
);

volScalarField& m3 = tm3.ref();
volScalarField& invDsm = tInvDsm.ref();

forAll(sizeGroups_, i)
{
const sizeGroup& fi = sizeGroups_[i];

m3 += pow3(fi.d())*formFactor()*fi
*max(fi.phase(), small)/fi.x();
invDsm += fi/fi.d();
}

return tm3;
}


Foam::tmp<Foam::volScalarField> Foam::diameterModels::velocityGroup::dsm() const
{
return
max(min(phase_/m2_, sizeGroups_.last().d()), sizeGroups_.first().d());
return 1.0/tInvDsm;
}


Expand Down Expand Up @@ -243,44 +202,6 @@ Foam::diameterModels::velocityGroup::velocityGroup
),
fSum()
),
m2_
(
IOobject
(
IOobject::groupName
(
"m2",
IOobject::groupName
(
phase.name(),
popBalName_
)
),
phase.time().timeName(),
phase.mesh()
),
phase.mesh(),
dimensionedScalar("m2", inv(dimLength), Zero)
),
m3_
(
IOobject
(
IOobject::groupName
(
"m3",
IOobject::groupName
(
phase.name(),
popBalName_
)
),
phase.time().timeName(),
phase.mesh()
),
phase.mesh(),
dimensionedScalar("m3", dimless, Zero)
),
d_
(
IOobject
Expand Down Expand Up @@ -354,10 +275,6 @@ Foam::diameterModels::velocityGroup::velocityGroup
fields_.add(sizeGroups_[i]);
}

m2_ = secondMoment();

m3_ = thirdMoment();

d_ = dsm();
}

Expand All @@ -379,10 +296,6 @@ void Foam::diameterModels::velocityGroup::preSolve()

void Foam::diameterModels::velocityGroup::postSolve()
{
m2_ = secondMoment();

m3_ = thirdMoment();

d_ = dsm();

Info<< this->phase().name() << " Sauter mean diameter, min, max = "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ class velocityGroup
//- Sum of sizeGroup volume fractions
volScalarField fSum_;

//- Second moment of the distribution
volScalarField m2_;

//- Third moment of the distribution
volScalarField m3_;

//- Number-based Sauter-mean diameter of the phase
volScalarField d_;

Expand All @@ -133,10 +127,6 @@ class velocityGroup

// Private member functions

tmp<volScalarField> secondMoment() const;

tmp<volScalarField> thirdMoment() const;

tmp<volScalarField> dsm() const;

tmp<volScalarField> fSum() const;
Expand Down Expand Up @@ -180,12 +170,6 @@ public:
//- Return sizeGroups belonging to this velocityGroup
inline const PtrList<sizeGroup>& sizeGroups() const;

//- Return second moment of the distribution
inline const volScalarField& m2() const;

//- Return third moment of the distribution
inline const volScalarField& m3() const;

//- Return const-reference to multivariate convectionScheme
inline const tmp<fv::convectionScheme<scalar>>& mvConvection() const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -53,20 +53,6 @@ Foam::diameterModels::velocityGroup::sizeGroups() const
}


inline const Foam::volScalarField&
Foam::diameterModels::velocityGroup::m2() const
{
return m2_;
}


inline const Foam::volScalarField&
Foam::diameterModels::velocityGroup::m3() const
{
return m3_;
}


inline const Foam::tmp<Foam::fv::convectionScheme<Foam::scalar>>&
Foam::diameterModels::velocityGroup::mvConvection() const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Description
\vartable
\sigma | Surface tension [N/m]
v_i | Volume of bubble i [m3]
v_j | Volume of bubble j [m3]
v_i | Volume of droplet i [m3]
v_j | Volume of droplet j [m3]
\epsilon_c | Turbulent dissipation rate of continuous phase [m2/s3]
\alpha_d | Total void fraction of disperse phase [-]
\mu_c | Molecular dynamic viscosity of liquid phase [Pa s]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -114,7 +114,7 @@ void Foam::diameterModels::daughterSizeDistributionModel::correct()

for (label i = 0; i <= k; i++)
{
nik_[k].append(new dimensionedScalar (this->n(i, k)));
nik_[k].append(new dimensionedScalar (this->calcNik(i, k)));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -118,7 +118,11 @@ public:

//- Calculate and return total number of particles assigned to class i
// when a particle of class k breaks
virtual dimensionedScalar n(const label i, const label k) const = 0;
virtual dimensionedScalar calcNik
(
const label i,
const label k
) const = 0;
};


Expand Down
Loading

0 comments on commit ee6216b

Please sign in to comment.