VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
D3Q27System.cpp
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//
33//=======================================================================================
34#include "D3Q27System.h"
35
37
38namespace d3q27_system
39{
40//using namespace UbMath;
41 using namespace vf::basics::constant;
42 using namespace vf::lbm::dir;
43
44// index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
45const int DX1[] = { 0, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1 };
46const int DX2[] = { 0, 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1 };
47const int DX3[] = { 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1 };
48
49const real WEIGTH[] = { c8o27,
50 c2o27, c2o27, c2o27, c2o27, c2o27, c2o27,
51 c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54,
52 c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c1o216 };
53
54const int INVDIR[] = { d000, iP00, iM00, i0P0, i0M0, i00P, i00M,
55 iPP0, iMM0, iPM0, iMP0, iP0P, iM0M, iP0M, iM0P, i0PP, i0MM, i0PM, i0MP,
56 iPPP, iMPP, iPMP, iMMP, iPPM, iMPM, iPMM, iMMM };
57
59
60
61
62real getDensity(const real *const &f /*[27]*/)
63{
64 return vf::lbm::getDensity(f);
65}
66
67real getIncompVelocityX1(const real *const &f /*[27]*/)
68{
70}
71
72real getIncompVelocityX2(const real *const &f /*[27]*/)
73{
75}
76
77real getIncompVelocityX3(const real *const &f /*[27]*/)
78{
80}
81
82
83
84
85
86} // namespace D3Q27System
float real
Definition DataTypes.h:42
namespace for global system-functions
const int INVDIR[]
real getIncompVelocityX2(const real *const &f)
real getIncompVelocityX1(const real *const &f)
const int DX1[]
const int DX3[]
const int DX2[]
const real WEIGTH[]
real getDensity(const real *const &f)
real getIncompVelocityX3(const real *const &f)
constexpr real getIncompressibleVelocityX3(const real *const &f)
constexpr real getIncompressibleVelocityX2(const real *const &f)
constexpr real getDensity(const real *const &f)
constexpr real getIncompressibleVelocityX1(const real *const &f)