From 8bdde6b419cb5bc6d5ed35aa57d04359ba867f17 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 5 Oct 2022 09:58:39 +0200 Subject: [PATCH 1/3] merge with develop --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index face27fefa0..ea7024c74d6 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2887,11 +2887,17 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, geometry->vertex[iMarker][iVertex]->GetNormal(Vector); + AxiFactor = 0.0; if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) + if (geometry->nodes->GetCoord(iPoint, 1) > EPS) AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); - else - AxiFactor = 1.0; + else { + for (const auto jPoint : geometry->nodes->GetPoints(iPoint)) { + if (geometry->nodes->GetVertex(jPoint,iMarker) >= 0){ + AxiFactor = PI_NUMBER * geometry->nodes->GetCoord(jPoint,1); + } + } + } } else { AxiFactor = 1.0; } From f907b4aa95b8fcd990bb1108d3d2527d9360862c Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 5 Oct 2022 10:18:31 +0200 Subject: [PATCH 2/3] small rewrite --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index ea7024c74d6..556c86426ca 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2832,7 +2832,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iDim, iMarker; unsigned long iVertex, iPoint; su2double *V_outlet = nullptr, Velocity[3], MassFlow, - Velocity2, Density, Area, AxiFactor; + Velocity2, Density, Area; unsigned short iMarker_Outlet, nMarker_Outlet; string Inlet_TagBound, Outlet_TagBound; su2double Vector[MAXNDIM] = {0.0}; @@ -2887,7 +2887,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, geometry->vertex[iMarker][iVertex]->GetNormal(Vector); - AxiFactor = 0.0; + su2double AxiFactor = 1.0; if (axisymmetric) { if (geometry->nodes->GetCoord(iPoint, 1) > EPS) AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); @@ -2898,9 +2898,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } } } - } else { - AxiFactor = 1.0; - } + } Density = V_outlet[prim_idx.Density()]; From 86ce6074918f614cf5e441fe67a189118ba39e2f Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Wed, 5 Oct 2022 06:57:55 -0700 Subject: [PATCH 3/3] Apply suggestions from code review --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 556c86426ca..13fb65bd64d 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2893,8 +2893,8 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); else { for (const auto jPoint : geometry->nodes->GetPoints(iPoint)) { - if (geometry->nodes->GetVertex(jPoint,iMarker) >= 0){ - AxiFactor = PI_NUMBER * geometry->nodes->GetCoord(jPoint,1); + if (geometry->nodes->GetVertex(jPoint,iMarker) >= 0) { + AxiFactor = PI_NUMBER * geometry->nodes->GetCoord(jPoint, 1); } } }