mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Corrected particle patch post-processing model
This commit is contained in:
@ -36,15 +36,12 @@ Foam::label Foam::PatchPostProcessing<CloudType>::applyToPatch
|
|||||||
const label globalPatchI
|
const label globalPatchI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label patchI = 0;
|
forAll(patchIDs_, i)
|
||||||
forAllConstIter(labelHashSet, patchIDs_, iter)
|
|
||||||
{
|
{
|
||||||
if (iter.key() == globalPatchI)
|
if (patchIDs_[i] == globalPatchI)
|
||||||
{
|
{
|
||||||
return patchI;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
patchI++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -105,7 +102,7 @@ void Foam::PatchPostProcessing<CloudType>::write()
|
|||||||
);
|
);
|
||||||
sort(globalData);
|
sort(globalData);
|
||||||
|
|
||||||
patchOutFile<< "# Time " + parcelType::propHeader << nl;
|
patchOutFile<< "# Time currentProc " + parcelType::propHeader << nl;
|
||||||
|
|
||||||
forAll(globalData, dataI)
|
forAll(globalData, dataI)
|
||||||
{
|
{
|
||||||
@ -135,6 +132,7 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
|
|||||||
const wordList allPatchNames = owner.mesh().boundaryMesh().names();
|
const wordList allPatchNames = owner.mesh().boundaryMesh().names();
|
||||||
wordList patchName(this->coeffDict().lookup("patches"));
|
wordList patchName(this->coeffDict().lookup("patches"));
|
||||||
|
|
||||||
|
labelHashSet uniquePatchIDs;
|
||||||
forAllReverse(patchName, i)
|
forAllReverse(patchName, i)
|
||||||
{
|
{
|
||||||
labelList patchIDs = findStrings(patchName[i], allPatchNames);
|
labelList patchIDs = findStrings(patchName[i], allPatchNames);
|
||||||
@ -152,9 +150,18 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(patchIDs, j)
|
uniquePatchIDs.insert(patchIDs);
|
||||||
|
}
|
||||||
|
|
||||||
|
patchIDs_ = uniquePatchIDs.toc();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
forAll(patchIDs_, i)
|
||||||
{
|
{
|
||||||
patchIDs_.insert(patchIDs[j]);
|
const label patchI = patchIDs_[i];
|
||||||
|
const word& patchName = owner.mesh().boundaryMesh()[patchI].name();
|
||||||
|
Info<< "Post-process patch " << patchName << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +202,8 @@ void Foam::PatchPostProcessing<CloudType>::postPatch
|
|||||||
if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_)
|
if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_)
|
||||||
{
|
{
|
||||||
OStringStream data;
|
OStringStream data;
|
||||||
data<< this->owner().time().timeName() << ' ' << p;
|
data<< this->owner().time().timeName() << ' ' << Pstream::myProcNo()
|
||||||
|
<< ' ' << p;
|
||||||
patchData_[localPatchI].append(data.str());
|
patchData_[localPatchI].append(data.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class PatchPostProcessing
|
|||||||
label maxStoredParcels_;
|
label maxStoredParcels_;
|
||||||
|
|
||||||
//- List of patch indices to post-process
|
//- List of patch indices to post-process
|
||||||
labelHashSet patchIDs_;
|
labelList patchIDs_;
|
||||||
|
|
||||||
//- List of output data per patch
|
//- List of output data per patch
|
||||||
List<DynamicList<string> > patchData_;
|
List<DynamicList<string> > patchData_;
|
||||||
|
|||||||
Reference in New Issue
Block a user