ENH: lagrangian - updated injection model

This commit is contained in:
andy 2013-11-12 15:16:26 +00:00
parent 5d0c0287ca
commit e949770310

View File

@ -586,27 +586,25 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
pPtr->rho()
);
const scalar mParcel0 = pPtr->nParticle()*pPtr->mass();
if (pPtr->nParticle() >= 1.0)
{
parcelsAdded++;
massAdded += pPtr->nParticle()*pPtr->mass();
if (!pPtr->move(td, dt))
{
massAdded += mParcel0;
delete pPtr;
}
else
{
if (pPtr->nParticle() >= 1.0)
if (pPtr->move(td, dt))
{
td.cloud().addParticle(pPtr);
massAdded += mParcel0;
parcelsAdded++;
}
else
{
delayedVolume += pPtr->nParticle()*pPtr->volume();
delete pPtr;
}
}
else
{
delayedVolume += pPtr->nParticle()*pPtr->volume();
delete pPtr;
}
}
}
}