mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Changed order of parcel property initialisation
This commit is contained in:
@ -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
|
||||
|
||||
@ -227,29 +227,13 @@ template<class CloudType>
|
||||
void Foam::ReactingCloud<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.pc() = this->thermo().thermo().p()[parcel.cell()];
|
||||
parcel.Y() = composition().YMixture0();
|
||||
}
|
||||
else
|
||||
{
|
||||
checkSuppliedComposition
|
||||
(
|
||||
parcel.Y(),
|
||||
composition().YMixture0(),
|
||||
"YMixture"
|
||||
);
|
||||
}
|
||||
|
||||
// derived information - store initial mass
|
||||
parcel.mass0() = parcel.mass();
|
||||
parcel.pc() = this->thermo().thermo().p()[parcel.cell()];
|
||||
parcel.Y() = composition().YMixture0();
|
||||
}
|
||||
|
||||
|
||||
@ -262,6 +246,19 @@ void Foam::ReactingCloud<CloudType>::checkParcelProperties
|
||||
)
|
||||
{
|
||||
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
if (fullyDescribed)
|
||||
{
|
||||
checkSuppliedComposition
|
||||
(
|
||||
parcel.Y(),
|
||||
composition().YMixture0(),
|
||||
"YMixture"
|
||||
);
|
||||
}
|
||||
|
||||
// derived information - store initial mass
|
||||
parcel.mass0() = parcel.mass();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user