ENH: InjectedParticleDistributionInjection model - added protection for the case of zero particles; updated tutorial scripts. See #363

This commit is contained in:
Andrew Heather
2016-12-22 10:30:15 +00:00
parent c3df4b9368
commit 02ba3a2d44
3 changed files with 9 additions and 2 deletions

View File

@ -384,6 +384,11 @@ Foam::InjectedParticleDistributionInjection<CloudType>::parcelsToInject
nParcelsInjected_ += returnReduce(nParcelsInjected0_, sumOp<label>()); nParcelsInjected_ += returnReduce(nParcelsInjected0_, sumOp<label>());
nParcelsInjected0_ = 0; nParcelsInjected0_ = 0;
if (startTime_.empty() || this->volumeTotal_ < ROOTVSMALL)
{
return 0;
}
scalar targetVolume = 0; scalar targetVolume = 0;
forAll(startTime_, injectori) forAll(startTime_, injectori)
{ {

View File

@ -25,7 +25,7 @@ copyLagrangianData()
if [ -z $latestTime ] if [ -z $latestTime ]
then then
echo "Error: unable to find Lagrangian data in case $eulerianCase" echo "Error: unable to find Lagrangian data in case $dir"
exit 1 exit 1
fi fi
@ -37,6 +37,7 @@ copyLagrangianData()
\cp -r $dir 0 \cp -r $dir 0
else else
echo "Error: unable to find Lagrangian data in case $dir" echo "Error: unable to find Lagrangian data in case $dir"
exit 1
fi fi
} }

View File

@ -25,7 +25,7 @@ copyLagrangianData()
if [ -z $latestTime ] if [ -z $latestTime ]
then then
echo "Error: unable to find Lagrangian data in case $eulerianCase" echo "Error: unable to find Lagrangian data in case $dir"
exit 1 exit 1
fi fi
@ -37,6 +37,7 @@ copyLagrangianData()
\cp -r $dir 0 \cp -r $dir 0
else else
echo "Error: unable to find Lagrangian data in case $dir" echo "Error: unable to find Lagrangian data in case $dir"
exit 1
fi fi
} }