37 int i, j, k, n, nmin, nmax;
40 double *rho_1D, *pre_1D, *eng_1D, *vx_1D, *vy_1D, *vz_1D, *marker_1D;
42 double *rhodown, *rhoup, *rhofront, *rhoback;
43 double *vxdown, *vxup, *vxfront, *vxback;
44 double *vydown, *vyup, *vyfront, *vyback;
45 double *vzdown, *vzup, *vzfront, *vzback;
47 double *pressure_solid_1D;
50 double *a_coef, *ai_coef, *b_coef, *bi_coef, *c_coef, *ci_coef;
55 double *pl, *p6, *rl, *r6;
56 double *u6, *ul, *vl, *v6;
57 double *wl, *w6, *el, *e6;
58 double *ql, *q6, *dp, *du;
59 double *dv, *dw, *dq, *de;
60 double *scratch1, *scratch2, *scratch3;
63 double *plft, *prgh, *ulft, *urgh, *rlft, *rrgh, *Cdtdx, *fCdtdx;
68 double *clft, *crgh, *plfti, *prghi, *pmid, *pmold, *wlft, *wrgh, *zlft, *zrgh;
69 double *umidl, *umidr, *umid;
71 double *dm, *dtbdm, *upmid, *xa1, *xa2, *xa3;
73 double *dvol, *dvol0, *dvol1;
76 double *fluxr, *fluxu, *fluxv, *fluxw, *fluxe, *fluxq;
83 #pragma omp parallel default(none) \
84 private(j, i, k, n, nmin, nmax, state, state_next, rho_1D, pre_1D, \
85 eng_1D, vx_1D, vy_1D, vz_1D, marker_1D, dx0, xa0, xa, dx, \
86 pressure_solid_1D, a_coef, ai_coef, b_coef, bi_coef, c_coef, ci_coef, \
87 d_x, diffa, da, ar, pl, p6, rl, r6, \
88 u6, ul, vl, v6, wl, w6, \
89 el, e6, ql, q6, dp, du, dr, deltaa, \
90 dv, dw, dq, de, scratch1, scratch2, scratch3, \
91 plft, prgh, ulft, urgh, rlft, rrgh, Cdtdx, fCdtdx, \
92 steep, flat, para, clft, crgh, plfti, prghi, pmid, \
93 pmold, wlft, wrgh, zlft, zrgh, umidl, umidr, umid, \
94 dm, dtbdm, upmid, xa1, xa2, xa3, vx_1D_old, \
95 dvol, dvol0, dvol1, delta, fluxr, fluxu, fluxv, \
96 fluxw, fluxe, fluxq, dm0, e_int_1D, rhodown, rhoup, \
97 rhofront, rhoback, vxdown, vxup, vxfront, vxback, \
98 vydown, vyup, vyfront, vyback, vzdown, vzup, vzfront, \
100 shared(x, y, z, dom, rho, pre, vx, vy, vz, marker, zxa, zdx, \
101 pressure_on_solid, smallr, small, smallp, Gamma, max_array_length, flag, \
102 direction, obstacle_density, obstacle_temperature, advection, with_obstacles, \
103 viscosity_on_off, bound, inflow_density, inflow_velocity, dimension, \
104 rho_visc, vx_visc, vy_visc, vz_visc)
110 init_ppm(&rho_1D, &pre_1D, &eng_1D, &vx_1D, &vy_1D, &vz_1D, &marker_1D, &dx0, &xa0, &xa, &dx,
111 &a_coef, &ai_coef, &b_coef, &bi_coef, &c_coef, &ci_coef, &d_x, &da, &ar,
112 &dp, &dr, &du, &pl, &p6, &rl, &r6, &ul, &u6, &vl, &v6, &wl, &w6, &el, &e6, &ql,
113 &q6, &deltaa, &dv, &dw, &dq, &de, &scratch1, &scratch2, &scratch3, &diffa,
114 &plft, &prgh, &ulft, &urgh, &rlft, &rrgh, &Cdtdx, &fCdtdx, &clft, &crgh,
115 &plfti, &prghi, &pmid, &pmold, &wlft, &wrgh, &zlft, &zrgh, &umidl, &umidr,
116 &umid, &dm, &dtbdm, &upmid, &xa1, &xa2, &xa3, &vx_1D_old, &e_int_1D, &dvol,
117 &dvol0, &dvol1, &delta, &fluxr, &fluxu, &fluxv, &fluxw, &fluxe, &fluxq,
118 &dm0, &steep, &flat, ¶, &pressure_solid_1D, &rhodown, &rhoup, &rhofront,
119 &rhoback, &vxdown, &vxup, &vxfront, &vxback, &vydown, &vyup, &vyfront,
120 &vyback, &vzdown, &vzup, &vzfront, &vzback,
dimension);
123 for (k = 0; k <
z; k++) {
126 #pragma omp for schedule(static)
128 for (j = 0; j <
y; j++) {
136 for (i = 0; i <
x; i++) {
146 if (
dom[i][j][k] == 0) {
149 rho_1D[n] =
rho[i][j][k];
150 pre_1D[n] =
pre[i][j][k];
151 vx_1D[n] =
vx[i][j][k];
152 vy_1D[n] =
vy[i][j][k];
153 vz_1D[n] =
vz[i][j][k];
160 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)));
167 if ((j > 0) && (
dom[i][j - 1][k] == 0) && (j < y - 1)) {
169 vxdown[n] =
vx_visc[i][j - 1][k];
170 vydown[n] =
vy_visc[i][j - 1][k];
171 vzdown[n] =
vz_visc[i][j - 1][k];
173 if ((j > 0) && (
dom[i][j - 1][k] != 0) && (j < y - 1)) {
214 vxup[n] =
vx_visc[i][j + 1][k];
215 vyup[n] =
vy_visc[i][j + 1][k];
216 vzup[n] =
vz_visc[i][j + 1][k];
224 if ((j < y - 1) && (
dom[i][j + 1][k] == 0) && (j > 0)) {
226 vxup[n] =
vx_visc[i][j + 1][k];
227 vyup[n] =
vy_visc[i][j + 1][k];
228 vzup[n] =
vz_visc[i][j + 1][k];
230 if ((j < y - 1) && (
dom[i][j + 1][k] != 0) && (j > 0)) {
249 if (
bound.
up == 4) vxup[n] = 0.0;
267 if (
bound.
up == 4) vzup[n] = 0.0;
271 vxdown[n] =
vx_visc[i][j - 1][k];
272 vydown[n] =
vy_visc[i][j - 1][k];
273 vzdown[n] =
vz_visc[i][j - 1][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] =
vx_visc[i][j][k - 1];
284 vyfront[n] =
vy_visc[i][j][k - 1];
285 vzfront[n] =
vz_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] =
vx_visc[i][j][k + 1];
338 vyback[n] =
vy_visc[i][j][k + 1];
339 vzback[n] =
vz_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 nmaxx2 = (nmax - nmin) + 6;
422 if ((nmin == 0) || (nmax == (x - 1))) {
427 if ((nmax - nmin) != (x - 1)) {
431 if (nmin == 0) lefter = 1;
434 if (nmax == (x - 1)) lefter = 2;
437 if ((nmin != 0) && (nmax != (x - 1))) lefter = 3;
440 ppm_step(i, j, k, direction, flag, nminx2, nmaxx2, a_coef, ai_coef, b_coef, bi_coef, c_coef, ci_coef,
441 d_x, diffa, da, ar, pl, p6, rl, r6, u6, ul, vl, v6, wl, w6, el,
442 e6, ql, q6, dp, du, dr, dv, dw, dq, de, scratch1, scratch2, scratch3,
443 plft, prgh, ulft, urgh, rlft, rrgh, Cdtdx, fCdtdx, steep, flat,
444 para, clft, crgh, plfti, prghi, pmid, pmold, wlft, wrgh, zlft,
445 zrgh, umidl, umidr, umid, dm, dtbdm, upmid, xa1, xa2, xa3,
446 vx_1D_old, dvol, dvol0, dvol1, delta, fluxr, fluxu, fluxv,
447 fluxw, fluxe, fluxq, dm0, e_int_1D, rho_1D, pre_1D, eng_1D,
448 vx_1D, vy_1D, vz_1D, marker_1D, pressure_solid_1D,
449 dx0, xa0, xa, dx, bound_checker, lefter, rhodown, rhoup, rhofront,
450 rhoback, vxdown, vxup, vxfront, vxback, vydown, vyup, vyfront,
454 for (ii = nmin; ii <= nmax; ii++) {
457 rho[ii][j][k] = rho_1D[n];
458 pre[ii][j][k] = pre_1D[n];
459 vx[ii][j][k] = vx_1D[n];
460 vy[ii][j][k] = vy_1D[n];
461 vz[ii][j][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);