OpenLB 1.7
Loading...
Searching...
No Matches
twoWayHelperFunctionals.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/* Helper functionals for Lagrangian two-way coupling methods -- header file.
26 */
27
28#ifndef LB_TWO_WAY_HELPER_FUNCTIONALS_H
29#define LB_TWO_WAY_HELPER_FUNCTIONALS_H
30
33
34namespace olb {
35
40template<typename T, typename Lattice>
42public:
44 virtual bool operator() ( T gF[], T latticeVelF[], T latticeVelP[],
45 T physPosP[], int latticeRoundedP[],
46 int globic )=0;
48protected:
51 SuperLattice<T, Lattice>& sLattice );
52 UnitConverter<T, Lattice>& _converter; // reference to a UnitConverter
53 SuperLattice<T, Lattice>& _sLattice; // reference to a lattice
54 std::shared_ptr<SuperLatticeInterpDensity3Degree3D<T, Lattice> > _interpLatticeDensity;
55 std::shared_ptr<SuperLatticeInterpPhysVelocity3D<T, Lattice> > _interpLatticeVelocity ;
56};
57
60template<typename T, typename Lattice>
62public:
66 std::shared_ptr<SuperLatticeInterpDensity3Degree3D<T, Lattice> > interpLatticeDensity );
68 virtual bool operator() ( T gF[], T latticeVelF[], T latticeVelP[],
69 T physPosP[], int latticeRoundedP[],
70 int globic ) override;
71};
72
75template<typename T, typename Lattice>
76class LaddMomentumExchange : public TwoWayHelperFunctional<T, Lattice> {
77public:
81 std::shared_ptr<SuperLatticeInterpDensity3Degree3D<T, Lattice> > interpLatticeDensity,
82 std::shared_ptr<SuperLatticeInterpPhysVelocity3D<T, Lattice> > interpLatticeVelocity );
84 virtual bool operator() ( T gF[], T latticeVelF[], T latticeVelP[],
85 T physPosP[], int latticeRoundedP[],
86 int globic ) override;
87};
88
89}
90
91#endif
LaddMomentumExchange(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > interpLatticeDensity, std::shared_ptr< SuperLatticeInterpPhysVelocity3D< T, Lattice > > interpLatticeVelocity)
Constructor.
virtual bool operator()(T gF[], T latticeVelF[], T latticeVelP[], T physPosP[], int latticeRoundedP[], int globic) override
Computes the momentum transfer from fluid to particle.
NaiveMomentumExchange(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > interpLatticeDensity)
Constructor.
virtual bool operator()(T gF[], T latticeVelF[], T latticeVelP[], T physPosP[], int latticeRoundedP[], int globic) override
Computes the momentum transfer from fluid to particle.
Super class maintaining block lattices for a cuboid decomposition.
Abstact class for all the local forward-coupling models, viz., momentum coupling from fluid to partic...
std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > _interpLatticeDensity
virtual bool operator()(T gF[], T latticeVelF[], T latticeVelP[], T physPosP[], int latticeRoundedP[], int globic)=0
Computes the momentum transfer from fluid to particle.
SuperLattice< T, Lattice > & _sLattice
TwoWayHelperFunctional(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
Constructor.
UnitConverter< T, Lattice > & _converter
std::shared_ptr< SuperLatticeInterpPhysVelocity3D< T, Lattice > > _interpLatticeVelocity
Conversion between physical and lattice units, as well as discretization.
Top level namespace for all of OpenLB.