OpenLB 1.7
Loading...
Searching...
No Matches
boundaryPostProcessors2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2006, 2007 Jonas Latt
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 * Generic version of the collision, which modifies the particle
9 * distribution functions, by Orestis Malaspinas.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public
22 * License along with this program; if not, write to the Free
23 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
25*/
26
27#ifndef FD_BOUNDARIES_2D_H
28#define FD_BOUNDARIES_2D_H
29
30#include "core/postProcessing.h"
31
32#include "core/operator.h"
33
34namespace olb {
35
41template<typename T, typename DESCRIPTOR, int direction, int orientation>
43public:
45
46 int getPriority() const {
47 return 0;
48 }
49
50 template <CONCEPT(Cell) CELL>
51 void apply(CELL& cell) any_platform;
52
53private:
54 template<int deriveDirection, typename CELL>
55 void interpolateGradients(CELL& blockLattice, T velDeriv[DESCRIPTOR::d]) const any_platform;
56
57};
58
59
68template<typename T, typename DESCRIPTOR, int NORMAL_X, int NORMAL_Y>
70public:
72
73 int getPriority() const {
74 return 0;
75 }
76
77 template <CONCEPT(Cell) CELL>
78 void apply(CELL& cell) any_platform;
79
80};
81
82template<typename T, typename DESCRIPTOR, int NORMAL_X, int NORMAL_Y>
84public:
86
87 int getPriority() const {
88 return 0;
89 }
90
91 template <CONCEPT(Cell) CELL>
92 void apply(CELL& cell) any_platform;
93
94};
95
96
101template<typename T, typename DESCRIPTOR, int NORMAL_X, int NORMAL_Y>
103public:
105
107
108 int getPriority() const {
109 return 0;
110 }
111
112 template <CONCEPT(Cell) CELL, typename PARAMETERS>
113 void apply(CELL& cell, PARAMETERS& parameters) any_platform;
114
115};
116
117
121template<typename T, typename DESCRIPTOR, int NORMAL_X, int NORMAL_Y>
123public:
125
126 int getPriority() const {
127 return 0;
128 }
129
130 template <CONCEPT(Cell) CELL>
131 void apply(CELL& cell) any_platform;
132
133};
134
135
139template<typename T, typename DESCRIPTOR, int direction, int orientation>
141public:
142 StraightConvectionBoundaryProcessor2D(int x0_, int x1_, int y0_, int y1_, T* uAv_ = NULL);
144 int extent() const override
145 {
146 return 1;
147 }
148 int extent(int whichDirection) const override
149 {
150 return 1;
151 }
152 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
153 void processSubDomain ( BlockLattice<T,DESCRIPTOR>& blockLattice,
154 int x0_, int x1_, int y0_, int y1_ ) override;
155private:
156 int x0, x1, y0, y1;
157 T*** saveCell;
158 T* uAv;
159};
160
161template<typename T, typename DESCRIPTOR, int direction, int orientation>
163public:
164 StraightConvectionBoundaryProcessorGenerator2D(int x0_, int x1_, int y0_, int y1_, T* uAv_ = NULL);
165 PostProcessor2D<T,DESCRIPTOR>* generate() const override;
167private:
168 T* uAv;
169};
170
175template<typename T, typename DESCRIPTOR>
176class SlipBoundaryProcessor2D : public LocalPostProcessor2D<T,DESCRIPTOR> {
177public:
178 SlipBoundaryProcessor2D(int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_);
179 int extent() const override
180 {
181 return 0;
182 }
183 int extent(int whichDirection) const override
184 {
185 return 0;
186 }
187 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
188 void processSubDomain ( BlockLattice<T,DESCRIPTOR>& blockLattice,
189 int x0_, int x1_, int y0_, int y1_ ) override;
190private:
191 int reflectionPop[DESCRIPTOR::q];
192 int x0, x1, y0, y1;
193};
194
195
196template<typename T, typename DESCRIPTOR>
198public:
199 SlipBoundaryProcessorGenerator2D(int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_);
200 PostProcessor2D<T,DESCRIPTOR>* generate() const override;
202private:
203 int discreteNormalX;
204 int discreteNormalY;
205};
206
211template<typename T, typename DESCRIPTOR>
213public:
214 PartialSlipBoundaryProcessor2D(T tuner_, int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_);
215 int extent() const override
216 {
217 return 0;
218 }
219 int extent(int whichDirection) const override
220 {
221 return 0;
222 }
223 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
224 void processSubDomain ( BlockLattice<T,DESCRIPTOR>& blockLattice,
225 int x0_, int x1_, int y0_, int y1_ ) override;
226private:
227 int reflectionPop[DESCRIPTOR::q];
228 int x0, x1, y0, y1;
229 T tuner;
230};
231
232
233template<typename T, typename DESCRIPTOR>
235public:
236 PartialSlipBoundaryProcessorGenerator2D(T tuner_, int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_);
237 PostProcessor2D<T,DESCRIPTOR>* generate() const override;
239private:
240 int discreteNormalX;
241 int discreteNormalY;
242 T tuner;
243};
244
250template<typename T, typename DESCRIPTOR, int xNormal,int yNormal>
252public:
254
255 int getPriority() const {
256 return 1;
257 }
258
259 template <CONCEPT(Cell) CELL>
260 void apply(CELL& cell) any_platform;
261
262};
263
264}
265
266#endif
Platform-abstracted block lattice for external access and inter-block interaction.
PostProcessors for the chemical potential boundary condition in the free energy model.
PostProcessor for pressure / velocity outflow boundaries in the free energy model.
PostProcessor for the wetting boundary condition in the free energy model.
static constexpr OperatorScope scope
meta::list< olb::descriptors::ADDEND > parameters
void apply(CELL &cell, PARAMETERS &parameters) any_platform
This class computes the skordos BC in 2D on a convex corner but with a limited number of terms added ...
This class computes a partial slip BC in 2D.
int extent() const override
Extent of application area (0 for purely local operations)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
PartialSlipBoundaryProcessor2D(T tuner_, int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
PartialSlipBoundaryProcessorGenerator2D(T tuner_, int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_)
PostProcessorGenerator2D< T, DESCRIPTOR > * clone() const override
PostProcessor2D< T, DESCRIPTOR > * generate() const override
Interface of 2D post-processing steps.
This class computes a slip BC in 2D.
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
SlipBoundaryProcessor2D(int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
int extent() const override
Extent of application area (0 for purely local operations)
PostProcessorGenerator2D< T, DESCRIPTOR > * clone() const override
PostProcessor2D< T, DESCRIPTOR > * generate() const override
SlipBoundaryProcessorGenerator2D(int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_)
This class computes a convection BC on a flat wall in 2D.
StraightConvectionBoundaryProcessor2D(int x0_, int x1_, int y0_, int y1_, T *uAv_=NULL)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
int extent() const override
Extent of application area (0 for purely local operations)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
PostProcessor2D< T, DESCRIPTOR > * generate() const override
PostProcessorGenerator2D< T, DESCRIPTOR > * clone() const override
StraightConvectionBoundaryProcessorGenerator2D(int x0_, int x1_, int y0_, int y1_, T *uAv_=NULL)
This class computes the skordos BC on a flat wall in 2D but with a limited number of terms added to t...
static constexpr OperatorScope scope
Top level namespace for all of OpenLB.
OperatorScope
Block-wide operator application scopes.
Definition operator.h:54
@ PerCell
Per-cell application, i.e. OPERATOR::apply is passed a CELL concept implementation.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition platform.h:78
Interface for post-processing steps – header file.
Plain wrapper for list of types.
Definition meta.h:276