summaryrefslogtreecommitdiff
path: root/src/LLBM/equilibrium_density_wall.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-05-17 00:30:13 +0200
committerAdrian Kummerlaender2021-05-17 00:30:13 +0200
commita92271176a19e06611099c0eccc4e6a6887f4915 (patch)
tree54067b334bfae7d99c79cfb00da5891334f9514c /src/LLBM/equilibrium_density_wall.h
downloadSweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.tar
SweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.tar.gz
SweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.tar.bz2
SweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.tar.lz
SweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.tar.xz
SweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.tar.zst
SweepLB-a92271176a19e06611099c0eccc4e6a6887f4915.zip
Extract public version of SweepLB
Diffstat (limited to 'src/LLBM/equilibrium_density_wall.h')
-rw-r--r--src/LLBM/equilibrium_density_wall.h144
1 files changed, 144 insertions, 0 deletions
diff --git a/src/LLBM/equilibrium_density_wall.h b/src/LLBM/equilibrium_density_wall.h
new file mode 100644
index 0000000..598d59d
--- /dev/null
+++ b/src/LLBM/equilibrium_density_wall.h
@@ -0,0 +1,144 @@
+#pragma once
+
+#include "wall.h"
+#include "concepts.h"
+
+struct EquilibriumDensityWallO {
+
+template <concepts::Arithmetic V, concepts::Arithmetic T>
+static void apply(V f_curr[19], V f_next[19], T rho_w, WallNormal<1,0,0>) {
+ V u_w = (rho_w - f_curr[0] - T{2.00000000000000}*f_curr[11] - f_curr[12] - f_curr[14] - T{2.00000000000000}*f_curr[15] - f_curr[16] - f_curr[18] - T{2.00000000000000}*f_curr[1] - f_curr[2] - f_curr[4] - T{2.00000000000000}*f_curr[5] - f_curr[6] - T{2.00000000000000}*f_curr[8] - f_curr[9])/rho_w;
+ V rho = rho_w;
+ V u[3] { u_w, 0., 0. };
+ V e0 = T{0.0277777777777778}*rho;
+ V e1 = u[1] + u[2];
+ V e2 = T{4.50000000000000}*(e1*e1);
+ V e3 = T{3.00000000000000}*u[2];
+ V e4 = u[1]*u[1];
+ V e5 = T{1.50000000000000}*e4;
+ V e6 = -e5;
+ V e7 = u[0]*u[0];
+ V e8 = T{1.50000000000000}*e7;
+ V e9 = T{1.00000000000000} - e8;
+ V e10 = e6 + e9;
+ V e11 = e10 + e3;
+ V e12 = T{3.00000000000000}*u[1];
+ V e13 = u[2]*u[2];
+ V e14 = T{1.50000000000000}*e13;
+ V e15 = -e14;
+ V e16 = e12 + e15;
+ V e17 = T{3.00000000000000}*u[0];
+ V e18 = -u[2];
+ V e19 = e18 + u[0];
+ V e20 = -T{4.50000000000000}*e19*e19;
+ V e21 = e14 + e5 + T{-1.00000000000000};
+ V e22 = e21 + e8;
+ V e23 = e22 - e3;
+ V e24 = T{0.0555555555555556}*rho;
+ V e25 = T{3.00000000000000}*e13;
+ V e26 = u[0] + u[2];
+ V e27 = T{4.50000000000000}*(e26*e26);
+ V e28 = e15 + e17;
+ V e29 = e18 + u[1];
+ V e30 = -T{4.50000000000000}*e29*e29;
+ V e31 = -e12;
+ V e32 = u[0] - u[1];
+ V e33 = -T{4.50000000000000}*e32*e32;
+ V e34 = e17 + e22;
+ V e35 = T{3.00000000000000}*e4;
+ V e36 = u[0] + u[1];
+ V e37 = T{4.50000000000000}*(e36*e36);
+ V e38 = T{3.00000000000000}*e7;
+ V e39 = e8 + T{-1.00000000000000};
+ V e40 = -e17 + e22;
+ V e41 = e22 + e3;
+ f_next[0] = e0*(e11 + e16 + e2);
+ f_next[1] = -e0*(e17 + e20 + e23);
+ f_next[2] = e24*(e11 + e25);
+ f_next[3] = e0*(e11 + e27 + e28);
+ f_next[4] = -e0*(e12 + e23 + e30);
+ f_next[5] = -e0*(e31 + e33 + e34);
+ f_next[6] = e24*(e16 + e35 + e9);
+ f_next[7] = e0*(e10 + e16 + e17 + e37);
+ f_next[8] = -e24*(e17 + e21 - e38);
+ f_next[9] = -T{0.333333333333333}*e22*rho;
+ f_next[10] = e24*(e28 + e38 + e6 + T{1.00000000000000});
+ f_next[11] = -e0*(e12 + e34 - e37);
+ f_next[12] = -e24*(e12 + e14 - e35 + e39);
+ f_next[13] = -e0*(e12 + e33 + e40);
+ f_next[14] = -e0*(e30 + e31 + e41);
+ f_next[15] = -e0*(-e27 + e3 + e34);
+ f_next[16] = -e24*(-e25 + e3 + e39 + e5);
+ f_next[17] = -e0*(e20 + e3 + e40);
+ f_next[18] = -e0*(e12 - e2 + e41);
+}
+
+template <concepts::Arithmetic V, concepts::Arithmetic T>
+static void apply(V f_curr[19], V f_next[19], T rho_w, WallNormal<-1,0,0>) {
+ V u_w = (-rho_w + f_curr[0] + T{2.00000000000000}*f_curr[10] + f_curr[12] + T{2.00000000000000}*f_curr[13] + f_curr[14] + f_curr[16] + T{2.00000000000000}*f_curr[17] + f_curr[18] + f_curr[2] + T{2.00000000000000}*f_curr[3] + f_curr[4] + f_curr[6] + T{2.00000000000000}*f_curr[7] + f_curr[9])/rho_w;
+ V rho = rho_w;
+ V u[3] { u_w, 0., 0. };
+ V e0 = T{0.0277777777777778}*rho;
+ V e1 = u[1] + u[2];
+ V e2 = T{4.50000000000000}*(e1*e1);
+ V e3 = T{3.00000000000000}*u[2];
+ V e4 = u[1]*u[1];
+ V e5 = T{1.50000000000000}*e4;
+ V e6 = -e5;
+ V e7 = u[0]*u[0];
+ V e8 = T{1.50000000000000}*e7;
+ V e9 = T{1.00000000000000} - e8;
+ V e10 = e6 + e9;
+ V e11 = e10 + e3;
+ V e12 = T{3.00000000000000}*u[1];
+ V e13 = u[2]*u[2];
+ V e14 = T{1.50000000000000}*e13;
+ V e15 = -e14;
+ V e16 = e12 + e15;
+ V e17 = T{3.00000000000000}*u[0];
+ V e18 = -u[2];
+ V e19 = e18 + u[0];
+ V e20 = -T{4.50000000000000}*e19*e19;
+ V e21 = e14 + e5 + T{-1.00000000000000};
+ V e22 = e21 + e8;
+ V e23 = e22 - e3;
+ V e24 = T{0.0555555555555556}*rho;
+ V e25 = T{3.00000000000000}*e13;
+ V e26 = u[0] + u[2];
+ V e27 = T{4.50000000000000}*(e26*e26);
+ V e28 = e15 + e17;
+ V e29 = e18 + u[1];
+ V e30 = -T{4.50000000000000}*e29*e29;
+ V e31 = -e12;
+ V e32 = u[0] - u[1];
+ V e33 = -T{4.50000000000000}*e32*e32;
+ V e34 = e17 + e22;
+ V e35 = T{3.00000000000000}*e4;
+ V e36 = u[0] + u[1];
+ V e37 = T{4.50000000000000}*(e36*e36);
+ V e38 = T{3.00000000000000}*e7;
+ V e39 = e8 + T{-1.00000000000000};
+ V e40 = -e17 + e22;
+ V e41 = e22 + e3;
+ f_next[0] = e0*(e11 + e16 + e2);
+ f_next[1] = -e0*(e17 + e20 + e23);
+ f_next[2] = e24*(e11 + e25);
+ f_next[3] = e0*(e11 + e27 + e28);
+ f_next[4] = -e0*(e12 + e23 + e30);
+ f_next[5] = -e0*(e31 + e33 + e34);
+ f_next[6] = e24*(e16 + e35 + e9);
+ f_next[7] = e0*(e10 + e16 + e17 + e37);
+ f_next[8] = -e24*(e17 + e21 - e38);
+ f_next[9] = -T{0.333333333333333}*e22*rho;
+ f_next[10] = e24*(e28 + e38 + e6 + T{1.00000000000000});
+ f_next[11] = -e0*(e12 + e34 - e37);
+ f_next[12] = -e24*(e12 + e14 - e35 + e39);
+ f_next[13] = -e0*(e12 + e33 + e40);
+ f_next[14] = -e0*(e30 + e31 + e41);
+ f_next[15] = -e0*(-e27 + e3 + e34);
+ f_next[16] = -e24*(-e25 + e3 + e39 + e5);
+ f_next[17] = -e0*(e20 + e3 + e40);
+ f_next[18] = -e0*(e12 - e2 + e41);
+}
+
+};