GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
SinterNeck.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 //
14 // Copyright (C) 2008-2019 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff
15 //
16 // This program is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29 
30 #ifndef _libDEM_SinterNeck_hpp_
31 #define _libDEM_SinterNeck_hpp_
32 
33 #include <string>
34 #include <vector>
35 
36 
37 
38 
39 #include "GranOO3/DEM/Bond.hpp"
40 #include "GranOO3/DEM/Element.hpp"
41 #include "GranOO3/Core/SetOf.hpp"
42 
43 
44 #include "GranOO3/Geom/Point.hpp"
45 
46 namespace GranOO3
47 {
48  namespace DEM
49  {
50 
51 
52  class SinterNeck : public Bond,
53  public Core::Register< SinterNeck >,
55  {
56 
57  GRANOO_CLASS(DEM::SinterNeck, Bond);
58 
59  public:
60  //CONSTRUCTORS & DESTRUCTORS
61  SinterNeck(Element& el1, Element& el2);
62  virtual ~SinterNeck();
63 
64  //USEFULL
65 
66  virtual double get_linear_stiffness() const;
67  virtual double get_angular_stiffness() const;
68  virtual double compute_critical_time_step() const;
69  virtual void draw();
70  virtual std::string info() const;
71 
72  // COMMON METHOD
73  void init_all() ; // initialize all parameters
74  void update_T() ; // update temperature
75  void update_n() ; // update normal vector
76  void update_r() ; // update equivalent radius
77  void update_h() ; // update neck thickness
78  void update_vn() ; // update normal relative velocity
79  void update_a() ; // update neck radius (only AFTER computing reaction forces !)
80  virtual void update_delta_b() = 0; // update effective grain boundary diffusion coef
81  void force_neck_radius_to_zero(); // force a to be null
82 
83  //ACCESSORS
84  GRANOO_ACCESS(T , double, _T ); // temperature
85  GRANOO_ACCESS(a , double, _a ); // neck radius
86  GRANOO_ACCESS(a0 , double, _a0 ); // initial neck radius
87  GRANOO_ACCESS(h , double, _h ); // neck thickness
88  GRANOO_ACCESS(h0 , double, _h0 ); // initial neck thickness
89  GRANOO_ACCESS(r , double, _r ); // equivalent radius
90  GRANOO_ACCESS(gamma_s, double, _gamma_s ); // surface energy
91  GRANOO_ACCESS(omega , double, _omega ); // atomic volume
92  GRANOO_ACCESS(delta_b, double, _delta_b ); // effective grain boundary diffusion coef
93  GRANOO_ACCESS(vn , double, _vn ); // normal relative velocity
94  GRANOO_ACCESS_GET(k , double, k ); // boltzmann constant
95  GRANOO_ACCESS_GET(R , double, R ); // gas constant
96  GRANOO_ACCESS(Fnv , double, _Fnv ); // normal viscous force (repulsive)
97  GRANOO_ACCESS(Fna , double, _Fna ); // normal sintering force (attractive)
98  GRANOO_ACCESS(n, Geom::Vector, _n ); // normal direction
99 
100  private:
101  SinterNeck() = delete;
102  SinterNeck(const SinterNeck& frame) = delete;
103  SinterNeck & operator=(const SinterNeck &) = delete;
104 
105  private:
106  //SERIALIZATION
108  template<class Archive> void save(Archive&, const unsigned int ) const;
109  template<class Archive> void load(Archive&, const unsigned int);
111 
112  protected:
114  double _T = 0.; // current temperature
115 
117  double _a = 0.; // neck radius (a_s: Martin, a: Rojek)
118  double _a0 = 0.; // initial neck radius (new)
119  double _h = 0.; // neck thickness (h : Martin, δ: Rojek)
120  double _r = 0.; // equivalent radius (R* : Martin, \bar{r}: Rojek)
121  double _h0 = 0.; // initial neck thickness (new)
122 
124  double _vn = 0.; // normal relative velocity (dh/dt: Martin, v_rn: Rojek)
125 
127  double _gamma_s = 1.72 ; // surface energy (𝛾s: Martin, 𝛾s: Rojek)
128  double _omega = 1.18e-29; // atomic volume ( Ω: Martin, Ω: Rojek)
129 
131  double _delta_b = 0.; // effective grain boundary diffusion coef (Δb : Martin, Db: Rojek)
132 
134  const double k = 1.3806503e-23; // boltzmann constant
135  const double R = 8.314; // gas constant
136 
138  double _Fnv = 0.; // normal viscous force (repulsive)
139  double _Fna = 0.; // normal sintering force (attractive)
140 
142  Geom::Vector _n = Geom::Vector(0.,0.,0.); // normal direction
143 
144  };
145 
146 
147  template<class Archive> void
148  SinterNeck::save(Archive& ar, const unsigned int v) const {
149  ar << boost::serialization::base_object<Bond>(*this);
150  ar << _T;
151 
152  ar << _a;
153  if (v >= 1)
154  ar << _a0;
155 
156  ar << _h;
157  if (v >= 1)
158  ar << _h0;
159 
160  ar << _r;
161  ar << _gamma_s;
162  ar << _omega;
163  ar << _delta_b;
164  ar << _vn;
165  ar << _Fnv;
166  ar << _Fna;
167  }
168 
169  template<class Archive> void
170  SinterNeck::load(Archive& ar, const unsigned int v) {
171  ar >> boost::serialization::base_object<Bond>(*this);
172  ar >> _T;
173 
174  ar >> _a;
175  if (v >= 1)
176  ar >> _a0;
177 
178  ar >> _h;
179  if (v >= 1)
180  ar >> _h0;
181 
182  ar >> _r;
183  ar >> _gamma_s;
184  ar >> _omega;
185  ar >> _delta_b;
186  ar >> _vn;
187  ar >> _Fnv;
188  ar >> _Fna;
189  }
190 
191  inline void
193 #ifndef SERVER
194  Bond::draw();
195 #endif
196  }
197 
198  }
199 }
200 
201 
202 #include <boost/serialization/version.hpp>
204 
205 
206 namespace GranOO3
207 {
208  GRANOO_CLASS_DECLARE_TPL(DEM::SinterNeck);
209 }
210 
211 
212 #endif
213 
214 
BOOST_CLASS_VERSION(GranOO3::DEM::SinterNeck, 1) namespace GranOO3
Definition: SinterNeck.hpp:203
Definition: SetOf.hpp:346
the base class for all bonds between discrete elements.
Definition: Bond.hpp:49
virtual void draw()
OpenGL draw of the bond
Definition: Bond.cpp:428
a base class that represents an element
Definition: Element.hpp:55
Definition: SinterNeck.hpp:55
virtual void update_delta_b()=0
double _h
Definition: SinterNeck.hpp:119
void force_neck_radius_to_zero()
Definition: SinterNeck.cpp:89
virtual void draw()
OpenGL draw of the bond
Definition: SinterNeck.hpp:192
void init_all()
Definition: SinterNeck.cpp:73
const double R
Definition: SinterNeck.hpp:135
SinterNeck(const SinterNeck &frame)=delete
virtual ~SinterNeck()
Definition: SinterNeck.cpp:69
double _omega
Definition: SinterNeck.hpp:128
double _a0
Definition: SinterNeck.hpp:118
double _r
Definition: SinterNeck.hpp:120
void update_h()
Definition: SinterNeck.cpp:119
double _a
Definition: SinterNeck.hpp:117
void update_r()
Definition: SinterNeck.cpp:111
double _gamma_s
Definition: SinterNeck.hpp:127
virtual double compute_critical_time_step() const
a pure virtual method able to return the critical time step value
Definition: SinterNeck.cpp:155
void update_a()
Definition: SinterNeck.cpp:135
double _h0
Definition: SinterNeck.hpp:121
virtual double get_linear_stiffness() const
compute the linear stiffness of the bond
Definition: SinterNeck.cpp:142
double _Fnv
Definition: SinterNeck.hpp:138
void save(Archive &, const unsigned int) const
Definition: SinterNeck.hpp:148
const double k
Definition: SinterNeck.hpp:134
void update_T()
Definition: SinterNeck.cpp:96
double _vn
Definition: SinterNeck.hpp:124
double _T
Definition: SinterNeck.hpp:114
virtual std::string info() const
Display some useful info in the terminal
Definition: SinterNeck.cpp:177
double _Fna
Definition: SinterNeck.hpp:139
void update_vn()
Definition: SinterNeck.cpp:128
friend class boost::serialization::access
Definition: SinterNeck.hpp:107
SinterNeck & operator=(const SinterNeck &)=delete
void update_n()
Definition: SinterNeck.cpp:105
virtual double get_angular_stiffness() const
similar as get_linear_stiffness() for rotation
Definition: SinterNeck.cpp:148
SinterNeck(Element &el1, Element &el2)
double _delta_b
Definition: SinterNeck.hpp:131
void load(Archive &, const unsigned int)
Definition: SinterNeck.hpp:170
Geom::Vector _n
Definition: SinterNeck.hpp:142
Definition: Vector.hpp:75
pure virtual class for modeling classes able to compute a critical time step
Definition: CriticalTimeStep.hpp:50
Definition: Common.hpp:198