www.cemf.ir
grainParticles.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 __grainParticles_hpp__
30 #define __grainParticles_hpp__
31 
32 #include "indexContainer.hpp"
33 #include "particles.hpp"
34 #include "property.hpp"
35 #include "grainShape.hpp"
37 #include "systemControl.hpp"
38 
39 namespace pFlow
40 {
41 
42 class grainParticles : public particles
43 {
44 public:
45 
47 
48 private:
49 
52 
55 
58 
60 
61 
64 
67 
70 
73 
76 
79 
82 
85 
88 
90 
91 private:
92 
93 
95  const wordVector& shapeNames,
96  uint32Vector& propIds,
97  realVector& diams,
98  realVector& coarseGrainFactors,
99  realVector& m,
100  realVector& Is,
101  uint32Vector& shIndex
102  );
103 
104 protected:
105 
107  {
108  return accelerationTimer_;
109  }
110 
112  {
113  return intCorrectTimer_;
114  }
115 
117  {
118  return rVelIntegration_();
119  }
120 
121 public:
122 
125 
126  ~grainParticles() override = default;
127 
136  /*bool insertParticles
137  (
138  const realx3Vector& position,
139  const wordVector& shapes,
140  const setFieldList& setField
141  ) override ;*/
142 
143  // TODO: make this method private later
144  bool initializeParticles();
145 
147  const auto& grains() const
148  {
149  return grains_;
150  }
151 
153  const auto& I() const
154  {
155  return I_;
156  }
157 
159  auto& I()
160  {
161  return I_;
162  }
163 
164  const auto& rVelocity() const
165  {
166  return rVelocity_;
167  }
168 
169  auto& rVelocity()
170  {
171  return rVelocity_;
172  }
173 
175  real t,
176  real dt,
177  uint32 iter,
178  const message& msg,
179  const anyList& varList
180  ) override
181  {
183  return false;
184  }
185 
186  const uint32PointField_D& propertyId() const override
187  {
188  return propertyId_;
189  }
190 
191  const realPointField_D& diameter() const override
192  {
193  return grainDiameter_;
194  }
195 
197  {
198  return grainDiameter_;
199  }
200 
202  {
203  return coarseGrainFactor_;
204  }
205 
206 
207  const realPointField_D& mass() const override
208  {
209  return mass_;
210  }
211 
213  bool beforeIteration() override;
214 
216  bool iterate() override;
217 
218  bool insertParticles(
219  const realx3Vector& position,
220  const wordVector& shapesNames,
221  const anyList& setVarList
222  ) override;
223 
225  {
226  return rAcceleration_;
227  }
228 
229  const realx3PointField_D& rAcceleration() const override
230  {
231  return rAcceleration_;
232  }
233 
234  const realPointField_D& boundingSphere() const override
235  {
236  return diameter();
237  }
238 
239  word shapeTypeName() const override;
240 
241  const shape& getShapes() const override;
242 
243  void boundingSphereMinMax(real& minDiam, real& maxDiam) const override;
244 
245 };// grainParticles
246 
247 } // pFlow
248 
249 #endif //__sphereParticles_hpp__
pFlow::grainParticles::mass_
realPointField_D mass_
mass of particles field
Definition: grainParticles.hpp:63
notImplementedFunction
#define notImplementedFunction
Report that a function is yet not implemented.
Definition: error.hpp:84
pFlow::grainParticles::rVelocity_
realx3PointField_D rVelocity_
pointField of rotational Velocity of particles on device
Definition: grainParticles.hpp:69
pFlow::grainParticles::~grainParticles
~grainParticles() override=default
pFlow::grainParticles::grains_
ShapeType grains_
reference to shapes
Definition: grainParticles.hpp:51
pFlow::grainParticles::insertParticles
bool insertParticles(const realx3Vector &position, const wordVector &shapesNames, const anyList &setVarList) override
Definition: grainParticles.cpp:345
pFlow::message
Definition: message.hpp:33
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::grainParticles::intPredictTimer_
Timer intPredictTimer_
timer for integration computations (prediction step)
Definition: grainParticles.hpp:84
pFlow::grainParticles::getShapes
const shape & getShapes() const override
Definition: grainParticles.cpp:409
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::boundaryGrainParticlesList
Definition: boundaryGrainParticlesList.hpp:13
pFlow::integration
Base class for integrating the first order ODE (IVP)
Definition: integration.hpp:51
systemControl.hpp
pFlow::grainParticles::grainDiameter_
realPointField_D grainDiameter_
diameter / boundig sphere size of particles on device
Definition: grainParticles.hpp:57
pFlow::grainParticles::propertyId_
uint32PointField_D propertyId_
property id on device
Definition: grainParticles.hpp:54
pFlow::grainParticles
Definition: grainParticles.hpp:42
pFlow::grainParticles::shapeTypeName
word shapeTypeName() const override
Definition: grainParticles.cpp:404
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::grainParticles::intCorrectTimer_
Timer intCorrectTimer_
timer for integration computations (correction step)
Definition: grainParticles.hpp:87
pFlow::grainParticles::iterate
bool iterate() override
iterate particles
Definition: grainParticles.cpp:301
particles.hpp
pFlow::grainParticles::diameter
const realPointField_D & diameter() const override
Definition: grainParticles.hpp:191
pFlow::grainParticles::I
const auto & I() const
const reference to inertia pointField
Definition: grainParticles.hpp:153
pFlow::grainParticles::getParticlesInfoFromShape
bool getParticlesInfoFromShape(const wordVector &shapeNames, uint32Vector &propIds, realVector &diams, realVector &coarseGrainFactors, realVector &m, realVector &Is, uint32Vector &shIndex)
Definition: grainParticles.cpp:88
pFlow::grainParticles::initializeParticles
bool initializeParticles()
Insert new particles in position with specified shapes.
Definition: grainParticles.cpp:26
pFlow::grainParticles::fieldUpdateTimer_
Timer fieldUpdateTimer_
Definition: grainParticles.hpp:89
pFlow
Definition: demGeometry.hpp:27
pFlow::grainParticles::propertyId
const uint32PointField_D & propertyId() const override
Definition: grainParticles.hpp:186
pFlow::grainParticles::grains
const auto & grains() const
const reference to shapes object
Definition: grainParticles.hpp:147
pFlow::grainParticles::hearChanges
bool hearChanges(real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
Definition: grainParticles.hpp:174
pFlow::grainParticles::boundingSphere
const realPointField_D & boundingSphere() const override
Definition: grainParticles.hpp:234
pFlow::grainParticles::mass
const realPointField_D & mass() const override
Definition: grainParticles.hpp:207
pFlow::grainParticles::I
auto & I()
reference to inertia pointField
Definition: grainParticles.hpp:159
pFlow::pointField
Definition: pointField.hpp:33
pFlow::grainParticles::I_
realPointField_D I_
pointField of inertial of particles
Definition: grainParticles.hpp:66
pFlow::grainParticles::rVelIntegration
integration & rVelIntegration()
Definition: grainParticles.hpp:116
pFlow::anyList
Definition: anyList.hpp:35
pFlow::grainParticles::boundingSphereMinMax
void boundingSphereMinMax(real &minDiam, real &maxDiam) const override
Definition: grainParticles.cpp:415
pFlow::grainParticles::rAcceleration_
realx3PointField_D rAcceleration_
pointField of rotational acceleration of particles on device
Definition: grainParticles.hpp:72
pFlow::particles
Definition: particles.hpp:33
grainShape.hpp
pFlow::shape
Definition: shape.hpp:30
pFlow::Timer
Definition: Timer.hpp:33
pFlow::grainParticles::beforeIteration
bool beforeIteration() override
before iteration step
Definition: grainParticles.cpp:278
pFlow::grainParticles::rVelIntegration_
uniquePtr< integration > rVelIntegration_
rotational velocity integrator
Definition: grainParticles.hpp:78
pFlow::grainParticles::rAcceleration
const realx3PointField_D & rAcceleration() const override
Definition: grainParticles.hpp:229
pFlow::grainParticles::accelerationTimer_
Timer accelerationTimer_
timer for acceleration computations
Definition: grainParticles.hpp:81
boundaryGrainParticlesList.hpp
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:37
pFlow::grainParticles::coarseGrainFactor_
realPointField_D coarseGrainFactor_
Definition: grainParticles.hpp:59
pFlow::grainParticles::coarseGrainFactor
const realPointField_D & coarseGrainFactor() const
Definition: grainParticles.hpp:201
pFlow::grainParticles::rVelocity
const auto & rVelocity() const
Definition: grainParticles.hpp:164
pFlow::grainParticles::grainParticles
grainParticles(systemControl &control, const property &prop)
construct from systemControl and property
Definition: grainParticles.cpp:143
pFlow::grainParticles::rAcceleration
realx3PointField_D & rAcceleration() override
Definition: grainParticles.hpp:224
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::grainShape
Definition: grainShape.hpp:29
pFlow::grainParticles::grainDiameter
const realPointField_D & grainDiameter() const
Definition: grainParticles.hpp:196
property.hpp
pFlow::grainParticles::intCorrectTimer
Timer & intCorrectTimer()
Definition: grainParticles.hpp:111
pFlow::grainParticles::rVelocity
auto & rVelocity()
Definition: grainParticles.hpp:169
pFlow::grainParticles::boundaryGrainParticles_
boundaryGrainParticlesList boundaryGrainParticles_
boundaries
Definition: grainParticles.hpp:75
pFlow::demComponent::dt
real dt() const
Time step of integration.
Definition: demComponent.cpp:33
pFlow::grainParticles::accelerationTimer
Timer & accelerationTimer()
Definition: grainParticles.hpp:106
pFlow::Vector< word >
m
uint32 m
Definition: NBSLoop.hpp:22
indexContainer.hpp