Commit 64f230ae authored by andy's avatar andy
Browse files

ENH: Changed order of parcel property initialisation

parent 062846d7
......@@ -502,14 +502,10 @@ template<class CloudType>
void Foam::KinematicCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
if (!fullyDescribed)
{
parcel.rho() = constProps_.rho0();
}
parcel.rho() = constProps_.rho0();
}
......
......@@ -490,8 +490,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -225,20 +225,29 @@ Foam::ReactingCloud<CloudType>::~ReactingCloud()
template<class CloudType>
void Foam::ReactingCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
parcel.pc() = this->thermo().thermo().p()[parcel.cell()];
parcel.Y() = composition().YMixture0();
}
template<class CloudType>
void Foam::ReactingCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
if (!fullyDescribed)
{
parcel.pc() = this->thermo().thermo().p()[parcel.cell()];
parcel.Y() = composition().YMixture0();
}
else
if (fullyDescribed)
{
checkSuppliedComposition
(
......@@ -253,18 +262,6 @@ void Foam::ReactingCloud<CloudType>::setParcelThermoProperties
}
template<class CloudType>
void Foam::ReactingCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
}
template<class CloudType>
void Foam::ReactingCloud<CloudType>::storeState()
{
......
......@@ -271,8 +271,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -158,24 +158,37 @@ template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
label idGas = this->composition().idGas();
label idLiquid = this->composition().idLiquid();
label idSolid = this->composition().idSolid();
if (!fullyDescribed)
{
parcel.YGas() = this->composition().Y0(idGas);
parcel.YLiquid() = this->composition().Y0(idLiquid);
parcel.YSolid() = this->composition().Y0(idSolid);
}
else
parcel.YGas() = this->composition().Y0(idGas);
parcel.YLiquid() = this->composition().Y0(idLiquid);
parcel.YSolid() = this->composition().Y0(idSolid);
}
template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
if (fullyDescribed)
{
label idGas = this->composition().idGas();
label idLiquid = this->composition().idLiquid();
label idSolid = this->composition().idSolid();
this->checkSuppliedComposition
(
parcel.YGas(),
......@@ -198,18 +211,6 @@ void Foam::ReactingMultiphaseCloud<CloudType>::setParcelThermoProperties
}
template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
}
template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::storeState()
{
......
......@@ -244,8 +244,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -237,17 +237,13 @@ template<class CloudType>
void Foam::ThermoCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
if (!fullyDescribed)
{
parcel.T() = constProps_.T0();
parcel.Cp() = constProps_.Cp0();
}
parcel.T() = constProps_.T0();
parcel.Cp() = constProps_.Cp0();
}
......
......@@ -285,8 +285,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -593,7 +593,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
);
// Check/set new parcel thermo properties
cloud.setParcelThermoProperties(*pPtr, dt, fullyDescribed());
cloud.setParcelThermoProperties(*pPtr, dt);
// Assign new parcel properties in injection model
setProperties(parcelI, newParcels, timeInj, *pPtr);
......@@ -702,7 +702,7 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
);
// Check/set new parcel thermo properties
cloud.setParcelThermoProperties(*pPtr, 0.0, fullyDescribed());
cloud.setParcelThermoProperties(*pPtr, 0.0);
// Assign new parcel properties in injection model
setProperties(parcelI, newParcels, 0.0, *pPtr);
......
......@@ -161,23 +161,19 @@ template<class CloudType>
void Foam::SprayCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
if (!fullyDescribed)
{
const liquidMixtureProperties& liqMix = this->composition().liquids();
const liquidMixtureProperties& liqMix = this->composition().liquids();
const scalarField& Y(parcel.Y());
scalarField X(liqMix.X(Y));
const scalarField& Y(parcel.Y());
scalarField X(liqMix.X(Y));
// override rho and Cp from constantProperties
parcel.Cp() = liqMix.Cp(parcel.pc(), parcel.T(), X);
parcel.rho() = liqMix.rho(parcel.pc(), parcel.T(), X);
}
// override rho and Cp from constantProperties
parcel.Cp() = liqMix.Cp(parcel.pc(), parcel.T(), X);
parcel.rho() = liqMix.rho(parcel.pc(), parcel.T(), X);
}
......
......@@ -213,8 +213,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment