passing by reference instead of pointer

This commit is contained in:
andy
2009-06-15 17:44:47 +01:00
parent 7d73dd3171
commit 040c1d727c
9 changed files with 25 additions and 25 deletions

View File

@ -151,18 +151,18 @@ Foam::KinematicCloud<ParcelType>::~KinematicCloud()
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
if (!fullyDescribed)
{
pPtr->rho() = constProps_.rho0();
parcel.rho() = constProps_.rho0();
}
scalar carrierDt = this->db().time().deltaT().value();
pPtr->stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
}

View File

@ -357,7 +357,7 @@ public:
//- Check parcel properties
void checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
);

View File

@ -148,34 +148,34 @@ Foam::ReactingCloud<ParcelType>::~ReactingCloud()
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
ThermoCloud<ParcelType>::checkParcelProperties
(
pPtr,
parcel,
lagrangianDt,
fullyDescribed
);
if (!fullyDescribed)
{
pPtr->Y() = composition().YMixture0();
parcel.Y() = composition().YMixture0();
}
else
{
checkSuppliedComposition
(
pPtr->Y(),
parcel.Y(),
composition().YMixture0(),
"YMixture"
);
}
// derived information - store initial mass
pPtr->mass0() = pPtr->mass();
parcel.mass0() = parcel.mass();
}

View File

@ -224,7 +224,7 @@ public:
//- Check parcel properties
void checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
);

View File

@ -76,14 +76,14 @@ Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud()
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
ReactingCloud<ParcelType>::checkParcelProperties
(
pPtr,
parcel,
lagrangianDt,
fullyDescribed
);
@ -94,27 +94,27 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
if (!fullyDescribed)
{
pPtr->YGas() = this->composition().Y0(idGas);
pPtr->YLiquid() = this->composition().Y0(idLiquid);
pPtr->YSolid() = this->composition().Y0(idSolid);
parcel.YGas() = this->composition().Y0(idGas);
parcel.YLiquid() = this->composition().Y0(idLiquid);
parcel.YSolid() = this->composition().Y0(idSolid);
}
else
{
this->checkSuppliedComposition
(
pPtr->YGas(),
parcel.YGas(),
this->composition().Y0(idGas),
"YGas"
);
this->checkSuppliedComposition
(
pPtr->YLiquid(),
parcel.YLiquid(),
this->composition().Y0(idLiquid),
"YLiquid"
);
this->checkSuppliedComposition
(
pPtr->YSolid(),
parcel.YSolid(),
this->composition().Y0(idSolid),
"YSolid"
);

View File

@ -178,7 +178,7 @@ public:
//- Check parcel properties
void checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
);

View File

@ -113,22 +113,22 @@ Foam::ThermoCloud<ParcelType>::~ThermoCloud()
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
KinematicCloud<ParcelType>::checkParcelProperties
(
pPtr,
parcel,
lagrangianDt,
fullyDescribed
);
if (!fullyDescribed)
{
pPtr->T() = constProps_.T0();
pPtr->cp() = constProps_.cp0();
parcel.T() = constProps_.T0();
parcel.cp() = constProps_.cp0();
}
}

View File

@ -220,7 +220,7 @@ public:
//- Check parcel properties
void checkParcelProperties
(
ParcelType* pPtr,
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
);

View File

@ -401,7 +401,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
setProperties(parcelI, newParcels, timeInj, *pPtr);
// Check new parcel properties
td.cloud().checkParcelProperties(pPtr, dt, fullyDescribed());
td.cloud().checkParcelProperties(*pPtr, dt, fullyDescribed());
// Apply correction to velocity for 2-D cases
meshTools::constrainDirection