# PhasicFlow: src/Particles/SphereParticles/sphereParticles/sphereParticles.hpp Source File

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 "systemControl.hpp"
#include "particles.hpp"
#include "sphereShape.hpp"
#include "property.hpp"
#include "indexContainer.hpp"
namespace pFlow
{
class sphereParticles
:
public particles
{
protected:
const property& property_;
sphereShape& shapes_;
realPointField_D& I_;
realx3PointField_D& rVelocity_;
realx3PointField_D& rAcceleration_;
uniquePtr<integration> rVelIntegration_ = nullptr;
Timer accelerationTimer_;
Timer intPredictTimer_;
Timer intCorrectTimer_;
bool diameterMassInertiaPropId(const word& shName, real& diam, real& mass, real& I, int8& propIdx);
bool initializeParticles();
bool insertSphereParticles(const wordVector& names, const int32IndexContainer& indices);
virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const override;
public:
sphereParticles(systemControl &control, const property& prop);
sphereParticles(const sphereParticles&) = delete;
sphereParticles(sphereParticles&&) = default;
sphereParticles& operator=(const sphereParticles&) = delete;
sphereParticles& operator=(sphereParticles&&) = default;
virtual ~sphereParticles()=default;
bool insertParticles
(
const realx3Vector& position,
const wordVector& shapes,
const setFieldList& setField
) override ;
const auto& shapes()const
{
return shapes_;
}
const auto& I()const
{
return I_;
}
auto& I()
{
return I_;
}
const realx3Vector_D rVelocity()const
{
return rVelocity_;
}
const realVector_D& boundingSphere()const override
{
return this->diameter();
}
word shapeTypeName() const override
{
return "sphere";
}
void boundingSphereMinMax(
real& minDiam,
real& maxDiam )const override
{
shapes_.diameterMinMax(minDiam, maxDiam);
}
bool update(const eventMessage& msg) override;
realx3PointField_D& rAcceleration() override
{
return rAcceleration_;
}
const realx3PointField_D& rAcceleration() const override
{
return rAcceleration_;
}
bool beforeIteration() override;
bool iterate() override;
bool afterIteration() override;
}; //sphereParticles
} // pFlow
#endif //__sphereParticles_hpp__
pFlow::sphereParticles::rAcceleration_
realx3PointField_D & rAcceleration_
pointField of rotational acceleration of particles on device
Definition: sphereParticles.hpp:63
pFlow::particles::mass
const auto & mass() const
Definition: particles.hpp:188
pFlow::sphereParticles::operator=
sphereParticles & operator=(const sphereParticles &)=delete
no copy-assignement
pFlow::sphereParticles::boundingSphere
const realVector_D & boundingSphere() const override
Definition: sphereParticles.hpp:143
pFlow::sphereParticles::shapeTypeName
word shapeTypeName() const override
Definition: sphereParticles.hpp:148
pFlow::sphereParticles::rVelocity
const realx3Vector_D rVelocity() const
Definition: sphereParticles.hpp:138
pFlow::sphereParticles::~sphereParticles
virtual ~sphereParticles()=default
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::eventMessage
Definition: eventMessage.hpp:29
pFlow::sphereShape
Definition: sphereShape.hpp:32
pFlow::demComponent::control
const auto & control() const
Definition: demComponent.hpp:57
pFlow::sphereParticles::diameterMassInertiaPropId
bool diameterMassInertiaPropId(const word &shName, real &diam, real &mass, real &I, int8 &propIdx)
Definition: sphereParticles.cpp:37
pFlow::particles::position
const auto & position() const
Definition: particles.hpp:159
pFlow::sphereParticles::insertSphereParticles
bool insertSphereParticles(const wordVector &names, const int32IndexContainer &indices)
Definition: sphereParticles.cpp:139
pFlow::sphereParticles::intPredictTimer_
Timer intPredictTimer_
timer for integration computations (prediction step)
Definition: sphereParticles.hpp:72
systemControl.hpp
pFlow::sphereParticles::boundingSphereMinMax
void boundingSphereMinMax(real &minDiam, real &maxDiam) const override
Definition: sphereParticles.hpp:153
pFlow::sphereParticles::I
auto & I()
reference to inertia pointField
Definition: sphereParticles.hpp:133
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::sphereParticles::sphereParticles
sphereParticles(systemControl &control, const property &prop)
construct from systemControl and property
Definition: sphereParticles.cpp:219
pFlow::systemControl
Definition: systemControl.hpp:41
particles.hpp
pFlow::sphereParticles::accelerationTimer_
Timer accelerationTimer_
timer for acceleration computations
Definition: sphereParticles.hpp:69
pFlow::sphereParticles::getFieldObjectList
virtual uniquePtr< List< eventObserver * > > getFieldObjectList() const override
Definition: sphereParticles.cpp:26
pFlow::sphereParticles::intCorrectTimer_
Timer intCorrectTimer_
timer for integration computations (correction step)
Definition: sphereParticles.hpp:75
pFlow::sphereParticles::update
bool update(const eventMessage &msg) override
Definition: sphereParticles.cpp:334
pFlow
Definition: demComponent.hpp:28
pFlow::sphereParticles::afterIteration
bool afterIteration() override
after iteration step
Definition: sphereParticles.cpp:133
pFlow::sphereParticles::insertParticles
bool insertParticles(const realx3Vector &position, const wordVector &shapes, const setFieldList &setField) override
Insert new particles in position with specified shapes.
Definition: sphereParticles.cpp:362
pFlow::sphereParticles
Class for managing spherical particles.
Definition: sphereParticles.hpp:44
sphereShape.hpp
pFlow::pointField
Definition: pointField.hpp:35
pFlow::sphereParticles::property_
const property & property_
reference to material properties
Definition: sphereParticles.hpp:51
pFlow::particles
Definition: particles.hpp:33
pFlow::sphereParticles::I_
realPointField_D & I_
pointField of inertial of particles
Definition: sphereParticles.hpp:57
pFlow::sphereParticles::I
const auto & I() const
const reference to inertia pointField
Definition: sphereParticles.hpp:127
pFlow::setFieldList
Definition: setFieldList.hpp:32
pFlow::Timer
Definition: Timer.hpp:39
pFlow::sphereParticles::iterate
bool iterate() override
iterate particles
Definition: sphereParticles.cpp:104
pFlow::VectorSingle
Definition: VectorSingle.hpp:45
pFlow::sphereParticles::rAcceleration
const realx3PointField_D & rAcceleration() const override
Definition: sphereParticles.hpp:168
pFlow::sphereParticles::initializeParticles
bool initializeParticles()
Definition: sphereParticles.cpp:73
pFlow::sphereParticles::beforeIteration
bool beforeIteration() override
before iteration step
Definition: sphereParticles.cpp:84
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:40
pFlow::sphereParticles::shapes_
sphereShape & shapes_
reference to shapes
Definition: sphereParticles.hpp:54
pFlow::particles::diameter
const auto & diameter() const
Definition: particles.hpp:180
pFlow::sphereParticles::rVelocity_
realx3PointField_D & rVelocity_
pointField of rotational Velocity of particles on device
Definition: sphereParticles.hpp:60
pFlow::uniquePtr
Definition: uniquePtr.hpp:44
pFlow::int8
signed char int8
Definition: builtinTypes.hpp:49
pFlow::sphereParticles::rVelIntegration_
uniquePtr< integration > rVelIntegration_
rotational velocity integrator
Definition: sphereParticles.hpp:66
property.hpp
pFlow::Vector< word >
pFlow::sphereParticles::rAcceleration
realx3PointField_D & rAcceleration() override
Definition: sphereParticles.hpp:163
indexContainer.hpp
pFlow::indexContainer< int32 >
pFlow::sphereShape::diameterMinMax
void diameterMinMax(real &minD, real &maxD) const
Definition: sphereShape.hpp:146
pFlow::sphereParticles::shapes
const auto & shapes() const
const reference to shapes object
Definition: sphereParticles.hpp:121