ENH: Reinstated the wallBoundedStreamline function object

Note: performs its own tracking and does not rely on the base
particle::trackXXX functions, and uses a local particle position.

Look to update to barycentric tracking in the future.
This commit is contained in:
Andrew Heather
2017-09-14 12:02:03 +01:00
parent 2defba00a9
commit d7fd550e61
15 changed files with 545 additions and 609 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -62,10 +62,8 @@ Foam::tetIndices Foam::functionObjects::wallBoundedStreamLine::findNearestTet
label minTetPti = -1;
scalar minDistSqr = sqr(GREAT);
forAll(cFaces, cFacei)
for (label facei : cFaces)
{
label facei = cFaces[cFacei];
if (isWallPatch[facei])
{
const face& f = mesh_.faces()[facei];
@ -98,8 +96,7 @@ Foam::tetIndices Foam::functionObjects::wallBoundedStreamLine::findNearestTet
(
celli,
minFacei,
minTetPti,
mesh_
minTetPti
);
}
@ -226,7 +223,7 @@ void Foam::functionObjects::wallBoundedStreamLine::track()
const scalar trackTime = Foam::sqrt(GREAT);
// Track
particles.move(td, trackTime);
particles.move(particles, td, trackTime);
}
@ -265,6 +262,7 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
{
// 1. Positive volume decomposition tets
faceSet faces(mesh_, "lowQualityTetFaces", mesh_.nFaces()/100+1);
if
(
polyMeshTetDecomposition::checkFaceTets
@ -287,21 +285,18 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
// 2. All edges on a cell having two faces
EdgeMap<label> numFacesPerEdge;
forAll(mesh_.cells(), celli)
for (const cell& cFaces : mesh_.cells())
{
const cell& cFaces = mesh_.cells()[celli];
numFacesPerEdge.clear();
forAll(cFaces, cFacei)
for (const label facei : cFaces)
{
label facei = cFaces[cFacei];
const face& f = mesh_.faces()[facei];
forAll(f, fp)
{
const edge e(f[fp], f.nextLabel(fp));
EdgeMap<label>::iterator eFnd =
numFacesPerEdge.find(e);
EdgeMap<label>::iterator eFnd = numFacesPerEdge.find(e);
if (eFnd != numFacesPerEdge.end())
{
eFnd()++;
@ -313,12 +308,12 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
}
}
forAllConstIter(EdgeMap<label>, numFacesPerEdge, iter)
forAllConstIters(numFacesPerEdge, iter)
{
if (iter() != 2)
{
FatalErrorInFunction
<< "problem cell:" << celli
<< "problem cell:" << cFaces
<< abort(FatalError);
}
}