diff --git a/src/pe_coupling/mapping/BodyBBMapping.cpp b/src/pe_coupling/mapping/BodyBBMapping.cpp index c3726a574fd68c97b6dc5329311f6bb927e0fb77..41d5e0c10803c49a031bddd6fe6e4b021f2ae158 100644 --- a/src/pe_coupling/mapping/BodyBBMapping.cpp +++ b/src/pe_coupling/mapping/BodyBBMapping.cpp @@ -57,7 +57,7 @@ CellInterval getCellBB( const pe::ConstBodyID body, const IBlock & block, Struct // then determine the cell bounding box of the intersection blockStorage.getCellBBFromAABB( cellBB, body->getAABB().getIntersection( extendedBlockAABB ), level ); - // if infinte body does not intersect with the extended block AABB, return an empty interval + // if infinite body does not intersect with the extended block AABB, return an empty interval if( cellBB.empty() ) return CellInterval(); } diff --git a/src/pe_coupling/momentum_exchange_method/BodyMapping.h b/src/pe_coupling/momentum_exchange_method/BodyMapping.h index c44bc77e6a525f78c41f91127bac7def5b59096a..045eeb5d1ec0c97d2085c98242b3611d24599186 100644 --- a/src/pe_coupling/momentum_exchange_method/BodyMapping.h +++ b/src/pe_coupling/momentum_exchange_method/BodyMapping.h @@ -123,6 +123,9 @@ private: CellInterval cellBB = getCellBB( body, *block, *blockStorage_, flagField->nrOfGhostLayers() ); + WALBERLA_ASSERT_LESS_EQUAL(body->getLinearVel().length(), real_t(1), + "Velocity is above 1 (" << body->getLinearVel() << "), which violates the assumption made in the getCellBB() function. The coupling might thus not work properly. Body:\n" << *body); + Vector3<real_t> startCellCenter = blockStorage_->getBlockLocalCellCenter( *block, cellBB.min() ); real_t cz = startCellCenter[2]; @@ -157,6 +160,9 @@ private: } // let pointer from body field point to this body (*bodyField)(x,y,z) = body; + + WALBERLA_ASSERT(isFlagSet( cellFlagPtr, obstacle ), "Flag mapping incorrect for body\n" << *body ); + WALBERLA_ASSERT_EQUAL((*bodyField)(x,y,z), body, "Body field does not point to correct body\n" << *body << "."); } else { diff --git a/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h b/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h index 808fc089f1038092a5a54460f5e6bee46eea3e12..e65d2cc3ce392a73bc93cc59ff183be76ab35e29 100644 --- a/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h +++ b/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h @@ -108,7 +108,7 @@ private: if (isFlagSet(flagField->get(x,y,z), formerObstacle)) { boundaryHandling->setDomain( fluid, x, y, z ); removeFlag( flagField->get(x,y,z), formerObstacle ); - (*bodyField)(x,y,z) = NULL; + (*bodyField)(x,y,z) = nullptr; } } }