OpenLB 1.8.1
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
42//TODO: adapt description
49template <typename T, typename DESCRIPTOR, typename PARTICLETYPE>
50class BlockLatticeMomentumExchangeForce final : public BlockLatticePhysF<T,DESCRIPTOR> {
52
53private:
54 const BlockGeometry<T,DESCRIPTOR::d>& _blockGeometry;
55 BlockLattice<T,DESCRIPTOR>& _blockLattice;
60 std::size_t _iP0;
61 const std::set<int> _ignoredMaterials;
62 const F _f;
63public:
65 const BlockGeometry<T,DESCRIPTOR::d>& blockGeometry,
67 const UnitConverter<T,DESCRIPTOR>& converter,
71 std::size_t iP0=0,
72 const std::set<int>& ignoredMaterials = std::set<int>{},
73 const F f = [](auto&, const auto&, const auto&, const auto&){}
74 );
75 void evaluate(T output[], particles::Particle<T,PARTICLETYPE>& particle, int iP);
76 bool operator() (T output[], const int input[]) override;
77 static constexpr bool serializeForce = true; //Return serialized force values via output[]
78};
79
80
81//TODO: adapt description
87template <typename T, typename DESCRIPTOR, typename PARTICLETYPE,
89class SuperLatticeParticleForce final : public SuperLatticePhysF<T,DESCRIPTOR> {
91
92public:
94 const SuperGeometry<T,DESCRIPTOR::d>& superGeometry,
96 const UnitConverter<T,DESCRIPTOR>& converter,
98 std::size_t iP0=0,
99 const std::set<int>& ignoredMaterials = std::set<int>{},
100 const F f = [](auto&, const auto&, const auto&, const auto&){}
101 );
102 bool operator() (T output[], const int input[]) override;
103};
104
105
106
107//TODO: alias for SuperFunctor with BlockLatticeMomentumExchangeForce
108template <typename T, typename DESCRIPTOR, typename PARTICLETYPE>
110 SuperLatticeParticleForce<T,DESCRIPTOR,PARTICLETYPE,
112
113
114//TODO: alias for SuperFunctor with BlockLatticeStokesDragForce
115template <typename T, typename DESCRIPTOR, typename PARTICLETYPE>
117 SuperLatticeParticleForce<T,DESCRIPTOR,PARTICLETYPE,
119
120
123
125template <typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque=false>
127public:
129 const UnitConverter<T,DESCRIPTOR>& converter,
130 const SuperGeometry<T,DESCRIPTOR::d>& superGeometry,
132};
133
135template <typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque=false>
143
144
146template <typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque=false>
148private:
149 BlockLattice<T,DESCRIPTOR>& _blockLattice;
150 const BlockGeometry<T,DESCRIPTOR::d>& _blockGeometry;
152public:
154 const BlockGeometry<T,DESCRIPTOR::d>& blockGeometry,
156 const UnitConverter<T,DESCRIPTOR>& converter);
157 bool operator() (T output[], const int input[]) override;
158};
159
160
161
162
163}
164#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)
bool operator()(T output[], const int input[]) override
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::set< int > &ignoredMaterials=std::set< int >{}, const F f=[](auto &, const auto &, const auto &, const auto &){})
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::set< int > &ignoredMaterials=std::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.
Top level namespace for all of OpenLB.
std::conditional_t< DESCRIPTOR::d==2, BlockLatticePhysF2D< T, DESCRIPTOR >, BlockLatticePhysF3D< T, DESCRIPTOR > > BlockLatticePhysF
Definition aliases.h:328
std::conditional_t< DESCRIPTOR::d==2, SuperLatticePhysF2D< T, DESCRIPTOR >, SuperLatticePhysF3D< T, DESCRIPTOR > > SuperLatticePhysF
Definition aliases.h:318
Converts dimensions by deriving from given cartesian dimension D.