OpenLB 1.8.1
Loading...
Searching...
No Matches
navierStokesAdvectionDiffusionCouplingPostProcessor2D.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_ADVECTION_DIFFUSION_COUPLING_POST_PROCESSOR_2D_H
25#define NAVIER_STOKES_ADVECTION_DIFFUSION_COUPLING_POST_PROCESSOR_2D_H
26
27#include "core/blockStructure.h"
28#include "core/postProcessing.h"
29#include "utilities/omath.h"
30
31namespace olb {
32
33//======================================================================
34// ======== Phase field coupling without bouancy 2D ====================//
35//======================================================================
36template<typename T, typename DESCRIPTOR>
38public:
39 PhaseFieldCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
40 T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness,
41 std::vector<BlockStructureD<2>* > partners_);
42 int extent() const override
43 {
44 return 0;
45 }
46 int extent(int whichDirection) const override
47 {
48 return 0;
49 }
50 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
52 int x0_, int x1_, int y0_, int y1_) override;
53private:
54 using L = DESCRIPTOR;
55 using PHI_CACHE = descriptors::FIELD_BASE<1, 0, 0>;
56
57 int x0, x1, y0, y1;
58
59 T _rho_L, _rho_H, _delta_rho;
60 T _mu_L, _mu_H;
61 T _surface_tension, _interface_thickness;
62 T _beta, _kappa;
63
65
66 std::vector<BlockStructureD<2>*> partners;
67};
68
69template<typename T, typename DESCRIPTOR>
71public:
72 PhaseFieldCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
73 T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness);
74 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
76
77private:
78 T _rho_L, _rho_H, _delta_rho;
79 T _mu_L, _mu_H;
80 T _surface_tension, _interface_thickness;
81};
82
83
84//======================================================================
85// ======== AD coupling with Boussinesq bouancy for Smagorinsky-LES ====================//
86//======================================================================
87template<typename T, typename DESCRIPTOR>
89public:
90 SmagorinskyBoussinesqCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
91 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_, T smagoPrefactor_,
92 std::vector<BlockStructureD<2>* > partners_);
93 int extent() const override
94 {
95 return 0;
96 }
97 int extent(int whichDirection) const override
98 {
99 return 0;
100 }
101 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
103 int x0_, int x1_, int y0_, int y1_) override;
104private:
105 typedef DESCRIPTOR L;
106 int x0, x1, y0, y1;
107 T gravity, T0, deltaTemp;
108 std::vector<T> dir;
109 T PrTurb;
111 T forcePrefactor[L::d];
112 T tauTurbADPrefactor;
113 T smagoPrefactor;
114
115 std::vector<BlockStructureD<2>*> partners;
116};
117
118template<typename T, typename DESCRIPTOR>
120public:
121 SmagorinskyBoussinesqCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
122 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_, T smagoPrefactor_);
123 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
125
126private:
127 T gravity, T0, deltaTemp;
128 std::vector<T> dir;
129 T PrTurb;
130 T smagoPrefactor;
131};
132
133//======================================================================
134// ======== AD coupling with Boussinesq bouancy for Mixed Scale-LES ====================//
135//======================================================================
136template<typename T, typename DESCRIPTOR>
138public:
139 MixedScaleBoussinesqCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
140 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_,
141 std::vector<BlockStructureD<2>* > 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_) override;
153private:
154 typedef DESCRIPTOR L;
155 using HEAT_FLUX_CACHE = descriptors::FIELD_BASE<1, 0, 0>;
156 int x0, x1, y0, y1;
157 T gravity, T0, deltaTemp, PrTurb;
158 std::vector<T> dir;
160 Vector<T, L::d> forcePrefactor;
161 T tauTurbADPrefactor;
162
163 std::vector<BlockStructureD<2>*> partners;
164};
165
166template<typename T, typename DESCRIPTOR>
168public:
169 MixedScaleBoussinesqCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
170 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_);
171 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
173
174private:
175 T gravity, T0, deltaTemp, PrTurb;
176 std::vector<T> dir;
177};
178
179}
180
181#endif
Base of a regular block.
MixedScaleBoussinesqCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_)
LatticeCouplingGenerator for advectionDiffusion coupling.
PostProcessor2D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 2 > * > partners) const override
LatticeCouplingGenerator2D< T, DESCRIPTOR > * clone() const override
MixedScaleBoussinesqCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, std::vector< BlockStructureD< 2 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
int extent() const override
Extent of application area (0 for purely local operations)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
PostProcessor2D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 2 > * > partners) const override
LatticeCouplingGenerator2D< T, DESCRIPTOR > * clone() const override
PhaseFieldCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_, T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness)
LatticeCouplingGenerator for advectionDiffusion coupling.
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.
PhaseFieldCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_, T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness, std::vector< BlockStructureD< 2 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
int extent() const override
Extent of application area (0 for purely local operations)
Interface of 2D post-processing steps.
Definition aliases.h:43
LatticeCouplingGenerator2D< T, DESCRIPTOR > * clone() const override
PostProcessor2D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 2 > * > partners) const override
SmagorinskyBoussinesqCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_)
LatticeCouplingGenerator for advectionDiffusion coupling.
SmagorinskyBoussinesqCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_, std::vector< BlockStructureD< 2 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) 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)
int extent() const override
Extent of application area (0 for purely local operations)
Plain old scalar vector.
Top level namespace for all of OpenLB.
Interface for post-processing steps – header file.
Base of a field whose size is defined by [C_0,C_1,C_2]^T * [1,D,Q].
Definition fields.h:52