36 int i, j, k, n, nmin, nmax;
41 double *rho_1D, *pre_1D, *eng_1D, *vx_1D, *vy_1D, *vz_1D, *marker_1D;
43 double *rhodown, *rhoup, *rhofront, *rhoback;
44 double *vxdown, *vxup, *vxfront, *vxback;
45 double *vydown, *vyup, *vyfront, *vyback;
46 double *vzdown, *vzup, *vzfront, *vzback;
48 double *pressure_solid_1D;
51 double *a_coef, *ai_coef, *b_coef, *bi_coef, *c_coef, *ci_coef;
56 double *pl, *p6, *rl, *r6;
57 double *u6, *ul, *vl, *v6;
58 double *wl, *w6, *el, *e6;
59 double *ql, *q6, *dp, *du;
60 double *dv, *dw, *dq, *de;
61 double *scratch1, *scratch2, *scratch3;
64 double *plft, *prgh, *ulft, *urgh, *rlft, *rrgh, *Cdtdx, *fCdtdx;
69 double *clft, *crgh, *plfti, *prghi, *pmid, *pmold, *wlft, *wrgh, *zlft, *zrgh;
70 double *umidl, *umidr, *umid;
72 double *dm, *dtbdm, *upmid, *xa1, *xa2, *xa3;
74 double *dvol, *dvol0, *dvol1;
77 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, zya, zdy, \
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)
112 init_ppm(&rho_1D, &pre_1D, &eng_1D, &vx_1D, &vy_1D, &vz_1D, &marker_1D, &dx0, &xa0, &xa, &dx,
113 &a_coef, &ai_coef, &b_coef, &bi_coef, &c_coef, &ci_coef, &d_x, &da, &ar,
114 &dp, &dr, &du, &pl, &p6, &rl, &r6, &ul, &u6, &vl, &v6, &wl, &w6, &el, &e6, &ql,
115 &q6, &deltaa, &dv, &dw, &dq, &de, &scratch1, &scratch2, &scratch3, &diffa,
116 &plft, &prgh, &ulft, &urgh, &rlft, &rrgh, &Cdtdx, &fCdtdx, &clft, &crgh,
117 &plfti, &prghi, &pmid, &pmold, &wlft, &wrgh, &zlft, &zrgh, &umidl, &umidr,
118 &umid, &dm, &dtbdm, &upmid, &xa1, &xa2, &xa3, &vx_1D_old, &e_int_1D, &dvol,
119 &dvol0, &dvol1, &delta, &fluxr, &fluxu, &fluxv, &fluxw, &fluxe, &fluxq,
120 &dm0, &steep, &flat, ¶, &pressure_solid_1D, &rhodown, &rhoup, &rhofront,
121 &rhoback, &vxdown, &vxup, &vxfront, &vxback, &vydown, &vyup, &vyfront,
122 &vyback, &vzdown, &vzup, &vzfront, &vzback,
dimension);
126 for (k = 0; k <
z; k++) {
129 #pragma omp for schedule(static)
132 for (i = 0; i <
x; i++) {
140 for (j = 0; j <
y; j++) {
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] =
vy[i][j][k];
156 vy_1D[n] =
vz[i][j][k];
157 vz_1D[n] =
vx[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] =
vy[i - 1][j][k];
174 vydown[n] =
vz[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] =
vy_visc[i + 1][j][k];
229 vyup[n] =
vz_visc[i + 1][j][k];
230 vzup[n] =
vx_visc[i + 1 ][j][k];
232 if ((i < x - 1) && (
dom[i + 1][j][k] != 0) && (i > 0)) {
272 vxdown[n] =
vx_visc[i - 1][j][k];
273 vydown[n] =
vy_visc[i - 1][j][k];
274 vzdown[n] =
vz_visc[i - 1][j][k];
281 if ((k > 0) && (
dom[i][j][k - 1] == 0) && (k < z - 1)) {
282 rhofront[n] =
rho_visc[i][j][k - 1];
283 vxfront[n] =
vy_visc[i][j][k - 1];
284 vyfront[n] =
vz_visc[i][j][k - 1];
285 vzfront[n] =
vx_visc[i][j][k - 1];
287 if ((k > 0) && (
dom[i][j][k - 1] != 0) && (k < z - 1)) {
327 vxback[n] =
vx_visc[i][j][k + 1];
328 vyback[n] =
vy_visc[i][j][k + 1];
329 vzback[n] =
vz_visc[i][j][k + 1];
335 if ((k < z - 1) && (
dom[i][j][k + 1] == 0) && (k > 0)) {
337 vxback[n] =
vy_visc[i][j][k + 1];
338 vyback[n] =
vz_visc[i][j][k + 1];
339 vzback[n] =
vx_visc[i][j][k + 1];
341 if ((k < z - 1) && (
dom[i][j][k + 1] != 0) && (k > 0)) {
380 rhofront[n] =
rho_visc[i][j][k - 1];
381 vxfront[n] =
vx_visc[i][j][k - 1];
382 vyfront[n] =
vy_visc[i][j][k - 1];
383 vzfront[n] =
vz_visc[i][j][k - 1];
389 }
else if (
dom[i][j][k] == 1) {
413 if (state != state_next) {
419 int nmaxy2 = (nmax - nmin) + 6;
423 if ((nmin == 0) || (nmax == (y - 1))) {
428 if ((nmax - nmin) != (y - 1)) {
432 if (nmin == 0) lefter = 1;
435 if (nmax == (y - 1)) lefter = 2;
438 if ((nmin != 0) && (nmax != (y - 1))) lefter = 3;
441 ppm_step(i, j, k, direction, flag, nminy2, nmaxy2, a_coef, ai_coef, b_coef, bi_coef, c_coef, ci_coef,
442 d_x, diffa, da, ar, pl, p6, rl, r6, u6, ul, vl, v6, wl, w6, el,
443 e6, ql, q6, dp, du, dr, dv, dw, dq, de, scratch1, scratch2, scratch3,
444 plft, prgh, ulft, urgh, rlft, rrgh, Cdtdx, fCdtdx, steep, flat,
445 para, clft, crgh, plfti, prghi, pmid, pmold, wlft, wrgh, zlft,
446 zrgh, umidl, umidr, umid, dm, dtbdm, upmid, xa1, xa2, xa3,
447 vx_1D_old, dvol, dvol0, dvol1, delta, fluxr, fluxu, fluxv,
448 fluxw, fluxe, fluxq, dm0, e_int_1D, rho_1D, pre_1D, eng_1D,
449 vx_1D, vy_1D, vz_1D, marker_1D, pressure_solid_1D, dx0, xa0,
450 xa, dx, bound_checker, lefter, rhodown, rhoup, rhofront,
451 rhoback, vxdown, vxup, vxfront, vxback, vydown, vyup, vyfront,
455 for (jj = nmin; jj <= nmax; jj++) {
458 rho[i][jj][k] = rho_1D[n];
459 pre[i][jj][k] = pre_1D[n];
460 vy[i][jj][k] = vx_1D[n];
461 vz[i][jj][k] = vy_1D[n];
462 vx[i][jj][k] = vz_1D[n];
479 ppm_free(&rho_1D, &pre_1D, &eng_1D, &vx_1D, &vy_1D, &vz_1D, &marker_1D,
480 &pressure_solid_1D, &dx0, &xa0, &xa, &dx, &a_coef, &ai_coef,
481 &b_coef, &bi_coef, &c_coef, &ci_coef, &d_x, &da, &ar,
482 &dp, &dr, &du, &pl, &p6, &rl, &r6, &ul, &u6, &vl, &v6, &wl, &w6, &el, &e6, &ql,
483 &q6, &deltaa, &dv, &dw, &dq, &de, &scratch1, &scratch2, &scratch3, &diffa,
484 &plft, &prgh, &ulft, &urgh, &rlft, &rrgh, &Cdtdx, &fCdtdx, &clft, &crgh,
485 &plfti, &prghi, &pmid, &pmold, &wlft, &wrgh, &zlft, &zrgh, &umidl, &umidr,
486 &umid, &dm, &dtbdm, &upmid, &xa1, &xa2, &xa3, &vx_1D_old, &e_int_1D, &dvol,
487 &dvol0, &dvol1, &delta, &fluxr, &fluxu, &fluxv, &fluxw, &fluxe, &fluxq,
488 &dm0, &steep, &flat, ¶, &rhodown, &rhoup, &rhofront,
489 &rhoback, &vxdown, &vxup, &vxfront, &vxback, &vydown, &vyup, &vyfront,
490 &vyback, &vzdown, &vzup, &vzfront, &vzback,
dimension);