From 347a4fee7a4ce7028f81481135803e38c7d0858d Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Tue, 14 Mar 2023 08:48:46 -0700 Subject: [PATCH] DEMSystem correction for fluid force --- .../sphereDEMSystem/sphereFluidParticles.cpp | 7 +++++++ .../sphereDEMSystem/sphereFluidParticles.hpp | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp b/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp index 386ac859..9b3a44b0 100644 --- a/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp +++ b/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp @@ -54,6 +54,13 @@ pFlow::sphereFluidParticles::sphereFluidParticles( ) {} +bool pFlow::sphereFluidParticles::beforeIteration() +{ + sphereParticles::beforeIteration(); + zeroFluidForce_H(); + zeroFluidTorque_H(); + return true; +} bool pFlow::sphereFluidParticles::iterate() diff --git a/DEMSystems/sphereDEMSystem/sphereFluidParticles.hpp b/DEMSystems/sphereDEMSystem/sphereFluidParticles.hpp index 48b73f34..9890dac8 100644 --- a/DEMSystems/sphereDEMSystem/sphereFluidParticles.hpp +++ b/DEMSystems/sphereDEMSystem/sphereFluidParticles.hpp @@ -48,12 +48,24 @@ protected: realx3PointField_HD& fluidTorque_; + void zeroFluidForce_H() + { + fluidForce_.fillHost(zero3); + } + + void zeroFluidTorque_H() + { + fluidTorque_.fillHost(zero3); + } + public: /// construct from systemControl and property sphereFluidParticles(systemControl &control, const property& prop); - + /// before iteration step + bool beforeIteration() override; + /// iterate particles bool iterate() override;