Commit 8aca0ed3 authored by andy's avatar andy
Browse files

ENH: Only inject new parcelt if nParticle/parcel >= 1

parent fc1bc5c5
......@@ -294,7 +294,8 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
parcelBasis_(pbNumber),
nParticleFixed_(0.0),
time0_(0.0),
timeStep0_(this->template getModelProperty<scalar>("timeStep0"))
timeStep0_(this->template getModelProperty<scalar>("timeStep0")),
delayedVolume_(0.0)
{}
......@@ -321,7 +322,8 @@ Foam::InjectionModel<CloudType>::InjectionModel
parcelBasis_(pbNumber),
nParticleFixed_(0.0),
time0_(owner.db().time().value()),
timeStep0_(this->template getModelProperty<scalar>("timeStep0"))
timeStep0_(this->template getModelProperty<scalar>("timeStep0")),
delayedVolume_(0.0)
{
// Provide some info
// - also serves to initialise mesh dimensions - needed for parallel runs
......@@ -394,7 +396,8 @@ Foam::InjectionModel<CloudType>::InjectionModel
parcelBasis_(im.parcelBasis_),
nParticleFixed_(im.nParticleFixed_),
time0_(im.time0_),
timeStep0_(im.timeStep0_)
timeStep0_(im.timeStep0_),
delayedVolume_(im.delayedVolume_)
{}
......@@ -502,6 +505,9 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
if (prepareForNextTimeStep(time, newParcels, newVolume))
{
newVolume += delayedVolume_;
scalar delayedVolume = 0;
const scalar trackTime = this->owner().solution().trackTime();
const polyMesh& mesh = this->owner().mesh();
typename TrackData::cloudType& cloud = td.cloud();
......@@ -579,7 +585,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
pPtr->rho()
);
if (pPtr->move(td, dt))
if ((pPtr->nParticle() >= 1.0) && (pPtr->move(td, dt)))
{
td.cloud().addParticle(pPtr);
massAdded += pPtr->nParticle()*pPtr->mass();
......@@ -587,11 +593,14 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
}
else
{
delayedVolume += pPtr->nParticle()*pPtr->volume();
delete pPtr;
}
}
}
}
delayedVolume_ = delayedVolume;
}
postInjectCheck(parcelsAdded, massAdded);
......
......@@ -134,6 +134,10 @@ protected:
//- Time at start of injection time step [s]
scalar timeStep0_;
//- Volume that should have been injected, but would lead to
// less than 1 particle per parcel
scalar delayedVolume_;
// Protected Member Functions
......
Supports Markdown
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