30 double velocity_x, velocity_y, velocity_z;
33 sprintf(filename,
"%stotal_quantities_of_fluid.txt",
output_dir);
34 fd = fopen(filename,
"aw");
36 printf(
"-----------------------------------\n");
37 printf(
"The output directory does not exist\n");
38 printf(
"-----------------------------------\n");
42 velocity_x = velocity_y = velocity_z = velo_ratio = 0.0;
46 #pragma omp parallel default(none) \
48 shared(x, y, z, velocity_x, velocity_y, velocity_z, \
54 for (i = 0; i <
x; i++) {
57 #pragma omp for schedule(static)
60 for (j = 0; j <
y; j++) {
61 for (k = 0; k <
z; k++) {
62 if (
dom[i][j][k] == 0) {
63 velocity_x +=
rho[i][j][k] *
vx[i][j][k];
64 velocity_y +=
rho[i][j][k] *
vy[i][j][k];
65 velocity_z +=
rho[i][j][k] *
vz[i][j][k];
78 #pragma omp parallel default(none) \
80 shared(x, y, z, velocity_x, velocity_y, velocity_z, \
87 for (i = 0; i <
x; i++) {
90 #pragma omp for schedule(static)
93 for (j = 0; j <
y; j++) {
94 if (
dom[i][j][k] == 0) {
95 velocity_x +=
rho[i][j][k] *
vx[i][j][k];
96 velocity_y +=
rho[i][j][k] *
vy[i][j][k];
97 velocity_z +=
rho[i][j][k] *
vz[i][j][k];
108 velo_ratio = velocity_x / velocity_y;
109 fprintf(fd,
"%e %e %e %e\n",
time_sim, velo_ratio, velocity_x, velocity_y);
113 fprintf(fd,
"%e %e %e %e\n",
time_sim, velocity_x, velocity_y, velocity_z);
129 double total_pressure_force;
131 total_pressure_force = 0.0;
133 sprintf(filename,
"%stotal_pressure_on_solid.txt",
output_dir);
134 fd = fopen(filename,
"aw");
136 printf(
"-----------------------------------\n");
137 printf(
"The output directory does not exist\n");
138 printf(
"-----------------------------------\n");
144 #pragma omp parallel default(none) \
145 private(j, i, k, l) \
146 shared(x, y, z, total_pressure_force, \
147 pressure_on_solid, dimension, dom, xmax, \
152 for (i = 1; i < x - 1; i++) {
155 #pragma omp for schedule(static)
158 for (j = 1; j < y - 1; j++) {
159 for (k = 1; k < z - 1; k++) {
160 if (
dom[i][j][k] == 1) {
161 for (l = -1; l < 2; l++) {
162 if (l == 0)
continue;
163 if (
dom[i + l][j][k] == 0) {
166 if (
dom[i][j + l][k] == 0) {
169 if (
dom[i][j][k + l] == 0) {
186 #pragma omp parallel default(none) \
191 total_pressure_force, \
198 for (i = 1; i < x - 1; i++) {
201 #pragma omp for schedule(static)
204 for (j = 1; j < y - 1; j++) {
205 if (
dom[i][j][k] == 1) {
206 for (l = -1; l < 2; l++) {
207 if (l == 0)
continue;
208 if (
dom[i + l][j][k] == 0) {
211 if (
dom[i][j + l][k] == 0) {
224 fprintf(fd,
"%e %e\n",
time_sim, total_pressure_force);