phasicFlow/DEMSystems/sphereDEMSystem/sphereDEMSystem.hpp

147 lines
3.1 KiB
C++
Raw Normal View History

2022-12-03 08:42:56 +00:00
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
2022-12-09 22:02:54 +00:00
#ifndef __sphereDEMSystem_hpp__
#define __sphereDEMSystem_hpp__
2022-12-03 08:42:56 +00:00
#include "DEMSystem.hpp"
2022-12-09 22:02:54 +00:00
#include "property.hpp"
#include "uniquePtr.hpp"
#include "geometry.hpp"
#include "sphereFluidParticles.hpp"
2022-12-09 22:02:54 +00:00
#include "interaction.hpp"
#include "Insertions.hpp"
#include "domainDistribute.hpp"
2022-12-03 08:42:56 +00:00
2022-12-30 14:03:56 +00:00
namespace pFlow
2022-12-03 08:42:56 +00:00
{
class sphereDEMSystem
:
public DEMSystem
2022-12-03 08:42:56 +00:00
{
protected:
2022-12-06 15:20:47 +00:00
// protected members
2022-12-03 08:42:56 +00:00
uniquePtr<property> property_ = nullptr;
2022-12-03 08:42:56 +00:00
uniquePtr<geometry> geometry_ = nullptr;
2022-12-03 08:42:56 +00:00
uniquePtr<sphereFluidParticles> particles_ = nullptr;
2022-12-03 08:42:56 +00:00
2022-12-06 15:20:47 +00:00
uniquePtr<sphereInsertion> insertion_ = nullptr;
uniquePtr<interaction> interaction_ = nullptr;
2022-12-07 13:16:54 +00:00
uniquePtr<domainDistribute> particleDistribution_=nullptr;
2022-12-03 08:42:56 +00:00
// to be used for CPU communications
ViewType1D<realx3, HostSpace> parVelocity_;
ViewType1D<realx3, HostSpace> parPosition_;
ViewType1D<real, HostSpace> parDiameter_;
// protected member functions
2022-12-03 08:42:56 +00:00
auto& Property()
{
return property_();
}
auto& Geometry()
{
return geometry_();
}
auto& Particles()
{
return particles_();
}
auto& Interaction()
{
return interaction_();
}
bool loop();
2022-12-03 08:42:56 +00:00
public:
TypeInfo("sphereDEMSystem");
sphereDEMSystem(
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]);
2022-12-06 15:20:47 +00:00
virtual ~sphereDEMSystem();
2022-12-06 15:20:47 +00:00
sphereDEMSystem(const sphereDEMSystem&)=delete;
sphereDEMSystem& operator = (const sphereDEMSystem&)=delete;
add_vCtor(
DEMSystem,
sphereDEMSystem,
word);
2022-12-03 08:42:56 +00:00
bool updateParticleDistribution(real extentFraction, const std::vector<box> domains) override;
int32 numParInDomain(int32 di)const override;
std::vector<int32> numParInDomain()const override;
2022-12-30 14:03:56 +00:00
span<const int32> parIndexInDomain(int32 di)const override;
span<real> parDiameter() override;
span<realx3> parVelocity() override;
span<realx3> parPosition() override;
span<realx3> parFluidForce() override;
span<realx3> parFluidTorque() override;
bool sendFluidForceToDEM() override;
bool sendFluidTorqueToDEM() override;
2022-12-30 14:03:56 +00:00
bool beforeIteration() override;
2022-12-30 14:03:56 +00:00
bool iterate(
real upToTime,
real timeToWrite,
word timeName) override;
bool iterate(real upToTime) override;
real maxBounndingSphereSize()const override;
2022-12-07 13:16:54 +00:00
2022-12-03 08:42:56 +00:00
};
} // pFlow
#endif