Skip to content

Commit

Permalink
BUG: Corrected database lookup of turbulence model to address
Browse files Browse the repository at this point in the history
     problem encountered with pbeFoam and some breakup kernels.

     Corrects bug: #45
  • Loading branch information
AlbertoPa committed Oct 30, 2016
1 parent 04c9e53 commit fe7017e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
6 changes: 4 additions & 2 deletions applications/pbeFoam/createFields.H
Expand Up @@ -57,7 +57,6 @@
thermo
)
);

compressible::turbulenceModel& turbulence = pTurbulence();
turbulence.validate();

Expand All @@ -79,6 +78,9 @@
(
populationBalanceModel::New
(
"populationBalance", populationBalanceProperties, U, phi
"populationBalance",
populationBalanceProperties,
U,
phi
)
);
1 change: 0 additions & 1 deletion applications/pbeFoam/output.H
Expand Up @@ -4,4 +4,3 @@

Info<< "moment.0 = " << moment0[0] << endl;


8 changes: 6 additions & 2 deletions applications/pbeFoam/pbeFoam.C
Expand Up @@ -38,8 +38,8 @@ Description
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "OFstream.H"
#include "thermoPhysicsTypes.H"
#include "basicMultiComponentMixture.H"
//#include "thermoPhysicsTypes.H"
//#include "basicMultiComponentMixture.H"
#include "cellModeller.H"
#include "populationBalanceModel.H"

Expand All @@ -49,6 +49,10 @@ int main(int argc, char *argv[])
{
argList::noParallel();

#define CREATE_MESH createSingleCellMesh.H
#define NO_CONTROL
#include "postProcess.H"

#include "setRootCase.H"
#include "createTime.H"
#include "createSingleCellMesh.H"
Expand Down
Expand Up @@ -77,21 +77,21 @@ Foam::populationBalanceSubModels::aggregationKernels::turbulentBrownian::Ka
const volScalarField& abscissa2
) const
{
if (!abscissa1.mesh().foundObject<fluidThermo>(basicThermo::dictName))
if (!abscissa1.db().foundObject<fluidThermo>(basicThermo::dictName))
{
FatalErrorInFunction
<< "No valid thermophysical model found."
<< abort(FatalError);
}

const fluidThermo& flThermo =
abscissa1.mesh().lookupObject<fluidThermo>(basicThermo::dictName);
abscissa1.db().lookupObject<fluidThermo>(basicThermo::dictName);

typedef compressible::turbulenceModel cmpTurbModel;

if
(
!abscissa1.mesh().foundObject<cmpTurbModel>
!abscissa1.db().foundObject<cmpTurbModel>
(
cmpTurbModel::propertiesName
)
Expand All @@ -103,7 +103,7 @@ Foam::populationBalanceSubModels::aggregationKernels::turbulentBrownian::Ka
}

const compressible::turbulenceModel& flTurb =
abscissa1.mesh().lookupObject<compressible::turbulenceModel>
abscissa1.db().lookupObject<compressible::turbulenceModel>
(
turbulenceModel::propertiesName
);
Expand Down
Expand Up @@ -78,21 +78,21 @@ Foam::populationBalanceSubModels::breakupKernels::AyaziShamlou::Kb
const volScalarField& abscissa
) const
{
if (!abscissa.mesh().foundObject<fluidThermo>(basicThermo::dictName))
if (!abscissa.db().foundObject<fluidThermo>(basicThermo::dictName))
{
FatalErrorInFunction
<< "No valid thermophysical model found."
<< abort(FatalError);
}

const fluidThermo& flThermo =
abscissa.mesh().lookupObject<fluidThermo>(basicThermo::dictName);
abscissa.db().lookupObject<fluidThermo>(basicThermo::dictName);

typedef compressible::turbulenceModel cmpTurbModel;

if
(
!abscissa.mesh().foundObject<cmpTurbModel>
!abscissa.mesh().time().db().foundObject<cmpTurbModel>
(
cmpTurbModel::propertiesName
)
Expand All @@ -103,8 +103,8 @@ Foam::populationBalanceSubModels::breakupKernels::AyaziShamlou::Kb
<< abort(FatalError);
}

const compressible::turbulenceModel& flTurb =
abscissa.mesh().lookupObject<compressible::turbulenceModel>
const cmpTurbModel& flTurb =
abscissa.mesh().time().db().lookupObject<cmpTurbModel>
(
turbulenceModel::propertiesName
);
Expand All @@ -122,14 +122,14 @@ Foam::populationBalanceSubModels::breakupKernels::AyaziShamlou::Kb
volScalarField kc(15.0*pow(phiL, 1.2));

// Aggregation strength
volScalarField tauf(9.0*kc*phiL*F/(8.0*sqr(primarySize_)
volScalarField sigma(9.0*kc*phiL*F/(8.0*sqr(primarySize_)
*Foam::constant::mathematical::pi));

const volScalarField& mu = flThermo.mu();
volScalarField epsilonByNu(flTurb.epsilon()/flThermo.nu());

volScalarField epsilonByNu(flTurb.epsilon()*flThermo.rho()/mu);
volScalarField tau = flThermo.mu()*sqrt(epsilonByNu);

return sqrt(epsilonByNu/15.0)*exp(-tauf/(mu*sqrt(epsilonByNu)));
return sqrt(epsilonByNu/15.0)*exp(-sigma/tau);
}

// ************************************************************************* //
Expand Up @@ -82,7 +82,7 @@ Foam::populationBalanceSubModels::breakupKernels::LuoSvendsen::Kb

if
(
!abscissa.mesh().foundObject<cmpTurbModel>
!abscissa.mesh().time().db().foundObject<cmpTurbModel>
(
cmpTurbModel::propertiesName
)
Expand All @@ -93,10 +93,10 @@ Foam::populationBalanceSubModels::breakupKernels::LuoSvendsen::Kb
<< abort(FatalError);
}

const compressible::turbulenceModel& flTurb =
abscissa.mesh().lookupObject<compressible::turbulenceModel>
const cmpTurbModel& flTurb =
abscissa.mesh().time().db().lookupObject<cmpTurbModel>
(
turbulenceModel::propertiesName
cmpTurbModel::propertiesName
);

return Cb_*pow(flTurb.epsilon(), epsilonExp_)
Expand Down

0 comments on commit fe7017e

Please sign in to comment.