OpenLB 1.7
Loading...
Searching...
No Matches
forwardCouplingModels3D.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/* Models for Lagrangian forward-coupling methods -- header file.
26 */
27
28#ifndef LB_FORWARD_COUPLING_MODELS_H
29#define LB_FORWARD_COUPLING_MODELS_H
30
34
35namespace olb {
36
40template<typename T, template<typename V> class Particle>
42public:
44 virtual bool operator() (Particle<T>* p, int globic)=0;
45protected:
47 ForwardCouplingModel( SuperGeometry<T,3>& sGeometry, std::shared_ptr<DragModel<T, Particle>> dragModel );
49 std::shared_ptr<DragModel<T, Particle>> _dragModel; // reference to a drag model
50};
51
55template<typename T, typename Lattice, template<typename V> class Particle>
57protected:
61 SuperGeometry<T,3>& sGeometry,
62 std::shared_ptr<DragModel<T, Particle>> dragModel );
63 UnitConverter<T, Lattice>& _converter; // reference to a UnitConverter
64 SuperLattice<T, Lattice>& _sLattice; // reference to a lattice
65 // Functional to interpolate lattice density at particle's location
66 std::shared_ptr<SuperLatticeInterpDensity3Degree3D<T, Lattice> > _interpLatticeDensity;
67 // Functional to interpolate lattice velocity at particle's location
68 std::shared_ptr<SuperLatticeInterpPhysVelocity3D<T, Lattice> > _interpLatticeVelocity;
69 // Momentum-exchange helper functional
70 std::shared_ptr<TwoWayHelperFunctional<T, Lattice> > _momentumExchange;
71};
72
77template<typename T, typename Lattice, template<typename V> class Particle>
78class LocalBaseForwardCouplingModel : public BaseForwardCouplingModel<T,Lattice,Particle> {
79public:
81 virtual bool operator() (Particle<T>* p, int globic) override;
82 //virtual bool operator() (SuperParticleSystem3D<T,Particle>& spSys) override;
83protected:
87 SuperGeometry<T,3>& sGeometry,
88 std::shared_ptr<DragModel<T, Particle>> dragModel );
89};
90
94template<typename T, typename Lattice, template<typename V> class Particle>
95class NaiveForwardCouplingModel : public LocalBaseForwardCouplingModel<T,Lattice,Particle> {
96public:
100 SuperGeometry<T,3>& sGeometry,
101 std::shared_ptr<DragModel<T, Particle>> dragModel );
102};
103
107template<typename T, typename Lattice, template<typename V> class Particle>
108class LaddForwardCouplingModel : public LocalBaseForwardCouplingModel<T,Lattice,Particle> {
109public:
112 SuperLattice<T, Lattice>& sLattice,
113 SuperGeometry<T,3>& sGeometry,
114 std::shared_ptr<DragModel<T, Particle>> dragModel );
115};
116
121template<typename T, typename Lattice, template<typename V> class Particle>
123public:
125 virtual bool operator() (Particle<T>* p, int globic) override;
126// virtual bool operator() (SuperParticleSystem3D<T,Particle>& spSys) override;
127protected:
130 SuperLattice<T, Lattice>& sLattice,
131 SuperGeometry<T,3>& sGeometry,
132 std::shared_ptr<DragModel<T, Particle>> dragModel,
133 std::shared_ptr<SmoothingFunctional<T, Lattice>> smoothingFunctional );
134 std::shared_ptr<SmoothingFunctional<T, Lattice>> _smoothingFunctional; // Functional to treat non-local smoothing
135};
136
141template<typename T, typename Lattice, template<typename V> class Particle>
143public:
146 SuperLattice<T, Lattice>& sLattice,
147 SuperGeometry<T,3>& sGeometry,
148 std::shared_ptr<DragModel<T, Particle>> dragModel,
149 std::shared_ptr<SmoothingFunctional<T, Lattice>> smoothingFunctional );
150};
151
156template<typename T, typename Lattice, template<typename V> class Particle>
157class vanWachemForwardCouplingModel : public BaseForwardCouplingModel<T,Lattice,Particle> {
158public:
161 SuperLattice<T, Lattice>& sLattice,
162 SuperGeometry<T,3>& sGeometry,
163 std::shared_ptr<DragModel<T, Particle>> dragModel,
164 std::shared_ptr<SmoothingFunctional<T, Lattice>> smoothingFunctional, int nVoxelInterpPoints );
166 virtual bool operator() (Particle<T>* p, int globic) override;
167protected:
168 std::shared_ptr<SmoothingFunctional<T, Lattice>> _smoothingFunctional; // Functional to treat non-local smoothing
169};
170
171
172}
173
174#endif
Abstact base class for all the local/non-local forward-coupling models.
UnitConverter< T, Lattice > & _converter
std::shared_ptr< TwoWayHelperFunctional< T, Lattice > > _momentumExchange
std::shared_ptr< SuperLatticeInterpPhysVelocity3D< T, Lattice > > _interpLatticeVelocity
BaseForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel)
Constructor.
std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > _interpLatticeDensity
SuperLattice< T, Lattice > & _sLattice
Abstact base class for DragModelBase.
Abstact base class for all the forward-coupling models Its raison d'etre consists of not being temple...
ForwardCouplingModel(SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel)
Constructor.
SuperGeometry< T, 3 > & _sGeometry
std::shared_ptr< DragModel< T, Particle > > _dragModel
virtual bool operator()(Particle< T > *p, int globic)=0
Class operator to apply the coupling, for overload.
Class for a forward-coupling model following the Ladd's mechanism.
LaddForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel)
Constructor.
Abstact class for all the local forward-coupling models, viz., momentum coupling from fluid to partic...
LocalBaseForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel)
Constructor.
virtual bool operator()(Particle< T > *p, int globic) override
Class operator to apply the coupling, for overload.
Class for a naive forward-coupling model.
NaiveForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel)
Constructor.
Class for a naive, non-local forward-coupling model as in Sungkorn et al.
NaiveNonLocalForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel, std::shared_ptr< SmoothingFunctional< T, Lattice > > smoothingFunctional)
Constructor.
Abstact class for all the non-local forward-coupling models, viz., momentum coupling from fluid to pa...
std::shared_ptr< SmoothingFunctional< T, Lattice > > _smoothingFunctional
NonLocalBaseForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel, std::shared_ptr< SmoothingFunctional< T, Lattice > > smoothingFunctional)
Constructor.
virtual bool operator()(Particle< T > *p, int globic) override
Class operator to apply the coupling, for overload.
Abstact class for all the smoothing functionals.
Representation of a statistic for a parallel 2D geometry.
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
Class for a forward-coupling model as in Evrard, Denner and van Wachem (2019), but with an extra-norm...
virtual bool operator()(Particle< T > *p, int globic) override
Class operator to apply the coupling, for overload.
vanWachemForwardCouplingModel(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< DragModel< T, Particle > > dragModel, std::shared_ptr< SmoothingFunctional< T, Lattice > > smoothingFunctional, int nVoxelInterpPoints)
Constructor.
std::shared_ptr< SmoothingFunctional< T, Lattice > > _smoothingFunctional
Top level namespace for all of OpenLB.