OpenLB 1.7
Loading...
Searching...
No Matches
latticeMomentumExchangeForce.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2012 Robin Trunk, Mathias J. Kraus
4 * 2021 Nicolas Hafen
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#ifndef LATTICE_MOMENTUM_EXCHANGE_FORCE_H
26#define LATTICE_MOMENTUM_EXCHANGE_FORCE_H
27
28#include "utilities/aliases.h"
29
30namespace olb {
31
32//Forward declaration
33namespace particles{
34template<typename T, typename PARTICLETYPE> class SuperParticleSystem;
35template<typename T, typename PARTICLETYPE> class ParticleSystem;
36template<typename T, typename PARTICLETYPE> class Particle;
37}
38
39
40
41//TODO: adapt description
48template <typename T, typename DESCRIPTOR, typename PARTICLETYPE>
49class BlockLatticeMomentumExchangeForce final : public BlockLatticePhysF<T,DESCRIPTOR> {
51
52private:
53 const BlockGeometry<T,DESCRIPTOR::d>& _blockGeometry;
54 BlockLattice<T,DESCRIPTOR>& _blockLattice;
59 std::size_t _iP0;
60 const std::unordered_set<int> _ignoredMaterials;
61 const F _f;
62public:
64 const BlockGeometry<T,DESCRIPTOR::d>& blockGeometry,
66 const UnitConverter<T,DESCRIPTOR>& converter,
70 std::size_t iP0=0,
71 const std::unordered_set<int>& ignoredMaterials = std::unordered_set<int>{},
72 const F f = [](auto&, const auto&, const auto&, const auto&){}
73 );
74 void evaluate(T output[], particles::Particle<T,PARTICLETYPE>& particle, int iP);
75 bool operator() (T output[], const int input[]) override;
76 static constexpr bool serializeForce = true; //Return serialized force values via output[]
77};
78
79
80//TODO: adapt description
86template <typename T, typename DESCRIPTOR, typename PARTICLETYPE,
88class SuperLatticeParticleForce final : public SuperLatticePhysF<T,DESCRIPTOR> {
90
91public:
93 const SuperGeometry<T,DESCRIPTOR::d>& superGeometry,
95 const UnitConverter<T,DESCRIPTOR>& converter,
97 std::size_t iP0=0,
98 const std::unordered_set<int>& ignoredMaterials = std::unordered_set<int>{},
99 const F f = [](auto&, const auto&, const auto&, const auto&){}
100 );
101 bool operator() (T output[], const int input[]) override;
102};
103
104
105
106//TODO: alias for SuperFunctor with BlockLatticeMomentumExchangeForce
107template <typename T, typename DESCRIPTOR, typename PARTICLETYPE>
109 SuperLatticeParticleForce<T,DESCRIPTOR,PARTICLETYPE,
111
112
113//TODO: alias for SuperFunctor with BlockLatticeStokesDragForce
114template <typename T, typename DESCRIPTOR, typename PARTICLETYPE>
116 SuperLatticeParticleForce<T,DESCRIPTOR,PARTICLETYPE,
118
119
122
124template <typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque=false>
126public:
128 const UnitConverter<T,DESCRIPTOR>& converter,
129 const SuperGeometry<T,DESCRIPTOR::d>& superGeometry,
131};
132
134template <typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque=false>
142
143
145template <typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque=false>
147private:
148 BlockLattice<T,DESCRIPTOR>& _blockLattice;
149 const BlockGeometry<T,DESCRIPTOR::d>& _blockGeometry;
151public:
153 const BlockGeometry<T,DESCRIPTOR::d>& blockGeometry,
155 const UnitConverter<T,DESCRIPTOR>& converter);
156 bool operator() (T output[], const int input[]) override;
157};
158
159
160
161
162}
163#endif
Representation of a block geometry.
functor to get pointwise momentum exchange on local lattice (block level)
bool operator()(T output[], const int input[]) override
BlockLatticeMomentumExchangeForceLocal(BlockLattice< T, DESCRIPTOR > &blockLattice, const BlockGeometry< T, DESCRIPTOR::d > &blockGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem, const UnitConverter< T, DESCRIPTOR > &converter)
Functor that returns forces acting on a particle surface, returns data in output for every particle i...
void evaluate(T output[], particles::Particle< T, PARTICLETYPE > &particle, int iP)
BlockLatticeMomentumExchangeForce(BlockLattice< T, DESCRIPTOR > &blockLattice, const BlockGeometry< T, DESCRIPTOR::d > &blockGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem, const UnitConverter< T, DESCRIPTOR > &converter, PhysR< T, DESCRIPTOR::d > cellMin=PhysR< T, DESCRIPTOR::d >(0.), PhysR< T, DESCRIPTOR::d > cellMax=PhysR< T, DESCRIPTOR::d >(0.), Vector< bool, DESCRIPTOR::d > periodic=Vector< bool, DESCRIPTOR::d >(false), std::size_t iP0=0, const std::unordered_set< int > &ignoredMaterials=std::unordered_set< int >{}, const F f=[](auto &, const auto &, const auto &, const auto &){})
bool operator()(T output[], const int input[]) override
Platform-abstracted block lattice for external access and inter-block interaction.
Representation of a statistic for a parallel 2D geometry.
functor to get pointwise momentum exchange on local lattice (parallel particle version)
SuperLatticeMomentumExchangeForceLocalParallel(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter, const SuperGeometry< T, DESCRIPTOR::d > &superGeometry, particles::SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem)
The following are functors that work in the traditional (output[], input[]) sense,...
SuperLatticeMomentumExchangeForceLocal(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter, const SuperGeometry< T, DESCRIPTOR::d > &superGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem)
The following are functors that work in the traditional (output[], input[]) sense,...
Functor that returns forces acting on a particle surface, returns data in output for every particle i...
bool operator()(T output[], const int input[]) override
SuperLatticeParticleForce(SuperLattice< T, DESCRIPTOR > &sLattice, const SuperGeometry< T, DESCRIPTOR::d > &superGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem, const UnitConverter< T, DESCRIPTOR > &converter, Vector< bool, DESCRIPTOR::d > periodic=Vector< bool, DESCRIPTOR::d >(false), std::size_t iP0=0, const std::unordered_set< int > &ignoredMaterials=std::unordered_set< int >{}, const F f=[](auto &, const auto &, const auto &, const auto &){})
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.
std::conditional_t< DESCRIPTOR::d==2, BlockLatticePhysF2D< T, DESCRIPTOR >, BlockLatticePhysF3D< T, DESCRIPTOR > > BlockLatticePhysF
Definition aliases.h:339
std::conditional_t< DESCRIPTOR::d==2, SuperLatticePhysF2D< T, DESCRIPTOR >, SuperLatticePhysF3D< T, DESCRIPTOR > > SuperLatticePhysF
Definition aliases.h:329
Converts dimensions by deriving from given cartesian dimension D.