OpenLB 1.7
Loading...
Searching...
No Matches
dragModels3D.hh
Go to the documentation of this file.
1/* Lattice Boltzmann sample, written in C++, using the OpenLB
2 * library
3 *
4 * Copyright (C) 2019 Davide Dapelo
5 * E-mail contact: info@openlb.net
6 * The most recent release of OpenLB can be downloaded at
7 * <http://www.openlb.net/>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23 */
24
25/* Drag force models for Lagrangian two-way coupling -- generic implementation.
26 */
27
28#ifndef LB_DRAG_MODELS_HH
29#define LB_DRAG_MODELS_HH
30
31namespace olb {
32
33
35
36template<typename T, typename Lattice, template<typename V> class Particle>
40
41
43
44template<typename T, typename Lattice, template<typename V> class Particle>
48
49template<typename T, typename Lattice, template<typename V> class Particle>
51 Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction )
52{
53 return 1.83;
54}
55
56
58
59template<typename T, typename Lattice, template<typename V> class Particle>
61 : DragModelBase<T,Lattice,Particle>(converter)
62{
63 this->_reP = std::make_shared<NewtonianParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter);
64}
65
66template<typename T, typename Lattice, template<typename V> class Particle>
68 Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction )
69{
70 T physVelRelative = this->_converter.getPhysVelocity (
71 util::sqrt( util::pow(latticeVelF[0] - latticeVelP[0],2) +
72 util::pow(latticeVelF[1] - latticeVelP[1],2) +
73 util::pow(latticeVelF[2] - latticeVelP[2],2) ) );
74
75 T ReP = continuousPhaseFraction * this->_reP->operator() (p, physVelRelative, globicFull);
76
77 T a[3] = {T(), T(), T()};
78 if (ReP < 0.1) {
79 a[0] = 0.0;
80 a[1] = 24.0;
81 a[2] = 0.0;
82 }
83 else if (ReP < 1.0) {
84 a[0] = 3.69;
85 a[1] = 22.73;
86 a[2] = 0.0903;
87 }
88 else if (ReP < 10.0) {
89 a[0] = 1.222;
90 a[1] = 29.16667;
91 a[2] =-3.8889;
92 }
93 else if (ReP < 100.0) {
94 a[0] = 0.6167;
95 a[1] = 46.5;
96 a[2] =-116.67;
97 }
98 else if (ReP < 1000.0) {
99 a[0] = 0.3644;
100 a[1] = 98.33;
101 a[2] =-2778;
102 }
103 else if (ReP < 5000.0) {
104 a[0] = 0.357;
105 a[1] = 148.62;
106 a[2] =-4.75e4;
107 }
108 else if (ReP < 10000.0) {
109 a[0] = 0.46;
110 a[1] =-490.546;
111 a[2] = 57.87e4;
112 }
113 else {
114 a[0] = 0.5191;
115 a[1] =-1662.5;
116 a[2] = 5.4167e6;
117 }
118
119 return ( a[0] + a[1]/ReP + a[2]/(ReP*ReP) );
120}
121
122
124
125template<typename T, typename Lattice, template<typename V> class Particle>
128 : MorsiDragModel<T,Lattice,Particle>(converter)
129{
130 this->_reP = std::make_shared<PowerLawParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter, sLattice);
131}
132
133
135
136template<typename T, typename Lattice, template<typename V> class Particle>
138 : DragModelBase<T,Lattice,Particle>(converter)
139{
140 this->_reP = std::make_shared<NewtonianParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter);
141}
142
143template<typename T, typename Lattice, template<typename V> class Particle>
145 Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction )
146{
147 T physVelRelative = this->_converter.getPhysVelocity (
148 util::sqrt( util::pow(latticeVelF[0] - latticeVelP[0],2) +
149 util::pow(latticeVelF[1] - latticeVelP[1],2) +
150 util::pow(latticeVelF[2] - latticeVelP[2],2) ) );
151
152 T ReP = continuousPhaseFraction * this->_reP->operator() (p, physVelRelative, globicFull);
153
154 return ReP > 1000.
155 ? 0.44
156 : ( 24. * (1. + 0.15 * util::pow(ReP, 0.687)) / ReP );
157}
158
159
161
162template<typename T, typename Lattice, template<typename V> class Particle>
165 : SchillerNaumannDragModel<T,Lattice,Particle>(converter)
166{
167 this->_reP = std::make_shared<PowerLawParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter, sLattice);
168}
169
170
172
173template<typename T, typename Lattice, template<typename V> class Particle>
175 : DragModelBase<T,Lattice,Particle>(converter)
176{
177 this->_reP = std::make_shared<NewtonianParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter);
178}
179
180template<typename T, typename Lattice, template<typename V> class Particle>
182 Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction )
183{
184 T physVelRelative = this->_converter.getPhysVelocity (
185 util::sqrt( util::pow(latticeVelF[0] - latticeVelP[0],2) +
186 util::pow(latticeVelF[1] - latticeVelP[1],2) +
187 util::pow(latticeVelF[2] - latticeVelP[2],2) ) );
188
189 T ReP = continuousPhaseFraction * this->_reP->operator() (p, physVelRelative, globicFull);
190
191 return ReP > 195.
192 ? 0.95
193 : ( 16./ReP * (1. + 0.173*util::pow(ReP, 0.657)) + 0.413 / (1. + 16300*util::pow(ReP, -1.09)) );
194}
195
196
198
199template<typename T, typename Lattice, template<typename V> class Particle>
202 : DewsburyDragModel<T,Lattice,Particle>(converter)
203{
204 this->_reP = std::make_shared<PowerLawParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter, sLattice);
205}
206
207
209
210template<typename T, typename Lattice, template<typename V> class Particle>
212 : DragModelBase<T,Lattice,Particle>(converter)
213{
214 this->_reP = std::make_shared<NewtonianParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter);
215}
216
217template<typename T, typename Lattice, template<typename V> class Particle>
219 Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction )
220{
221 T physVelRelative = this->_converter.getPhysVelocity (
222 util::sqrt( util::pow(latticeVelF[0] - latticeVelP[0],2) +
223 util::pow(latticeVelF[1] - latticeVelP[1],2) +
224 util::pow(latticeVelF[2] - latticeVelP[2],2) ) );
225
226 T ReP = continuousPhaseFraction * this->_reP->operator() (p, physVelRelative, globicFull);
227
228 if (ReP <= 10.) {
229 return 1.2 * 24./ReP * ( 1. + 0.173*util::pow(ReP, 0.675) );
230 }
231 else if (ReP <= 100. ) {
232 return 0.813 * 24./ReP * ( 1. + 24.*util::pow(ReP, -1.125) );
233 }
234 else {
235 return 1.07 * 24./ReP * ( -1. + 0.037*util::pow(ReP, 0.825) );
236 }
237}
238
239
241
242template<typename T, typename Lattice, template<typename V> class Particle>
245 : SunDragModel<T,Lattice,Particle>(converter)
246{
247 this->_reP = std::make_shared<PowerLawParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter, sLattice);
248}
249
250
251}
252
253#endif
Class to compute the drag coefficient for gas bubbles in a liquid fluid phase as in Dewsbury et al.
DewsburyDragModel(UnitConverter< T, Lattice > &converter)
Constructor.
virtual T operator()(Particle< T > *p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction=1.) override
Returns the scalar drag coefficient. globicFull = { globic, latticeRoundedP[0, ......
Abstact class for all the drag models.
UnitConverter< T, Lattice > & _converter
Returns the scalar drag coefficient to overload.
DragModelBase(UnitConverter< T, Lattice > &converter)
Constructor.
std::shared_ptr< ParticleReynoldsNumber< T, Particle > > _reP
Functional to compute particle Reynolds number.
Class to compute the standard drag coefficient as in Morsi and Alexander (1972).
MorsiDragModel(UnitConverter< T, Lattice > &converter)
Constructor.
virtual T operator()(Particle< T > *p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction=1.) override
Returns the scalar drag coefficient. globicFull = { globic, latticeRoundedP[0, ......
PowerLawDewsburyDragModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
PowerLawMorsiDragModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
PowerLawSchillerNaumannDragModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
PowerLawSunDragModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
Class to compute the standard drag coefficient as in Schiller and Naumann (1935).
SchillerNaumannDragModel(UnitConverter< T, Lattice > &converter)
Constructor.
virtual T operator()(Particle< T > *p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction=1.) override
Returns the scalar drag coefficient. globicFull = { globic, latticeRoundedP[0, ......
StokesSimplifiedDragModel(UnitConverter< T, Lattice > &converter)
Constructor.
virtual T operator()(Particle< T > *p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction=1.) override
Returns the scalar drag coefficient. globicFull = { globic, latticeRoundedP[0, ......
Class to compute the drag coefficient for gas bubbles in a liquid fluid phase as in Sun,...
virtual T operator()(Particle< T > *p, T latticeVelF[], T latticeVelP[], int globicFull[], T continuousPhaseFraction=1.) override
Returns the scalar drag coefficient. globicFull = { globic, latticeRoundedP[0, ......
SunDragModel(UnitConverter< T, Lattice > &converter)
Constructor.
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
Top level namespace for all of OpenLB.