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 
81  bool insertSphereParticles(const wordVector& names, const int32IndexContainer& indices);
82 
83  virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const override;
84 
85 public:
86 
89 
91  sphereParticles(const sphereParticles&) = delete;
92 
94  sphereParticles(sphereParticles&&) = default;
95 
97  sphereParticles& operator=(const sphereParticles&) = delete;
98 
101 
102  virtual ~sphereParticles()=default;
103 
113  bool insertParticles
114  (
115  const realx3Vector& position,
116  const wordVector& shapes,
117  const setFieldList& setField
118  ) override ;
119 
121  const auto& shapes()const
122  {
123  return shapes_;
124  }
125 
127  const auto& I()const
128  {
129  return I_;
130  }
131 
133  auto& I()
134  {
135  return I_;
136  }
137 
138  const realx3Vector_D rVelocity()const
139  {
140  return rVelocity_;
141  }
142 
143  const realVector_D& boundingSphere()const override
144  {
145  return this->diameter();
146  }
147 
148  word shapeTypeName() const override
149  {
150  return "sphere";
151  }
152 
154  real& minDiam,
155  real& maxDiam )const override
156  {
157  shapes_.diameterMinMax(minDiam, maxDiam);
158  }
159 
160  bool update(const eventMessage& msg) override;
161 
162 
164  {
165  return rAcceleration_;
166  }
167 
168  const realx3PointField_D& rAcceleration() const override
169  {
170  return rAcceleration_;
171  }
172 
174  bool beforeIteration() override;
175 
177  bool iterate() override;
178 
180  bool afterIteration() override;
181 
182 
183 
184 }; //sphereParticles
185 
186 } // pFlow
187 
188 #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