OpenLB 1.7
Loading...
Searching...
No Matches
guoZhaoDynamics.cse.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2024 Adrian Kummerlaender
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 DYNAMICS_GUO_ZHAO_DYNAMICS_CSE_H
25#define DYNAMICS_GUO_ZHAO_DYNAMICS_CSE_H
26
27
28#ifndef DISABLE_CSE
29
30#include "equilibrium.h"
31#include "collision.h"
32#include "latticeDescriptors.h"
33
34namespace olb {
35
36namespace collision {
37
38namespace detail {
39
40template <typename... FIELDS>
41struct SmagorinskyEffectiveOmega<BGK,descriptors::D3Q19<FIELDS...>,momenta::Forced<momenta::BulkTuple>,guoZhao::GuoZhaoSecondOrder> {
42
43template <CONCEPT(MinimalCell) CELL, typename PARAMETERS, typename V=typename CELL::value_t>
44CellStatistic<V> apply(CELL& cell, PARAMETERS& parameters) any_platform
45{
46auto x21 = cell.template getFieldComponent<olb::descriptors::FORCE>(2);
47auto x20 = cell.template getFieldComponent<olb::descriptors::FORCE>(1);
48auto x28 = parameters.template get<olb::descriptors::OMEGA>();
49auto x29 = parameters.template get<olb::collision::LES::Smagorinsky>();
50auto x22 = cell.template getFieldComponent<olb::descriptors::EPSILON>(0);
51auto x19 = cell.template getFieldComponent<olb::descriptors::FORCE>(0);
52auto x23 = cell[14] + cell[5];
53auto x24 = cell[18] + cell[9];
54auto x25 = x23 + x24 + cell[0] + cell[10] + cell[11] + cell[12] + cell[13] + cell[15] + cell[16] + cell[17] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[7] + cell[8] + V{1};
55auto x26 = V{1} / (x25);
56auto x27 = V{0.333333333333333}*cell[4];
57auto x30 = V{0.333333333333333}*cell[5];
58auto x31 = V{0.333333333333333}*cell[13];
59auto x32 = V{0.333333333333333}*cell[14];
60auto x33 = V{0.5}*x21;
61auto x34 = V{1}*cell[12];
62auto x35 = V{1}*cell[15];
63auto x36 = V{1}*cell[17];
64auto x37 = V{1}*cell[3];
65auto x38 = V{1}*cell[16];
66auto x39 = V{1}*cell[18];
67auto x40 = V{1}*cell[9];
68auto x41 = V{1}*cell[8];
69auto x42 = -x41;
70auto x43 = x40 + x42;
71auto x44 = V{1}*cell[7];
72auto x45 = V{1}*cell[6];
73auto x46 = -x45;
74auto x47 = x44 + x46;
75auto x48 = x26*(x34 + x35 + x36 - x37 - x38 - x39 + x43 + x47);
76auto x49 = x33 + x48;
77auto x50 = x49*x49;
78auto x51 = V{0.333333333333333}*cell[0];
79auto x52 = V{0.333333333333333}*cell[1];
80auto x53 = V{0.333333333333333}*cell[10];
81auto x54 = x51 + x52 + x53 - V{0.666666666666667}*cell[17] - V{0.666666666666667}*cell[18] - V{0.666666666666667}*cell[8] - V{0.666666666666667}*cell[9];
82auto x55 = V{0.333333333333333}*cell[2];
83auto x56 = V{0.333333333333333}*cell[11];
84auto x57 = x55 + x56 - V{0.666666666666667}*cell[15] - V{0.666666666666667}*cell[16] - V{0.666666666666667}*cell[6] - V{0.666666666666667}*cell[7];
85auto x58 = x25*x50 + x27 + x30 + x31 + x32 + x54 + x57 - V{0.666666666666667}*cell[12] - V{0.666666666666667}*cell[3];
86auto x59 = V{0.333333333333333}*cell[6];
87auto x60 = V{0.333333333333333}*cell[7];
88auto x61 = V{0.333333333333333}*cell[15];
89auto x62 = V{0.333333333333333}*cell[16];
90auto x63 = V{0.5}*x20;
91auto x64 = V{1}*cell[11];
92auto x65 = V{1}*cell[13];
93auto x66 = V{1}*cell[2];
94auto x67 = V{1}*cell[14];
95auto x68 = V{1}*cell[5];
96auto x69 = V{1}*cell[4];
97auto x70 = -x69;
98auto x71 = x68 + x70;
99auto x72 = x26*(x36 + x39 - x40 + x42 + x64 + x65 - x66 - x67 + x71);
100auto x73 = x63 + x72;
101auto x74 = x73*x73;
102auto x75 = V{0.333333333333333}*cell[3];
103auto x76 = V{0.333333333333333}*cell[12];
104auto x77 = x75 + x76 - V{0.666666666666667}*cell[13] - V{0.666666666666667}*cell[14] - V{0.666666666666667}*cell[4] - V{0.666666666666667}*cell[5];
105auto x78 = x25*x74 + x54 + x59 + x60 + x61 + x62 + x77 - V{0.666666666666667}*cell[11] - V{0.666666666666667}*cell[2];
106auto x79 = V{0.333333333333333}*cell[8];
107auto x80 = V{0.333333333333333}*cell[9];
108auto x81 = V{0.333333333333333}*cell[17];
109auto x82 = V{0.333333333333333}*cell[18];
110auto x83 = V{1}*cell[10];
111auto x84 = V{1}*cell[1];
112auto x85 = V{0.5}*x19 + x26*(x35 + x38 - x44 + x46 + x65 + x67 - x68 + x70 + x83 - x84);
113auto x86 = x85*x85;
114auto x87 = x25*x86 + x51 + x57 + x77 + x79 + x80 + x81 + x82 - V{0.666666666666667}*cell[10] - V{0.666666666666667}*cell[1];
115auto x88 = x25*x73;
116auto x89 = x85*x88;
117auto x90 = x49*x88;
118auto x91 = x25*x49*x85 - x35 + x38 + x47;
119auto x92 = V{1} / (V{3.00000046417339}*util::sqrt(x26*(x29*x29)*util::sqrt((x23 + x89 - cell[13] - cell[4])*(-x65 + x67 + x71 + x89) + (x24 + x90 - cell[17] - cell[8])*(-x36 + x39 + x43 + x90) + V{0.5}*(x58*x58) + V{0.5}*(x78*x78) + V{0.5}*(x87*x87) + x91*x91) + V{0.0277777691819762}/((x28)*(x28))) + V{0.5}/x28);
120auto x93 = V{1} / (x22);
121auto x94 = x93*(V{1.5}*x50 + V{1.5}*x74 + V{1.5}*x86);
122auto x95 = V{1} - x94;
123auto x96 = V{1} - x92;
124auto x97 = V{0.0555555555555556}*cell[0] + V{0.0555555555555556}*cell[10] + V{0.0555555555555556}*cell[11] + V{0.0555555555555556}*cell[12] + V{0.0555555555555556}*cell[13] + V{0.0555555555555556}*cell[14] + V{0.0555555555555556}*cell[15] + V{0.0555555555555556}*cell[16] + V{0.0555555555555556}*cell[17] + V{0.0555555555555556}*cell[18] + V{0.0555555555555556}*cell[1] + V{0.0555555555555556}*cell[2] + V{0.0555555555555556}*cell[3] + V{0.0555555555555556}*cell[4] + V{0.0555555555555556}*cell[5] + V{0.0555555555555556}*cell[6] + V{0.0555555555555556}*cell[7] + V{0.0555555555555556}*cell[8] + V{0.0555555555555556}*cell[9] + V{0.0555555555555556};
125auto x98 = V{4.5}*cell[14];
126auto x99 = V{4.5}*cell[16];
127auto x100 = V{4.5}*cell[5];
128auto x101 = V{4.5}*cell[7];
129auto x102 = V{4.5}*cell[13] - V{4.5}*cell[4];
130auto x103 = V{4.5}*cell[15] - V{4.5}*cell[6];
131auto x104 = V{2.25}*x19 + x26*(-x100 - x101 + x102 + x103 + x98 + x99 + V{4.5}*cell[10] - V{4.5}*cell[1]);
132auto x105 = x104*x85*x93;
133auto x106 = x94 + V{-1};
134auto x107 = V{1.5}*x19;
135auto x108 = V{3}*cell[14];
136auto x109 = V{3}*cell[16];
137auto x110 = V{3}*cell[5];
138auto x111 = V{3}*cell[7];
139auto x112 = V{3}*cell[13] - V{3}*cell[4];
140auto x113 = V{3}*cell[15] - V{3}*cell[6];
141auto x114 = x26*(x108 + x109 - x110 - x111 + x112 + x113 + V{3}*cell[10] - V{3}*cell[1]);
142auto x115 = x107 + x114;
143auto x116 = x106 + x115;
144auto x117 = V{2.25}*x20;
145auto x118 = V{4.5}*cell[18];
146auto x119 = V{4.5}*cell[9];
147auto x120 = V{4.5}*cell[17] - V{4.5}*cell[8];
148auto x121 = x26*(x100 + x102 + x118 - x119 + x120 - x98 + V{4.5}*cell[11] - V{4.5}*cell[2]);
149auto x122 = x117 + x121;
150auto x123 = x122*x73*x93;
151auto x124 = V{1.5}*x20;
152auto x125 = V{3}*cell[18];
153auto x126 = V{3}*cell[9];
154auto x127 = V{3}*cell[17] - V{3}*cell[8];
155auto x128 = x26*(-x108 + x110 + x112 + x125 - x126 + x127 + V{3}*cell[11] - V{3}*cell[2]);
156auto x129 = x124 + x128;
157auto x130 = x106 + x129;
158auto x131 = V{2.25}*x21;
159auto x132 = x26*(x101 + x103 - x118 + x119 + x120 - x99 + V{4.5}*cell[12] - V{4.5}*cell[3]);
160auto x133 = x131 + x132;
161auto x134 = x133*x49*x93;
162auto x135 = V{1.5}*x21;
163auto x136 = x26*(-x109 + x111 + x113 - x125 + x126 + x127 + V{3}*cell[12] - V{3}*cell[3]);
164auto x137 = x135 + x136;
165auto x138 = V{0.0277777777777778}*cell[0] + V{0.0277777777777778}*cell[10] + V{0.0277777777777778}*cell[11] + V{0.0277777777777778}*cell[12] + V{0.0277777777777778}*cell[13] + V{0.0277777777777778}*cell[14] + V{0.0277777777777778}*cell[15] + V{0.0277777777777778}*cell[16] + V{0.0277777777777778}*cell[17] + V{0.0277777777777778}*cell[18] + V{0.0277777777777778}*cell[1] + V{0.0277777777777778}*cell[2] + V{0.0277777777777778}*cell[3] + V{0.0277777777777778}*cell[4] + V{0.0277777777777778}*cell[5] + V{0.0277777777777778}*cell[6] + V{0.0277777777777778}*cell[7] + V{0.0277777777777778}*cell[8] + V{0.0277777777777778}*cell[9] + V{0.0277777777777778};
166auto x139 = x93*(x104 + x122)*(x73 + x85);
167auto x140 = x93*(x104 - x117 - x121)*(-x63 - x72 + x85);
168auto x141 = x129 + x95;
169auto x142 = -x107 - x114;
170auto x143 = x93*(x104 + x133)*(x49 + x85);
171auto x144 = -x33 - x48;
172auto x145 = -x131 - x132;
173auto x146 = x93*(x104 + x145)*(x144 + x85);
174auto x147 = x137 + x95;
175auto x148 = x93*(x122 + x133)*(x49 + x73);
176auto x149 = x93*(x122 + x145)*(x144 + x73);
177auto x150 = -x124 - x128;
178auto x151 = x115 + x95;
179auto x152 = -x135 - x136;
180cell[0] = x92*(x95*(x27 + x30 + x31 + x32 + x51 + x52 + x53 + x55 + x56 + x59 + x60 + x61 + x62 + x75 + x76 + x79 + x80 + x81 + x82 + V{0.333333333333333}) + V{-0.333333333333333}) + V{1}*x96*cell[0];
181cell[1] = x84*x96 - x92*(x97*(-x105 + x116) + V{0.0555555555555556});
182cell[2] = x66*x96 - x92*(x97*(-x123 + x130) + V{0.0555555555555556});
183cell[3] = x37*x96 - x92*(x97*(x106 - x134 + x137) + V{0.0555555555555556});
184cell[4] = x69*x96 - x92*(x138*(x116 + x129 - x139) + V{0.0277777777777778});
185cell[5] = x68*x96 + x92*(x138*(x140 + x141 + x142) + V{-0.0277777777777778});
186cell[6] = x45*x96 - x92*(x138*(x116 + x137 - x143) + V{0.0277777777777778});
187cell[7] = x44*x96 + x92*(x138*(x142 + x146 + x147) + V{-0.0277777777777778});
188cell[8] = x41*x96 - x92*(x138*(x130 + x137 - x148) + V{0.0277777777777778});
189cell[9] = x40*x96 + x92*(x138*(x147 + x149 + x150) + V{-0.0277777777777778});
190cell[10] = x83*x96 + x92*(x97*(x105 + x151) + V{-0.0555555555555556});
191cell[11] = x64*x96 + x92*(x97*(x123 + x141) + V{-0.0555555555555556});
192cell[12] = x34*x96 + x92*(x97*(x134 + x147) + V{-0.0555555555555556});
193cell[13] = x65*x96 + x92*(x138*(x129 + x139 + x151) + V{-0.0277777777777778});
194cell[14] = x67*x96 + x92*(x138*(x140 + x150 + x151) + V{-0.0277777777777778});
195cell[15] = x35*x96 + x92*(x138*(x137 + x143 + x151) + V{-0.0277777777777778});
196cell[16] = x38*x96 + x92*(x138*(x146 + x151 + x152) + V{-0.0277777777777778});
197cell[17] = x36*x96 + x92*(x138*(x137 + x141 + x148) + V{-0.0277777777777778});
198cell[18] = x39*x96 + x92*(x138*(x141 + x149 + x152) + V{-0.0277777777777778});
199return { x25, x50 + x74 + x86 };
200}
201
202template <typename CELL, typename PARAMETERS, typename V=typename CELL::value_t>
203auto computeEffectiveOmega(CELL& cell, PARAMETERS& parameters) any_platform
204{
205auto x19 = cell.template getFieldComponent<olb::descriptors::FORCE>(0);
206auto x21 = cell.template getFieldComponent<olb::descriptors::FORCE>(2);
207auto x28 = parameters.template get<olb::descriptors::OMEGA>();
208auto x20 = cell.template getFieldComponent<olb::descriptors::FORCE>(1);
209auto x29 = parameters.template get<olb::collision::LES::Smagorinsky>();
210auto x0 = cell[14] + cell[5];
211auto x1 = cell[18] + cell[9];
212auto x2 = x0 + x1 + cell[0] + cell[10] + cell[11] + cell[12] + cell[13] + cell[15] + cell[16] + cell[17] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[7] + cell[8] + V{1};
213auto x3 = V{1} / (x2);
214auto x4 = V{1}*cell[15];
215auto x5 = V{1}*cell[17];
216auto x6 = V{1}*cell[16];
217auto x7 = V{1}*cell[18];
218auto x8 = V{1}*cell[9];
219auto x9 = -V{1}*cell[8];
220auto x10 = x8 + x9;
221auto x11 = V{1}*cell[7];
222auto x12 = -V{1}*cell[6];
223auto x13 = x11 + x12;
224auto x14 = V{0.5}*x21 + x3*(x10 + x13 + x4 + x5 - x6 - x7 + V{1}*cell[12] - V{1}*cell[3]);
225auto x15 = V{0.333333333333333}*cell[0];
226auto x16 = x15 + V{0.333333333333333}*cell[10] - V{0.666666666666667}*cell[17] - V{0.666666666666667}*cell[18] + V{0.333333333333333}*cell[1] - V{0.666666666666667}*cell[8] - V{0.666666666666667}*cell[9];
227auto x17 = V{0.333333333333333}*cell[11] - V{0.666666666666667}*cell[15] - V{0.666666666666667}*cell[16] + V{0.333333333333333}*cell[2] - V{0.666666666666667}*cell[6] - V{0.666666666666667}*cell[7];
228auto x18 = x16 + x17 + x2*(x14*x14) - V{0.666666666666667}*cell[12] + V{0.333333333333333}*cell[13] + V{0.333333333333333}*cell[14] - V{0.666666666666667}*cell[3] + V{0.333333333333333}*cell[4] + V{0.333333333333333}*cell[5];
229auto x22 = V{1}*cell[13];
230auto x23 = V{1}*cell[14];
231auto x24 = V{1}*cell[5];
232auto x25 = -V{1}*cell[4];
233auto x26 = x24 + x25;
234auto x27 = V{0.5}*x20 + x3*(x22 - x23 + x26 + x5 + x7 - x8 + x9 + V{1}*cell[11] - V{1}*cell[2]);
235auto x30 = V{0.333333333333333}*cell[12] - V{0.666666666666667}*cell[13] - V{0.666666666666667}*cell[14] + V{0.333333333333333}*cell[3] - V{0.666666666666667}*cell[4] - V{0.666666666666667}*cell[5];
236auto x31 = x16 + x2*(x27*x27) + x30 - V{0.666666666666667}*cell[11] + V{0.333333333333333}*cell[15] + V{0.333333333333333}*cell[16] - V{0.666666666666667}*cell[2] + V{0.333333333333333}*cell[6] + V{0.333333333333333}*cell[7];
237auto x32 = V{0.5}*x19 + x3*(-x11 + x12 + x22 + x23 - x24 + x25 + x4 + x6 + V{1}*cell[10] - V{1}*cell[1]);
238auto x33 = x15 + x17 + x2*(x32*x32) + x30 - V{0.666666666666667}*cell[10] + V{0.333333333333333}*cell[17] + V{0.333333333333333}*cell[18] - V{0.666666666666667}*cell[1] + V{0.333333333333333}*cell[8] + V{0.333333333333333}*cell[9];
239auto x34 = x2*x27;
240auto x35 = x32*x34;
241auto x36 = x14*x34;
242auto x37 = x13 + x14*x2*x32 - x4 + x6;
243return V{1} / (V{3.00000046417339}*util::sqrt(x3*(x29*x29)*util::sqrt((x0 + x35 - cell[13] - cell[4])*(-x22 + x23 + x26 + x35) + (x1 + x36 - cell[17] - cell[8])*(x10 + x36 - x5 + x7) + V{0.5}*(x18*x18) + V{0.5}*(x31*x31) + V{0.5}*(x33*x33) + x37*x37) + V{0.0277777691819762}/((x28)*(x28))) + V{0.5}/x28);
244}
245
246};
247
248
249}
250
251}
252
253}
254
255#endif
256
257#endif
Descriptor for all types of 2D and 3D lattices.
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
Top level namespace for all of OpenLB.
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition platform.h:78
V computeEffectiveOmega(CELL &cell, PARAMETERS &parameters) any_platform
CellStatistic< V > apply(CELL &cell, PARAMETERS &parameters) any_platform