OpenLB 1.7
Loading...
Searching...
No Matches
hertzMindlinDeresiewicz3D.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Marie-Luise Maier, Mathias J. Krause, Sascha Janz
3 * E-mail contact: info@openlb.net
4 * The most recent release of OpenLB can be downloaded at
5 * <http://www.openlb.net/>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public
18 * License along with this program; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23/* Alberto Di Renzo, Francesco Paolo Di Maio:
24 * "Comparison of contact-force models for the simulation of collisions in
25 * DEM-based granular ow codes",
26 * Chemical Engineering Science 59 (2004) 525 - 541
27 */
28
29#ifndef HERTZMINDLINDERESIEWICZ3D_HH
30#define HERTZMINDLINDERESIEWICZ3D_HH
31
32#include "utilities/omath.h"
34
35namespace olb {
36
37template<typename T, template<typename U> class PARTICLETYPE, typename DESCRIPTOR>
39 T G1, T G2, T v1, T v2, T scale1, T scale2, bool validationKruggelEmden) :
40 Force3D<T, PARTICLETYPE>(), _G1(G1), _G2(G2), _v1(v1), _v2(v2), _scale1(
41 scale1), _scale2(scale2), _validationKruggelEmden(validationKruggelEmden)
42{
43 // E-Modul Particle
44 E1 = 2 * (1 + _v1) * _G1;
45 E2 = 2 * (1 + _v2) * _G2;
46
47 // equivalent combined E-Modul
48 eE = (1 - util::pow(_v1, 2)) / E1 + (1 - util::pow(_v2, 2)) / E2;
49 eE = 1 / eE;
50
51 // equivalent combined E-Modul
52 eG = (2.0 - _v1) / _G1 + (2 - _v2) / _G2;
53 eG = 1. / eG;
54}
55
56template<typename T, template<typename U> class PARTICLETYPE, typename DESCRIPTOR>
58 typename std::deque<PARTICLETYPE<T> >::iterator p, int pInt,
60{
61 T force[3] = {T(), T(), T()};
62
63 computeForce(p, pInt, pSys, force);
64}
65
66template<typename T, template<typename U> class PARTICLETYPE, typename DESCRIPTOR>
68 typename std::deque<PARTICLETYPE<T> >::iterator p, int pInt,
69 ParticleSystem3D<T, PARTICLETYPE>& pSys, T force[3])
70{
71
72 std::vector<std::pair<size_t, T>> ret_matches;
73 // kind of contactDetection has to be chosen in application
74 pSys.getContactDetection()->getMatches(pInt, ret_matches);
75
76 PARTICLETYPE<T>* p2 = NULL;
77
78 // iterator walks through number of neighbored particles = ret_matches
79 for (const auto& it : ret_matches) {
80
81 if (!util::nearZero(it.second)) {
82
83 p2 = &pSys[it.first];
84
85 // overlap
86 T delta = (p2->getRad() + p->getRad()) - util::sqrt(it.second);
87
88 // equivalent mass
89 T M = p->getMass() * p2->getMass() / (p->getMass() + p2->getMass());
90 // equivalent radius
91 T R = p->getRad() * p2->getRad() / (p->getRad() + p2->getRad());
92 // relative velocity
93 std::vector < T > _velR(3, T());
94 _velR[0] = -(p2->getVel()[0] - p->getVel()[0]);
95 _velR[1] = -(p2->getVel()[1] - p->getVel()[1]);
96 _velR[2] = -(p2->getVel()[2] - p->getVel()[2]);
97
98 std::vector < T > _d(3, T());
99 std::vector < T > _normal(3, T());
100
101 //_d: vector from particle1 to particle2
102 _d[0] = p2->getPos()[0] - p->getPos()[0];
103 _d[1] = p2->getPos()[1] - p->getPos()[1];
104 _d[2] = p2->getPos()[2] - p->getPos()[2];
105
106 if ( !util::nearZero(util::norm(_d)) ) {
107 _normal = util::normalize(_d);
108 }
109 else {
110 return;
111 }
112
113 Vector<T, 3> d_(_d);
114 Vector<T, 3> velR_(_velR);
115 T dot = velR_[0] * _normal[0] + velR_[1] * _normal[1] + velR_[2] * _normal[2];
116
117 // normal part of relative velocity
118 // normal relative to surface of particles at contact point
119 std::vector < T > _velN(3, T());
120 _velN[0] = dot * _normal[0];
121 _velN[1] = dot * _normal[1];
122 _velN[2] = dot * _normal[2];
123
124 // tangential part of relative velocity
125 // tangential relative to surface of particles at contact point
126 std::vector < T > _velT(3, T());
127 _velT[0] = _velR[0] - _velN[0];
128 _velT[1] = _velR[1] - _velN[1];
129 _velT[2] = _velR[2] - _velN[2];
130
131 if (delta > 0.) {
132
133 // Force normal
134 // spring constant in normal direction
135 // (Alberto Di Renzo, Francesco Paolo Di Maio, Chemical Engineering Science 59 (2004) 525 - 541)
136 // constant kn from H. Kruggel-Endem
137 T kn = 4 / 3. * util::sqrt(R) * eE;
138 if (_validationKruggelEmden) {
139 kn = 7.35e9; // to compare to Kruggel-Emden
140 }
141
142 // part of mechanical force of spring in normal direction
143 // Hertz Contact (P. A. Langston, Powder Technology 85 (1995))
144 std::vector < T > Fs_n(3, T());
145 Fs_n[0] = -kn * util::pow(delta, 1.5) * _normal[0];
146 Fs_n[1] = -kn * util::pow(delta, 1.5) * _normal[1];
147 Fs_n[2] = -kn * util::pow(delta, 1.5) * _normal[2];
148
149 // part of mechanical force of damper in normal direction
150 // damped linear spring (Cundall, Strack 1979)
151 // (K.W. Chu, A.B. Yu, Powder Technology 179 (2008) 104 – 114)
152 // damper constant in normal direction
153 // constant eta_n from H. Kruggel-Endem
154 T eta_n = 0.3 * util::sqrt(4.5 * M * util::sqrt(delta) * kn);
155 if (_validationKruggelEmden) {
156 eta_n = 1.96e5; // to compare to Kruggel-Emden
157 }
158
159 std::vector < T > Fd_n(3, T());
160 Fd_n[0] = -eta_n * _velN[0] * util::sqrt(delta);
161 Fd_n[1] = -eta_n * _velN[1] * util::sqrt(delta);
162 Fd_n[2] = -eta_n * _velN[2] * util::sqrt(delta);
163
164 std::vector < T > F_n(3, T());
165 F_n[0] = Fs_n[0] + Fd_n[0];
166 F_n[1] = Fs_n[1] + Fd_n[1];
167 F_n[2] = Fs_n[2] + Fd_n[2];
168
169 // Force tangential
170 // spring constant in tangential direction
171 // (N.G. Deen, Chemical Engineering Science 62 (2007) 28 - 44)
172 T kt = 2 * util::sqrt(2 * R) * _G1 / (2 - _v1) * util::pow(delta, 0.5);
173
174 // damper constant in normal direction
175 T eta_t = 2 * util::sqrt(2. / 7. * M * kt);
176
177 // part of mechanical force of damper in tangential direction
178 std::vector < T > F_t(3, T());
179 F_t[0] = -eta_t * _velT[0];
180 F_t[1] = -eta_t * _velT[1];
181 F_t[2] = -eta_t * _velT[2];
182
183 // entire force
184 // factor _scale to prevent instability
185 force[0] = _scale1 * F_n[0] + _scale2 * F_t[0];
186 force[1] = _scale1 * F_n[1] + _scale2 * F_t[1];
187 force[2] = _scale1 * F_n[2] + _scale2 * F_t[2];
188
189 p->getForce()[0] += force[0] * 0.5 ;
190 p->getForce()[1] += force[1] * 0.5 ;
191 p->getForce()[2] += force[2] * 0.5 ;
192 p2->getForce()[0] -= force[0] * 0.5 ;
193 p2->getForce()[1] -= force[1] * 0.5 ;
194 p2->getForce()[2] -= force[2] * 0.5 ;
195 }
196 }
197 }
198}
199
200}
201
202#endif
Prototype for all particle forces.
Definition force3D.h:43
HertzMindlinDeresiewicz3D(T G1, T G2, T v1, T v2, T scale1=T(1.), T scale2=T(1.), bool validationKruggelEmden=false)
void computeForce(typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &pSys, T force[3])
void applyForce(typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &pSys) override
ContactDetection< T, PARTICLETYPE > * getContactDetection()
Plain old scalar vector.
Definition vector.h:47
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
T norm(const std::vector< T > &a)
l2 norm of a vector of arbitrary length
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
Vector< T, D > normalize(const Vector< T, D > &a)
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087
Top level namespace for all of OpenLB.