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 -----------------------------------------------------------------------------*/
20 
30 #ifndef __sphereParticles_hpp__
31 #define __sphereParticles_hpp__
32 
33 #include "systemControl.hpp"
34 #include "particles.hpp"
35 #include "sphereShape.hpp"
36 #include "property.hpp"
37 #include "indexContainer.hpp"
38 
39 
40 
41 namespace pFlow
42 {
43 
45 :
46  public particles
47 {
48 protected:
49 
51  const property& property_;
52 
55 
58 
61 
64 
67 
70 
73 
76 
77  bool diameterMassInertiaPropId(const word& shName, real& diam, real& mass, real& I, int8& propIdx);
78 
79  bool initializeParticles();
80 
82  const wordVector& names,
83  const int32IndexContainer& indices,
84  bool setId = true);
85 
86  virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const override;
87 
88 public:
89 
92 
94  sphereParticles(const sphereParticles&) = delete;
95 
97  sphereParticles(sphereParticles&&) = default;
98 
100  sphereParticles& operator=(const sphereParticles&) = delete;
101 
104 
105  virtual ~sphereParticles()=default;
106 
116  bool insertParticles
117  (
118  const realx3Vector& position,
119  const wordVector& shapes,
120  const setFieldList& setField
121  ) override ;
122 
124  const auto& shapes()const
125  {
126  return shapes_;
127  }
128 
130  const auto& I()const
131  {
132  return I_;
133  }
134 
136  auto& I()
137  {
138  return I_;
139  }
140 
141  const realx3Vector_D rVelocity()const
142  {
143  return rVelocity_;
144  }
145 
146  const realVector_D& boundingSphere()const override
147  {
148  return this->diameter();
149  }
150 
151  word shapeTypeName() const override
152  {
153  return "sphere";
154  }
155 
157  real& minDiam,
158  real& maxDiam )const override
159  {
160  shapes_.diameterMinMax(minDiam, maxDiam);
161  }
162 
163  bool update(const eventMessage& msg) override;
164 
165 
167  {
168  return rAcceleration_;
169  }
170 
171  const realx3PointField_D& rAcceleration() const override
172  {
173  return rAcceleration_;
174  }
175 
177  bool beforeIteration() override;
178 
180  bool iterate() override;
181 
183  bool afterIteration() override;
184 
185 
186 
187 }; //sphereParticles
188 
189 } // pFlow
190 
191 #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:146
pFlow::sphereParticles::shapeTypeName
word shapeTypeName() const override
Definition: sphereParticles.hpp:151
pFlow::sphereParticles::rVelocity
const realx3Vector_D rVelocity() const
Definition: sphereParticles.hpp:141
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::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:156
pFlow::sphereParticles::I
auto & I()
reference to inertia pointField
Definition: sphereParticles.hpp:136
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:225
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:340
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:368
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:130
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::sphereParticles::insertSphereParticles
bool insertSphereParticles(const wordVector &names, const int32IndexContainer &indices, bool setId=true)
Definition: sphereParticles.cpp:139
pFlow::VectorSingle
Definition: VectorSingle.hpp:47
pFlow::sphereParticles::rAcceleration
const realx3PointField_D & rAcceleration() const override
Definition: sphereParticles.hpp:171
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:166
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:124