1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
/* Lattice Boltzmann sample, written in C++, using the OpenLB
* library
*
* Copyright (C) 2019 Davide Dapelo
* E-mail contact: info@openlb.net
* The most recent release of OpenLB can be downloaded at
* <http://www.openlb.net/>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/* Drag force models for Lagrangian two-way coupling -- generic implementation.
*/
#ifndef LB_DRAG_MODELS_HH
#define LB_DRAG_MODELS_HH
namespace olb {
////////////////////// Class DragModelBase ////////////////////////
template<typename T, typename Lattice, template<typename V> class Particle>
DragModelBase<T,Lattice,Particle>::DragModelBase(UnitConverter<T, Lattice>& converter)
: _converter(converter)
{}
////////////////////// Class StokesSimplifiedDragModel ////////////////////////
template<typename T, typename Lattice, template<typename V> class Particle>
StokesSimplifiedDragModel<T,Lattice,Particle>::StokesSimplifiedDragModel(UnitConverter<T, Lattice>& converter)
: DragModelBase<T,Lattice,Particle>(converter)
{}
template<typename T, typename Lattice, template<typename V> class Particle>
T StokesSimplifiedDragModel<T,Lattice,Particle>::operator() (
Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[] )
{
return 1.83;
}
////////////////////// Class MorsiDragModel ////////////////////////
template<typename T, typename Lattice, template<typename V> class Particle>
MorsiDragModel<T,Lattice,Particle>::MorsiDragModel(UnitConverter<T, Lattice>& converter)
: DragModelBase<T,Lattice,Particle>(converter)
{
this->_reP = std::make_shared<NewtonianParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter);
}
template<typename T, typename Lattice, template<typename V> class Particle>
T MorsiDragModel<T,Lattice,Particle>::operator() (
Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[] )
{
T physVelRelative = this->_converter.getPhysVelocity (
sqrt( pow(latticeVelF[0] - latticeVelP[0],2) +
pow(latticeVelF[1] - latticeVelP[1],2) +
pow(latticeVelF[2] - latticeVelP[2],2) ) );
T ReP = this->_reP->operator() (p, physVelRelative, globicFull);
T a[3] = {T(), T(), T()};
if (ReP < 0.1) {
a[0] = 0.0; a[1] = 24.0; a[2] = 0.0;
}
else if (ReP < 1.0) {
a[0] = 3.69; a[1] = 22.73; a[2] = 0.0903;
}
else if (ReP < 10.0) {
a[0] = 1.222; a[1] = 29.16667; a[2] =-3.8889;
}
else if (ReP < 100.0) {
a[0] = 0.6167; a[1] = 46.5; a[2] =-116.67;
}
else if (ReP < 1000.0) {
a[0] = 0.3644; a[1] = 498.33; a[2] =-2778;
}
else if (ReP < 5000.0) {
a[0] = 0.357; a[1] = 148.62; a[2] =-4.75e4;
}
else if (ReP < 10000.0) {
a[0] = 0.46; a[1] =-490.546; a[2] = 57.87e4;
}
else {
a[0] = 0.5191; a[1] =-1662.5; a[2] = 5.4167e6;
}
return ( a[0] + a[1]/ReP + a[2]/(ReP*ReP) ) * physVelRelative;
}
////////////////////// Class DewsburyDragModel ////////////////////////
template<typename T, typename Lattice, template<typename V> class Particle>
DewsburyDragModel<T,Lattice,Particle>::DewsburyDragModel(UnitConverter<T, Lattice>& converter)
: DragModelBase<T,Lattice,Particle>(converter)
{
this->_reP = std::make_shared<NewtonianParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter);
}
template<typename T, typename Lattice, template<typename V> class Particle>
T DewsburyDragModel<T,Lattice,Particle>::operator() (
Particle<T>* p, T latticeVelF[], T latticeVelP[], int globicFull[] )
{
T physVelRelative = this->_converter.getPhysVelocity (
sqrt( pow(latticeVelF[0] - latticeVelP[0],2) +
pow(latticeVelF[1] - latticeVelP[1],2) +
pow(latticeVelF[2] - latticeVelP[2],2) ) );
T ReP = this->_reP->operator() (p, physVelRelative, globicFull);
T Cd = 0.95;
if (ReP <= 195.) {
Cd = 16./ReP * (1. + 0.173*pow(ReP, 0.657))
+ 0.413 / (1. + 16300*pow(ReP, -1.09));
}
return Cd * this->_converter.getLatticeVelocity(physVelRelative);
}
////////////////////// Class PowerLawDewsburyDragModel ////////////////////////
template<typename T, typename Lattice, template<typename V> class Particle>
PowerLawDewsburyDragModel<T,Lattice,Particle>::PowerLawDewsburyDragModel (
UnitConverter<T, Lattice>& converter, SuperLattice3D<T, Lattice>& sLattice )
: DewsburyDragModel<T,Lattice,Particle>(converter)
{
this->_reP = std::make_shared<PowerLawParticleReynoldsNumber<T,Lattice,Particle> > (this->_converter, sLattice);
}
}
#endif
|