Funnel.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef FUNNEL_H
27 #define FUNNEL_H
28 #include "Chute.h"
29 
37 
38 class Funnel : public Chute {
39  public:
40 
43 
45  //Funnel(MD& other) : MD(other), Mercury3D(other), Chute() {constructor();}
46  //Funnel(HGRID_base& other) : MD(other), Mercury3D(other), Chute() {constructor();}
47  //Funnel(Mercury3D& other) : MD(other), Mercury3D(other), Chute() {constructor();}
48 
50  void write(std::ostream& os, bool writeAllParticles = false) const override;
51 
53  void read(std::istream& is, ReadOptions opt = ReadOptions::ReadAll) override;
54 
56  void constructor();
57 
59  void cleanChute();
60 
62  void set_funnz(double funnz_){funnz=funnz_;}
63 
65  double get_funnz() const {return funnz;}
66 
68  void set_funfr(double funfr_){
69  if (funfr_ < 0.0 || funfr_ > 1.0)
70  {
71  logger(WARN, "Filling Ratio is below 0 or above 1, default value of 0.33 is used!");
72  }
73  else
74  {
75  funfr = funfr_;
76  }
77  }
78 
80  double get_funfr() const {return funfr;}
81 
83  double get_funr(){return funr;}
84 
86  void set_funO(double x, double y){funO[0]=x; funO[1]=y;}
87  void set_funO(double* x){funO[0]=x[0]; funO[1]=x[1];}
88 
90  const double* get_funO() const {return funO;}
91 
92  double get_funOx() const {return funO[0];}
93 
94  double get_funOy() const {return funO[1];}
95 
96  double get_fundiag() const {return fundiag;}
97 
98  double get_funrmax() const {return funrmax;}
99 
101  void set_funa(double funa_){funa=funa_*constants::pi/180;}
102 
104  double get_funa() const {return funa;}
105 
107  double get_funH() const {return funH;}
108 
110  void set_funHf(double funHf_){funHf=funHf_;}
111 
113  double get_funHf() const {return funHf;}
114 
116  void set_funD(double funD_){funD=funD_;}
117 
119  double get_funD() const {return funD;}
120 
121  void setName_();
122 
123 protected:
125 
127  void set_funH(double funH_){funH=funH_;}
128 
129  void set_funrmax(double funrmax_){funrmax=funrmax_;}
130 
131  void set_fundiag(double fundiag_){fundiag=fundiag_;}
132 
134  void set_funr(double funr_){funr=funr_;}
135 
137  virtual void setupInitialConditions() override;
138 
140  virtual void create_inflow_particle();
141 
143  virtual void create_funnel();
144 
146  virtual void update_funnel();
147 
149  virtual void check_funnel();
150 
152  virtual void create_walls();
153 
154  virtual bool readNextArgument(int& i, int argc, char *argv[]) override;
155 
156  double funr; // Funnel radius.
157  double funO[2]; // Origin of the funnel is the (x,y) location of the center of the top of the funnel.
158  double funa; // Angle of the funnel
159  double funH; // Heigth of the funnel
160  double funHf; // Falling heigth
161  double funD; // Funnel diameter at the downside of the funnel.
162  double funnz; //Number of particles along the heigth of the funnel
163  double funfr; // Filling ratio of the funnel
164  double fundiag; //The diagonal of the filling region
165  double funrmax; //The maximum range for r
166 
167 };
168 #endif
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ WARN
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
ReadOptions
Definition: DPMBase.h:254
Definition: Funnel.h:38
double get_funD() const
Get minimum funnel diameter:
Definition: Funnel.h:119
void set_funrmax(double funrmax_)
Definition: Funnel.h:129
void cleanChute()
Here we define the outflow.
Definition: Funnel.cc:346
double funr
Definition: Funnel.h:156
double get_funH() const
Get funnel Heigth:
Definition: Funnel.h:107
double funO[2]
Definition: Funnel.h:157
double get_funOx() const
Definition: Funnel.h:92
virtual void create_inflow_particle()
Sets variable values for particles that are created at the inflow.
Definition: Funnel.cc:94
const double * get_funO() const
Get funnel origin of the funnel:
Definition: Funnel.h:90
double get_funa() const
Get funnel angle:
Definition: Funnel.h:104
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
This function reads all funnel data.
Definition: Funnel.cc:80
double funD
Definition: Funnel.h:161
double funHf
Definition: Funnel.h:160
virtual void create_funnel()
Create the funnel.
Definition: Funnel.cc:159
double funnz
Definition: Funnel.h:162
virtual void setupInitialConditions() override
initialise particle position, velocity, radius
Definition: Funnel.cc:137
double get_fundiag() const
Definition: Funnel.h:96
void set_funH(double funH_)
Set funnel Heigth:
Definition: Funnel.h:127
double funa
Definition: Funnel.h:158
double fundiag
Definition: Funnel.h:164
virtual void update_funnel()
Updates the parameters for the funnel;.
Definition: Funnel.cc:262
double get_funOy() const
Definition: Funnel.h:94
void set_fundiag(double fundiag_)
Definition: Funnel.h:131
double funfr
Definition: Funnel.h:163
double get_funr()
Get funnel radius:
Definition: Funnel.h:83
void set_funa(double funa_)
Set funnel angle:
Definition: Funnel.h:101
double get_funrmax() const
Definition: Funnel.h:98
virtual void check_funnel()
Check the funnel parameters.
Definition: Funnel.cc:279
void set_funO(double x, double y)
Set funnel origin of the funnel:
Definition: Funnel.h:86
double funH
Definition: Funnel.h:159
virtual bool readNextArgument(int &i, int argc, char *argv[]) override
Interprets the i^th command-line argument.
Definition: Funnel.cc:373
void set_funr(double funr_)
Set funnel radius:
Definition: Funnel.h:134
double get_funnz() const
Get the funnel number of particles along the funnel heigth:
Definition: Funnel.h:65
void setName_()
Definition: Funnel.cc:424
virtual void create_walls()
Create or update the walls.
Definition: Funnel.cc:317
double funrmax
Definition: Funnel.h:165
void set_funD(double funD_)
Set minimum funnel diameter:
Definition: Funnel.h:116
Funnel()
This is the default constructor. All it does is set sensible defaults.
Definition: Funnel.h:42
double get_funHf() const
Get falling heigth:
Definition: Funnel.h:113
void set_funfr(double funfr_)
Set the filling ratio.
Definition: Funnel.h:68
void set_funHf(double funHf_)
Set falling heigth:
Definition: Funnel.h:110
void set_funO(double *x)
Definition: Funnel.h:87
SphericalParticle inflowParticle_
Definition: Funnel.h:124
void write(std::ostream &os, bool writeAllParticles=false) const override
This function prints all funnel data in human readable format.
Definition: Funnel.cc:45
void constructor()
This is the actual constructor.
Definition: Funnel.cc:32
void set_funnz(double funnz_)
Set funnel number of particles along the funnel heigth:
Definition: Funnel.h:62
double get_funfr() const
Get the filling ratio.
Definition: Funnel.h:80
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
const Mdouble pi
Definition: ExtendedMath.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51