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>
|
template<class ParticleType>
|
||||||
void Foam::Cloud<ParticleType>::cloudReset(const Cloud<ParticleType>& c)
|
void Foam::Cloud<ParticleType>::cloudReset(const Cloud<ParticleType>& c)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -109,6 +109,7 @@ Foam::CollidingCloud<CloudType>::CollidingCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this);
|
parcelType::readFields(*this);
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -394,6 +394,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this);
|
parcelType::readFields(*this);
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -94,6 +94,7 @@ Foam::MPPICCloud<CloudType>::MPPICCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this);
|
parcelType::readFields(*this);
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,6 +111,7 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this, this->composition());
|
parcelType::readFields(*this, this->composition());
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -98,6 +98,7 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this, this->composition());
|
parcelType::readFields(*this, this->composition());
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -203,6 +203,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this);
|
parcelType::readFields(*this);
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|||||||
@ -94,6 +94,7 @@ Foam::SprayCloud<CloudType>::SprayCloud
|
|||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
parcelType::readFields(*this, this->composition());
|
parcelType::readFields(*this, this->composition());
|
||||||
|
this->deleteLostParticles();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info << "Average parcel mass: " << averageParcelMass_ << endl;
|
Info << "Average parcel mass: " << averageParcelMass_ << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user