Skip to content
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

Error message when reference area is incorrect #2454

Open
wants to merge 3 commits 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
28 changes: 20 additions & 8 deletions Common/src/geometry/CPhysicalGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4358,19 +4358,31 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig* config) {
const bool D3 = (nDim == 3);

if (config->GetRefArea() == 0.0) {
if (D3)
config->SetRefArea(TotalPositiveZArea);
else
config->SetRefArea(TotalPositiveYArea);
if (D3) {
// Check if the area is valid
if (TotalPositiveZArea <= 0.0) {
SU2_MPI::Error(
"ERROR: Total positive Z area is zero or negative! Please check the geometry and ensure the area is valid.",
"CPhysicalGeometry::SetPositive_ZArea");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"CPhysicalGeometry::SetPositive_ZArea");
CURRENT_FUNCTION);

}

if (rank == MASTER_NODE) {
if (D3)
config->SetRefArea(TotalPositiveZArea);
if (rank == MASTER_NODE) {
cout << "Reference area = " << TotalPositiveZArea << A << ".\n";
else
}
} else {
// Check if the area is valid in 2D
if (TotalPositiveYArea <= 0.0) {
SU2_MPI::Error(
"ERROR: Total positive Y area is zero or negative! Please check the geometry and ensure the area is valid.",
"CPhysicalGeometry::SetPositive_ZArea");
Copy link
Member

Choose a reason for hiding this comment

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

And here too

}
config->SetRefArea(TotalPositiveYArea);
if (rank == MASTER_NODE) {
cout << "Reference length = " << TotalPositiveYArea << L << ".\n";
}
}
}

/*--- Set a semi-span value if no value is provided ---*/

if (config->GetSemiSpan() == 0.0) {
Expand Down