mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
lagrangian: Delete lost particles on restart
Warning messages are generated for each particle deleted
This commit is contained in:
@ -172,6 +172,25 @@ void Foam::Cloud<ParticleType>::deleteParticle(ParticleType& p)
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::Cloud<ParticleType>::deleteLostParticles()
|
||||
{
|
||||
forAllIter(typename Cloud<ParticleType>, *this, pIter)
|
||||
{
|
||||
ParticleType& p = pIter();
|
||||
|
||||
if (p.cell() == -1)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "deleting lost particle at position " << p.position()
|
||||
<< endl;
|
||||
|
||||
deleteParticle(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::Cloud<ParticleType>::cloudReset(const Cloud<ParticleType>& c)
|
||||
{
|
||||
|
||||
@ -109,6 +109,7 @@ Foam::CollidingCloud<CloudType>::CollidingCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this);
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -394,6 +394,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this);
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,6 +94,7 @@ Foam::MPPICCloud<CloudType>::MPPICCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this);
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,6 +111,7 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this, this->composition());
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -98,6 +98,7 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this, this->composition());
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -203,6 +203,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this);
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -94,6 +94,7 @@ Foam::SprayCloud<CloudType>::SprayCloud
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this, this->composition());
|
||||
this->deleteLostParticles();
|
||||
}
|
||||
|
||||
Info << "Average parcel mass: " << averageParcelMass_ << endl;
|
||||
|
||||
Reference in New Issue
Block a user