36 int i, j, k, n, nmin, nmax;
39 double *rho_1D, *pre_1D, *eng_1D, *vx_1D, *vy_1D, *vz_1D, *marker_1D;
41 double *rhodown, *rhoup, *rhofront, *rhoback;
42 double *vxdown, *vxup, *vxfront, *vxback;
43 double *vydown, *vyup, *vyfront, *vyback;
44 double *vzdown, *vzup, *vzfront, *vzback;
46 double *pressure_solid_1D;
49 double *a_coef, *ai_coef, *b_coef, *bi_coef, *c_coef, *ci_coef;
54 double *pl, *p6, *rl, *r6;
55 double *u6, *ul, *vl, *v6;
56 double *wl, *w6, *el, *e6;
57 double *ql, *q6, *dp, *du;
58 double *dv, *dw, *dq, *de;
59 double *scratch1, *scratch2, *scratch3;
62 double *plft, *prgh, *ulft, *urgh, *rlft, *rrgh, *Cdtdx, *fCdtdx;
67 double *clft, *crgh, *plfti, *prghi, *pmid, *pmold, *wlft, *wrgh, *zlft, *zrgh;
68 double *umidl, *umidr, *umid;
70 double *dm, *dtbdm, *upmid, *xa1, *xa2, *xa3;
72 double *dvol, *dvol0, *dvol1;
75 double *fluxr, *fluxu, *fluxv, *fluxw, *fluxe, *fluxq;
84 #pragma omp parallel default(none) \
85 private(i, j, k, n, nmin, nmax, state, state_next, rho_1D, pre_1D,\
86 eng_1D, vx_1D, vy_1D, vz_1D, marker_1D, \
87 pressure_solid_1D, dx0, xa0, xa, dx, \
88 a_coef, ai_coef, b_coef, bi_coef, c_coef, ci_coef, \
89 d_x, diffa, da, ar, pl, p6, rl, r6, \
90 u6, ul, vl, v6, wl, w6, \
91 el, e6, ql, q6, dp, du, dr, deltaa, \
92 dv, dw, dq, de, scratch1, scratch2, scratch3, \
93 plft, prgh, ulft, urgh, rlft, rrgh, Cdtdx, fCdtdx, \
94 steep, flat, para, clft, crgh, plfti, prghi, pmid, \
95 pmold, wlft, wrgh, zlft, zrgh, umidl, umidr, umid, \
96 dm, dtbdm, upmid, xa1, xa2, xa3, vx_1D_old, \
97 dvol, dvol0, dvol1, delta, fluxr, fluxu, fluxv, \
98 fluxw, fluxe, fluxq, dm0, e_int_1D, rhodown, rhoup, \
99 rhofront, rhoback, vxdown, vxup, vxfront, vxback, \
100 vydown, vyup, vyfront, vyback, vzdown, vzup, vzfront, \
102 shared(x, y, z, rho, dom, \
103 pre, vx, vy, vz, marker, zza, zdz, \
104 pressure_on_solid, smallp, smallr, small, Gamma, max_array_length, flag, \
105 direction, obstacle_density, obstacle_temperature, advection, with_obstacles, \
106 viscosity_on_off, bound, inflow_density, inflow_velocity, dimension, \
107 rho_visc, vx_visc, vy_visc, vz_visc)
111 init_ppm(&rho_1D, &pre_1D, &eng_1D, &vx_1D, &vy_1D, &vz_1D, &marker_1D, &dx0, &xa0, &xa, &dx,
112 &a_coef, &ai_coef, &b_coef, &bi_coef, &c_coef, &ci_coef, &d_x, &da, &ar,
113 &dp, &dr, &du, &pl, &p6, &rl, &r6, &ul, &u6, &vl, &v6, &wl, &w6, &el, &e6, &ql,
114 &q6, &deltaa, &dv, &dw, &dq, &de, &scratch1, &scratch2, &scratch3, &diffa,
115 &plft, &prgh, &ulft, &urgh, &rlft, &rrgh, &Cdtdx, &fCdtdx, &clft, &crgh,
116 &plfti, &prghi, &pmid, &pmold, &wlft, &wrgh, &zlft, &zrgh, &umidl, &umidr,
117 &umid, &dm, &dtbdm, &upmid, &xa1, &xa2, &xa3, &vx_1D_old, &e_int_1D, &dvol,
118 &dvol0, &dvol1, &delta, &fluxr, &fluxu, &fluxv, &fluxw, &fluxe, &fluxq,
119 &dm0, &steep, &flat, ¶, &pressure_solid_1D, &rhodown, &rhoup, &rhofront,
120 &rhoback, &vxdown, &vxup, &vxfront, &vxback, &vydown, &vyup, &vyfront,
121 &vyback, &vzdown, &vzup, &vzfront, &vzback,
dimension);
126 for (j = 0; j <
y; j++) {
129 #pragma omp for schedule(static)
132 for (i = 0; i <
x; i++) {
140 for (k = 0; k <
z; k++) {
150 if (
dom[i][j][k] == 0) {
153 rho_1D[n] =
rho[i][j][k];
154 pre_1D[n] =
pre[i][j][k];
155 vx_1D[n] =
vz[i][j][k];
156 vy_1D[n] =
vx[i][j][k];
157 vz_1D[n] =
vy[i][j][k];
164 eng_1D[n] = pre_1D[n] / (rho_1D[n] *
Gamma) + 0.5 * ((pow(vx_1D[n], 2))+(pow(vy_1D[n], 2))+(pow(vz_1D[n], 2)));
171 if ((i > 0) && (
dom[i - 1][j][k] == 0) && (i < x - 1)) {
172 rhodown[n] =
rho[i - 1][j ][k];
173 vxdown[n] =
vz[i - 1][j ][k];
174 vydown[n] =
vy[i - 1][j][k];
175 vzdown[n] =
vx[i - 1][j][k];
177 if ((i > 0) && (
dom[i - 1][j][k] != 0) && (i < x - 1)) {
218 vxup[n] =
vx_visc[i + 1][j][k];
219 vyup[n] =
vy_visc[i + 1][j][k];
220 vzup[n] =
vz_visc[i + 1][j][k];
226 if ((i < x - 1) && (
dom[i + 1][j][k] == 0) && (i > 0)) {
228 vxup[n] =
vz_visc[i + 1][j][k];
229 vyup[n] =
vx_visc[i + 1][j][k];
230 vzup[n] =
vy_visc[i + 1][j][k];
232 if ((i < x - 1) && (
dom[i + 1][j][k] != 0) && (i > 0)) {
274 vxdown[n] =
vx_visc[i - 1][j][k];
275 vydown[n] =
vy_visc[i - 1][j][k];
276 vzdown[n] =
vz_visc[i - 1][j][k];
284 if ((j > 0) && (
dom[i][j - 1][k] == 0) && (j < y - 1)) {
285 rhofront[n] =
rho_visc[i][j - 1][k];
286 vxfront[n] =
vz_visc[i][j - 1][k];
287 vyfront[n] =
vx_visc[i][j - 1][k];
288 vzfront[n] =
vy_visc[i][j - 1][k];
290 if ((j > 0) && (
dom[i][j - 1][k] != 0) && (j < y - 1)) {
330 vxback[n] =
vx_visc[i][j + 1][k];
331 vyback[n] =
vy_visc[i][j + 1][k];
332 vzback[n] =
vz_visc[i][j + 1][k];
338 if ((j < y - 1) && (
dom[i][j + 1][k ] == 0) && (j > 0)) {
340 vxback[n] =
vz_visc[i][j + 1][k ];
341 vyback[n] =
vx_visc[i][j + 1][k ];
342 vzback[n] =
vy_visc[i][j + 1][k ];
344 if ((j < y - 1) && (
dom[i][j + 1][k] != 0) && (j > 0)) {
363 if (
bound.
up == 4) vxback[n] = 0.0;
380 if (
bound.
up == 4) vzback[n] = 0.0;
383 rhofront[n] =
rho_visc[i][j - 1][k];
384 vxfront[n] =
vx_visc[i][j - 1][k];
385 vyfront[n] =
vy_visc[i][j - 1][k];
386 vzfront[n] =
vz_visc[i][j - 1][k];
392 }
else if (
dom[i][j][k] == 1) {
417 if (state != state_next) {
423 int nmaxz2 = (nmax - nmin) + 6;
427 if ((nmin == 0) || (nmax == (z - 1))) {
431 if ((nmax - nmin) != (z - 1)) {
435 if (nmin == 0) lefter = 1;
438 if (nmax == (z - 1)) lefter = 2;
441 if ((nmin != 0) && (nmax != (z - 1))) lefter = 3;
444 ppm_step(i, j, k, direction, flag, nminz2, nmaxz2, a_coef, ai_coef, b_coef, bi_coef, c_coef, ci_coef,
445 d_x, diffa, da, ar, pl, p6, rl, r6, u6, ul, vl, v6, wl, w6, el,
446 e6, ql, q6, dp, du, dr, dv, dw, dq, de, scratch1, scratch2, scratch3,
447 plft, prgh, ulft, urgh, rlft, rrgh, Cdtdx, fCdtdx, steep, flat,
448 para, clft, crgh, plfti, prghi, pmid, pmold, wlft, wrgh, zlft,
449 zrgh, umidl, umidr, umid, dm, dtbdm, upmid, xa1, xa2, xa3,
450 vx_1D_old, dvol, dvol0, dvol1, delta, fluxr, fluxu, fluxv,
451 fluxw, fluxe, fluxq, dm0, e_int_1D, rho_1D, pre_1D, eng_1D,
452 vx_1D, vy_1D, vz_1D, marker_1D, pressure_solid_1D, dx0, xa0,
453 xa, dx, bound_checker, lefter, rhodown, rhoup, rhofront,
454 rhoback, vxdown, vxup, vxfront, vxback, vydown, vyup, vyfront,
458 for (kk = nmin; kk <= nmax; kk++) {
461 rho[i][j][kk] = rho_1D[n];
462 pre[i][j][kk] = pre_1D[n];
463 vz[i][j][kk] = vx_1D[n];
464 vx[i][j][kk] = vy_1D[n];
465 vy[i][j][kk] = vz_1D[n];
482 ppm_free(&rho_1D, &pre_1D, &eng_1D, &vx_1D, &vy_1D, &vz_1D, &marker_1D,
483 &pressure_solid_1D, &dx0, &xa0, &xa, &dx, &a_coef, &ai_coef, &b_coef,
484 &bi_coef, &c_coef, &ci_coef, &d_x, &da, &ar,
485 &dp, &dr, &du, &pl, &p6, &rl, &r6, &ul, &u6, &vl, &v6, &wl, &w6, &el, &e6, &ql,
486 &q6, &deltaa, &dv, &dw, &dq, &de, &scratch1, &scratch2, &scratch3, &diffa,
487 &plft, &prgh, &ulft, &urgh, &rlft, &rrgh, &Cdtdx, &fCdtdx, &clft, &crgh,
488 &plfti, &prghi, &pmid, &pmold, &wlft, &wrgh, &zlft, &zrgh, &umidl, &umidr,
489 &umid, &dm, &dtbdm, &upmid, &xa1, &xa2, &xa3, &vx_1D_old, &e_int_1D, &dvol,
490 &dvol0, &dvol1, &delta, &fluxr, &fluxu, &fluxv, &fluxw, &fluxe, &fluxq,
491 &dm0, &steep, &flat, ¶, &rhodown, &rhoup, &rhofront,
492 &rhoback, &vxdown, &vxup, &vxfront, &vxback, &vydown, &vyup, &vyfront,
493 &vyback, &vzdown, &vzup, &vzfront, &vzback,
dimension);