OpenLB 1.7
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// ======== Total enthalpy coupling with Boussinesq bouancy 2D and phase change====================//
35//======================================================================
36template<typename T, typename DESCRIPTOR, typename DYNAMICS>
38public:
39 TotalEnthalpyPhaseChangeCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
40 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_,
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 typedef DESCRIPTOR L;
55 int x0, x1, y0, y1;
56 T gravity, T0, deltaTemp;
57 std::vector<T> dir;
59 T forcePrefactor[L::d];
60
61 std::vector<BlockStructureD<2>*> partners;
62};
63
64template <typename T, typename DESCRIPTOR, typename DYNAMICS>
66public:
67 TotalEnthalpyPhaseChangeCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
68 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_);
69 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
71
72private:
73 T gravity, T0, deltaTemp;
74 std::vector<T> dir;
75};
76
77
78//======================================================================
79// ======== Phase field coupling without bouancy 2D ====================//
80//======================================================================
81template<typename T, typename DESCRIPTOR>
83public:
84 PhaseFieldCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
85 T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness,
86 std::vector<BlockStructureD<2>* > partners_);
87 int extent() const override
88 {
89 return 0;
90 }
91 int extent(int whichDirection) const override
92 {
93 return 0;
94 }
95 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
97 int x0_, int x1_, int y0_, int y1_) override;
98private:
99 using L = DESCRIPTOR;
100 using PHI_CACHE = descriptors::FIELD_BASE<1, 0, 0>;
101
102 int x0, x1, y0, y1;
103
104 T _rho_L, _rho_H, _delta_rho;
105 T _mu_L, _mu_H;
106 T _surface_tension, _interface_thickness;
107 T _beta, _kappa;
108
110
111 std::vector<BlockStructureD<2>*> partners;
112};
113
114template<typename T, typename DESCRIPTOR>
116public:
117 PhaseFieldCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
118 T rho_L, T rho_H, T mu_L, T mu_H, T surface_tension, T interface_thickness);
119 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
121
122private:
123 T _rho_L, _rho_H, _delta_rho;
124 T _mu_L, _mu_H;
125 T _surface_tension, _interface_thickness;
126};
127
128
129//======================================================================
130// ======== AD coupling with Boussinesq bouancy for Smagorinsky-LES ====================//
131//======================================================================
132template<typename T, typename DESCRIPTOR>
134public:
135 SmagorinskyBoussinesqCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
136 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_, T smagoPrefactor_,
137 std::vector<BlockStructureD<2>* > partners_);
138 int extent() const override
139 {
140 return 0;
141 }
142 int extent(int whichDirection) const override
143 {
144 return 0;
145 }
146 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
148 int x0_, int x1_, int y0_, int y1_) override;
149private:
150 typedef DESCRIPTOR L;
151 int x0, x1, y0, y1;
152 T gravity, T0, deltaTemp;
153 std::vector<T> dir;
154 T PrTurb;
156 T forcePrefactor[L::d];
157 T tauTurbADPrefactor;
158 T smagoPrefactor;
159
160 std::vector<BlockStructureD<2>*> partners;
161};
162
163template<typename T, typename DESCRIPTOR>
165public:
166 SmagorinskyBoussinesqCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
167 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_, T smagoPrefactor_);
168 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
170
171private:
172 T gravity, T0, deltaTemp;
173 std::vector<T> dir;
174 T PrTurb;
175 T smagoPrefactor;
176};
177
178//======================================================================
179// ======== AD coupling with Boussinesq bouancy for Mixed Scale-LES ====================//
180//======================================================================
181template<typename T, typename DESCRIPTOR>
183public:
184 MixedScaleBoussinesqCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_,
185 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_,
186 std::vector<BlockStructureD<2>* > partners_);
187 int extent() const override
188 {
189 return 0;
190 }
191 int extent(int whichDirection) const override
192 {
193 return 0;
194 }
195 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
197 int x0_, int x1_, int y0_, int y1_) override;
198private:
199 typedef DESCRIPTOR L;
200 using HEAT_FLUX_CACHE = descriptors::FIELD_BASE<1, 0, 0>;
201 int x0, x1, y0, y1;
202 T gravity, T0, deltaTemp, PrTurb;
203 std::vector<T> dir;
205 Vector<T, L::d> forcePrefactor;
206 T tauTurbADPrefactor;
207
208 std::vector<BlockStructureD<2>*> partners;
209};
210
211template<typename T, typename DESCRIPTOR>
213public:
214 MixedScaleBoussinesqCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_,
215 T gravity_, T T0_, T deltaTemp_, std::vector<T> dir_, T PrTurb_);
216 PostProcessor2D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<2>* > partners) const override;
218
219private:
220 T gravity, T0, deltaTemp, PrTurb;
221 std::vector<T> dir;
222};
223
224}
225
226#endif
Platform-abstracted block lattice for external access and inter-block interaction.
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.
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)
PostProcessor2D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 2 > * > partners) const override
TotalEnthalpyPhaseChangeCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_)
LatticeCouplingGenerator for advectionDiffusion coupling.
LatticeCouplingGenerator2D< T, DESCRIPTOR > * clone() const override
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
TotalEnthalpyPhaseChangeCouplingPostProcessor2D(int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, std::vector< BlockStructureD< 2 > * > partners_)
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.
Plain old scalar vector.
Definition vector.h:47
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].