BrownianMotionForce: Updated interface to turbulence model

This commit is contained in:
Henry
2015-04-30 17:38:12 +01:00
parent 841b303a33
commit 933bf2ba8a

View File

@ -26,8 +26,7 @@ License
#include "BrownianMotionForce.H"
#include "mathematicalConstants.H"
#include "demandDrivenData.H"
#include "turbulentTransportModel.H"
#include "turbulentFluidThermoModel.H"
#include "turbulenceModel.H"
using namespace Foam::constant;
@ -57,18 +56,17 @@ Foam::tmp<Foam::volScalarField>
Foam::BrownianMotionForce<CloudType>::kModel() const
{
const objectRegistry& obr = this->owner().mesh();
const word turbName = turbulenceModel::propertiesName;
const word turbName =
IOobject::groupName
(
turbulenceModel::propertiesName,
this->owner().U().group()
);
if (obr.foundObject<compressible::turbulenceModel>(turbName))
if (obr.foundObject<turbulenceModel>(turbName))
{
const compressible::turbulenceModel& model =
obr.lookupObject<compressible::turbulenceModel>(turbName);
return model.k();
}
else if (obr.foundObject<incompressible::turbulenceModel>(turbName))
{
const incompressible::turbulenceModel& model =
obr.lookupObject<incompressible::turbulenceModel>(turbName);
const turbulenceModel& model =
obr.lookupObject<turbulenceModel>(turbName);
return model.k();
}
else
@ -76,7 +74,7 @@ Foam::BrownianMotionForce<CloudType>::kModel() const
FatalErrorIn
(
"Foam::tmp<Foam::volScalarField>"
"Foam::BrownianMotionForce<CloudType>::kModel() const"
"Foam::DispersionRASModel<CloudType>::kModel() const"
)
<< "Turbulence model not found in mesh database" << nl
<< "Database objects include: " << obr.sortedToc()