mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Corrected particle number scaling in cloud *OfSystem functions - resolves bug #503
This commit is contained in:
@ -241,7 +241,7 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::massInSystem() const
|
||||
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
|
||||
{
|
||||
const parcelType& p = iter();
|
||||
sysMass += p.mass()*p.nParticle();
|
||||
sysMass += p.nParticle()*p.mass();
|
||||
}
|
||||
|
||||
return sysMass;
|
||||
@ -258,7 +258,7 @@ Foam::KinematicCloud<CloudType>::linearMomentumOfSystem() const
|
||||
{
|
||||
const parcelType& p = iter();
|
||||
|
||||
linearMomentum += p.mass()*p.U();
|
||||
linearMomentum += p.nParticle()*p.mass()*p.U();
|
||||
}
|
||||
|
||||
return linearMomentum;
|
||||
@ -275,7 +275,7 @@ Foam::KinematicCloud<CloudType>::linearKineticEnergyOfSystem() const
|
||||
{
|
||||
const parcelType& p = iter();
|
||||
|
||||
linearKineticEnergy += 0.5*p.mass()*(p.U() & p.U());
|
||||
linearKineticEnergy += p.nParticle()*0.5*p.mass()*(p.U() & p.U());
|
||||
}
|
||||
|
||||
return linearKineticEnergy;
|
||||
@ -293,7 +293,7 @@ Foam::KinematicCloud<CloudType>::rotationalKineticEnergyOfSystem() const
|
||||
const parcelType& p = iter();
|
||||
|
||||
rotationalKineticEnergy +=
|
||||
0.5*p.momentOfInertia()*(p.omega() & p.omega());
|
||||
p.nParticle()*0.5*p.momentOfInertia()*(p.omega() & p.omega());
|
||||
}
|
||||
|
||||
return rotationalKineticEnergy;
|
||||
|
||||
Reference in New Issue
Block a user