reactingEulerFoam/phaseSystems/populationBalanceModel: Rationalization of function names and documentation

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum
This commit is contained in:
Henry Weller
2018-03-29 17:40:45 +01:00
parent ec9ca0229b
commit 262ed2cd33
33 changed files with 172 additions and 104 deletions

View File

@ -25,7 +25,7 @@ Class
Foam::functionObjects::sizeDistribution
Group
grpreactingEulerFoamFunctionObjects
grpFieldFunctionObjects
Description
This function object calculates and outputs information about the size

View File

@ -72,13 +72,27 @@ Foam::diameterModels::binaryBreakupModel::binaryBreakupModel
const dictionary& dict
)
:
popBal_(popBal),
C_("C", dimless, dict.lookupOrDefault("C", 1.0))
popBal_(popBal)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::phaseCompressibleTurbulenceModel&
Foam::diameterModels::binaryBreakupModel::continuousTurbulence() const
{
return
popBal_.mesh().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
popBal_.continuousPhase().name()
)
);
}
void Foam::diameterModels::binaryBreakupModel::correct()
{}

View File

@ -38,6 +38,7 @@ SourceFiles
#define binaryBreakupModel_H
#include "populationBalanceModel.H"
#include "phaseCompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,12 +57,9 @@ protected:
// Protected data
//- Reference to the populationBalance
//- Reference to the populationBalanceModel
const populationBalanceModel& popBal_;
//- Optional coefficient
const dimensionedScalar C_;
public:
@ -138,17 +136,14 @@ public:
// Member Functions
//- Return reference to the populationBalance
const populationBalanceModel& popBal() const
{
return popBal_;
}
//- Return a reference to the turbulence model for the continuous phase
const phaseCompressibleTurbulenceModel& continuousTurbulence() const;
//- Correct diameter independent expressions
virtual void correct();
//- Add to binary breakupRate
virtual void binaryBreakupRate
virtual void addToBinaryBreakupRate
(
volScalarField& binaryBreakupRate,
const label i,

View File

@ -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
@ -62,8 +62,9 @@ powerLawUniformBinary
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::binaryBreakupModels::powerLawUniformBinary::
binaryBreakupRate
void
Foam::diameterModels::binaryBreakupModels::powerLawUniformBinary::
addToBinaryBreakupRate
(
volScalarField& binaryBreakupRate,
const label i,
@ -73,9 +74,7 @@ binaryBreakupRate
const sizeGroup& fj = *popBal_.sizeGroups()[j];
binaryBreakupRate.primitiveFieldRef() +=
C_.value()
*pow(fj.x().value(), power_)
*2.0/fj.x().value();
pow(fj.x().value(), power_)*2.0/fj.x().value();
}

View File

@ -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
@ -84,7 +84,7 @@ public:
// Member Functions
//- Add to binary breakupRate
virtual void binaryBreakupRate
virtual void addToBinaryBreakupRate
(
volScalarField& binaryBreakupRate,
const label i,

View File

@ -73,8 +73,7 @@ Foam::diameterModels::breakupModel::breakupModel
)
:
popBal_(popBal),
dict_(dict),
C_("C", dimless, dict.lookupOrDefault("C", 1.0))
dict_(dict)
{
dsd_ = daughterSizeDistributionModel::New(*this, dict);
}
@ -82,6 +81,21 @@ Foam::diameterModels::breakupModel::breakupModel
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::phaseCompressibleTurbulenceModel&
Foam::diameterModels::breakupModel::continuousTurbulence() const
{
return
popBal_.mesh().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
popBal_.continuousPhase().name()
)
);
}
void Foam::diameterModels::breakupModel::correct()
{}

View File

@ -38,6 +38,7 @@ SourceFiles
#include "populationBalanceModel.H"
#include "daughterSizeDistributionModel.H"
#include "phaseCompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,15 +57,12 @@ protected:
// Protected data
//- Reference to the populationBalance
//- Reference to the populationBalanceModel
const populationBalanceModel& popBal_;
//- Dictionary
dictionary dict_;
//- Optional coefficient
const dimensionedScalar C_;
//- Daughter size distribution model
autoPtr<daughterSizeDistributionModel> dsd_;
@ -144,12 +142,15 @@ public:
// Member Functions
//- Return reference to the populationBalance
//- Return reference to the populationBalanceModel
const populationBalanceModel& popBal() const
{
return popBal_;
}
//- Return a reference to the turbulence model for the continuous phase
const phaseCompressibleTurbulenceModel& continuousTurbulence() const;
//- Return const-reference to daughter size distribution pointer
const autoPtr<daughterSizeDistributionModel>& dsdPtr() const
{
@ -165,8 +166,8 @@ public:
//- Correct diameter independent expressions
virtual void correct();
//- Add to breakupRate
virtual void breakupRate
//- Set total breakupRate
virtual void setBreakupRate
(
volScalarField& breakupRate,
const label i

View File

@ -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
@ -50,13 +50,14 @@ Foam::diameterModels::breakupModels::exponential::exponential
)
:
breakupModel(popBal, dict),
exponent_(readScalar(dict.lookup("exponent")))
exponent_(readScalar(dict.lookup("exponent"))),
C_(readScalar(dict.lookup("C")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::breakupModels::exponential::breakupRate
void Foam::diameterModels::breakupModels::exponential::setBreakupRate
(
volScalarField& breakupRate,
const label i
@ -64,7 +65,8 @@ void Foam::diameterModels::breakupModels::exponential::breakupRate
{
const sizeGroup& fi = *popBal_.sizeGroups()[i];
breakupRate.primitiveFieldRef() = C_.value()*exp(exponent_*fi.x().value());
breakupRate.primitiveFieldRef() =
C_*exp(exponent_*fi.x().value());
}

View File

@ -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
@ -57,9 +57,12 @@ class exponential
{
// Private data
//- Power
//- Exponent
scalar exponent_;
//- Coefficient
scalar C_;
public:
@ -82,8 +85,8 @@ public:
// Member Functions
//- Add to total breakupRate
virtual void breakupRate
//- Set total breakupRate
virtual void setBreakupRate
(
volScalarField& breakupRate,
const label i

View File

@ -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
@ -56,7 +56,7 @@ Foam::diameterModels::breakupModels::powerLaw::powerLaw
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::breakupModels::powerLaw::breakupRate
void Foam::diameterModels::breakupModels::powerLaw::setBreakupRate
(
volScalarField& breakupRate,
const label i
@ -64,7 +64,7 @@ void Foam::diameterModels::breakupModels::powerLaw::breakupRate
{
const sizeGroup& fi = *popBal_.sizeGroups()[i];
breakupRate.primitiveFieldRef() = C_.value()*pow(fi.x().value(), power_);
breakupRate.primitiveFieldRef() = pow(fi.x().value(), power_);
}

View File

@ -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
@ -82,8 +82,8 @@ public:
// Member Functions
//- Add to total breakupRate
virtual void breakupRate
//- Set total breakupRate
virtual void setBreakupRate
(
volScalarField& breakupRate,
const label i

View File

@ -38,6 +38,25 @@ namespace diameterModels
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
const Foam::tmp<Foam::volScalarField>
Foam::diameterModels::coalescenceModel::sigma
(
const word& phase1,
const word& phase2
) const
{
const phasePairKey key
(
phase1,
phase2
);
return popBal_.fluid().sigma(key);
}
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::diameterModels::coalescenceModel>
@ -73,13 +92,27 @@ Foam::diameterModels::coalescenceModel::coalescenceModel
const dictionary& dict
)
:
popBal_(popBal),
C_("C", dimless, dict.lookupOrDefault("C", 1.0))
popBal_(popBal)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::phaseCompressibleTurbulenceModel&
Foam::diameterModels::coalescenceModel::continuousTurbulence() const
{
return
popBal_.mesh().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
popBal_.continuousPhase().name()
)
);
}
void Foam::diameterModels::coalescenceModel::correct()
{}

View File

@ -36,6 +36,7 @@ SourceFiles
#define coalescenceModel_H
#include "populationBalanceModel.H"
#include "phaseCompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,11 +55,18 @@ protected:
// Protected data
//- Reference to the populationBalance
//- Reference to the populationBalanceModel
const populationBalanceModel& popBal_;
//- Optional coefficient
const dimensionedScalar C_;
// Protected member functions
//- Return the surface tension coefficient
const tmp<volScalarField> sigma
(
const word& phase1,
const word& phase2
) const;
public:
@ -136,17 +144,14 @@ public:
// Member Functions
//- Return reference to the populationBalance
const populationBalanceModel& popBal() const
{
return popBal_;
}
//- Return a reference to the turbulence model for the continuous phase
const phaseCompressibleTurbulenceModel& continuousTurbulence() const;
//- Correct diameter independent expressions
virtual void correct();
//- Add to coalescenceRate
virtual void coalescenceRate
virtual void addToCoalescenceRate
(
volScalarField& coalescenceRate,
const label i,

View File

@ -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
@ -62,15 +62,16 @@ constantCoalescence
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::coalescenceModels::constantCoalescence::
coalescenceRate
void
Foam::diameterModels::coalescenceModels::constantCoalescence::
addToCoalescenceRate
(
volScalarField& coalescenceRate,
const label i,
const label j
)
{
coalescenceRate += C_.value()*rate_;
coalescenceRate += rate_;
}

View File

@ -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
@ -48,7 +48,7 @@ namespace coalescenceModels
{
/*---------------------------------------------------------------------------*\
Class constantCoalescence Declaration
Class constantCoalescence Declaration
\*---------------------------------------------------------------------------*/
class constantCoalescence
@ -83,7 +83,7 @@ public:
// Member Functions
//- Add to coalescenceRate
virtual void coalescenceRate
virtual void addToCoalescenceRate
(
volScalarField& coalescenceRate,
const label i,

View File

@ -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
@ -55,7 +55,7 @@ Foam::diameterModels::coalescenceModels::hydrodynamic::hydrodynamic
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::coalescenceModels::hydrodynamic::coalescenceRate
void Foam::diameterModels::coalescenceModels::hydrodynamic::addToCoalescenceRate
(
volScalarField& coalescenceRate,
const label i,
@ -66,7 +66,7 @@ void Foam::diameterModels::coalescenceModels::hydrodynamic::coalescenceRate
const sizeGroup& fj = *popBal_.sizeGroups()[j];
coalescenceRate.primitiveFieldRef() +=
C_.value()*pow3((fi.d().value() + fj.d().value()));
pow3((fi.d().value() + fj.d().value()));
}

View File

@ -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
@ -77,7 +77,7 @@ public:
// Member Functions
//- Add to coalescenceRate
virtual void coalescenceRate
virtual void addToCoalescenceRate
(
volScalarField& coalescenceRate,
const label i,

View File

@ -80,15 +80,17 @@ void Foam::diameterModels::driftModels::constantDrift::correct()
}
void Foam::diameterModels::driftModels::constantDrift::driftRate
void Foam::diameterModels::driftModels::constantDrift::addToDriftRate
(
volScalarField& driftRate,
const label i
)
{
const sizeGroup& fi = *popBal_.sizeGroups()[i];
phaseModel& phase = const_cast<phaseModel&>(fi.phase());
volScalarField& rho = phase.thermoRef().rho();
driftRate -= fi.phase().continuityErrorSources()/(N_*fi.phase().rho());
driftRate += (popBal_.fluid().fvOptions()(phase, rho)&rho)/(N_*rho);
}

View File

@ -88,7 +88,7 @@ public:
virtual void correct();
//- Add to driftRate
virtual void driftRate
virtual void addToDriftRate
(
volScalarField& driftRate,
const label i

View File

@ -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
@ -59,7 +59,7 @@ Foam::diameterModels::driftModels::densityChangeDrift::densityChangeDrift
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::driftModels::densityChangeDrift::driftRate
void Foam::diameterModels::driftModels::densityChangeDrift::addToDriftRate
(
volScalarField& driftRate,
const label i

View File

@ -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
@ -76,7 +76,7 @@ public:
// Member Functions
//- Add to driftRate
virtual void driftRate
virtual void addToDriftRate
(
volScalarField& driftRate,
const label i

View File

@ -133,7 +133,7 @@ public:
// Member Functions
//- Return reference to the populationBalance
//- Return reference to the populationBalanceModel
const populationBalanceModel& popBal() const
{
return popBal_;
@ -143,7 +143,7 @@ public:
virtual void correct();
//- Add to driftRate
virtual void driftRate
virtual void addToDriftRate
(
volScalarField& driftRate,
const label i

View File

@ -108,7 +108,7 @@ void Foam::diameterModels::driftModels::phaseChange::correct()
}
void Foam::diameterModels::driftModels::phaseChange::driftRate
void Foam::diameterModels::driftModels::phaseChange::addToDriftRate
(
volScalarField& driftRate,
const label i

View File

@ -91,7 +91,7 @@ public:
virtual void correct();
//- Add to driftRate
virtual void driftRate
virtual void addToDriftRate
(
volScalarField& driftRate,
const label i

View File

@ -97,18 +97,20 @@ void Foam::diameterModels::nucleationModels::constantNucleation::correct()
}
void Foam::diameterModels::nucleationModels::constantNucleation::
nucleationRate
void
Foam::diameterModels::nucleationModels::constantNucleation::addToNucleationRate
(
volScalarField& nucleationRate,
const label i
)
{
const sizeGroup& fi = *popBal_.sizeGroups()[i];
phaseModel& phase = const_cast<phaseModel&>(fi.phase());
volScalarField& rho = phase.thermoRef().rho();
nucleationRate -=
nucleationRate +=
popBal_.gamma(i, velGroup_.formFactor()*pow3(d_))
*fi.phase().continuityErrorSources()/fi.phase().rho()/fi.x();
*(popBal_.fluid().fvOptions()(phase, rho)&rho)/rho/fi.x();
}

View File

@ -90,7 +90,7 @@ public:
virtual void correct();
//- Add to nucleationRate
virtual void nucleationRate
virtual void addToNucleationRate
(
volScalarField& nucleationRate,
const label i

View File

@ -54,9 +54,9 @@ Foam::diameterModels::nucleationModel::New
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown zeroeth order model type "
<< "Unknown nucleation model type "
<< type << nl << nl
<< "Valid zeroeth order model types : " << endl
<< "Valid nucleation model types : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -133,7 +133,7 @@ public:
// Member Functions
//- Return reference to the populationBalance
//- Return reference to the populationBalanceModel
const populationBalanceModel& popBal() const
{
return popBal_;
@ -143,7 +143,7 @@ public:
virtual void correct();
//- Add to nucleationRate
virtual void nucleationRate
virtual void addToNucleationRate
(
volScalarField& nucleationRate,
const label i

View File

@ -143,8 +143,8 @@ void Foam::diameterModels::nucleationModels::wallBoiling::correct()
}
void Foam::diameterModels::nucleationModels::wallBoiling::
nucleationRate
void
Foam::diameterModels::nucleationModels::wallBoiling::addToNucleationRate
(
volScalarField& nucleationRate,
const label i

View File

@ -94,7 +94,7 @@ public:
virtual void correct();
//- Add to nucleationRate
virtual void nucleationRate
virtual void addToNucleationRate
(
volScalarField& nucleationRate,
const label i

View File

@ -692,7 +692,7 @@ void Foam::diameterModels::populationBalanceModel::sources()
forAll(coalescence_, model)
{
coalescence_[model].coalescenceRate
coalescence_[model].addToCoalescenceRate
(
coalescenceRate_(),
i,
@ -710,7 +710,7 @@ void Foam::diameterModels::populationBalanceModel::sources()
{
forAll(breakup_, model)
{
breakup_[model].breakupRate(breakupRate_(), i);
breakup_[model].setBreakupRate(breakupRate_(), i);
birthByBreakup(i, model);
@ -728,7 +728,7 @@ void Foam::diameterModels::populationBalanceModel::sources()
forAll(binaryBreakup_, model)
{
binaryBreakup_[model].binaryBreakupRate
binaryBreakup_[model].addToBinaryBreakupRate
(
binaryBreakupRate_(),
j,
@ -750,7 +750,7 @@ void Foam::diameterModels::populationBalanceModel::sources()
forAll(drift_, model)
{
drift_[model].driftRate(driftRate_(), i);
drift_[model].addToDriftRate(driftRate_(), i);
}
drift(i);
@ -762,7 +762,7 @@ void Foam::diameterModels::populationBalanceModel::sources()
forAll(nucleation_, model)
{
nucleation_[model].nucleationRate(nucleationRate_(), i);
nucleation_[model].addToNucleationRate(nucleationRate_(), i);
}
nucleation(i);

View File

@ -62,9 +62,9 @@ Description
\verbatim
Binary breakup term formulation:
Liao, Y.; Oertel, R.; Kriebitzsch, S.; Schlegel, F.; Lucas, D.
(2017). A Discrete Population Balance Equation for Binary Breakage.
International Journal for Numerical Methods in Fluids, Accepted for
publication.
(2018). A Discrete Population Balance Equation for Binary Breakage.
International Journal for Numerical Methods in Fluids,
DOI 10.1002/fld.4491.
\endverbatim
Usage

View File

@ -81,10 +81,7 @@ populationBalanceCoeffs
coalescenceModels
(
hydrodynamic
{
C 0.25;
}
CoulaloglouTavlarides{}
);
binaryBreakupModels
@ -94,8 +91,8 @@ populationBalanceCoeffs
(
exponential
{
C 0.5;
exponent 0.01;
C 10.0;
exponent 1.0;
daughterSizeDistributionModel uniformBinary;
}
);