OpenLB 1.7
Loading...
Searching...
No Matches
navierStokesAdvectionDiffusionCouplingPostProcessor3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2008 Orestis Malaspinas, Andrea Parmigiani, 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 * 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 NAVIER_STOKES_INTO_ADVECTION_DIFFUSION_COUPLING_POST_PROCESSOR_3D_H
25#define NAVIER_STOKES_INTO_ADVECTION_DIFFUSION_COUPLING_POST_PROCESSOR_3D_H
26
27#include "utilities/omath.h"
28
29#include "core/blockStructure.h"
30#include "core/postProcessing.h"
33
34namespace olb {
35
36
37//======================================================================
38// ======== Total enthalpy coupling with Boussinesq bouancy 3D and phase change====================//
39//======================================================================
40template<typename T, typename DESCRIPTOR, typename DYNAMICS>
42public:
43 TotalEnthalpyPhaseChangeCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
44 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_,
45 std::vector<BlockStructureD<3>* > partners_);
46 int extent() const override
47 {
48 return 1;
49 }
50 int extent(int whichDirection) const override
51 {
52 return 1;
53 }
54 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
56 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
57private:
58 typedef DESCRIPTOR L;
59 int x0, x1, y0, y1, z0, z1;
60 T gravity, T0, deltaTemp;
61 std::vector<T> dir;
63 T forcePrefactor[L::d];
64
65 std::vector<BlockStructureD<3>*> partners;
66};
67
68template<typename T, typename DESCRIPTOR, typename DYNAMICS>
70public:
71 TotalEnthalpyPhaseChangeCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
72 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_);
73 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>* > partners) const override;
75
76private:
77 T gravity, T0, deltaTemp;
78 std::vector<T> dir;
79};
80
81
82//======================================================================
83// ======== Phase field coupling without bouancy 3D ====================//
84//======================================================================
85template<typename T, typename DESCRIPTOR>
87public:
88 PhaseFieldCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
89 T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness,
90 std::vector<BlockStructureD<3>* > partners_);
91 int extent() const override
92 {
93 return 0;
94 }
95 int extent(int whichDirection) const override
96 {
97 return 0;
98 }
99 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
101 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
102private:
103 using L = DESCRIPTOR;
104 using PHI_CACHE = descriptors::FIELD_BASE<1,0,0>;
105
106 int x0, x1, y0, y1, z0, z1;
107
108 T _rho_L, _rho_H, _delta_rho;
109 T _mu_L, _mu_H;
110 T _surface_tension, _interface_thickness;
111 T _beta, _kappa;
112
114
115 std::vector<BlockStructureD<3>*> partners;
116};
117
118template<typename T, typename DESCRIPTOR>
120public:
121 PhaseFieldCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
122 T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness);
123 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>* > partners) const override;
125
126private:
127 T _rho_L, _rho_H, _delta_rho;
128 T _mu_L, _mu_H;
129 T _surface_tension, _interface_thickness;
130};
131
132
133//======================================================================
134// ============= SmagorinskyBoussinesqCoupling 3D ===================//
135//======================================================================
136template<typename T, typename DESCRIPTOR>
138public:
139 SmagorinskyBoussinesqCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
140 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_, T smagoPrefactor_,
141 std::vector<BlockStructureD<3>* > partners_);
142 int extent() const override
143 {
144 return 0;
145 }
146 int extent(int whichDirection) const override
147 {
148 return 0;
149 }
150 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
152 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
153private:
154 typedef DESCRIPTOR L;
155 int x0, x1, y0, y1, z0, z1;
156 T gravity, T0, deltaTemp;
157 std::vector<T> dir;
158 T PrTurb;
160 T forcePrefactor[L::d];
161 T tauTurbADPrefactor;
162 T smagoPrefactor;
163
164 std::vector<BlockStructureD<3>*> partners;
165};
166
167template<typename T, typename DESCRIPTOR>
169public:
171 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
172 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_, T smagoPrefactor_);
173 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>* > partners) const override;
175
176private:
177 T gravity, T0, deltaTemp;
178 std::vector<T> dir;
179 T PrTurb;
180 T smagoPrefactor;
181};
182
183//==================================================================================================
184// ========Coupling 3D of Navier-Stokes on Advection-Diffusion====================//
185//==================================================================================================
186template<
187 typename T,
188 typename DESCRIPTOR,
189 typename ADLattice,
190 typename FIELD_A,
191 typename FIELD_B
192 >
194 public LocalPostProcessor3D<T,DESCRIPTOR> {
195public:
197 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int iC_,
198 std::vector<BlockStructureD<3>* > partners_,
199 std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, DESCRIPTOR,ADLattice> > > forces_);
200 int extent() const override
201 {
202 return 1;
203 }
204 int extent(int whichDirection) const override
205 {
206 return 1;
207 }
208 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
210 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
211
212protected:
213 std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, DESCRIPTOR, ADLattice> > > _forces;
214
215private:
216
217 int x0, x1, y0, y1, z0, z1, iC;
218
219 BlockLattice<T,ADLattice>* _partnerLattice;
220
221 T dragCoeff;
222 Cell<T,ADLattice> _cell;
223 Cell<T,ADLattice> _cellXp;
224 Cell<T,ADLattice> _cellXn;
225 Cell<T,ADLattice> _cellYp;
226 Cell<T,ADLattice> _cellYn;
227 Cell<T,ADLattice> _cellZp;
228 Cell<T,ADLattice> _cellZn;
229
230 bool par = true;
231};
232
233template<
234 typename T,
235 typename DESCRIPTOR,
236 typename ADLattice,
237 typename FIELD_A,
238 typename FIELD_B
239 >
241 public LatticeCouplingGenerator3D<T,DESCRIPTOR> {
242public:
245 std::vector<BlockStructureD<3>* > partners) const override;
248
249protected:
250 std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, DESCRIPTOR, ADLattice> > > ADforces;
251};
252
253
254//======================================================================
255// ======== Porous Regularized NSDiffusion Coupling 3D =================//
256//======================================================================
257template<typename T, typename DESCRIPTOR>
259 public LocalPostProcessor3D<T,DESCRIPTOR> {
260public:
262 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
263 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_,
264 std::vector<BlockStructureD<3>* > partners_);
265 int extent() const override
266 {
267 return 1;
268 }
269 int extent(int whichDirection) const override
270 {
271 return 1;
272 }
273 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
275 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
276private:
277 int x0, x1, y0, y1, z0, z1;
278 T gravity, T0, deltaTemp;
279 std::vector<T> dir;
280
281 std::vector<BlockStructureD<3>*> partners;
282};
283
284template<typename T, typename DESCRIPTOR>
286 public LatticeCouplingGenerator3D<T,DESCRIPTOR> {
287public:
289 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
290 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_);
292 std::vector<BlockStructureD<3>* > partners) const override;
294
295private:
296 T gravity, T0, deltaTemp;
297 std::vector<T> dir;
298};
299
300//=====================================================================================
301//============== MixedScaleBoussinesqCouplingPostProcessor3D ===============
302//=====================================================================================
303template<typename T, typename DESCRIPTOR>
305public:
306 MixedScaleBoussinesqCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
307 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_,
308 std::vector<BlockStructureD<3>* > partners_);
309 int extent() const override
310 {
311 return 0;
312 }
313 int extent(int whichDirection) const override
314 {
315 return 0;
316 }
317 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
319 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
320private:
321 typedef DESCRIPTOR L;
322 using HEAT_FLUX_CACHE = descriptors::FIELD_BASE<1, 0, 0>;
323 int x0, x1, y0, y1, z0, z1;
324 T gravity, T0, deltaTemp;
325 std::vector<T> dir;
326 T PrTurb;
328 Vector<T,L::d> forcePrefactor;
329 T tauTurbADPrefactor;
330
331 std::vector<BlockStructureD<3>*> partners;
332};
333
334template<typename T, typename DESCRIPTOR>
336public:
337 MixedScaleBoussinesqCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
338 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_);
339 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>* > partners) const override;
341
342private:
343 T gravity, T0, deltaTemp;
344 std::vector<T> dir;
345 T PrTurb;
346};
347
348//======================================================================
349// ========VANS-ADE Particle Coupling 3D ====================//
350//======================================================================
351template<
352 typename T,
353 typename DESCRIPTOR,
354 typename POROSITY,
355 typename ADLattice,
356 typename FIELD_A,
357 typename FIELD_B
358 >
360 public LocalPostProcessor3D<T,DESCRIPTOR> {
361public:
363 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int iC_,
364 std::vector<BlockStructureD<3>* > partners_,
365 std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, DESCRIPTOR,ADLattice> > > forces_);
366 int extent() const override
367 {
368 return 1;
369 }
370 int extent(int whichDirection) const override
371 {
372 return 1;
373 }
374 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
376 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
377
378protected:
379 std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, DESCRIPTOR, ADLattice> > > _forces;
380private:
381 int x0, x1, y0, y1, z0, z1, iC;
382 BlockLattice<T,ADLattice>* _partnerLattice;
383
384 Cell<T,ADLattice> _cell;
385 Cell<T,ADLattice> _cellXp;
386 Cell<T,ADLattice> _cellXn;
387 Cell<T,ADLattice> _cellYp;
388 Cell<T,ADLattice> _cellYn;
389 Cell<T,ADLattice> _cellZp;
390 Cell<T,ADLattice> _cellZn;
391
392 bool par = true;
393};
394
395template<
396 typename T,
397 typename DESCRIPTOR,
398 typename POROSITY,
399 typename ADLattice,
400 typename FIELD_A,
401 typename FIELD_B
402 >
404 public LatticeCouplingGenerator3D<T,DESCRIPTOR> {
405public:
408 std::vector<BlockStructureD<3>* > partners) const override;
411
412protected:
413 std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, DESCRIPTOR, ADLattice> > > ADforces;
414 };
415
416}
417
418#endif
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
void addForce(AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > &force)
std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > > > ADforces
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > > > _forces
AdvectionDiffusionParticleCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int iC_, std::vector< BlockStructureD< 3 > * > partners_, std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > > > forces_)
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)
Platform-abstracted block lattice for external access and inter-block interaction.
Base of a regular block.
Highest-level interface to Cell data.
Definition cell.h:148
MixedScaleBoussinesqCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_)
LatticeCouplingGenerator for advectionDiffusion coupling.
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
int extent() const override
Extent of application area (0 for purely local operations)
MixedScaleBoussinesqCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, std::vector< BlockStructureD< 3 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
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)
PhaseFieldCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness)
LatticeCouplingGenerator for advectionDiffusion coupling.
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
int extent() const override
Extent of application area (0 for purely local operations)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
PhaseFieldCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness, std::vector< BlockStructureD< 3 > * > partners_)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
PorousNavierStokesAdvectionDiffusionCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_)
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, std::vector< BlockStructureD< 3 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
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)
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
SmagorinskyBoussinesqCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_)
LatticeCouplingGenerator for advectionDiffusion coupling.
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
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)
int extent() const override
Extent of application area (0 for purely local operations)
SmagorinskyBoussinesqCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_, std::vector< BlockStructureD< 3 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
TotalEnthalpyPhaseChangeCouplingGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_)
LatticeCouplingGenerator for advectionDiffusion coupling.
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
TotalEnthalpyPhaseChangeCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, std::vector< BlockStructureD< 3 > * > partners_)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
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_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
Plain old scalar vector.
Definition vector.h:47
std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > > > ADforces
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
VolumeAveragedNavierStokesAdvectionDiffusionParticleCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int iC_, std::vector< BlockStructureD< 3 > * > partners_, std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > > > forces_)
std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, DESCRIPTOR, ADLattice > > > _forces
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)
Top level namespace for all of OpenLB.
Interface for post-processing steps – header file.
Base of a field whose size is defined by [C,U_1,...,U_N]^T * [1,V_1,...V_N].