Commit e9497703 authored by andy's avatar andy
Browse files

ENH: lagrangian - updated injection model

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