Wall-normal direction¶
\[ \begin{align}\begin{aligned}\pder{\rho \ux}{t}
=
&
\dmomadv{\vx}{\vx}
\dmomadv{\vx}{\vy}
\dmomadv{\vx}{\vz}\\&
\dmompre{\vx}\\&
\dmomdif{\vx}{\vx}
\dmomdif{\vx}{\vy}
\dmomdif{\vx}{\vz}\end{aligned}\end{align} \]
Advection¶
\[\dmomadv{\vx}{\vx}\]
62const double hx_xm = HXXF(i-1);
63const double hx_x0 = HXXF(i );
64const double hx_xp = HXXF(i+1);
65const double jd_xm = JDXF(i-1);
66const double jd_x0 = JDXF(i );
67const double jd_xp = JDXF(i+1);
68const double mux_xm = + 0.5 * jd_xm / hx_xm * FLUXX(i-1, j )
69 + 0.5 * jd_x0 / hx_x0 * FLUXX(i , j );
70const double mux_xp = + 0.5 * jd_x0 / hx_x0 * FLUXX(i , j )
71 + 0.5 * jd_xp / hx_xp * FLUXX(i+1, j );
72const double ux_xm = + 0.5 * UX(i-1, j )
73 + 0.5 * UX(i , j );
74const double ux_xp = + 0.5 * UX(i , j )
75 + 0.5 * UX(i+1, j );
76src[cnt] -= 1. / jd_x0 * (
77 - mux_xm * ux_xm
78 + mux_xp * ux_xp
79);
84const double hx_xm = HXXF(i-1);
85const double hx_x0 = HXXF(i );
86const double hx_xp = HXXF(i+1);
87const double jd_xm = JDXF(i-1);
88const double jd_x0 = JDXF(i );
89const double jd_xp = JDXF(i+1);
90const double mux_xm = + 0.5 * jd_xm / hx_xm * FLUXX(i-1, j , k )
91 + 0.5 * jd_x0 / hx_x0 * FLUXX(i , j , k );
92const double mux_xp = + 0.5 * jd_x0 / hx_x0 * FLUXX(i , j , k )
93 + 0.5 * jd_xp / hx_xp * FLUXX(i+1, j , k );
94const double ux_xm = + 0.5 * UX(i-1, j , k )
95 + 0.5 * UX(i , j , k );
96const double ux_xp = + 0.5 * UX(i , j , k )
97 + 0.5 * UX(i+1, j , k );
98src[cnt] -= 1. / jd_x0 * (
99 - mux_xm * ux_xm
100 + mux_xp * ux_xp
101);
\[\dmomadv{\vx}{\vy}\]
124const double jd_xm = JDXC(i-1);
125const double jd_x0 = JDXF(i );
126const double jd_xp = JDXC(i );
127const double muy_ym = + 0.5 * jd_xm / hy * FLUXY(i-1, j )
128 + 0.5 * jd_xp / hy * FLUXY(i , j );
129const double muy_yp = + 0.5 * jd_xm / hy * FLUXY(i-1, j+1)
130 + 0.5 * jd_xp / hy * FLUXY(i , j+1);
131const double ux_ym = + 0.5 * UX(i , j-1)
132 + 0.5 * UX(i , j );
133const double ux_yp = + 0.5 * UX(i , j )
134 + 0.5 * UX(i , j+1);
135src[cnt] -= 1. / jd_x0 * (
136 - muy_ym * ux_ym
137 + muy_yp * ux_yp
138);
143const double jd_xm = JDXC(i-1);
144const double jd_x0 = JDXF(i );
145const double jd_xp = JDXC(i );
146const double muy_ym = + 0.5 * jd_xm / hy * FLUXY(i-1, j , k )
147 + 0.5 * jd_xp / hy * FLUXY(i , j , k );
148const double muy_yp = + 0.5 * jd_xm / hy * FLUXY(i-1, j+1, k )
149 + 0.5 * jd_xp / hy * FLUXY(i , j+1, k );
150const double ux_ym = + 0.5 * UX(i , j-1, k )
151 + 0.5 * UX(i , j , k );
152const double ux_yp = + 0.5 * UX(i , j , k )
153 + 0.5 * UX(i , j+1, k );
154src[cnt] -= 1. / jd_x0 * (
155 - muy_ym * ux_ym
156 + muy_yp * ux_yp
157);
\[\dmomadv{\vx}{\vz}\]
178const double jd_xm = JDXC(i-1);
179const double jd_x0 = JDXF(i );
180const double jd_xp = JDXC(i );
181const double muz_zm = + 0.5 * jd_xm / hz * FLUXZ(i-1, j , k )
182 + 0.5 * jd_xp / hz * FLUXZ(i , j , k );
183const double muz_zp = + 0.5 * jd_xm / hz * FLUXZ(i-1, j , k+1)
184 + 0.5 * jd_xp / hz * FLUXZ(i , j , k+1);
185const double ux_zm = + 0.5 * UX(i , j , k-1)
186 + 0.5 * UX(i , j , k );
187const double ux_zp = + 0.5 * UX(i , j , k )
188 + 0.5 * UX(i , j , k+1);
189src[cnt] -= 1. / jd_x0 * (
190 - muz_zm * ux_zm
191 + muz_zp * ux_zp
192);
Pressure-gradient¶
\[\dmompre{\vx}\]
325src[cnt] -= 1. / HXXF(i ) * (
326 - P(i-1, j )
327 + P(i , j )
328);
333src[cnt] -= 1. / HXXF(i ) * (
334 - P(i-1, j , k )
335 + P(i , j , k )
336);
Diffusion¶
\[\dmomdif{\vx}{\vx}\]
215const double hx_xm = HXXC(i-1);
216const double hx_xp = HXXC(i );
217const double jd_xm = JDXC(i-1);
218const double jd_x0 = JDXF(i );
219const double jd_xp = JDXC(i );
220const double txx_xm = TXX(i-1, j );
221const double txx_xp = TXX(i , j );
222src[cnt] += diffusivity / jd_x0 * (
223 - jd_xm / hx_xm * txx_xm
224 + jd_xp / hx_xp * txx_xp
225);
230const double hx_xm = HXXC(i-1);
231const double hx_xp = HXXC(i );
232const double jd_xm = JDXC(i-1);
233const double jd_x0 = JDXF(i );
234const double jd_xp = JDXC(i );
235const double txx_xm = TXX(i-1, j , k );
236const double txx_xp = TXX(i , j , k );
237src[cnt] += diffusivity / jd_x0 * (
238 - jd_xm / hx_xm * txx_xm
239 + jd_xp / hx_xp * txx_xp
240);
\[\dmomdif{\vx}{\vy}\]
262const double jd = JDXF(i );
263const double txy_ym = TXY(i , j );
264const double txy_yp = TXY(i , j+1);
265src[cnt] += diffusivity / jd * (
266 - jd / hy * txy_ym
267 + jd / hy * txy_yp
268);
273const double jd = JDXF(i );
274const double txy_ym = TXY(i , j , k );
275const double txy_yp = TXY(i , j+1, k );
276src[cnt] += diffusivity / jd * (
277 - jd / hy * txy_ym
278 + jd / hy * txy_yp
279);
\[\dmomdif{\vx}{\vz}\]
299const double jd = JDXF(i );
300const double txz_zm = TXZ(i , j , k );
301const double txz_zp = TXZ(i , j , k+1);
302src[cnt] += diffusivity / jd * (
303 - jd / hz * txz_zm
304 + jd / hz * txz_zp
305);