mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Updated lagrangian intermediate injection model counters for parallel usage
This commit is contained in:
@ -269,11 +269,9 @@ void Foam::KinematicCloud<ParcelType>::info() const
|
|||||||
{
|
{
|
||||||
Info<< "Cloud: " << this->name() << nl
|
Info<< "Cloud: " << this->name() << nl
|
||||||
<< " Total number of parcels added = "
|
<< " Total number of parcels added = "
|
||||||
<< returnReduce(this->injection().parcelsAddedTotal(), sumOp<label>())
|
<< this->injection().parcelsAddedTotal() << nl
|
||||||
<< nl
|
|
||||||
<< " Total mass introduced = "
|
<< " Total mass introduced = "
|
||||||
<< returnReduce(this->injection().massInjected(), sumOp<scalar>())
|
<< this->injection().massInjected() << nl
|
||||||
<< nl
|
|
||||||
<< " Current number of parcels = "
|
<< " Current number of parcels = "
|
||||||
<< returnReduce(this->size(), sumOp<label>()) << nl
|
<< returnReduce(this->size(), sumOp<label>()) << nl
|
||||||
<< " Current mass in system = "
|
<< " Current mass in system = "
|
||||||
|
|||||||
@ -219,7 +219,6 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
|
|||||||
" const label, "
|
" const label, "
|
||||||
" const scalar, "
|
" const scalar, "
|
||||||
" const scalar, "
|
" const scalar, "
|
||||||
" const scalar, "
|
|
||||||
" const scalar"
|
" const scalar"
|
||||||
")"
|
")"
|
||||||
)<< "Unknown parcelBasis type" << nl
|
)<< "Unknown parcelBasis type" << nl
|
||||||
@ -232,18 +231,26 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
|
|||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
void Foam::InjectionModel<CloudType>::postInjectCheck(const label parcelsAdded)
|
void Foam::InjectionModel<CloudType>::postInjectCheck
|
||||||
|
(
|
||||||
|
const label parcelsAdded,
|
||||||
|
const scalar massAdded
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (parcelsAdded > 0)
|
const label allParcelsAdded = returnReduce(parcelsAdded, sumOp<label>());
|
||||||
|
|
||||||
|
if (allParcelsAdded > 0)
|
||||||
{
|
{
|
||||||
Pout<< nl
|
Info<< nl
|
||||||
<< "--> Cloud: " << owner_.name() << nl
|
<< "--> Cloud: " << owner_.name() << nl
|
||||||
<< " Added " << parcelsAdded
|
<< " Added " << allParcelsAdded << " new parcels" << nl << endl;
|
||||||
<< " new parcels" << nl << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Increment total number of parcels added
|
// Increment total number of parcels added
|
||||||
parcelsAddedTotal_ += parcelsAdded;
|
parcelsAddedTotal_ += allParcelsAdded;
|
||||||
|
|
||||||
|
// Increment total mass injected
|
||||||
|
massInjected_ += returnReduce(massAdded, sumOp<scalar>());
|
||||||
|
|
||||||
// Update time for start of next injection
|
// Update time for start of next injection
|
||||||
time0_ = owner_.db().time().value();
|
time0_ = owner_.db().time().value();
|
||||||
@ -355,16 +362,12 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
|||||||
const polyMesh& mesh = owner_.mesh();
|
const polyMesh& mesh = owner_.mesh();
|
||||||
|
|
||||||
// Prepare for next time step
|
// Prepare for next time step
|
||||||
|
label parcelsAdded = 0;
|
||||||
|
scalar massAdded = 0.0;
|
||||||
label newParcels = 0;
|
label newParcels = 0;
|
||||||
scalar newVolume = 0.0;
|
scalar newVolume = 0.0;
|
||||||
prepareForNextTimeStep(time, newParcels, newVolume);
|
|
||||||
|
|
||||||
// Return if no parcels are required
|
prepareForNextTimeStep(time, newParcels, newVolume);
|
||||||
if (newParcels == 0)
|
|
||||||
{
|
|
||||||
postInjectCheck(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Duration of injection period during this timestep
|
// Duration of injection period during this timestep
|
||||||
const scalar deltaT =
|
const scalar deltaT =
|
||||||
@ -374,7 +377,6 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
|||||||
const scalar padTime = max(0.0, SOI_ - time0_);
|
const scalar padTime = max(0.0, SOI_ - time0_);
|
||||||
|
|
||||||
// Introduce new parcels linearly across carrier phase timestep
|
// Introduce new parcels linearly across carrier phase timestep
|
||||||
label parcelsAdded = 0;
|
|
||||||
for (label parcelI=0; parcelI<newParcels; parcelI++)
|
for (label parcelI=0; parcelI<newParcels; parcelI++)
|
||||||
{
|
{
|
||||||
if (validInjection(parcelI))
|
if (validInjection(parcelI))
|
||||||
@ -425,13 +427,13 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
|||||||
// Add the new parcel
|
// Add the new parcel
|
||||||
td.cloud().addParticle(pPtr);
|
td.cloud().addParticle(pPtr);
|
||||||
|
|
||||||
massInjected_ += pPtr->nParticle()*pPtr->mass();
|
massAdded += pPtr->nParticle()*pPtr->mass();
|
||||||
parcelsAdded++;
|
parcelsAdded++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
postInjectCheck(parcelsAdded);
|
postInjectCheck(parcelsAdded, massAdded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,11 @@ protected:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Post injection checks
|
//- Post injection checks
|
||||||
virtual void postInjectCheck(const label parcelsAdded);
|
virtual void postInjectCheck
|
||||||
|
(
|
||||||
|
const label parcelsAdded,
|
||||||
|
const scalar massAdded
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user