OpenLB 1.7
Loading...
Searching...
No Matches
smoothingFunctionals3D.h
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/* Smoothings functionals for Lagrangian two-way coupling methods -- header file.
26 */
27
28#ifndef LB_SMOOTHING_FUNCTIONALS_3D_H
29#define LB_SMOOTHING_FUNCTIONALS_3D_H
30
32
33namespace olb {
34
39template<typename T>
41 // Global IC
42 int globic = 0;
43 // Lattice position
44 int latticePos[3] = {0, 0, 0};
45 // Multiplicative weight for kernel smoothing
46 T weight = T();
47 // Continuous phase volume fraction
49};
50
53template<typename T, typename Lattice>
55public:
56 // Rebuilds _latticePosAndWeight with the new cells within _kernelLength from the bubble's position
57 virtual bool update(T physPosP[], int globic);
58 // Returns read-only access to internal data
59 const std::deque<LatticePosAndWeight<T>> getData() const
60 {
62 }
64 {
66 }
67protected:
70 T kernelLength, UnitConverter<T, Lattice>& converter, SuperLattice<T, Lattice>& sLattice, int nVoxelInterpPoints=2 );
72 virtual T smoothingFunction(T delta)=0;
74 virtual T compute(T physPosP[], T physPosL[])=0;
75 T _kernelLength; // Kernel's smoothing length.
76 UnitConverter<T, Lattice>& _converter; // reference to a UnitConverter
77 SuperLattice<T, Lattice>& _sLattice; // reference to a lattice
78 // positions and weights of the cells within _kernelLength from bubble's position
79 std::deque<LatticePosAndWeight<T> > _latticePosAndWeight;
81};
82
85template<typename T, typename Lattice>
87protected:
90 T kernelLength, UnitConverter<T, Lattice>& converter, SuperLattice<T, Lattice>& sLattice, int nVoxelInterpPoints=2 );
92 virtual T compute(T physPosP[], T physPosL[]) override;
93};
94
97template<typename T, typename Lattice>
99protected:
102 T kernelLength, UnitConverter<T, Lattice>& converter, SuperLattice<T, Lattice>& sLattice, int nVoxelInterpPoints=2 );
104 virtual T compute(T physPosP[], T physPosL[]) override;
105};
106
109template<typename T, typename Lattice>
111public:
114 T kernelLength, UnitConverter<T, Lattice>& converter, SuperLattice<T, Lattice>& sLattice );
115protected:
117 virtual T smoothingFunction(T delta) override;
118};
119
122template<typename T, typename Lattice>
124public:
127 T kernelLength, UnitConverter<T, Lattice>& converter, SuperLattice<T, Lattice>& sLattice, T radius, int nVoxelInterpPoints );
128 // Rebuilds _latticePosAndWeight with the new cells within _kernelLength from the bubble's position
129 virtual bool update(T physPosP[], int globic) override;
130protected:
132 virtual T smoothingFunction(T delta) override;
134 void updateContinuousPhaseFraction(T physPosP[], int globic);
135 T _radius; // particle radius (I assume all the particles in the system have the same radius!)
136};
137
140template<typename T, typename Lattice>
142public:
145 T kernelLength, UnitConverter<T, Lattice>& converter, SuperLattice<T, Lattice>& sLattice );
146protected:
148 virtual T smoothingFunction(T delta) override;
149};
150
151}
152
153#endif
Smoothing functional as in Deen et al (2004), Chem.
DeenSmoothingFunctional(T kernelLength, UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
virtual T smoothingFunction(T delta) override
The actual smoothing function.
Abstact class for all the linear-averaging smoothing functionals.
LinearAveragingSmoothingFunctional(T kernelLength, UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, int nVoxelInterpPoints=2)
Constructor.
virtual T compute(T physPosP[], T physPosL[]) override
Returns the weight for smoothing.
Abstact class for all the smoothing functionals.
virtual T compute(T physPosP[], T physPosL[])=0
Returns the weight for smoothing.
std::deque< LatticePosAndWeight< T > > _latticePosAndWeight
UnitConverter< T, Lattice > & _converter
SmoothingFunctional(T kernelLength, UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, int nVoxelInterpPoints=2)
Constructor.
virtual bool update(T physPosP[], int globic)
SuperLattice< T, Lattice > & _sLattice
virtual T smoothingFunction(T delta)=0
The actual smoothing function.
const std::deque< LatticePosAndWeight< T > > getData() const
Stepwise smoothing functional.
StepSmoothingFunctional(T kernelLength, UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
virtual T smoothingFunction(T delta) override
The actual smoothing function.
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
Abstact class for all the volume-averaging smoothing functionals.
VolumeAveragingSmoothingFunctional(T kernelLength, UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, int nVoxelInterpPoints=2)
Constructor.
virtual T compute(T physPosP[], T physPosL[]) override
Returns the weight for smoothing.
Smoothing functional as in Evrard, Denner and van Wachem (2019).
void updateContinuousPhaseFraction(T physPosP[], int globic)
Updates _latticePosAndWeight with contribution from continuous phase fraction. To be called AFTER com...
virtual T smoothingFunction(T delta) override
The actual smoothing function.
vanWachemSmoothingFunctional(T kernelLength, UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, T radius, int nVoxelInterpPoints)
Constructor.
virtual bool update(T physPosP[], int globic) override
Top level namespace for all of OpenLB.
Data structure for smoothing functionals.