OpenLB 1.7
Loading...
Searching...
No Matches
ReynoldsNumbers3D.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/* Particle Reynold number classes for Lagrangian two-way coupling methods -- generic implementation.
26 */
27
28#ifndef LB_REYNOLDS_NUMBERS_3D_HH
29#define LB_REYNOLDS_NUMBERS_3D_HH
30
31namespace olb {
32
34
35template<typename T, typename Lattice, template<typename V> class Particle>
39
40
42
43template<typename T, typename Lattice, template<typename V> class Particle>
47
48template<typename T, typename Lattice, template<typename V> class Particle>
49T NewtonianParticleReynoldsNumber<T,Lattice,Particle>::operator() ( Particle<T>* p, T magU, int globicFull[])
50{
51 T ReP = 2. * p->getRad() * magU / this->_converter.getPhysViscosity();
52 return ReP > this->_RePmin ? ReP : this->_RePmin;
53}
54
55
57
58template<typename T, typename Lattice, template<typename V> class Particle>
64
65template<typename T, typename Lattice, template<typename V> class Particle>
66T PowerLawParticleReynoldsNumber<T,Lattice,Particle>::operator() ( Particle<T>* p, T magU, int globicFull[])
67{
68 // loc() indicates the local cuboid number locIC of the actual processing thread,
69 // for given global cuboid number iC
70 // this is to get appropriate particle system on locIC
71 int locIC = _sLattice.getLoadBalancer().loc(globicFull[0]);
72
73 // particle's dimensionless position, rounded at neighbouring voxel
74 int latticeRoundedPosP[3] = { globicFull[1], globicFull[2], globicFull[3] };
75
76 // getting the power-law relaxation frequency form the dynamics's external field
77 T omega = _sLattice.getBlock(locIC).get (
78 latticeRoundedPosP[0],
79 latticeRoundedPosP[1],
80 latticeRoundedPosP[2] ).template getField<descriptors::OMEGA>();
81
82 // physical viscosity from relaxation time
83 T nu = this->_converter.getPhysViscosity (
84 (1./omega - 0.5) / descriptors::invCs2<T,Lattice>() );
85
86 T ReP = 2. * p->getRad() * magU / nu;
87 return ReP > this->_RePmin ? ReP : this->_RePmin;
88}
89
90
91}
92
93#endif
virtual T operator()(Particle< T > *p, T magU, int globicFull[]) override
Returns the particle Reynolds number. globicFull = { globic, latticeRoundedP[0, .....
NewtonianParticleReynoldsNumber(UnitConverter< T, Lattice > &converter)
Constructor.
Abstract class for particle Reynolds number computation within drag model.
ParticleReynoldsNumberBase(UnitConverter< T, Lattice > &converter)
Constructor.
virtual T operator()(Particle< T > *p, T magU, int globicFull[]) override
Returns the particle Reynolds number. globicFull = { globic, latticeRoundedP[0, .....
PowerLawParticleReynoldsNumber(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
Top level namespace for all of OpenLB.