# PhasicFlow: src/Particles/SphereParticles/sphereParticles/sphereParticles.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

sphereParticles.hpp
Go to the documentation of this file.
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __sphereParticles_hpp__
#define __sphereParticles_hpp__
#include "indexContainer.hpp"
#include "particles.hpp"
#include "property.hpp"
#include "sphereShape.hpp"
#include "boundarySphereParticlesList.hpp"
#include "systemControl.hpp"
namespace pFlow
{
class sphereParticles : public particles
{
public:
using ShapeType = sphereShape;
private:
ShapeType spheres_;
uint32PointField_D propertyId_;
realPointField_D diameter_;
realPointField_D mass_;
realPointField_D I_;
realx3PointField_D rVelocity_;
realx3PointField_D rAcceleration_;
boundarySphereParticlesList boundarySphereParticles_;
uniquePtr<integration> rVelIntegration_ = nullptr;
Timer accelerationTimer_;
Timer intPredictTimer_;
Timer intCorrectTimer_;
Timer fieldUpdateTimer_;
private:
bool getParticlesInfoFromShape(
const wordVector& shapeNames,
uint32Vector& propIds,
realVector& diams,
realVector& m,
realVector& Is,
uint32Vector& shIndex
);
/*bool initializeParticles();
bool insertSphereParticles(
const wordVector& names,
const int32IndexContainer& indices,
bool setId = true);
virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const override;
*/
protected:
Timer& accelerationTimer()
{
return accelerationTimer_;
}
Timer& intCorrectTimer()
{
return intCorrectTimer_;
}
integration& rVelIntegration()
{
return rVelIntegration_();
}
public:
sphereParticles(systemControl& control, const property& prop);
~sphereParticles() override = default;
/*bool insertParticles
(
const realx3Vector& position,
const wordVector& shapes,
const setFieldList& setField
) override ;*/
// TODO: make this method private later
bool initializeParticles();
const auto& spheres() const
{
return spheres_;
}
const auto& I() const
{
return I_;
}
auto& I()
{
return I_;
}
const auto& rVelocity() const
{
return rVelocity_;
}
auto& rVelocity()
{
return rVelocity_;
}
bool hearChanges(
real t,
real dt,
uint32 iter,
const message& msg,
const anyList& varList
) override
{
notImplementedFunction;
return false;
}
const uint32PointField_D& propertyId() const override
{
return propertyId_;
}
const realPointField_D& diameter() const override
{
return diameter_;
}
const realPointField_D& mass() const override
{
return mass_;
}
bool beforeIteration() override;
bool iterate() override;
bool insertParticles(
const realx3Vector& position,
const wordVector& shapesNames,
const anyList& setVarList
) override;
realx3PointField_D& rAcceleration() override
{
return rAcceleration_;
}
const realx3PointField_D& rAcceleration() const override
{
return rAcceleration_;
}
const realPointField_D& boundingSphere() const override
{
return diameter();
}
word shapeTypeName() const override;
const shape& getShapes() const override;
void boundingSphereMinMax(real& minDiam, real& maxDiam) const override;
}; // sphereParticles
} // pFlow
#endif //__sphereParticles_hpp__
pFlow::sphereParticles::propertyId_
uint32PointField_D propertyId_
property id on device
Definition: sphereParticles.hpp:54
pFlow::sphereParticles::mass
const realPointField_D & mass() const override
Definition: sphereParticles.hpp:199
notImplementedFunction
#define notImplementedFunction
Report that a function is yet not implemented.
Definition: error.hpp:84
pFlow::sphereParticles::boundingSphere
const realPointField_D & boundingSphere() const override
Definition: sphereParticles.hpp:226
pFlow::sphereParticles::diameter_
realPointField_D diameter_
diameter / boundig sphere size of particles on device
Definition: sphereParticles.hpp:57
pFlow::message
Definition: message.hpp:33
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::sphereParticles::rVelocity_
realx3PointField_D rVelocity_
pointField of rotational Velocity of particles on device
Definition: sphereParticles.hpp:66
pFlow::sphereShape
Definition: sphereShape.hpp:29
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::sphereParticles::getShapes
const shape & getShapes() const override
Definition: sphereParticles.cpp:639
pFlow::sphereParticles::insertParticles
bool insertParticles(const realx3Vector &position, const wordVector &shapesNames, const anyList &setVarList) override
Definition: sphereParticles.cpp:581
pFlow::sphereParticles::rVelocity
auto & rVelocity()
Definition: sphereParticles.hpp:172
pFlow::integration
Base class for integrating the first order ODE (IVP)
Definition: integration.hpp:51
pFlow::sphereParticles::intPredictTimer_
Timer intPredictTimer_
timer for integration computations (prediction step)
Definition: sphereParticles.hpp:81
pFlow::sphereParticles::hearChanges
bool hearChanges(real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
Definition: sphereParticles.hpp:177
systemControl.hpp
pFlow::sphereParticles::~sphereParticles
~sphereParticles() override=default
pFlow::sphereParticles::getParticlesInfoFromShape
bool getParticlesInfoFromShape(const wordVector &shapeNames, uint32Vector &propIds, realVector &diams, realVector &m, realVector &Is, uint32Vector &shIndex)
Definition: sphereParticles.cpp:259
pFlow::sphereParticles::boundingSphereMinMax
void boundingSphereMinMax(real &minDiam, real &maxDiam) const override
Definition: sphereParticles.cpp:645
pFlow::sphereParticles::I
auto & I()
reference to inertia pointField
Definition: sphereParticles.hpp:162
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::sphereParticles::sphereParticles
sphereParticles(systemControl &control, const property &prop)
construct from systemControl and property
Definition: sphereParticles.cpp:308
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::sphereParticles::propertyId
const uint32PointField_D & propertyId() const override
Definition: sphereParticles.hpp:189
pFlow::sphereParticles::spheres
const auto & spheres() const
const reference to shapes object
Definition: sphereParticles.hpp:150
particles.hpp
pFlow::sphereParticles::accelerationTimer_
Timer accelerationTimer_
timer for acceleration computations
Definition: sphereParticles.hpp:78
pFlow::sphereParticles::intCorrectTimer_
Timer intCorrectTimer_
timer for integration computations (correction step)
Definition: sphereParticles.hpp:84
pFlow::sphereParticles::boundarySphereParticles_
boundarySphereParticlesList boundarySphereParticles_
boundaries
Definition: sphereParticles.hpp:72
pFlow
Definition: demGeometry.hpp:27
pFlow::sphereParticles
Class for managing spherical particles.
Definition: sphereParticles.hpp:42
sphereShape.hpp
pFlow::pointField
Definition: pointField.hpp:33
pFlow::anyList
Definition: anyList.hpp:35
pFlow::particles
Definition: particles.hpp:33
pFlow::shape
Definition: shape.hpp:30
pFlow::sphereParticles::fieldUpdateTimer_
Timer fieldUpdateTimer_
Definition: sphereParticles.hpp:86
pFlow::sphereParticles::I
const auto & I() const
const reference to inertia pointField
Definition: sphereParticles.hpp:156
pFlow::Timer
Definition: Timer.hpp:33
pFlow::sphereParticles::shapeTypeName
word shapeTypeName() const override
Definition: sphereParticles.cpp:634
pFlow::sphereParticles::diameter
const realPointField_D & diameter() const override
Definition: sphereParticles.hpp:194
pFlow::sphereParticles::rVelocity
const auto & rVelocity() const
Definition: sphereParticles.hpp:167
pFlow::sphereParticles::iterate
bool iterate() override
iterate particles
Definition: sphereParticles.cpp:537
pFlow::sphereParticles::rVelIntegration
integration & rVelIntegration()
Definition: sphereParticles.hpp:119
pFlow::sphereParticles::rAcceleration
const realx3PointField_D & rAcceleration() const override
Definition: sphereParticles.hpp:221
pFlow::sphereParticles::initializeParticles
bool initializeParticles()
Insert new particles in position with specified shapes.
Definition: sphereParticles.cpp:201
pFlow::sphereParticles::beforeIteration
bool beforeIteration() override
before iteration step
Definition: sphereParticles.cpp:515
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:37
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::sphereParticles::intCorrectTimer
Timer & intCorrectTimer()
Definition: sphereParticles.hpp:114
pFlow::boundarySphereParticlesList
Definition: boundarySphereParticlesList.hpp:13
boundarySphereParticlesList.hpp
pFlow::sphereParticles::rVelIntegration_
uniquePtr< integration > rVelIntegration_
rotational velocity integrator
Definition: sphereParticles.hpp:75
property.hpp
pFlow::demComponent::dt
real dt() const
Time step of integration.
Definition: demComponent.cpp:33
pFlow::sphereParticles::mass_
realPointField_D mass_
mass of particles field
Definition: sphereParticles.hpp:60
pFlow::Vector< word >
m
uint32 m
Definition: NBSLoop.hpp:22
pFlow::sphereParticles::rAcceleration
realx3PointField_D & rAcceleration() override
Definition: sphereParticles.hpp:216
pFlow::sphereParticles::spheres_
ShapeType spheres_
reference to shapes
Definition: sphereParticles.hpp:51
pFlow::sphereParticles::accelerationTimer
Timer & accelerationTimer()
Definition: sphereParticles.hpp:109
indexContainer.hpp
pFlow::sphereParticles::rAcceleration_
realx3PointField_D rAcceleration_
pointField of rotational acceleration of particles on device
Definition: sphereParticles.hpp:69
pFlow::sphereParticles::I_
realPointField_D I_
pointField of inertial of particles
Definition: sphereParticles.hpp:63