VirtualFluids
0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
InterpolationAdvectionDiffusionFC.h
Go to the documentation of this file.
1
//=======================================================================================
2
// ____ ____ __ ______ __________ __ __ __ __
3
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4
// \ \ | | | | | |_) | | | | | | | / \ | |
5
// \ \ | | | | | _ / | | | | | | / /\ \ | |
6
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8
// \ \ | | ________________________________________________________________
9
// \ \ | | | ______________________________________________________________|
10
// \ \| | | | __ __ __ __ ______ _______
11
// \ | | |_____ | | | | | | | | | _ \ / _____)
12
// \ | | _____| | | | | | | | | | | \ \ \_______
13
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15
//
16
// This file is part of VirtualFluids. VirtualFluids is free software: you can
17
// redistribute it and/or modify it under the terms of the GNU General Public
18
// License as published by the Free Software Foundation, either version 3 of
19
// the License, or (at your option) any later version.
20
//
21
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24
// for more details.
25
//
26
// SPDX-License-Identifier: GPL-3.0-or-later
27
// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28
//
32
//=======================================================================================
33
#ifndef ADVECTION_DIFFUSION_INTERPOLATION_FC_H
34
#define ADVECTION_DIFFUSION_INTERPOLATION_FC_H
35
36
#include <
basics/constants/NumericConstants.h
>
37
38
#include "
lbm/constants/D3Q27.h
"
39
40
#include "
lbm/ChimeraTransformation.h
"
41
42
#include "
lbm/interpolation/InterpolationCoefficientsAdvectionDiffusion.h
"
43
44
namespace
vf::lbm::ad
45
{
46
47
constexpr
void
interpolateAdvectionDiffusionFC
(
real
*
const
populations,
real
* populationsAD,
48
const
real
omegaDiffusivityCoarse
,
const
real
epsnew
,
49
const
InterpolationCoefficients
&
coefficients
)
50
{
51
using namespace
::
vf::basics::constant
;
52
using namespace
::
vf::lbm::dir
;
53
using namespace
::
vf::lbm
;
54
58
real
m111
= c0o1;
59
real
m211
= c0o1;
60
real
m011
= c0o1;
61
real
m121
= c0o1;
62
real
m101
= c0o1;
63
real
m112
= c0o1;
64
real
m110
= c0o1;
65
real
m221
= c0o1;
66
real
m001
= c0o1;
67
real
m201
= c0o1;
68
real
m021
= c0o1;
69
real
m212
= c0o1;
70
real
m010
= c0o1;
71
real
m210
= c0o1;
72
real
m012
= c0o1;
73
real
m122
= c0o1;
74
real
m100
= c0o1;
75
real
m120
= c0o1;
76
real
m102
= c0o1;
77
real
m222
= c0o1;
78
real
m022
= c0o1;
79
real
m202
= c0o1;
80
real
m002
= c0o1;
81
real
m220
= c0o1;
82
real
m020
= c0o1;
83
real
m200
= c0o1;
84
real
m000
= c0o1;
85
89
real
&
populationsAD_000
=
m111
;
90
real
&
populationsAD_P00
=
m211
;
91
real
&
populationsAD_M00
=
m011
;
92
real
&
populationsAD_0P0
=
m121
;
93
real
&
populationsAD_0M0
=
m101
;
94
real
&
populationsAD_00P
=
m112
;
95
real
&
populationsAD_00M
=
m110
;
96
real
&
populationsAD_PP0
=
m221
;
97
real
&
populationsAD_MM0
=
m001
;
98
real
&
populationsAD_PM0
=
m201
;
99
real
&
populationsAD_MP0
=
m021
;
100
real
&
populationsAD_P0P
=
m212
;
101
real
&
populationsAD_M0M
=
m010
;
102
real
&
populationsAD_P0M
=
m210
;
103
real
&
populationsAD_M0P
=
m012
;
104
real
&
populationsAD_0PP
=
m122
;
105
real
&
populationsAD_0MM
=
m100
;
106
real
&
populationsAD_0PM
=
m120
;
107
real
&
populationsAD_0MP
=
m102
;
108
real
&
populationsAD_PPP
=
m222
;
109
real
&
populationsAD_MPP
=
m022
;
110
real
&
populationsAD_PMP
=
m202
;
111
real
&
populationsAD_MMP
=
m002
;
112
real
&
populationsAD_PPM
=
m220
;
113
real
&
populationsAD_MPM
=
m020
;
114
real
&
populationsAD_PMM
=
m200
;
115
real
&
populationsAD_MMM
=
m000
;
116
120
real
press = c0o1;
121
real
vvx
= c0o1;
122
real
vvy
= c0o1;
123
real
vvz
= c0o1;
124
125
getCompressibleMacroscopicValues
(populations, press,
vvx
,
vvy
,
vvz
);
126
127
m000
=
coefficients
.d000;
128
// m000 is the concentration
129
130
real
dxConcentration =
coefficients
.d100;
131
real
dyConcentration =
coefficients
.d010;
132
real
dzConcentration =
coefficients
.d001;
133
134
m100
= -(c1o1) / (c3o1 *
omegaDiffusivityCoarse
) * c1o2 * dxConcentration;
135
m010
= -(c1o1) / (c3o1 *
omegaDiffusivityCoarse
) * c1o2 * dyConcentration;
136
m001
= -(c1o1) / (c3o1 *
omegaDiffusivityCoarse
) * c1o2 * dzConcentration;
137
141
// linear combinations for second order moments
142
// const real mxxPyyPzz = m000;
143
144
m200
=
m000
* c1o3;
145
m020
=
m000
* c1o3;
146
m002
=
m000
* c1o3;
147
148
// fourth order moments
149
m022
=
m000
* c1o9;
150
m202
=
m022
;
151
m220
=
m022
;
152
153
// fifth order moments
154
155
// sixth order moment
156
m222
=
m000
* c1o27;
157
158
const
real
vxsq
=
vvx
*
vvx
;
159
const
real
vysq
=
vvy
*
vvy
;
160
const
real
vzsq
=
vvz
*
vvz
;
161
170
// X - Dir
171
backwardChimera
(
m000
,
m100
,
m200
,
vvx
,
vxsq
);
172
backwardChimera
(
m010
,
m110
,
m210
,
vvx
,
vxsq
);
173
backwardChimera
(
m020
,
m120
,
m220
,
vvx
,
vxsq
);
174
backwardChimera
(
m001
,
m101
,
m201
,
vvx
,
vxsq
);
175
backwardChimera
(
m011
,
m111
,
m211
,
vvx
,
vxsq
);
176
backwardChimera
(
m021
,
m121
,
m221
,
vvx
,
vxsq
);
177
backwardChimera
(
m002
,
m102
,
m202
,
vvx
,
vxsq
);
178
backwardChimera
(
m012
,
m112
,
m212
,
vvx
,
vxsq
);
179
backwardChimera
(
m022
,
m122
,
m222
,
vvx
,
vxsq
);
180
182
// Y - Dir
183
backwardChimera
(
m000
,
m010
,
m020
,
vvy
,
vysq
);
184
backwardChimera
(
m001
,
m011
,
m021
,
vvy
,
vysq
);
185
backwardChimera
(
m002
,
m012
,
m022
,
vvy
,
vysq
);
186
backwardChimera
(
m100
,
m110
,
m120
,
vvy
,
vysq
);
187
backwardChimera
(
m101
,
m111
,
m121
,
vvy
,
vysq
);
188
backwardChimera
(
m102
,
m112
,
m122
,
vvy
,
vysq
);
189
backwardChimera
(
m200
,
m210
,
m220
,
vvy
,
vysq
);
190
backwardChimera
(
m201
,
m211
,
m221
,
vvy
,
vysq
);
191
backwardChimera
(
m202
,
m212
,
m222
,
vvy
,
vysq
);
193
// Z - Dir
194
backwardChimera
(
m000
,
m001
,
m002
,
vvz
,
vzsq
);
195
backwardChimera
(
m010
,
m011
,
m012
,
vvz
,
vzsq
);
196
backwardChimera
(
m020
,
m021
,
m022
,
vvz
,
vzsq
);
197
backwardChimera
(
m100
,
m101
,
m102
,
vvz
,
vzsq
);
198
backwardChimera
(
m110
,
m111
,
m112
,
vvz
,
vzsq
);
199
backwardChimera
(
m120
,
m121
,
m122
,
vvz
,
vzsq
);
200
backwardChimera
(
m200
,
m201
,
m202
,
vvz
,
vzsq
);
201
backwardChimera
(
m210
,
m211
,
m212
,
vvz
,
vzsq
);
202
backwardChimera
(
m220
,
m221
,
m222
,
vvz
,
vzsq
);
203
204
205
populations[d000] =
populationsAD_000
;
206
populations[dP00] =
populationsAD_P00
;
207
populations[dM00] =
populationsAD_M00
;
208
populations[d0P0] =
populationsAD_0P0
;
209
populations[d0M0] =
populationsAD_0M0
;
210
populations[d00P] =
populationsAD_00P
;
211
populations[d00M] =
populationsAD_00M
;
212
populations[dPP0] =
populationsAD_PP0
;
213
populations[dMM0] =
populationsAD_MM0
;
214
populations[dPM0] =
populationsAD_PM0
;
215
populations[dMP0] =
populationsAD_MP0
;
216
populations[dP0P] =
populationsAD_P0P
;
217
populations[dM0M] =
populationsAD_M0M
;
218
populations[dP0M] =
populationsAD_P0M
;
219
populations[dM0P] =
populationsAD_M0P
;
220
populations[d0PP] =
populationsAD_0PP
;
221
populations[d0MM] =
populationsAD_0MM
;
222
populations[d0PM] =
populationsAD_0PM
;
223
populations[d0MP] =
populationsAD_0MP
;
224
populations[dPPP] =
populationsAD_PPP
;
225
populations[dMPP] =
populationsAD_MPP
;
226
populations[dPMP] =
populationsAD_PMP
;
227
populations[dMMP] =
populationsAD_MMP
;
228
populations[dPPM] =
populationsAD_PPM
;
229
populations[dMPM] =
populationsAD_MPM
;
230
populations[dPMM] =
populationsAD_PMM
;
231
populations[dMMM] =
populationsAD_MMM
;
232
}
233
234
}
// namespace vf::lbm::ad
235
236
#endif
237
ChimeraTransformation.h
InterpolationCoefficientsAdvectionDiffusion.h
NumericConstants.h
SPtr
std::shared_ptr< T > SPtr
Definition
PointerDefinitions.h:39
real
float real
Definition
DataTypes.h:42
D3Q27.h
vf::basics::constant
Definition
NumericConstants.h:41
vf::lbm::ad
Definition
InterpolationCoefficientsAdvectionDiffusion.h:45
vf::lbm::ad::interpolateAdvectionDiffusionFC
constexpr void interpolateAdvectionDiffusionFC(real *const populations, real *populationsAD, const real omegaDiffusivityCoarse, const real epsnew, const InterpolationCoefficients &coefficients)
Definition
InterpolationAdvectionDiffusionFC.h:47
vf::lbm::dir
Definition
D3Q27.h:42
vf::lbm
Definition
BoundaryConditions.h:41
vf::lbm::backwardChimera
constexpr void backwardChimera(real &mfa, real &mfb, real &mfc, real vv, real v2)
backward chimera transformation backwardChimera Transformation from central moments to distributions ...
Definition
ChimeraTransformation.h:108
vf::lbm::getCompressibleMacroscopicValues
constexpr void getCompressibleMacroscopicValues(const real *const &f, real &drho, real &oneOverRho, real &vx1, real &vx2, real &vx3)
Definition
MacroscopicQuantities.h:106
vf::lbm::ad::InterpolationCoefficients
Definition
InterpolationCoefficientsAdvectionDiffusion.h:56
src
lbm
refinement
InterpolationAdvectionDiffusionFC.h
Generated on Sat Sep 12 2026 02:03:21 for VirtualFluids by
1.9.8