www.cemf.ir
sphereParticles.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
29 #ifndef __sphereParticles_hpp__
30 #define __sphereParticles_hpp__
31 
32 #include "indexContainer.hpp"
33 #include "particles.hpp"
34 #include "property.hpp"
35 #include "sphereShape.hpp"
37 #include "systemControl.hpp"
38 
39 namespace pFlow
40 {
41 
42 class sphereParticles : public particles
43 {
44 public:
45 
47 
48 private:
49 
52 
55 
58 
61 
64 
67 
70 
73 
76 
79 
82 
85 
87 
88 private:
89 
90 
92  const wordVector& shapeNames,
93  uint32Vector& propIds,
94  realVector& diams,
95  realVector& m,
96  realVector& Is,
97  uint32Vector& shIndex
98  );
99  /*bool initializeParticles();
100 
101  bool insertSphereParticles(
102  const wordVector& names,
103  const int32IndexContainer& indices,
104  bool setId = true);
105 
106  virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const override;
107  */
108 protected:
110  {
111  return accelerationTimer_;
112  }
113 
115  {
116  return intCorrectTimer_;
117  }
118 
120  {
121  return rVelIntegration_();
122  }
123 
124 public:
125 
128 
129  ~sphereParticles() override = default;
130 
139  /*bool insertParticles
140  (
141  const realx3Vector& position,
142  const wordVector& shapes,
143  const setFieldList& setField
144  ) override ;*/
145 
146  // TODO: make this method private later
147  bool initializeParticles();
148 
150  const auto& spheres() const
151  {
152  return spheres_;
153  }
154 
156  const auto& I() const
157  {
158  return I_;
159  }
160 
162  auto& I()
163  {
164  return I_;
165  }
166 
167  const auto& rVelocity() const
168  {
169  return rVelocity_;
170  }
171 
172  auto& rVelocity()
173  {
174  return rVelocity_;
175  }
176 
178  real t,
179  real dt,
180  uint32 iter,
181  const message& msg,
182  const anyList& varList
183  ) override
184  {
186  return false;
187  }
188 
189  const uint32PointField_D& propertyId() const override
190  {
191  return propertyId_;
192  }
193 
194  const realPointField_D& diameter() const override
195  {
196  return diameter_;
197  }
198 
199  const realPointField_D& mass() const override
200  {
201  return mass_;
202  }
203 
205  bool beforeIteration() override;
206 
208  bool iterate() override;
209 
210  bool insertParticles(
211  const realx3Vector& position,
212  const wordVector& shapesNames,
213  const anyList& setVarList
214  ) override;
215 
217  {
218  return rAcceleration_;
219  }
220 
221  const realx3PointField_D& rAcceleration() const override
222  {
223  return rAcceleration_;
224  }
225 
226  const realPointField_D& boundingSphere() const override
227  {
228  return diameter();
229  }
230 
231  word shapeTypeName() const override;
232 
233  const shape& getShapes() const override;
234 
235  void boundingSphereMinMax(real& minDiam, real& maxDiam) const override;
236 
237 }; // sphereParticles
238 
239 } // pFlow
240 
241 #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