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
37
38#include "lbm/constants/D3Q27.h"
39
41
43
44namespace vf::lbm::ad
45{
46
47constexpr void interpolateAdvectionDiffusionFC(real* const populations, real* populationsAD,
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
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
180
182 // Y - Dir
193 // Z - Dir
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
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
constexpr void interpolateAdvectionDiffusionFC(real *const populations, real *populationsAD, const real omegaDiffusivityCoarse, const real epsnew, const InterpolationCoefficients &coefficients)
constexpr void backwardChimera(real &mfa, real &mfb, real &mfc, real vv, real v2)
backward chimera transformation backwardChimera Transformation from central moments to distributions ...
constexpr void getCompressibleMacroscopicValues(const real *const &f, real &drho, real &oneOverRho, real &vx1, real &vx2, real &vx3)