Commit 3c35c353 authored by sergio's avatar sergio
Browse files

BUG: Fixing bug in dimensioning variables for parallel case

parent 240e304b
...@@ -24,6 +24,7 @@ License ...@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "StandardWallInteraction.H" #include "StandardWallInteraction.H"
#include "processorPolyPatch.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...@@ -42,10 +43,10 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction ...@@ -42,10 +43,10 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction
), ),
e_(0.0), e_(0.0),
mu_(0.0), mu_(0.0),
nEscape_(cloud.mesh().boundary().size()), nEscape_(0),
massEscape_(nEscape_.size()), massEscape_(0),
nStick_(nEscape_.size()), nStick_(0),
massStick_(nEscape_.size()), massStick_(0),
outputByInjectorId_(this->coeffDict().lookupOrDefault("outputByInjectorId", false)), outputByInjectorId_(this->coeffDict().lookupOrDefault("outputByInjectorId", false)),
injIdToIndex_(cloud.injectors().size()) injIdToIndex_(cloud.injectors().size())
{ {
...@@ -73,6 +74,19 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction ...@@ -73,6 +74,19 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction
{} {}
} }
label nPatches = 0;
forAll(mesh_.boundaryMesh(), patchi)
{
if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
{
nPatches++;
}
}
nEscape_.setSize(nPatches);
massEscape_.setSize(nPatches);
nStick_.setSize(nPatches);
massStick_.setSize(nPatches);
forAll(nEscape_, patchi) forAll(nEscape_, patchi)
{ {
label nInjectors(1); label nInjectors(1);
...@@ -240,6 +254,7 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os) ...@@ -240,6 +254,7 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os)
// accumulate current data // accumulate current data
labelListList npe(nEscape_); labelListList npe(nEscape_);
forAll(npe, i) forAll(npe, i)
{ {
Pstream::listCombineGather(npe[i], plusEqOp<label>()); Pstream::listCombineGather(npe[i], plusEqOp<label>());
...@@ -288,12 +303,14 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os) ...@@ -288,12 +303,14 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os)
{ {
forAll(npe, i) forAll(npe, i)
{ {
os << " Parcel fate: walls (number, mass) "
os << " Parcel fate: patch (number, mass) "
<< mesh_.boundary()[i].name() << nl << mesh_.boundary()[i].name() << nl
<< " - escape = " << " - escape = "
<< npe[i][0] << ", " << mpe[i][0] << nl << npe[i][0] << ", " << mpe[i][0] << nl
<< " - stick = " << " - stick = "
<< nps[i][0] << ", " << mps[i][0] << nl; << nps[i][0] << ", " << mps[i][0] << nl;
} }
} }
...@@ -308,6 +325,7 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os) ...@@ -308,6 +325,7 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os)
this->setModelProperty("massStick", mps); this->setModelProperty("massStick", mps);
massStick_ = Zero; massStick_ = Zero;
} }
} }
......
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