From 71983fec41a63843e687894f1c098f771a715cc4 Mon Sep 17 00:00:00 2001 From: Henrik Rusche Date: Wed, 13 Sep 2017 12:26:36 +0200 Subject: [PATCH] Bugfix: reactingParcelFoam/evaporationTest tut hangs in parallel --- .../meshes/primitiveMesh/primitiveMeshFindCell.C | 10 ++++++---- src/lagrangian/basic/Particle/Particle.C | 2 +- src/lagrangian/basic/Particle/ParticleI.H | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/foam/meshes/primitiveMesh/primitiveMeshFindCell.C b/src/foam/meshes/primitiveMesh/primitiveMeshFindCell.C index 591ad8a09..747ac8ac5 100644 --- a/src/foam/meshes/primitiveMesh/primitiveMeshFindCell.C +++ b/src/foam/meshes/primitiveMesh/primitiveMeshFindCell.C @@ -48,8 +48,6 @@ bool Foam::primitiveMesh::pointInCell(const point& p, label celli) const const vectorField& cf = faceCentres(); const vectorField& Sf = faceAreas(); - bool inCell = true; - forAll(f, facei) { label nFace = f[facei]; @@ -59,10 +57,14 @@ bool Foam::primitiveMesh::pointInCell(const point& p, label celli) const { normal = -normal; } - inCell = inCell && ((normal & proj) <= 0); + + if ((normal & proj) > 0) + { + return false; + } } - return inCell; + return true; } diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index 2cee8dfa4..06f54532d 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -376,7 +376,7 @@ Foam::scalar Foam::Particle::trackToFace ); } else - { + { p.hitPatch(patch, td); } } diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H index fbecf43b8..ff864dbaf 100644 --- a/src/lagrangian/basic/Particle/ParticleI.H +++ b/src/lagrangian/basic/Particle/ParticleI.H @@ -37,6 +37,7 @@ inline Foam::scalar Foam::Particle::lambda ) const { const polyMesh& mesh = cloud_.polyMesh_; + const polyBoundaryMesh& patches = mesh.boundaryMesh(); bool movingMesh = mesh.moving(); if (movingMesh) @@ -46,7 +47,11 @@ inline Foam::scalar Foam::Particle::lambda vector Cf = mesh.faceCentres()[facei]; // move reference point for wall - if (!cloud_.internalFace(facei)) + if + ( + !cloud_.internalFace(facei) + && isA(patches[cloud_.facePatch(facei)]) + ) { const vector& C = mesh.cellCentres()[celli_]; scalar CCf = mag((C - Cf) & Sf); @@ -184,13 +189,18 @@ inline Foam::scalar Foam::Particle::lambda ) const { const polyMesh& mesh = cloud_.polyMesh_; + const polyBoundaryMesh& patches = mesh.boundaryMesh(); vector Sf = mesh.faceAreas()[facei]; Sf /= mag(Sf); vector Cf = mesh.faceCentres()[facei]; // move reference point for wall - if (!cloud_.internalFace(facei)) + if + ( + !cloud_.internalFace(facei) + && isA(patches[cloud_.facePatch(facei)]) + ) { const vector& C = mesh.cellCentres()[celli_]; scalar CCf = mag((C - Cf) & Sf);