OpenLB
1.7
Loading...
Searching...
No Matches
src
boundary
postprocessor
zeroGradientLatticePostProcessor3D.h
Go to the documentation of this file.
1
/* This file is part of the OpenLB library
2
*
3
* Copyright (C) 2023 Fedor Bukreev, Adrian Kummerländer
4
* E-mail contact: info@openlb.net
5
* The most recent release of OpenLB can be downloaded at
6
* <http://www.openlb.net/>
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License
10
* as published by the Free Software Foundation; either version 2
11
* of the License, or (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public
19
* License along with this program; if not, write to the Free
20
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301, USA.
22
*/
23
24
#ifndef ZERO_GRADIENT_LATTICE_POST_PROCESSOR_3D_H
25
#define ZERO_GRADIENT_LATTICE_POST_PROCESSOR_3D_H
26
27
#include "
core/blockStructure.h
"
28
#include "
core/postProcessing.h
"
29
#include "
core/util.h
"
30
#include "
dynamics/latticeDescriptors.h
"
31
#include "
utilities/omath.h
"
32
33
34
namespace
olb
{
35
36
//======================================================================
37
// ======== Zero Gradient Boundary for AD 3D ======//
38
//======================================================================
39
template
<
typename
T,
typename
DESCRIPTOR>
40
struct
zeroGradientLatticePostProcessor3D
41
{
42
static
constexpr
OperatorScope
scope
=
OperatorScope::PerCell
;
43
44
int
getPriority
()
const
{
45
return
0;
46
}
47
48
template
<
typename
CELL>
49
void
apply
(CELL& cell)
any_platform
{
50
for
(
int
iPop = 0; iPop<DESCRIPTOR::q; iPop++){
51
const
auto
c = descriptors::c<DESCRIPTOR>(iPop);
52
T v = T{0.};
53
T fluidN = cell.neighbor({c[0], c[1], c[2]}).
template
getField<descriptors::NEIGHBOR>();
54
T fluidNN = cell.neighbor({2*c[0], 2*c[1], 2*c[2]}).
template
getField<descriptors::NEIGHBOR>();
55
v = fluidN * cell.neighbor({c[0], c[1], c[2]})[iPop] + fluidN * fluidNN * cell.neighbor({2*c[0], 2*c[1], 2*c[2]})[iPop];
56
v *= (fluidN - T{0.5} * fluidN * fluidNN);
57
cell[iPop] = v;
58
}
59
}
60
};
61
}
62
63
#endif
blockStructure.h
latticeDescriptors.h
Descriptor for all types of 2D and 3D lattices.
olb
Top level namespace for all of OpenLB.
Definition
boundaryPostProcessors2D.h:34
olb::OperatorScope
OperatorScope
Block-wide operator application scopes.
Definition
operator.h:54
olb::OperatorScope::PerCell
@ PerCell
Per-cell application, i.e. OPERATOR::apply is passed a CELL concept implementation.
omath.h
any_platform
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition
platform.h:78
postProcessing.h
Interface for post-processing steps – header file.
olb::zeroGradientLatticePostProcessor3D
Definition
zeroGradientLatticePostProcessor3D.h:41
olb::zeroGradientLatticePostProcessor3D::getPriority
int getPriority() const
Definition
zeroGradientLatticePostProcessor3D.h:44
olb::zeroGradientLatticePostProcessor3D::scope
static constexpr OperatorScope scope
Definition
zeroGradientLatticePostProcessor3D.h:42
olb::zeroGradientLatticePostProcessor3D::apply
void apply(CELL &cell) any_platform
Definition
zeroGradientLatticePostProcessor3D.h:49
util.h
Set of functions commonly used in LB computations – header file.
Generated on Tue Mar 5 2024 09:57:44 for OpenLB by
1.10.0