Fixed Poisson 2D MPI

This commit is contained in:
2023-10-02 10:43:16 +02:00
parent 667e194a6b
commit bd0381e6a8
9 changed files with 20292 additions and 20210 deletions

View File

@@ -78,7 +78,7 @@ int main (int argc, char** argv)
/* Added function for particle tracing. Will inject and advance particles as per timePeriod */
trace(&particletracer, solver.u, solver.v, t);
//trace(&particletracer, solver.u, solver.v, t);
t += solver.dt;
nt++;

View File

@@ -595,7 +595,8 @@ void setSpecialBoundaryCondition(Solver* solver)
for (int i = 1; i < imax; i++) {
U(i, jmax + 1) = 2.0 - U(i, jmax);
}
} else if (strcmp(solver->problem, "canal") == 0) {
}
else if (strcmp(solver->problem, "canal") == 0) {
double ylength = solver->ylength;
double y;
@@ -604,6 +605,15 @@ void setSpecialBoundaryCondition(Solver* solver)
U(0, j) = y * (ylength - y) * 4.0 / (ylength * ylength);
}
}
else if (strcmp(solver->problem, "backstep") == 0) {
double ylength = solver->ylength;
double y;
for (int j = 1; j < jmax + 1; j++) {
//y = mDy * (j - 0.5);
U(0, j) = 0.0;
}
}
}
void setObjectBoundaryCondition(Solver* solver)