Skip to content

Fix #2203: Improve Spanwise Section Error Handling in Turbomachinery Simulations #2459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Common/src/geometry/CPhysicalGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4974,6 +4974,13 @@
max = 0;
SU2_MPI::Allreduce(&MyMin, &min, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm());
SU2_MPI::Allreduce(&MyMax, &max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm());
if (nSpan < 2) {

Check warning

Code scanning / CodeQL

Comparison result is always the same Warning

Comparison is always true because nSpan <= 0.
string marker_name = (marker_flag == INFLOW) ? "INFLOW" : "OUTFLOW";
SU2_MPI::Error("Failed to compute spanwise sections for " + marker_name +
". Found " + to_string(nSpan) + " nodes along the periodic boundary edge from hub to shroud. " +
"At least 2 nodes are required. Check your mesh for correct hub-to-shroud edge definition.",
CURRENT_FUNCTION);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the equispaced section of the if statement, it should go with the other error message and run if the automatic section fails to calculate any value of nSpanWiseSections in three dimensions, i.e.

(nSpanWiseSections[INFLOW - 1] == 0 || nSpanWiseSections[OUTFLOW -1] == 0)


/*--- compute height value for each spanwise section---*/
delta = (max - min) / (nSpanWiseSections[marker_flag - 1] - 1);
Expand All @@ -4988,9 +4995,9 @@
SPRINTF(buf, "nSpan inflow %u, nSpan outflow %u", nSpanWiseSections[INFLOW - 1],
nSpanWiseSections[OUTFLOW - 1]);
SU2_MPI::Error(
string(" At the moment only turbomachinery with the same amount of span-wise section can be simulated\n") +
buf,
CURRENT_FUNCTION);
string("Turbomachinery simulation requires equal spanwise sections at INFLOW and OUTFLOW. ") + buf +
"\nThis is likely a mesh issue. Ensure that the periodic boundaries from hub to shroud are consistently defined in the mesh.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not likely a mesh issue, it is a mesh issue!

CURRENT_FUNCTION);
} else {
config->SetnSpanWiseSections(nSpanWiseSections[OUTFLOW - 1]);
}
Expand Down
Loading