Skip to content
Snippets Groups Projects
Commit 1bc454a2 authored by Christoph Rettinger's avatar Christoph Rettinger
Browse files

Minor updates in fp coupling functionalities

parent 37776b83
Branches
Tags
No related merge requests found
...@@ -165,9 +165,9 @@ private: ...@@ -165,9 +165,9 @@ private:
} }
} }
else if( isFlagSet( cellFlagPtr, obstacle ) )
// cell is already an obstacle (maybe from another particle) {
if( isFlagSet( cellFlagPtr, obstacle ) ) { // cell is already an obstacle (maybe from another particle)
auto formerParticleUid = (*particleField)(x, y, z); auto formerParticleUid = (*particleField)(x, y, z);
auto formerParticleIdx = ac_->uidToIdx(formerParticleUid); auto formerParticleIdx = ac_->uidToIdx(formerParticleUid);
if(!isSet(ac_->getFlags(formerParticleIdx), mesa_pd::data::particle_flags::FIXED) ) if(!isSet(ac_->getFlags(formerParticleIdx), mesa_pd::data::particle_flags::FIXED) )
...@@ -179,10 +179,9 @@ private: ...@@ -179,10 +179,9 @@ private:
(*particleField)(x, y, z) = particleUid; (*particleField)(x, y, z) = particleUid;
} }
} }
else if( isFlagSet( cellFlagPtr, formerObstacle ) )
// cell is a former obstacle cell (maybe from another particle that has moved away)
if( isFlagSet( cellFlagPtr, formerObstacle ) )
{ {
// cell is a former obstacle cell (maybe from another particle that has moved away)
boundaryHandling->setBoundary( obstacle, x, y, z ); boundaryHandling->setBoundary( obstacle, x, y, z );
removeFlag( cellFlagPtr, formerObstacle ); removeFlag( cellFlagPtr, formerObstacle );
(*particleField)(x, y, z) = particleUid; (*particleField)(x, y, z) = particleUid;
...@@ -333,8 +332,12 @@ private: ...@@ -333,8 +332,12 @@ private:
{ {
if( singleCast(particleIdx, ac, containsPointFctr, ac, Vector3<real_t>(cx,cy,cz)) ) if( singleCast(particleIdx, ac, containsPointFctr, ac, Vector3<real_t>(cx,cy,cz)) )
{ {
boundaryHandling->forceBoundary(obstacleFlag, x, y, z); if(boundaryHandling->isDomain(x,y,z))
(*particleField)(x,y,z) = ac.getUid(particleIdx); {
boundaryHandling->forceBoundary(obstacleFlag, x, y, z);
(*particleField)(x,y,z) = ac.getUid(particleIdx);
}
// no else -> will not overwrite pre-existing boundary cells, e.g. of previously applied applied mapping (e.g. when first mapping global particles)
} }
cx += dx; cx += dx;
} }
......
...@@ -74,6 +74,11 @@ public: ...@@ -74,6 +74,11 @@ public:
} }
} }
void setPosition(Vector3<real_t> probeLocation)
{
probeLocation_ = probeLocation;
}
private: private:
void printStatusOfCellSurrounding(Cell centerCell, const IBlock& block) void printStatusOfCellSurrounding(Cell centerCell, const IBlock& block)
...@@ -121,7 +126,7 @@ private: ...@@ -121,7 +126,7 @@ private:
void printToScreen(bool isFluid, real_t rho, Vector3<real_t> velocity) void printToScreen(bool isFluid, real_t rho, Vector3<real_t> velocity)
{ {
if(printToScreen_) WALBERLA_LOG_INFO("Values in probe at position " << probeLocation_ << ": " << (isFluid?"F":"P") << ", rho = " << rho << ", velocity = " << velocity); if(printToScreen_) WALBERLA_LOG_INFO("Values in probe at position " << probeLocation_ << " on rank " << mpi::MPIManager::instance()->rank() << ": " << (isFluid?"F":"P") << ", rho = " << rho << ", velocity = " << velocity);
} }
void writeToFile(bool isFluid, real_t rho, Vector3<real_t> velocity) void writeToFile(bool isFluid, real_t rho, Vector3<real_t> velocity)
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "mesa_pd/data/Flags.h" #include "mesa_pd/data/Flags.h"
#include "mesa_pd/data/IAccessor.h" #include "mesa_pd/data/IAccessor.h"
#include "mesa_pd/data/shape/Sphere.h" #include "mesa_pd/data/shape/Sphere.h"
#include "mesa_pd/kernel/ParticleSelector.h"
namespace walberla { namespace walberla {
namespace lbm_mesapd_coupling { namespace lbm_mesapd_coupling {
...@@ -76,8 +77,9 @@ struct StokesNumberBasedSphereSelector ...@@ -76,8 +77,9 @@ struct StokesNumberBasedSphereSelector
static_assert(std::is_base_of<mesa_pd::data::IAccessor, ParticleAccessor_T>::value, "Provide a valid accessor as template"); static_assert(std::is_base_of<mesa_pd::data::IAccessor, ParticleAccessor_T>::value, "Provide a valid accessor as template");
lbm_mesapd_coupling::RegularParticlesSelector regularParticlesSelector; lbm_mesapd_coupling::RegularParticlesSelector regularParticlesSelector;
mesa_pd::kernel::SelectLocal localParticlesSelector;
if(regularParticlesSelector(particleIdx, ac)) if(regularParticlesSelector(particleIdx, ac) && localParticlesSelector(particleIdx, ac))
{ {
// check for non-fixed spheres // check for non-fixed spheres
if( ac.getShape(particleIdx)->getShapeType() == mesa_pd::data::Sphere::SHAPE_TYPE ) if( ac.getShape(particleIdx)->getShapeType() == mesa_pd::data::Sphere::SHAPE_TYPE )
......
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