mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Split parcel initialisation into 2 parts around injection
This commit is contained in:
@ -499,7 +499,7 @@ bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicCloud<CloudType>::checkParcelProperties
|
||||
void Foam::KinematicCloud<CloudType>::setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
@ -510,7 +510,17 @@ void Foam::KinematicCloud<CloudType>::checkParcelProperties
|
||||
{
|
||||
parcel.rho() = constProps_.rho0();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicCloud<CloudType>::checkParcelProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
)
|
||||
{
|
||||
const scalar carrierDt = mesh_.time().deltaTValue();
|
||||
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
|
||||
parcel.typeId() = constProps_.parcelTypeId();
|
||||
|
||||
@ -486,6 +486,14 @@ public:
|
||||
|
||||
// Cloud evolution functions
|
||||
|
||||
//- Set parcel thermo properties
|
||||
void setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
);
|
||||
|
||||
//- Check parcel properties
|
||||
void checkParcelProperties
|
||||
(
|
||||
|
||||
@ -224,22 +224,18 @@ Foam::ReactingCloud<CloudType>::~ReactingCloud()
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingCloud<CloudType>::checkParcelProperties
|
||||
void Foam::ReactingCloud<CloudType>::setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
)
|
||||
{
|
||||
CloudType::checkParcelProperties
|
||||
(
|
||||
parcel,
|
||||
lagrangianDt,
|
||||
fullyDescribed
|
||||
);
|
||||
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
if (!fullyDescribed)
|
||||
{
|
||||
parcel.pc() = this->thermo().thermo().p()[parcel.cell()];
|
||||
parcel.Y() = composition().YMixture0();
|
||||
}
|
||||
else
|
||||
@ -257,6 +253,18 @@ void Foam::ReactingCloud<CloudType>::checkParcelProperties
|
||||
}
|
||||
|
||||
|
||||
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()
|
||||
{
|
||||
|
||||
@ -267,6 +267,14 @@ public:
|
||||
|
||||
// Cloud evolution functions
|
||||
|
||||
//- Set parcel thermo properties
|
||||
void setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
);
|
||||
|
||||
//- Check parcel properties
|
||||
void checkParcelProperties
|
||||
(
|
||||
|
||||
@ -155,19 +155,14 @@ Foam::ReactingMultiphaseCloud<CloudType>::~ReactingMultiphaseCloud()
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
|
||||
void Foam::ReactingMultiphaseCloud<CloudType>::setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
)
|
||||
{
|
||||
CloudType::checkParcelProperties
|
||||
(
|
||||
parcel,
|
||||
lagrangianDt,
|
||||
fullyDescribed
|
||||
);
|
||||
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
label idGas = this->composition().idGas();
|
||||
label idLiquid = this->composition().idLiquid();
|
||||
@ -203,6 +198,18 @@ void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
|
||||
}
|
||||
|
||||
|
||||
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()
|
||||
{
|
||||
|
||||
@ -240,6 +240,14 @@ public:
|
||||
|
||||
// Cloud evolution functions
|
||||
|
||||
//- Set parcel thermo properties
|
||||
void setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
);
|
||||
|
||||
//- Check parcel properties
|
||||
void checkParcelProperties
|
||||
(
|
||||
|
||||
@ -233,6 +233,24 @@ Foam::ThermoCloud<CloudType>::~ThermoCloud()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoCloud<CloudType>::setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
)
|
||||
{
|
||||
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
if (!fullyDescribed)
|
||||
{
|
||||
parcel.T() = constProps_.T0();
|
||||
parcel.Cp() = constProps_.Cp0();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoCloud<CloudType>::checkParcelProperties
|
||||
(
|
||||
@ -242,12 +260,6 @@ void Foam::ThermoCloud<CloudType>::checkParcelProperties
|
||||
)
|
||||
{
|
||||
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
if (!fullyDescribed)
|
||||
{
|
||||
parcel.T() = constProps_.T0();
|
||||
parcel.Cp() = constProps_.Cp0();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -281,6 +281,14 @@ public:
|
||||
|
||||
// Cloud evolution functions
|
||||
|
||||
//- Set parcel thermo properties
|
||||
void setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
);
|
||||
|
||||
//- Check parcel properties
|
||||
void checkParcelProperties
|
||||
(
|
||||
|
||||
@ -530,6 +530,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
const scalar time = this->owner().db().time().value();
|
||||
const scalar trackTime = this->owner().solution().trackTime();
|
||||
const polyMesh& mesh = this->owner().mesh();
|
||||
typename TrackData::cloudType& cloud = td.cloud();
|
||||
|
||||
// Prepare for next time step
|
||||
label parcelsAdded = 0;
|
||||
@ -592,11 +593,14 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
);
|
||||
|
||||
// Check/set new parcel properties
|
||||
td.cloud().checkParcelProperties(*pPtr, dt, fullyDescribed());
|
||||
cloud.setParcelThermoProperties(*pPtr, dt, fullyDescribed());
|
||||
|
||||
// Assign new parcel properties in injection model
|
||||
setProperties(parcelI, newParcels, timeInj, *pPtr);
|
||||
|
||||
// Check/set new parcel properties
|
||||
cloud.checkParcelProperties(*pPtr, dt, fullyDescribed());
|
||||
|
||||
// Apply correction to velocity for 2-D cases
|
||||
meshTools::constrainDirection
|
||||
(
|
||||
@ -647,6 +651,7 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
|
||||
}
|
||||
|
||||
const polyMesh& mesh = this->owner().mesh();
|
||||
typename TrackData::cloudType& cloud = td.cloud();
|
||||
|
||||
// Reset counters
|
||||
time0_ = 0.0;
|
||||
@ -696,12 +701,15 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
|
||||
tetPtI
|
||||
);
|
||||
|
||||
// Check new parcel properties
|
||||
td.cloud().checkParcelProperties(*pPtr, 0.0, fullyDescribed());
|
||||
// Check/set new parcel properties
|
||||
cloud.setParcelThermoProperties(*pPtr, 0.0, fullyDescribed());
|
||||
|
||||
// Assign new parcel properties in injection model
|
||||
setProperties(parcelI, newParcels, 0.0, *pPtr);
|
||||
|
||||
// Check/set new parcel properties
|
||||
cloud.checkParcelProperties(*pPtr, 0.0, fullyDescribed());
|
||||
|
||||
// Apply correction to velocity for 2-D cases
|
||||
meshTools::constrainDirection
|
||||
(
|
||||
|
||||
@ -157,6 +157,30 @@ Foam::SprayCloud<CloudType>::~SprayCloud()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::SprayCloud<CloudType>::setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
)
|
||||
{
|
||||
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
if (!fullyDescribed)
|
||||
{
|
||||
const liquidMixtureProperties& liqMix = this->composition().liquids();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::SprayCloud<CloudType>::checkParcelProperties
|
||||
(
|
||||
@ -165,21 +189,7 @@ void Foam::SprayCloud<CloudType>::checkParcelProperties
|
||||
const bool fullyDescribed
|
||||
)
|
||||
{
|
||||
CloudType::checkParcelProperties
|
||||
(
|
||||
parcel,
|
||||
lagrangianDt,
|
||||
fullyDescribed
|
||||
);
|
||||
|
||||
const liquidMixtureProperties& liqMix = this->composition().liquids();
|
||||
|
||||
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);
|
||||
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
|
||||
|
||||
// store the injection position and initial drop size
|
||||
parcel.position0() = parcel.position();
|
||||
|
||||
@ -209,6 +209,14 @@ public:
|
||||
|
||||
// Cloud evolution functions
|
||||
|
||||
//- Set parcel thermo properties
|
||||
void setParcelThermoProperties
|
||||
(
|
||||
parcelType& parcel,
|
||||
const scalar lagrangianDt,
|
||||
const bool fullyDescribed
|
||||
);
|
||||
|
||||
//- Check parcel properties
|
||||
void checkParcelProperties
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user