Stream-wise direction¶
\[ \begin{align}\begin{aligned}\pder{\rho \uy}{t}
=
&
\dmomadv{\vy}{\vx}
\dmomadv{\vy}{\vy}
\dmomadv{\vy}{\vz}\\&
\dmompre{\vy}\\&
\dmomdif{\vy}{\vx}
\dmomdif{\vy}{\vy}
\dmomdif{\vy}{\vz}\end{aligned}\end{align} \]
Advection¶
\[\dmomadv{\vy}{\vx}\]
60const double hx_xm = HXXF(i );
61const double hx_xp = HXXF(i+1);
62const double jd_xm = JDXF(i );
63const double jd_x0 = JDXC(i );
64const double jd_xp = JDXF(i+1);
65const double mux_xm = + 0.5 * jd_xm / hx_xm * FLUXX(i , j-1)
66 + 0.5 * jd_xm / hx_xm * FLUXX(i , j );
67const double mux_xp = + 0.5 * jd_xp / hx_xp * FLUXX(i+1, j-1)
68 + 0.5 * jd_xp / hx_xp * FLUXX(i+1, j );
69const double uy_xm = + 0.5 * UY(i-1, j )
70 + 0.5 * UY(i , j );
71const double uy_xp = + 0.5 * UY(i , j )
72 + 0.5 * UY(i+1, j );
73src[cnt] -= 1. / jd_x0 * (
74 - mux_xm * uy_xm
75 + mux_xp * uy_xp
76);
81const double hx_xm = HXXF(i );
82const double hx_xp = HXXF(i+1);
83const double jd_xm = JDXF(i );
84const double jd_x0 = JDXC(i );
85const double jd_xp = JDXF(i+1);
86const double mux_xm = + 0.5 * jd_xm / hx_xm * FLUXX(i , j-1, k )
87 + 0.5 * jd_xm / hx_xm * FLUXX(i , j , k );
88const double mux_xp = + 0.5 * jd_xp / hx_xp * FLUXX(i+1, j-1, k )
89 + 0.5 * jd_xp / hx_xp * FLUXX(i+1, j , k );
90const double uy_xm = + 0.5 * UY(i-1, j , k )
91 + 0.5 * UY(i , j , k );
92const double uy_xp = + 0.5 * UY(i , j , k )
93 + 0.5 * UY(i+1, j , k );
94src[cnt] -= 1. / jd_x0 * (
95 - mux_xm * uy_xm
96 + mux_xp * uy_xp
97);
\[\dmomadv{\vy}{\vy}\]
119const double jd = JDXC(i );
120const double muy_ym = + 0.5 * jd / hy * FLUXY(i , j-1)
121 + 0.5 * jd / hy * FLUXY(i , j );
122const double muy_yp = + 0.5 * jd / hy * FLUXY(i , j )
123 + 0.5 * jd / hy * FLUXY(i , j+1);
124const double uy_ym = + 0.5 * UY(i , j-1)
125 + 0.5 * UY(i , j );
126const double uy_yp = + 0.5 * UY(i , j )
127 + 0.5 * UY(i , j+1);
128src[cnt] -= 1. / jd * (
129 - muy_ym * uy_ym
130 + muy_yp * uy_yp
131);
136const double jd = JDXC(i );
137const double muy_ym = + 0.5 * jd / hy * FLUXY(i , j-1, k )
138 + 0.5 * jd / hy * FLUXY(i , j , k );
139const double muy_yp = + 0.5 * jd / hy * FLUXY(i , j , k )
140 + 0.5 * jd / hy * FLUXY(i , j+1, k );
141const double uy_ym = + 0.5 * UY(i , j-1, k )
142 + 0.5 * UY(i , j , k );
143const double uy_yp = + 0.5 * UY(i , j , k )
144 + 0.5 * UY(i , j+1, k );
145src[cnt] -= 1. / jd * (
146 - muy_ym * uy_ym
147 + muy_yp * uy_yp
148);
\[\dmomadv{\vy}{\vz}\]
168const double jd = JDXC(i );
169const double muz_zm = + 0.5 * jd / hz * FLUXZ(i , j-1, k )
170 + 0.5 * jd / hz * FLUXZ(i , j , k );
171const double muz_zp = + 0.5 * jd / hz * FLUXZ(i , j-1, k+1)
172 + 0.5 * jd / hz * FLUXZ(i , j , k+1);
173const double uy_zm = + 0.5 * UY(i , j , k-1)
174 + 0.5 * UY(i , j , k );
175const double uy_zp = + 0.5 * UY(i , j , k )
176 + 0.5 * UY(i , j , k+1);
177src[cnt] -= 1. / jd * (
178 - muz_zm * uy_zm
179 + muz_zp * uy_zp
180);
Pressure-gradient¶
\[\dmompre{\vy}\]
313src[cnt] -= 1. / hy * (
314 - P(i , j-1)
315 + P(i , j )
316);
321src[cnt] -= 1. / hy * (
322 - P(i , j-1, k )
323 + P(i , j , k )
324);
Diffusion¶
\[\dmomdif{\vy}{\vx}\]
203const double hx_xm = HXXF(i );
204const double hx_xp = HXXF(i+1);
205const double jd_xm = JDXF(i );
206const double jd_x0 = JDXC(i );
207const double jd_xp = JDXF(i+1);
208const double txy_xm = TXY(i , j );
209const double txy_xp = TXY(i+1, j );
210src[cnt] += diffusivity / jd_x0 * (
211 - jd_xm / hx_xm * txy_xm
212 + jd_xp / hx_xp * txy_xp
213);
218const double hx_xm = HXXF(i );
219const double hx_xp = HXXF(i+1);
220const double jd_xm = JDXF(i );
221const double jd_x0 = JDXC(i );
222const double jd_xp = JDXF(i+1);
223const double txy_xm = TXY(i , j , k );
224const double txy_xp = TXY(i+1, j , k );
225src[cnt] += diffusivity / jd_x0 * (
226 - jd_xm / hx_xm * txy_xm
227 + jd_xp / hx_xp * txy_xp
228);
\[\dmomdif{\vy}{\vy}\]
250const double jd = JDXC(i );
251const double tyy_ym = TYY(i , j-1);
252const double tyy_yp = TYY(i , j );
253src[cnt] += diffusivity / jd * (
254 - jd / hy * tyy_ym
255 + jd / hy * tyy_yp
256);
261const double jd = JDXC(i );
262const double tyy_ym = TYY(i , j-1, k );
263const double tyy_yp = TYY(i , j , k );
264src[cnt] += diffusivity / jd * (
265 - jd / hy * tyy_ym
266 + jd / hy * tyy_yp
267);
\[\dmomdif{\vy}{\vz}\]
287const double jd = JDXC(i );
288const double tyz_zm = TYZ(i , j , k );
289const double tyz_zp = TYZ(i , j , k+1);
290src[cnt] += diffusivity / jd * (
291 - jd / hz * tyz_zm
292 + jd / hz * tyz_zp
293);