Files
phasicFlow/src/Particles/SphereParticles/sphereParticles/sphereParticles.hpp

220 lines
5.0 KiB
C++
Raw Normal View History

2022-09-05 01:56:29 +04:30
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
2022-09-05 01:56:29 +04:30
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
2022-09-05 01:56:29 +04:30
Licence:
This file is part of phasicFlow code. It is a free software for simulating
2022-09-05 01:56:29 +04:30
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
2022-09-05 01:56:29 +04:30
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
/**
2023-06-07 05:40:43 -07:00
* @class pFlow::sphereParticles
*
* @brief Class for managing spherical particles
*
2023-06-07 05:40:43 -07:00
* This is a top-level class that contains the essential components for
* defining spherical prticles in a DEM simulation.
2022-09-05 01:56:29 +04:30
*/
2022-12-10 01:32:54 +03:30
#ifndef __sphereParticles_hpp__
#define __sphereParticles_hpp__
2022-09-05 01:56:29 +04:30
#include "indexContainer.hpp"
2022-12-10 01:32:54 +03:30
#include "particles.hpp"
#include "property.hpp"
#include "sphereShape.hpp"
#include "systemControl.hpp"
2022-09-05 01:56:29 +04:30
namespace pFlow
{
class sphereParticles : public particles
2022-09-05 01:56:29 +04:30
{
public:
using ShapeType = sphereShape;
private:
2022-09-05 01:56:29 +04:30
/// reference to shapes
ShapeType spheres_;
2022-09-05 01:56:29 +04:30
2024-01-26 01:10:10 -08:00
/// property id on device
uint32PointField_D propertyId_;
2024-01-26 01:10:10 -08:00
/// diameter / boundig sphere size of particles on device
realPointField_D diameter_;
2024-01-26 01:10:10 -08:00
/// mass of particles field
realPointField_D mass_;
2024-01-26 01:10:10 -08:00
/// pointField of inertial of particles
realPointField_D I_;
2022-09-05 01:56:29 +04:30
/// pointField of rotational Velocity of particles on device
realx3PointField_D rVelocity_;
2022-09-05 01:56:29 +04:30
/// pointField of rotational acceleration of particles on device
realx3PointField_D rAcceleration_;
2022-09-05 01:56:29 +04:30
/// rotational velocity integrator
uniquePtr<integration> rVelIntegration_ = nullptr;
2022-09-05 01:56:29 +04:30
/// timer for acceleration computations
Timer accelerationTimer_;
2022-09-05 01:56:29 +04:30
/// timer for integration computations (prediction step)
Timer intPredictTimer_;
2022-09-05 01:56:29 +04:30
/// timer for integration computations (correction step)
Timer intCorrectTimer_;
2022-09-05 01:56:29 +04:30
Timer fieldUpdateTimer_;
2022-09-05 01:56:29 +04:30
private:
bool initializeParticles();
bool getParticlesInfoFromShape(
const wordVector& shapeNames,
uint32Vector& propIds,
realVector& diams,
realVector& m,
realVector& Is,
uint32Vector& shIndex
);
/*bool initializeParticles();
2022-09-05 01:56:29 +04:30
bool insertSphereParticles(
const wordVector& names,
const int32IndexContainer& indices,
bool setId = true);
2022-09-05 01:56:29 +04:30
virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const override;
*/
2022-09-05 01:56:29 +04:30
public:
/// construct from systemControl and property
sphereParticles(systemControl& control, const property& prop);
2022-09-05 01:56:29 +04:30
~sphereParticles() override = default;
2022-09-05 01:56:29 +04:30
/**
* Insert new particles in position with specified shapes
*
* This function is involked by inserted object to insert new set of
* particles into the simulation. \param position position of new particles
2022-09-05 01:56:29 +04:30
* \param shape shape of new particles
* \param setField initial value of the selected fields for new particles
*/
/*bool insertParticles
2022-09-05 01:56:29 +04:30
(
const realx3Vector& position,
const wordVector& shapes,
const setFieldList& setField
) override ;*/
2022-09-05 01:56:29 +04:30
/// const reference to shapes object
const auto& spheres() const
2022-09-05 01:56:29 +04:30
{
return spheres_;
2022-09-05 01:56:29 +04:30
}
/// const reference to inertia pointField
const auto& I() const
2022-09-05 01:56:29 +04:30
{
return I_;
}
/// reference to inertia pointField
2022-09-05 01:56:29 +04:30
auto& I()
{
return I_;
}
const auto& rVelocity() const
{
2022-09-05 01:56:29 +04:30
return rVelocity_;
}
auto& rVelocity()
{
return rVelocity_;
2022-09-05 01:56:29 +04:30
}
bool hearChanges(
real t,
real dt,
uint32 iter,
const message& msg,
const anyList& varList
) override
2022-09-05 01:56:29 +04:30
{
notImplementedFunction;
return false;
2022-09-05 01:56:29 +04:30
}
2024-01-26 01:10:10 -08:00
const uint32PointField_D& propertyId() const override
2024-01-26 01:10:10 -08:00
{
return propertyId_;
}
const realPointField_D& diameter() const override
2024-01-26 01:10:10 -08:00
{
return diameter_;
}
const realPointField_D& mass() const override
2024-01-26 01:10:10 -08:00
{
return mass_;
}
/// before iteration step
bool beforeIteration() override;
2022-09-05 01:56:29 +04:30
/// iterate particles
bool iterate() override;
bool insertParticles(
const realx3Vector& position,
const wordVector& shapesNames,
const anyList& setVarList
) override;
2022-09-05 01:56:29 +04:30
realx3PointField_D& rAcceleration() override
{
return rAcceleration_;
}
2022-09-05 01:56:29 +04:30
const realx3PointField_D& rAcceleration() const override
{
return rAcceleration_;
}
const realPointField_D& boundingSphere() const override
{
return diameter();
}
2022-09-05 01:56:29 +04:30
word shapeTypeName() const override;
2024-01-26 01:10:10 -08:00
const shape& getShapes() const override;
void boundingSphereMinMax(real& minDiam, real& maxDiam) const override;
}; // sphereParticles
2022-09-05 01:56:29 +04:30
} // pFlow
2022-12-10 01:32:54 +03:30
#endif //__sphereParticles_hpp__