From d1cf7ea33b69ce5279b38c4953015decdee0d805 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:10:31 +0200 Subject: [PATCH 01/43] Fix the internal energy of the under-relaxation factor The factor compares the old and new internal energy, computed as rho*E - 0.5*|rho*u|^2 without the division by rho (the code comment already refers to the static energy). For dimensional cases this value can be negative, and those points got a zero update: in the axisymmetric air nozzle 28 % of the points were frozen, and the case could not re-converge from a restart. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/solvers/CEulerSolver.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 32c265e55656..8259e1630520 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2551,9 +2551,12 @@ void CEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config) { su2double ratio = fabs(LinSysSol(iPoint, 0)) / max(nodes->GetSolution(iPoint, 0), EPS); su2double e_old = nodes->GetSolution(iPoint, nVar - 1); su2double e_new = e_old + LinSysSol(iPoint, nVar - 1); + /*--- rho*e = rho*E - |rho*u|^2 / (2*rho), with the old and the proposed new density. ---*/ + const su2double rho_old = max(nodes->GetSolution(iPoint, 0), EPS); + const su2double rho_new = max(rho_old + LinSysSol(iPoint, 0), EPS); for (unsigned short jVar = 1; jVar <= nDim; jVar++) { - e_old -= 0.5 * pow(nodes->GetSolution(iPoint, jVar), 2); - e_new -= 0.5 * pow(nodes->GetSolution(iPoint, jVar) + LinSysSol(iPoint, jVar), 2); + e_old -= 0.5 * pow(nodes->GetSolution(iPoint, jVar), 2) / rho_old; + e_new -= 0.5 * pow(nodes->GetSolution(iPoint, jVar) + LinSysSol(iPoint, jVar), 2) / rho_new; } ratio = fmax(ratio, fabs(e_new - e_old) / max(e_old, EPS)); From ffc5bafc7a489f00dbe4be78e02e0eaf874acf1b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:19 +0200 Subject: [PATCH 02/43] Clear the whole Jacobian in the non-physical guard of the general-gas Roe scheme Only the diagonal was zeroed (index [iVar][iVar] inside the jVar loop), so the off-diagonal entries kept the values of the previous edge. The guard of CUpwRoeBase_Flow already clears all entries. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/numerics/flow/convection/roe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 73114576d409..371e23059d20 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -811,8 +811,8 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co for (iVar = 0; iVar < nVar; iVar++) { Flux[iVar] = 0.0; for (jVar = 0; jVar < nVar; jVar++) { - Jacobian_i[iVar][iVar] = 0.0; - Jacobian_j[iVar][iVar] = 0.0; + Jacobian_i[iVar][jVar] = 0.0; + Jacobian_j[iVar][jVar] = 0.0; } } AD::SetPreaccOut(Flux, nVar); From a59d8275319156dd3a580c2c7d36783f62c49269 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:21:56 +0200 Subject: [PATCH 03/43] Compute HLLC on moving grids in the frame of the face, fix its Jacobians - Moving grids: the wave speeds, the pressure work of the moving face in the supersonic branches and the term V_g (p* - p)/(s - S_M) of the star-state energy were missing or inconsistent, so HLLC was not Galilean invariant (NACA0012 M 0.8, fixed grid vs still air and a translating grid: CL -12 %). The flux is now computed in the frame of the face (u' = u - w n, H' = H - w u_n + w^2/2) and transformed back (F = B F', J = B J' T). - Jacobians: sign of the velocity term of the general-gas dp/drho. The star-state Jacobians keep by default the density of the other state in dp*/dU (inexact, #2198), which was more robust with inexact linear solves in our tests; USE_ACCURATE_FLUX_JACOBIANS= YES now gives the exact derivative for fixed wave speeds. - Unit test hllc_jacobian_tests.cpp: finite differences in 2D and 3D, fixed and moving faces, both sides of the contact, all branches, default and exact. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/src/CConfig.cpp | 2 +- .../include/numerics/flow/convection/hllc.hpp | 30 +++ SU2_CFD/src/numerics/flow/convection/hllc.cpp | 180 +++++++++----- .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 220 ++++++++++++++++++ UnitTests/meson.build | 1 + config_template.cfg | 1 + 6 files changed, 381 insertions(+), 53 deletions(-) create mode 100644 UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index fd4207b0c5fe..034352b92aa4 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2171,7 +2171,7 @@ void CConfig::SetConfig_Options() { addDoubleArrayOption("JST_SENSOR_COEFF", 2, false, jst_coeff); /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ + /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2), exact Jacobians (for fixed wave speeds) for HLLC \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ addDoubleOption("CENTRAL_JACOBIAN_FIX_FACTOR", Cent_Jac_Fix_Factor, 4.0); diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index b525df4bf9cf..29f7ce727a34 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -39,6 +39,7 @@ class CUpwHLLC_Flow final : public CNumerics { private: bool implicit, dynamic_grid; + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -55,6 +56,8 @@ class CUpwHLLC_Flow final : public CNumerics { su2double *dSm_dU, *dPI_dU, *drhoStar_dU, *dpStar_dU, *dEStar_dU; su2double* Flux; /*!< \brief The flux accross the face. */ + bool fixedWaveSpeeds = false; /*!< \brief Use fixed_sL, fixed_sR as wave speeds (verification of the Jacobians). */ + su2double fixed_sL = 0.0, fixed_sR = 0.0; su2double** Jacobian_i; /*!< \brief The Jacobian w.r.t. point i after computation. */ su2double** Jacobian_j; /*!< \brief The Jacobian w.r.t. point j after computation. */ @@ -79,6 +82,18 @@ class CUpwHLLC_Flow final : public CNumerics { */ ResidualType<> ComputeResidual(const CConfig* config) override; + /*! + * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which + * treat them as constants. + * \param[in] active - Use the fixed values. + * \param[in] val_sL, val_sR - Left and right wave speeds. + */ + inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { + fixedWaveSpeeds = active; + fixed_sL = val_sL; + fixed_sR = val_sR; + } + }; /*! @@ -91,6 +106,7 @@ class CUpwHLLC_Flow final : public CNumerics { class CUpwGeneralHLLC_Flow final : public CNumerics { private: bool implicit, dynamic_grid; + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -108,6 +124,8 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { su2double *dSm_dU, *dPI_dU, *drhoStar_dU, *dpStar_dU, *dEStar_dU; su2double* Flux; /*!< \brief The flux accross the face. */ + bool fixedWaveSpeeds = false; /*!< \brief Use fixed_sL, fixed_sR as wave speeds (verification of the Jacobians). */ + su2double fixed_sL = 0.0, fixed_sR = 0.0; su2double** Jacobian_i; /*!< \brief The Jacobian w.r.t. point i after computation. */ su2double** Jacobian_j; /*!< \brief The Jacobian w.r.t. point j after computation. */ @@ -132,6 +150,18 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { */ ResidualType<> ComputeResidual(const CConfig* config) override; + /*! + * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which + * treat them as constants. + * \param[in] active - Use the fixed values. + * \param[in] val_sL, val_sR - Left and right wave speeds. + */ + inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { + fixedWaveSpeeds = active; + fixed_sL = val_sL; + fixed_sR = val_sR; + } + /*! * \brief Compute the Average quantities for a general fluid flux between two nodes i and j. * Using the approach of Vinokur and Montagne' diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index ef6a2a5a41e9..18b210e72381 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -28,12 +28,59 @@ #include "../../../../include/numerics/flow/convection/hllc.hpp" #include "../../../../../Common/include/toolboxes/geometry_toolbox.hpp" +namespace { +/*--- Moving grids. The flux across a face that moves with normal velocity w is the flux of the states seen from the + face (velocity u' = u - c, c = w n, same thermodynamic state) transformed back: with U' = T U, + F_ALE(U) = B F'(U'), where F' is the flux for a fixed face. Mass: unchanged; momentum: + c F'_0; + energy: + c.F'_m + |c|^2/2 F'_0. The Jacobians are B J' T. ---*/ + +void ShiftToFaceFrame(unsigned short nDim, su2double w, const su2double* unitNormal, su2double* velocity, + su2double& enthalpy) { + const su2double projVel = GeometryToolbox::DotProduct(nDim, velocity, unitNormal); + for (unsigned short iDim = 0; iDim < nDim; iDim++) velocity[iDim] -= w * unitNormal[iDim]; + enthalpy += w * (0.5 * w - projVel); // H' = H - u.c + |c|^2/2 +} + +void FaceFrameToMovingFlux(unsigned short nDim, su2double w, const su2double* unitNormal, su2double* flux) { + const unsigned short nVar = nDim + 2; + su2double cDotMom = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) cDotMom += w * unitNormal[iDim] * flux[iDim+1]; + flux[nVar-1] += cDotMom + 0.5 * w * w * flux[0]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) flux[iDim+1] += w * unitNormal[iDim] * flux[0]; +} + +void FaceFrameToMovingJacobian(unsigned short nDim, su2double w, const su2double* unitNormal, su2double** jac) { + const unsigned short nVar = nDim + 2; + constexpr unsigned short maxDim = 3, maxVar = maxDim + 2; + su2double c[maxDim] = {0.0}, T[maxVar][maxVar] = {{0.0}}, B[maxVar][maxVar] = {{0.0}}, tmp[maxVar][maxVar]; + su2double c2 = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { c[iDim] = w * unitNormal[iDim]; c2 += c[iDim] * c[iDim]; } + for (unsigned short iVar = 0; iVar < nVar; iVar++) { T[iVar][iVar] = 1.0; B[iVar][iVar] = 1.0; } + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + T[iDim+1][0] = -c[iDim]; T[nVar-1][iDim+1] = -c[iDim]; + B[iDim+1][0] = c[iDim]; B[nVar-1][iDim+1] = c[iDim]; + } + T[nVar-1][0] = 0.5 * c2; B[nVar-1][0] = 0.5 * c2; + for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (unsigned short jVar = 0; jVar < nVar; jVar++) { + tmp[iVar][jVar] = 0.0; + for (unsigned short kVar = 0; kVar < nVar; kVar++) tmp[iVar][jVar] += jac[iVar][kVar] * T[kVar][jVar]; + } + for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (unsigned short jVar = 0; jVar < nVar; jVar++) { + jac[iVar][jVar] = 0.0; + for (unsigned short kVar = 0; kVar < nVar; kVar++) jac[iVar][jVar] += B[iVar][kVar] * tmp[kVar][jVar]; + } +} +} // namespace + CUpwHLLC_Flow::CUpwHLLC_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); + useAccurateJacobian = config->GetUse_Accurate_Jacobians(); Gamma = config->GetGamma(); @@ -114,6 +161,16 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) Density_j = V_j[nDim+2]; Enthalpy_j = V_j[nDim+3]; + /*--- Moving grid: states seen from the face (see ShiftToFaceFrame). ---*/ + + ProjInterfaceVel = 0.0; + if (dynamic_grid) { + for (iDim = 0; iDim < nDim; iDim++) + ProjInterfaceVel += 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * UnitNormal[iDim]; + ShiftToFaceFrame(nDim, ProjInterfaceVel, UnitNormal, Velocity_i, Enthalpy_i); + ShiftToFaceFrame(nDim, ProjInterfaceVel, UnitNormal, Velocity_j, Enthalpy_j); + } + sq_vel_i = GeometryToolbox::SquaredNorm(nDim, Velocity_i); sq_vel_j = GeometryToolbox::SquaredNorm(nDim, Velocity_j); @@ -128,22 +185,6 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) ProjVelocity_i = GeometryToolbox::DotProduct(nDim, Velocity_i, UnitNormal); ProjVelocity_j = GeometryToolbox::DotProduct(nDim, Velocity_j, UnitNormal); - /*--- Projected Grid Velocity ---*/ - - ProjInterfaceVel = 0; - - if (dynamic_grid) { - - for (iDim = 0; iDim < nDim; iDim++) - ProjInterfaceVel += 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * UnitNormal[iDim]; - - SoundSpeed_i -= ProjInterfaceVel; - SoundSpeed_j += ProjInterfaceVel; - - ProjVelocity_i -= ProjInterfaceVel; - ProjVelocity_j -= ProjInterfaceVel; - } - /*--- Roe's averaging ---*/ Rrho = ( sqrt(Density_i) + sqrt(Density_j) ); @@ -152,7 +193,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) RoeVelocity[iDim] = ( Velocity_i[iDim] * sqrt(Density_i) + Velocity_j[iDim] * sqrt(Density_j) ) / Rrho; } sq_velRoe = GeometryToolbox::SquaredNorm(nDim, RoeVelocity); - RoeProjVelocity = GeometryToolbox::DotProduct(nDim, RoeVelocity, UnitNormal) - ProjInterfaceVel; + RoeProjVelocity = GeometryToolbox::DotProduct(nDim, RoeVelocity, UnitNormal); /*--- Mean Roe variables iPoint and jPoint ---*/ @@ -161,13 +202,15 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Roe-averaged speed of sound ---*/ - RoeSoundSpeed = sqrt( Gamma_Minus_One * ( RoeEnthalpy - 0.5 * sq_velRoe ) ) - ProjInterfaceVel; + RoeSoundSpeed = sqrt( Gamma_Minus_One * ( RoeEnthalpy - 0.5 * sq_velRoe ) ); /*--- Speed of sound at L and R ---*/ sL = min( RoeProjVelocity - RoeSoundSpeed, ProjVelocity_i - SoundSpeed_i); sR = max( RoeProjVelocity + RoeSoundSpeed, ProjVelocity_j + SoundSpeed_j); + if (fixedWaveSpeeds) { sL = fixed_sL; sR = fixed_sR; } + /*--- speed of contact surface ---*/ RHO = Density_j * (sR - ProjVelocity_j) - Density_i * (sL - ProjVelocity_i); @@ -205,7 +248,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) Flux[0] = sM * IntermediateState[0]; for (iDim = 0; iDim < nDim; iDim++) Flux[iDim+1] = sM * IntermediateState[iDim+1] + pStar * UnitNormal[iDim]; - Flux[nVar-1] = sM * ( IntermediateState[nVar-1] + pStar ) + pStar * ProjInterfaceVel; + Flux[nVar-1] = sM * ( IntermediateState[nVar-1] + pStar ); } } else { @@ -234,16 +277,29 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) Flux[0] = sM * IntermediateState[0]; for (iDim = 0; iDim < nDim; iDim++) Flux[iDim+1] = sM * IntermediateState[iDim+1] + pStar * UnitNormal[iDim]; - Flux[nVar-1] = sM * (IntermediateState[nVar-1] + pStar ) + pStar * ProjInterfaceVel; + Flux[nVar-1] = sM * (IntermediateState[nVar-1] + pStar ); } } + if (dynamic_grid) FaceFrameToMovingFlux(nDim, ProjInterfaceVel, UnitNormal, Flux); + for (iVar = 0; iVar < nVar; iVar++) Flux[iVar] *= Area; /*--- Return early if the Jacobians do not need to be computed. ---*/ if (!implicit) return ResidualType<>(Flux, Jacobian_i, Jacobian_j); + /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j + = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). + By default the density of the other state is kept, as in the previous implementation (an inexact transcription + of the reference, see #2198): in our tests it was more robust with inexact linear solves than the exact + derivative, which USE_ACCURATE_FLUX_JACOBIANS= YES gives. ---*/ + + const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; + const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; + + + if (sM > 0.0) { if (sL > 0.0) { @@ -295,7 +351,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing d/dU_L (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_i * (sR - ProjVelocity_j) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_R * (sR - ProjVelocity_j) * dSm_dU[iVar]; /*--- Computing d/dU_L (EStar) ---*/ @@ -352,7 +408,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing d/dU_R (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_j * (sL - ProjVelocity_i) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_L * (sL - ProjVelocity_i) * dSm_dU[iVar]; /*--- Computing d/dU_R (EStar) ---*/ @@ -414,7 +470,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing d/dU_L (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_i * (sR - ProjVelocity_j) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_R * (sR - ProjVelocity_j) * dSm_dU[iVar]; /*--- Computing d/dU_L (EStar) ---*/ @@ -466,7 +522,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing d/dU_R (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_j * (sL - ProjVelocity_i) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_L * (sL - ProjVelocity_i) * dSm_dU[iVar]; /*--- Computing d/dU_R (rhoStar) ---*/ @@ -519,6 +575,11 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) } } + if (dynamic_grid) { + FaceFrameToMovingJacobian(nDim, ProjInterfaceVel, UnitNormal, Jacobian_i); + FaceFrameToMovingJacobian(nDim, ProjInterfaceVel, UnitNormal, Jacobian_j); + } + /*--- Scale Jacobians by area (from Flux *= Area). ---*/ for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { @@ -535,6 +596,7 @@ CUpwGeneralHLLC_Flow::CUpwGeneralHLLC_Flow(unsigned short val_nDim, unsigned sho /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); + useAccurateJacobian = config->GetUse_Accurate_Jacobians(); Gamma = config->GetGamma(); @@ -613,6 +675,16 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c Density_j = V_j[nDim+2]; Enthalpy_j = V_j[nDim+3]; + /*--- Moving grid: states seen from the face (see ShiftToFaceFrame). ---*/ + + ProjInterfaceVel = 0.0; + if (dynamic_grid) { + for (iDim = 0; iDim < nDim; iDim++) + ProjInterfaceVel += 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * UnitNormal[iDim]; + ShiftToFaceFrame(nDim, ProjInterfaceVel, UnitNormal, Velocity_i, Enthalpy_i); + ShiftToFaceFrame(nDim, ProjInterfaceVel, UnitNormal, Velocity_j, Enthalpy_j); + } + sq_vel_i = 0.0; sq_vel_j = 0.0; @@ -650,28 +722,12 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c } - /*--- Projected Grid Velocity ---*/ - - ProjInterfaceVel = 0; - - if (dynamic_grid) { - - for (iDim = 0; iDim < nDim; iDim++) - ProjInterfaceVel += 0.5 * ( GridVel_i[iDim] + GridVel_j[iDim] )*UnitNormal[iDim]; - - SoundSpeed_i -= ProjInterfaceVel; - SoundSpeed_j += ProjInterfaceVel; - - ProjVelocity_i -= ProjInterfaceVel; - ProjVelocity_j -= ProjInterfaceVel; - } - /*--- Roe's averaging ---*/ Rrho = ( sqrt(Density_i) + sqrt(Density_j) ); sq_velRoe = 0.0; - RoeProjVelocity = - ProjInterfaceVel; + RoeProjVelocity = 0.0; for (iDim = 0; iDim < nDim; iDim++) { RoeVelocity[iDim] = ( Velocity_i[iDim] * sqrt(Density_i) + Velocity_j[iDim] * sqrt(Density_j) ) / Rrho; @@ -691,13 +747,15 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Roe-averaged speed of sound ---*/ //RoeSoundSpeed2 = RoeChi + RoeKappa * ( RoeEnthalpy - 0.5 * sq_velRoe ); - RoeSoundSpeed = sqrt( RoeChi + RoeKappa * ( RoeEnthalpy - 0.5 * sq_velRoe ) ) - ProjInterfaceVel; + RoeSoundSpeed = sqrt( RoeChi + RoeKappa * ( RoeEnthalpy - 0.5 * sq_velRoe ) ); /*--- Speed of sound at L and R ---*/ sL = min( RoeProjVelocity - RoeSoundSpeed, ProjVelocity_i - SoundSpeed_i ); sR = max( RoeProjVelocity + RoeSoundSpeed, ProjVelocity_j + SoundSpeed_j ); + if (fixedWaveSpeeds) { sL = fixed_sL; sR = fixed_sR; } + /*--- speed of contact surface ---*/ RHO = Density_j * (sR - ProjVelocity_j) - Density_i * (sL - ProjVelocity_i); @@ -734,7 +792,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c Flux[0] = sM * IntermediateState[0]; for (iDim = 0; iDim < nDim; iDim++) Flux[iDim+1] = sM * IntermediateState[iDim+1] + pStar * UnitNormal[iDim]; - Flux[nVar-1] = sM * ( IntermediateState[nVar-1] + pStar ) + pStar * ProjInterfaceVel; + Flux[nVar-1] = sM * ( IntermediateState[nVar-1] + pStar ); } } else { @@ -763,16 +821,29 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c Flux[0] = sM * IntermediateState[0]; for (iDim = 0; iDim < nDim; iDim++) Flux[iDim+1] = sM * IntermediateState[iDim+1] + pStar * UnitNormal[iDim]; - Flux[nVar-1] = sM * (IntermediateState[nVar-1] + pStar ) + pStar * ProjInterfaceVel; + Flux[nVar-1] = sM * (IntermediateState[nVar-1] + pStar ); } } + if (dynamic_grid) FaceFrameToMovingFlux(nDim, ProjInterfaceVel, UnitNormal, Flux); + for (iVar = 0; iVar < nVar; iVar++) Flux[iVar] *= Area; /*--- Return early if the Jacobians do not need to be computed. ---*/ if (!implicit) return ResidualType<>(Flux, Jacobian_i, Jacobian_j); + /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j + = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). + By default the density of the other state is kept, as in the previous implementation (an inexact transcription + of the reference, see #2198): in our tests it was more robust with inexact linear solves than the exact + derivative, which USE_ACCURATE_FLUX_JACOBIANS= YES gives. ---*/ + + const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; + const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; + + + if (sM > 0.0) { if (sL > 0.0) { @@ -800,7 +871,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_L (PI) ---*/ - dPI_dU[0] = Chi_i - 0.5 * Kappa_i * sq_vel_i; + dPI_dU[0] = Chi_i + 0.5 * Kappa_i * sq_vel_i; for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_i * Velocity_i[iDim]; dPI_dU[nVar-1] = Kappa_i; @@ -825,7 +896,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing d/dU_L (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_i * (sR - ProjVelocity_j) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_R * (sR - ProjVelocity_j) * dSm_dU[iVar]; /*--- Computing d/dU_L (EStar) ---*/ @@ -874,7 +945,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_R (PI) ---*/ - dPI_dU[0] = Chi_j - 0.5 * Kappa_j * sq_vel_j; + dPI_dU[0] = Chi_j + 0.5 * Kappa_j * sq_vel_j; for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_j * Velocity_j[iDim]; dPI_dU[nVar-1] = Kappa_j; @@ -891,7 +962,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing d/dU_R (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_j * (sL - ProjVelocity_i) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_L * (sL - ProjVelocity_i) * dSm_dU[iVar]; /*--- Computing d/dU_R (EStar) ---*/ @@ -944,7 +1015,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_L (PI) ---*/ - dPI_dU[0] = Chi_i - 0.5 * Kappa_i * sq_vel_i; + dPI_dU[0] = Chi_i + 0.5 * Kappa_i * sq_vel_i; for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_i * Velocity_i[iDim]; dPI_dU[nVar-1] = Kappa_i; @@ -961,7 +1032,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing d/dU_L (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_i * (sR - ProjVelocity_j) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_R * (sR - ProjVelocity_j) * dSm_dU[iVar]; /*--- Computing d/dU_L (EStar) ---*/ @@ -995,7 +1066,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_R (PI) ---*/ - dPI_dU[0] = Chi_j - 0.5 * Kappa_j * sq_vel_j; + dPI_dU[0] = Chi_j + 0.5 * Kappa_j * sq_vel_j; for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_j * Velocity_j[iDim]; dPI_dU[nVar-1] = Kappa_j; @@ -1012,7 +1083,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing d/dU_R (pStar) ---*/ for (iVar = 0; iVar < nVar; iVar++) - dpStar_dU[iVar] = Density_j * (sL - ProjVelocity_i) * dSm_dU[iVar]; + dpStar_dU[iVar] = rhoPStar_L * (sL - ProjVelocity_i) * dSm_dU[iVar]; /*--- Computing d/dU_R (rhoStar) ---*/ @@ -1064,6 +1135,11 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c } } + if (dynamic_grid) { + FaceFrameToMovingJacobian(nDim, ProjInterfaceVel, UnitNormal, Jacobian_i); + FaceFrameToMovingJacobian(nDim, ProjInterfaceVel, UnitNormal, Jacobian_j); + } + /*--- Scale Jacobians by area (from Flux *= Area). ---*/ for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp new file mode 100644 index 000000000000..0a14682612ed --- /dev/null +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -0,0 +1,220 @@ +/*! + * \file hllc_jacobian_tests.cpp + * \brief Finite-difference verification of the HLLC Jacobians (ideal and general gas, 2D and 3D), on fixed and moving + * faces, exact (USE_ACCURATE_FLUX_JACOBIANS) or default. + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include +#include +#include +#include +#include "../../../SU2_CFD/include/numerics/flow/convection/hllc.hpp" + +namespace { + +constexpr su2double gamma = 1.4; +constexpr unsigned short maxVar = 5; + +using State = std::array; // conservative variables (rho, rho u, rho v, [rho w], rho E) + +/*--- Primitive (T, u, ..., p, rho, h, c) and secondary (dp/drho_e, dp/de_rho) variables of an ideal gas whose total + energy contains the turbulent kinetic energy k. ---*/ +void Primitives(unsigned short nDim, const State& U, su2double k, su2double* V, su2double* S) { + const su2double rho = U[0]; + su2double q2 = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + V[iDim + 1] = U[iDim + 1] / rho; + q2 += V[iDim + 1] * V[iDim + 1]; + } + const su2double e = U[nDim + 1] / rho - 0.5 * q2 - k; + const su2double p = (gamma - 1) * rho * e; + V[0] = p / (rho * 287.058); + V[nDim + 1] = p; + V[nDim + 2] = rho; + V[nDim + 3] = (U[nDim + 1] + p) / rho; + V[nDim + 4] = sqrt(gamma * p / rho); + S[0] = (gamma - 1) * e; + S[1] = (gamma - 1) * rho; +} + +/*--- Conservative state from density, velocity, pressure and k. ---*/ +State Conservative(unsigned short nDim, su2double rho, const su2double* vel, su2double p, su2double k) { + State U{}; + su2double q2 = 0.0; + U[0] = rho; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + U[iDim + 1] = rho * vel[iDim]; + q2 += vel[iDim] * vel[iDim]; + } + U[nDim + 1] = p / (gamma - 1) + rho * (0.5 * q2 + k); + return U; +} + +struct Result { + State flux; + su2double jac_i[maxVar][maxVar], jac_j[maxVar][maxVar]; +}; + +Result Evaluate(unsigned short nDim, CNumerics& numerics, const CConfig* config, const State& Ui, const State& Uj, + su2double k_i, su2double k_j) { + su2double Vi[20] = {0.0}, Vj[20] = {0.0}, Si[2], Sj[2]; + Primitives(nDim, Ui, k_i, Vi, Si); + Primitives(nDim, Uj, k_j, Vj, Sj); + numerics.SetPrimitive(Vi, Vj); + numerics.SetSecondary(Si, Sj); + numerics.SetTurbKineticEnergy(k_i, k_j); + const auto res = numerics.ComputeResidual(config); + Result r; + for (unsigned short iVar = 0; iVar < nDim + 2; iVar++) { + r.flux[iVar] = res.residual[iVar]; + for (unsigned short jVar = 0; jVar < nDim + 2; jVar++) { + r.jac_i[iVar][jVar] = res.jacobian_i[iVar][jVar]; + r.jac_j[iVar][jVar] = res.jacobian_j[iVar][jVar]; + } + } + return r; +} + +/*--- Largest difference between the Jacobians and central differences of the flux, relative to the largest entry. ---*/ +su2double JacobianError(unsigned short nDim, CNumerics& numerics, const CConfig* config, const State& Ui, + const State& Uj, su2double k_i, su2double k_j) { + const unsigned short nVar = nDim + 2; + const auto ref = Evaluate(nDim, numerics, config, Ui, Uj, k_i, k_j); + su2double maxErr = 0.0, maxJac = 0.0; + for (int side = 0; side < 2; side++) { + for (unsigned short jVar = 0; jVar < nVar; jVar++) { + State Up = side ? Uj : Ui, Um = Up; + const su2double h = 1e-6 * std::max(std::abs(Up[jVar]), su2double(1.0)); + Up[jVar] += h; + Um[jVar] -= h; + const auto fp = side ? Evaluate(nDim, numerics, config, Ui, Up, k_i, k_j) + : Evaluate(nDim, numerics, config, Up, Uj, k_i, k_j); + const auto fm = side ? Evaluate(nDim, numerics, config, Ui, Um, k_i, k_j) + : Evaluate(nDim, numerics, config, Um, Uj, k_i, k_j); + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + const su2double fd = (fp.flux[iVar] - fm.flux[iVar]) / (2 * h); + const su2double jac = side ? ref.jac_j[iVar][jVar] : ref.jac_i[iVar][jVar]; + maxErr = std::max(maxErr, std::abs(jac - fd)); + maxJac = std::max(maxJac, std::abs(jac)); + } + } + } + return maxErr / maxJac; +} + +/*--- Contact speed sM of the scheme, in the frame of the face (w = grid velocity along the unit normal n). ---*/ +su2double ContactSpeed(unsigned short nDim, const State& Ui, const State& Uj, su2double k_i, su2double k_j, + const su2double* n, su2double w, su2double sL, su2double sR) { + su2double Vi[20] = {0.0}, Vj[20] = {0.0}, S[2]; + Primitives(nDim, Ui, k_i, Vi, S); + Primitives(nDim, Uj, k_j, Vj, S); + su2double u_i = -w, u_j = -w; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + u_i += Vi[iDim + 1] * n[iDim]; + u_j += Vj[iDim + 1] * n[iDim]; + } + const su2double p_i = Vi[nDim + 1], p_j = Vj[nDim + 1], rho_i = Vi[nDim + 2], rho_j = Vj[nDim + 2]; + return (p_i - p_j - rho_i * u_i * (sL - u_i) + rho_j * u_j * (sR - u_j)) / (rho_j * (sR - u_j) - rho_i * (sL - u_i)); +} + +std::unique_ptr MakeConfig(bool moving, bool accurate) { + std::stringstream options; + options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= HLLC\nTIME_DISCRE_FLOW= EULER_IMPLICIT\n"; + options << "USE_ACCURATE_FLUX_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; + if (moving) options << "GRID_MOVEMENT= STEADY_TRANSLATION\nTRANSLATION_RATE= 0.0 0.0 0.0\n"; + return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); +} + +/*--- With USE_ACCURATE_FLUX_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default + the derivative of p* is approximated (star states), the supersonic branches remain exact. ---*/ +template +void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accurate) { + auto config = MakeConfig(moving, accurate); + HLLC numerics(nDim, nDim + 2, config.get()); + + /*--- Oblique unit normal (face area 1.3) and, on moving faces, a grid velocity with a normal component. ---*/ + const su2double n2[3] = {0.8, 0.6, 0.0}, n3[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; + const su2double* n = (nDim == 2) ? n2 : n3; + su2double normal[3] = {0.0}, gridVel[3] = {0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) normal[iDim] = 1.3 * n[iDim]; + if (moving) { + gridVel[0] = 0.3; + gridVel[1] = -0.1; + gridVel[2] = 0.2; + } + numerics.SetNormal(normal); + numerics.SetGridVel(gridVel, gridVel); + su2double w = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) w += gridVel[iDim] * n[iDim]; + + /*--- Two state pairs with different density, pressure and velocity (also tangential): flow along +n (sM > 0, + left branches) and along -n (sM < 0, right branches). ---*/ + const su2double tangent[3] = {0.1, -0.2, 0.15}; + for (const su2double dir : {1.0, -1.0}) { + su2double vel_i[3], vel_j[3]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + vel_i[iDim] = dir * 0.5 * n[iDim] + tangent[iDim]; + vel_j[iDim] = dir * 0.25 * n[iDim] - tangent[iDim]; + } + const State Ui = Conservative(nDim, 1.2, vel_i, 1.1, k); + const State Uj = Conservative(nDim, 0.9, vel_j, 0.8, 0.8 * k); + + /*--- Wave speeds relative to the face, held fixed (the Jacobians treat them as constants): the supersonic and + the star branch on the side of the flow. ---*/ + const su2double supersonicSpeeds[2] = {dir > 0 ? 0.02 : -2.0, dir > 0 ? 2.0 : -0.02}; + const su2double starSpeeds[2] = {-2.0, 2.0}; + for (const auto* s : {supersonicSpeeds, starSpeeds}) { + numerics.SetFixedWaveSpeeds(true, s[0], s[1]); + const bool supersonic = (s[0] > 0.0) || (s[1] < 0.0); + const su2double sM = ContactSpeed(nDim, Ui, Uj, k, 0.8 * k, n, w, s[0], s[1]); + CAPTURE(nDim, moving, k, accurate, dir, s[0], s[1], sM); + + /*--- Make sure the intended branch is the one selected. ---*/ + if (supersonic) + REQUIRE(((dir > 0) ? s[0] : -s[1]) > 0.0); + else + REQUIRE(sM * dir > 0.0); + + const su2double error = JacobianError(nDim, numerics, config.get(), Ui, Uj, k, 0.8 * k); + if (accurate || supersonic) + CHECK(error < 1e-6); + else + CHECK(error > 1e-3); // the approximation is active + } + } +} + +} // namespace + +TEST_CASE("HLLC Jacobians match finite differences", "[HLLC]") { + for (const unsigned short nDim : {2, 3}) { + for (const bool moving : {false, true}) { + for (const bool accurate : {false, true}) { + CheckAllBranches(nDim, moving, 0.0, accurate); + CheckAllBranches(nDim, moving, 0.0, accurate); + } + } + } +} diff --git a/UnitTests/meson.build b/UnitTests/meson.build index fc99bc101b3a..c2974c4f11e6 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -15,6 +15,7 @@ su2_cfd_tests = files(['Common/CConfig_tests.cpp', 'Common/containers/CLookupTable_tests.cpp', 'Common/toolboxes/multilayer_perceptron/CLookUp_ANN_tests.cpp', 'SU2_CFD/numerics/CNumerics_tests.cpp', + 'SU2_CFD/numerics/hllc_jacobian_tests.cpp', 'SU2_CFD/fluid/CFluidModel_tests.cpp', 'SU2_CFD/gradients.cpp', 'SU2_CFD/solvers/CNEMOEulerSolver_tests.cpp', diff --git a/config_template.cfg b/config_template.cfg index 88533d33c689..5c7132467cc4 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1856,6 +1856,7 @@ LOW_MACH_PREC= NO % % Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) % Slower per iteration but potentialy more stable and capable of higher CFL +% For HLLC: exact Jacobians for fixed wave speeds (the default approximation is more robust with inexact linear solves) USE_ACCURATE_FLUX_JACOBIANS= NO % % Use the vectorized version of the selected numerical method (available for JST family and Roe). From 583c32afd6953e52afb4cddd83551a6a576a362e Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:09 +0200 Subject: [PATCH 04/43] Add the incompressible grid-motion Jacobian once, with the variable-density terms FDS added the grid-motion term inside a loop over the variables (nVar times). The term is now added once, as the exact derivative with respect to (p, u, h), including d(rho)/dh; the same terms are added to the incompressible JST and Lax-Friedrichs schemes. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- .../src/numerics/flow/convection/centered.cpp | 48 ++++++++++++------- SU2_CFD/src/numerics/flow/convection/fds.cpp | 24 ++++++---- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index b0130279f76f..54fdbdfdd8f9 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -161,17 +161,25 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi ProjVelocity += 0.5*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; /*--- Residual contributions ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (iVar = 0; iVar < nVar; iVar++) ProjFlux[iVar] -= ProjVelocity * 0.5*(U_i[iVar]+U_j[iVar]); - /*--- Jacobian contributions ---*/ - /*--- Implicit terms ---*/ - if (implicit) { - for (iDim = 0; iDim < nDim+1; iDim++){ - Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i; - Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j; + /*--- Jacobian of -ProjVelocity * 0.5*U, with U = (rho, rho*u, rho*h), w.r.t. the primitives (p, u, h), added + once. The density depends on h (variable density models) and not on the pressure. ---*/ + if (implicit) { + auto addGridJacobian = [&](su2double **Jac, su2double rho, const su2double *vel, su2double h, su2double T, + su2double cp) { + const su2double dRhodh = variable_density ? su2double(-rho / (T * cp)) : su2double(0.0); + const su2double factor = 0.5*ProjVelocity; + Jac[0][nDim+1] -= factor*dRhodh; + for (iDim = 0; iDim < nDim; iDim++) { + Jac[iDim+1][iDim+1] -= factor*rho; + Jac[iDim+1][nDim+1] -= factor*vel[iDim]*dRhodh; } - } + Jac[nDim+1][nDim+1] -= factor*(rho + h*dRhodh); + }; + addGridJacobian(Jacobian_i, DensityInc_i, Velocity_i, Enthalpy_i, Temperature_i, Cp_i); + addGridJacobian(Jacobian_j, DensityInc_j, Velocity_j, Enthalpy_j, Temperature_j, Cp_j); } } @@ -401,17 +409,25 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi ProjVelocity += 0.5*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; /*--- Residual contributions ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (iVar = 0; iVar < nVar; iVar++) ProjFlux[iVar] -= ProjVelocity * 0.5*(U_i[iVar]+U_j[iVar]); - /*--- Jacobian contributions ---*/ - /*--- Implicit terms ---*/ - if (implicit) { - for (iDim = 0; iDim < nDim+1; iDim++){ - Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i; - Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j; + /*--- Jacobian of -ProjVelocity * 0.5*U, with U = (rho, rho*u, rho*h), w.r.t. the primitives (p, u, h), added + once. The density depends on h (variable density models) and not on the pressure. ---*/ + if (implicit) { + auto addGridJacobian = [&](su2double **Jac, su2double rho, const su2double *vel, su2double h, su2double T, + su2double cp) { + const su2double dRhodh = variable_density ? su2double(-rho / (T * cp)) : su2double(0.0); + const su2double factor = 0.5*ProjVelocity; + Jac[0][nDim+1] -= factor*dRhodh; + for (iDim = 0; iDim < nDim; iDim++) { + Jac[iDim+1][iDim+1] -= factor*rho; + Jac[iDim+1][nDim+1] -= factor*vel[iDim]*dRhodh; } - } + Jac[nDim+1][nDim+1] -= factor*(rho + h*dRhodh); + }; + addGridJacobian(Jacobian_i, DensityInc_i, Velocity_i, Enthalpy_i, Temperature_i, Cp_i); + addGridJacobian(Jacobian_j, DensityInc_j, Velocity_j, Enthalpy_j, Temperature_j, Cp_j); } } diff --git a/SU2_CFD/src/numerics/flow/convection/fds.cpp b/SU2_CFD/src/numerics/flow/convection/fds.cpp index e806127da203..57c7ed9f6f5a 100644 --- a/SU2_CFD/src/numerics/flow/convection/fds.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fds.cpp @@ -249,19 +249,23 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config ProjVelocity += 0.5*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; /*--- Residual contributions ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (iVar = 0; iVar < nVar; iVar++) Flux[iVar] -= ProjVelocity * 0.5*(U_i[iVar]+U_j[iVar]); - /*--- Jacobian contributions ---*/ - /*--- Implicit terms ---*/ - if (implicit) { - for (iDim = 0; iDim < nDim; iDim++){ - Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i; - Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j; + /*--- Jacobian of -ProjVelocity * 0.5*U, with U = (rho, rho*u, rho*h), w.r.t. the primitives (p, u, h), added + once. The density depends on h (variable density models) and not on the pressure. ---*/ + if (implicit) { + auto addGridJacobian = [&](su2double **Jac, su2double rho, const su2double *vel, su2double h, su2double dRhodh) { + const su2double factor = 0.5*ProjVelocity; + Jac[0][nDim+1] -= factor*dRhodh; + for (iDim = 0; iDim < nDim; iDim++) { + Jac[iDim+1][iDim+1] -= factor*rho; + Jac[iDim+1][nDim+1] -= factor*vel[iDim]*dRhodh; } - Jacobian_i[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_i; - Jacobian_j[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_j; - } + Jac[nDim+1][nDim+1] -= factor*(rho + h*dRhodh); + }; + addGridJacobian(Jacobian_i, DensityInc_i, Velocity_i, Enthalpy_i, dRhodh_i); + addGridJacobian(Jacobian_j, DensityInc_j, Velocity_j, Enthalpy_j, dRhodh_j); } } From ca7aee08ccbe731300bbd1e036af55141f00b43d Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:09 +0200 Subject: [PATCH 05/43] Reduce the minimum pressure with MPI_MIN SetRangePressure reduced the local minima with MPI_MAX, so with more than one rank MinP was the largest of the local minima (used by the mass-flow outlet). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 512a99a97dc6..8c6ee1719a01 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2235,7 +2235,7 @@ void CIncEulerSolver::SetRangePressure(CGeometry *geometry, CSolver **solver_con BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { minP = MinP; - SU2_MPI::Allreduce(&minP, &MinP, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&minP, &MinP, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); maxP = MaxP; SU2_MPI::Allreduce(&maxP, &MaxP, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); From b29368df17aee204414315e1d3160ac29bad6c82 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:09 +0200 Subject: [PATCH 06/43] Reject combinations of source terms that share one numerics object The flow solvers build one numerics object per source slot, so two active sources of the same slot overwrote each other (e.g. body force + gravity gave twice the body force). First slot: body force, rotating frame, axisymmetric, gravity, Boussinesq, streamwise periodic. Second slot: radiation, periodic outlet, vorticity confinement. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/src/CConfig.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 034352b92aa4..c5fef6547554 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4598,6 +4598,36 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Rotating_Frame = (Kind_GridMovement == ROTATING_FRAME); + /*--- The finite volume flow solvers apply these source terms with a single numerics object, which is built + for only one of them: combinations would apply one source several times and ignore the others. Only these + solvers (and their discrete adjoints) are checked: e.g. elasticity uses BODY_FORCE and GRAVITY_FORCE together. ---*/ + + if (GetFluidProblem() && !GetNEMOProblem()) { + const bool inc = (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE); + const int nSources = int(Body_Force) + int(Rotating_Frame) + int(Axisymmetric) + int(GravityForce && !inc) + + int(inc && Kind_DensityModel == INC_DENSITYMODEL::BOUSSINESQ) + + int(inc && Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE); + if (nSources > 1) { + SU2_MPI::Error("Only one of BODY_FORCE, GRID_MOVEMENT= ROTATING_FRAME, AXISYMMETRIC, GRAVITY_FORCE (compressible), " + "INC_DENSITY_MODEL= BOUSSINESQ and KIND_STREAMWISE_PERIODIC (incompressible) can be used at a time.", + CURRENT_FUNCTION); + } + } + + /*--- The second source object, for radiation, the energy correction of incompressible streamwise periodic flow + (without periodic temperature) or vorticity confinement, is also built for only one of them. ---*/ + + if (GetFluidProblem() && !GetNEMOProblem()) { + const bool inc = (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE); + const bool periodicOutlet = inc && Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE && Energy_Equation && + !Streamwise_Periodic_Temperature; + if (int(Radiation) + int(periodicOutlet) + int(VorticityConfinement) > 1) { + SU2_MPI::Error("Only one of RADIATION, the energy correction of KIND_STREAMWISE_PERIODIC (incompressible, " + "STREAMWISE_PERIODIC_TEMPERATURE= NO) and VORTICITY_CONFINEMENT can be used at a time.", + CURRENT_FUNCTION); + } + } + /*--- In case the grid movement parameters have not been declared in the config file, set them equal to zero for safety. Also check to make sure that for each option, a value has been declared for each moving marker. ---*/ From df8f9787cdea64283d369dfd773793b10c63557c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:09 +0200 Subject: [PATCH 07/43] Read the Riemann boundary kind in BC_TurboRiemann It read the Giles kind of the marker (copied from BC_Giles), which reads past the end of the Giles list and crashes when the case has no Giles marker. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/solvers/CEulerSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 8259e1630520..15658e5a7459 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -5800,7 +5800,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain ProjVelocity_i += Velocity_i[iDim]*UnitNormal[iDim]; su2double donorAverages[5] = {0.0}; - switch (config->GetKind_Data_Giles(Marker_Tag)){ + switch (config->GetKind_Data_Riemann(Marker_Tag)){ case MIXING_IN: case MIXING_IN_1D: case MIXING_OUT: case MIXING_OUT_1D: for (auto mixVar = 0u; mixVar < 5; mixVar++) donorAverages[mixVar] = GetMixingState(val_marker, iSpan, mixVar); break; From f3bcaac94b17d55ed5217ee46f350089b794a26b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:09 +0200 Subject: [PATCH 08/43] Check the number of variables in the Green-Gauss gradient The boundary flux array had 20 entries and no bound check (NEMO with 10 or more species in 3D). Use 32, as the limiters, and stop with an error above it. The error of both checks is raised by the master thread only, since these functions run inside OpenMP parallel regions (MPI_THREAD_FUNNELED). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp | 9 ++++++++- SU2_CFD/include/limiters/computeLimiters_impl.hpp | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp index f60c0422f0cc..89eb028c6aeb 100644 --- a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp +++ b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp @@ -69,7 +69,14 @@ void computeGradientsGreenGauss(CSolver* solver, MPI_QUANTITIES kindMpiComm, PER const auto chunkSize = computeStaticChunkSize(nPointDomain, omp_get_max_threads(), OMP_MAX_CHUNK); #endif - static constexpr size_t MAXNVAR = 20; + static constexpr size_t MAXNVAR = 32; + + /*--- Called by all threads of a parallel region: only the master may call MPI (MPI_THREAD_FUNNELED). ---*/ + if (varEnd > MAXNVAR) { + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS + SU2_MPI::Error("Number of variables is too large, increase MAXNVAR.", CURRENT_FUNCTION); + END_SU2_OMP_SAFE_GLOBAL_ACCESS + } /*--- For each (non-halo) volume integrate over its faces (edges). ---*/ diff --git a/SU2_CFD/include/limiters/computeLimiters_impl.hpp b/SU2_CFD/include/limiters/computeLimiters_impl.hpp index 7d8beafb03e0..0cdc60207a27 100644 --- a/SU2_CFD/include/limiters/computeLimiters_impl.hpp +++ b/SU2_CFD/include/limiters/computeLimiters_impl.hpp @@ -80,8 +80,12 @@ void computeLimiters_impl(CSolver* solver, { constexpr size_t MAXNVAR = 32; - if (varEnd > MAXNVAR) + /*--- Called by all threads of a parallel region: only the master may call MPI (MPI_THREAD_FUNNELED). ---*/ + if (varEnd > MAXNVAR) { + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS SU2_MPI::Error("Number of variables is too large, increase MAXNVAR.", CURRENT_FUNCTION); + END_SU2_OMP_SAFE_GLOBAL_ACCESS + } const size_t nPointDomain = geometry.GetnPointDomain(); const size_t nPoint = geometry.GetnPoint(); From 99d861a2e510e9ea8edf735f7d0a649431b50a03 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:10 +0200 Subject: [PATCH 09/43] Clamp MGLEVEL to 10 The multigrid arrays hold at most 10 coarse levels (MAX_MG_LEVELS); MGLEVEL= 12 with MG_MIN_MESHSIZE= 1 crashed with stack smashing. Clamp with a warning, MG_MIN_MESHSIZE can still reduce the levels. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/src/CConfig.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index c5fef6547554..3a5bfee8f713 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4987,6 +4987,13 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Restart || ((Kind_MGCycle == MG_CYCLE::FULL) && ContinuousAdjoint)) Kind_MGCycle = MG_CYCLE::V; + /*--- The multigrid arrays hold at most 10 coarse levels (CMultiGridIntegration::MAX_MG_LEVELS). Clamp instead of + stopping, MG_MIN_MESHSIZE can still reduce the number of levels during the agglomeration. ---*/ + if (nMGLevels > 10) { + if (rank == MASTER_NODE) cout << "WARNING: MGLEVEL > 10 is not supported, using MGLEVEL= 10." << endl; + nMGLevels = 10; + } + FinestMesh = MESH_0; if (Kind_MGCycle == MG_CYCLE::FULL) FinestMesh = nMGLevels; From 536c8d8578fe6128b0492963357474f80a2dd62a Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:20 +0200 Subject: [PATCH 10/43] Use 0.5 instead of the integer division 1/2 in the axisymmetric source Jacobian The term 1/2*(Gamma-1) of d(v (rho E + p))/d(rho v) was 0 (implicit Jacobian only). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/numerics/flow/flow_sources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index e3797c7c5a5f..87784e73f39f 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -138,7 +138,7 @@ CNumerics::ResidualType<> CSourceAxisymmetric_Flow::ComputeResidual(const CConfi jacobian[3][0] = -Gamma*U_i[2]*U_i[3]/(U_i[0]*U_i[0]) + (Gamma-1)*U_i[2]*(U_i[1]*U_i[1]+U_i[2]*U_i[2])/(U_i[0]*U_i[0]*U_i[0]); jacobian[3][1] = -(Gamma-1)*U_i[2]*U_i[1]/(U_i[0]*U_i[0]); - jacobian[3][2] = Gamma*U_i[3]/U_i[0] - 1/2*(Gamma-1)*( (U_i[1]*U_i[1]+U_i[2]*U_i[2])/(U_i[0]*U_i[0]) + 2*U_i[2]*U_i[2]/(U_i[0]*U_i[0]) ); + jacobian[3][2] = Gamma*U_i[3]/U_i[0] - 0.5*(Gamma-1)*( (U_i[1]*U_i[1]+U_i[2]*U_i[2])/(U_i[0]*U_i[0]) + 2*U_i[2]*U_i[2]/(U_i[0]*U_i[0]) ); jacobian[3][3] = Gamma*U_i[2]/U_i[0]; for (iVar=0; iVar < nVar; iVar++) From a277f59157ab2142ca06a47e5e8a046f270a0da0 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:09:55 +0200 Subject: [PATCH 11/43] Use wave strengths that match the 3D P matrix in L2Roe, LMRoe and the explicit general-gas Roe In 3D the first three columns of the P matrix combine the entropy wave, weighted by n_j, with the shear waves. Their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j; the entropy jump was used unweighted in the first one only, so a contact or shear layer on a face not aligned with x got a wrong flux. The standard Roe scheme already projects the jump with P^-1 since #299. Unit test roe_contact_tests.cpp: a contact and a shear layer give the upwind flux in 2D and 3D. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/numerics/flow/convection/roe.cpp | 27 ++-- .../SU2_CFD/numerics/roe_contact_tests.cpp | 125 ++++++++++++++++++ UnitTests/meson.build | 1 + 3 files changed, 144 insertions(+), 9 deletions(-) create mode 100644 UnitTests/SU2_CFD/numerics/roe_contact_tests.cpp diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 371e23059d20..37c697515cfb 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -334,9 +334,12 @@ void CUpwL2Roe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J delta_wave[2] = proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); delta_wave[3] = -proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); } else { - delta_wave[0] = delta_rho - delta_p/RoeSoundSpeed2; - delta_wave[1] = (UnitNormal[0]*delta_vel[2]-UnitNormal[2]*delta_vel[0])*zeta; - delta_wave[2] = (UnitNormal[1]*delta_vel[0]-UnitNormal[0]*delta_vel[1])*zeta; + /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the + shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ + const su2double delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; + delta_wave[0] = UnitNormal[0]*delta_entropy + (delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1])*zeta; + delta_wave[1] = UnitNormal[1]*delta_entropy + (delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2])*zeta; + delta_wave[2] = UnitNormal[2]*delta_entropy + (delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0])*zeta; delta_wave[3] = proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); delta_wave[4] = -proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); } @@ -407,9 +410,12 @@ void CUpwLMRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J delta_wave[2] = proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); delta_wave[3] = -proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); } else { - delta_wave[0] = delta_rho - delta_p/RoeSoundSpeed2; - delta_wave[1] = (UnitNormal[0]*delta_vel[2]-UnitNormal[2]*delta_vel[0]); - delta_wave[2] = (UnitNormal[1]*delta_vel[0]-UnitNormal[0]*delta_vel[1]); + /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the + shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ + const su2double delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; + delta_wave[0] = UnitNormal[0]*delta_entropy + (delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1]); + delta_wave[1] = UnitNormal[1]*delta_entropy + (delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2]); + delta_wave[2] = UnitNormal[2]*delta_entropy + (delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0]); delta_wave[3] = proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); delta_wave[4] = -proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); } @@ -901,9 +907,12 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co delta_wave[2] = proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); delta_wave[3] = -proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); } else { - delta_wave[0] = delta_rho - delta_p/(RoeSoundSpeed*RoeSoundSpeed); - delta_wave[1] = UnitNormal[0]*delta_vel[2]-UnitNormal[2]*delta_vel[0]; - delta_wave[2] = UnitNormal[1]*delta_vel[0]-UnitNormal[0]*delta_vel[1]; + /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the + shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ + const su2double delta_entropy = delta_rho - delta_p/(RoeSoundSpeed*RoeSoundSpeed); + delta_wave[0] = UnitNormal[0]*delta_entropy + delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1]; + delta_wave[1] = UnitNormal[1]*delta_entropy + delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2]; + delta_wave[2] = UnitNormal[2]*delta_entropy + delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0]; delta_wave[3] = proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); delta_wave[4] = -proj_delta_vel + delta_p/(RoeDensity*RoeSoundSpeed); } diff --git a/UnitTests/SU2_CFD/numerics/roe_contact_tests.cpp b/UnitTests/SU2_CFD/numerics/roe_contact_tests.cpp new file mode 100644 index 000000000000..9c99a461f218 --- /dev/null +++ b/UnitTests/SU2_CFD/numerics/roe_contact_tests.cpp @@ -0,0 +1,125 @@ +/*! + * \file roe_contact_tests.cpp + * \brief Roe-type schemes must resolve a contact discontinuity and a shear layer exactly (upwind flux), in 2D + * and 3D, on faces not aligned with the axes. + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include +#include +#include +#include "../../../SU2_CFD/include/numerics/flow/convection/roe.hpp" + +namespace { + +constexpr su2double gamma = 1.4; + +std::unique_ptr MakeConfig(bool implicit) { + std::stringstream options; + options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= ROE\nENTROPY_FIX_COEFF= 0.0\nROE_KAPPA= 0.5\n"; + options << "TIME_DISCRE_FLOW= " << (implicit ? "EULER_IMPLICIT" : "EULER_EXPLICIT") << "\n"; + return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); +} + +/*--- Primitive (T, u, v, [w], p, rho, h, c) and secondary (dp/drho_e, dp/de_rho) variables of an ideal gas. ---*/ +void State(unsigned short nDim, su2double rho, const su2double* vel, su2double p, su2double* V, su2double* S) { + su2double q2 = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + V[iDim + 1] = vel[iDim]; + q2 += vel[iDim] * vel[iDim]; + } + V[0] = p / (rho * 287.058); + V[nDim + 1] = p; + V[nDim + 2] = rho; + V[nDim + 3] = gamma / (gamma - 1) * p / rho + 0.5 * q2; + V[nDim + 4] = sqrt(gamma * p / rho); + S[0] = p / rho; + S[1] = (gamma - 1) * rho; +} + +template +std::unique_ptr MakeScheme(unsigned short nDim, const CConfig* config) { + return std::make_unique(nDim, nDim + 2, config); +} +template <> +std::unique_ptr MakeScheme(unsigned short nDim, const CConfig* config) { + return std::make_unique(nDim, nDim + 2, config, false); +} + +/*--- Two states with the same pressure and normal velocity, different density and (with shear) tangential + velocity: a contact discontinuity, whose exact (upwind) flux is the flux of the upstream state. ---*/ +template +void CheckContact(const char* name, unsigned short nDim, const su2double* vel, bool implicit, bool shear) { + auto config = MakeConfig(implicit); + auto numerics = MakeScheme(nDim, config.get()); + + const su2double p = 1.0, rho_i = 1.4, rho_j = 0.7; + const su2double n2[2] = {0.6, 0.8}, n3[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; + const su2double* n = (nDim == 2) ? n2 : n3; + const su2double t2[2] = {0.16, -0.12}, t3[3] = {0.15, -0.1, 0.0}; // tangential velocity jumps + const su2double* t = (nDim == 2) ? t2 : t3; + su2double vel_j[3] = {0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) vel_j[iDim] = vel[iDim] + (shear ? t[iDim] : 0.0); + + su2double Vi[10] = {0.0}, Vj[10] = {0.0}, Si[2], Sj[2]; + State(nDim, rho_i, vel, p, Vi, Si); + State(nDim, rho_j, vel_j, p, Vj, Sj); + numerics->SetPrimitive(Vi, Vj); + numerics->SetSecondary(Si, Sj); + numerics->SetNormal(n); + const auto res = numerics->ComputeResidual(config.get()); + + su2double un = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) un += vel[iDim] * n[iDim]; + const su2double rho_up = (un >= 0.0) ? rho_i : rho_j; + const su2double* V_up = (un >= 0.0) ? Vi : Vj; + + CAPTURE(name, nDim, un, implicit, shear); + CHECK(res.residual[0] == Approx(rho_up * un).margin(1e-12)); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + CHECK(res.residual[iDim + 1] == Approx(rho_up * V_up[iDim + 1] * un + p * n[iDim]).margin(1e-12)); + CHECK(res.residual[nDim + 1] == Approx(rho_up * V_up[nDim + 3] * un).margin(1e-12)); +} + +template +void CheckContacts(const char* name, bool implicit = true, bool shear = true) { + const su2double zero[3] = {0.0, 0.0, 0.0}, moving[3] = {0.3, -0.1, 0.2}, reverse[3] = {-0.3, 0.1, -0.2}; + for (const unsigned short nDim : {2, 3}) { + for (const auto* vel : {zero, moving, reverse}) { + CheckContact(name, nDim, vel, implicit, false); + if (shear) CheckContact(name, nDim, vel, implicit, true); + } + } +} + +} // namespace + +TEST_CASE("Roe schemes resolve a contact and a shear layer exactly", "[Roe]") { + CheckContacts("Roe"); + CheckContacts("general Roe", true); + CheckContacts("general Roe", false); + CheckContacts("LMRoe"); + /*--- L2Roe scales the tangential velocity jump at low Mach number (not upwind by design). ---*/ + CheckContacts("L2Roe", true, false); +} diff --git a/UnitTests/meson.build b/UnitTests/meson.build index c2974c4f11e6..8c2e61614e74 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -15,6 +15,7 @@ su2_cfd_tests = files(['Common/CConfig_tests.cpp', 'Common/containers/CLookupTable_tests.cpp', 'Common/toolboxes/multilayer_perceptron/CLookUp_ANN_tests.cpp', 'SU2_CFD/numerics/CNumerics_tests.cpp', + 'SU2_CFD/numerics/roe_contact_tests.cpp', 'SU2_CFD/numerics/hllc_jacobian_tests.cpp', 'SU2_CFD/fluid/CFluidModel_tests.cpp', 'SU2_CFD/gradients.cpp', From c333a18ebd6c26c584e24088fedfe9b1c9364af5 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 29 Sep 2026 14:10:40 +0200 Subject: [PATCH 12/43] Check the MUSCL face states before evaluating the fluid model The consistent extrapolation and the low-Mach correction called the fluid model with the reconstructed pressure and density before checking that they are positive (possible NaN or fluid-model errors with real-gas models at start-up). Check them first, also rejecting zero and NaN, and check again after the low-Mach correction. Valid states give the same result as before. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/solvers/CEulerSolver.cpp | 42 ++++++++++++++++++---------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 15658e5a7459..6b8784f228aa 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1947,27 +1947,39 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain } - /*--- Recompute the reconstructed quantities in a thermodynamically consistent way. ---*/ + /*--- Check for non-physical solutions after reconstruction. If found, use the + cell-average value of the solution. This is a locally 1st order approximation, + which is typically only active during the start-up of a calculation. + Pressure and density are checked before the fluid model is evaluated with them. ---*/ - if (!ideal_gas || low_mach_corr) { - ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_i, Secondary_i); - ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_j, Secondary_j); - } + auto nonPositive = [](su2double value) { return !(value > 0.0) || !std::isfinite(SU2_TYPE::GetValue(value)); }; + bool neg_pres_or_rho_i = nonPositive(Primitive_i[prim_idx.Pressure()]) || nonPositive(Primitive_i[prim_idx.Density()]); + bool neg_pres_or_rho_j = nonPositive(Primitive_j[prim_idx.Pressure()]) || nonPositive(Primitive_j[prim_idx.Density()]); - /*--- Low-Mach number correction. ---*/ + if (!neg_pres_or_rho_i && !neg_pres_or_rho_j) { - if (low_mach_corr) { - LowMachPrimitiveCorrection(GetFluidModel(), nDim, Primitive_i, Primitive_j); - } + /*--- Recompute the reconstructed quantities in a thermodynamically consistent way. ---*/ - /*--- Check for non-physical solutions after reconstruction. If found, use the - cell-average value of the solution. This is a locally 1st order approximation, - which is typically only active during the start-up of a calculation. ---*/ + if (!ideal_gas || low_mach_corr) { + ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_i, Secondary_i); + ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_j, Secondary_j); + } + + /*--- Low-Mach number correction. ---*/ + + if (low_mach_corr) { + LowMachPrimitiveCorrection(GetFluidModel(), nDim, Primitive_i, Primitive_j); + } + + /*--- The correction changes the face states, check them again. ---*/ - bool neg_pres_or_rho_i = (Primitive_i[prim_idx.Pressure()] < 0.0) || (Primitive_i[prim_idx.Density()] < 0.0); - bool neg_pres_or_rho_j = (Primitive_j[prim_idx.Pressure()] < 0.0) || (Primitive_j[prim_idx.Density()] < 0.0); + neg_pres_or_rho_i = nonPositive(Primitive_i[prim_idx.Pressure()]) || nonPositive(Primitive_i[prim_idx.Density()]); + neg_pres_or_rho_j = nonPositive(Primitive_j[prim_idx.Pressure()]) || nonPositive(Primitive_j[prim_idx.Density()]); + } - su2double R = sqrt(fabs(Primitive_j[prim_idx.Density()]/Primitive_i[prim_idx.Density()])); + su2double R = 1.0; + if (!neg_pres_or_rho_i && !neg_pres_or_rho_j) + R = sqrt(Primitive_j[prim_idx.Density()]/Primitive_i[prim_idx.Density()]); su2double sq_vel = 0.0; for (auto iDim = 0u; iDim < nDim; iDim++) { su2double RoeVelocity = (R * Primitive_j[iDim + prim_idx.Velocity()] + From c0dc0cee396ba32632edde575713d7629c8c652c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 13:52:07 +0200 Subject: [PATCH 13/43] Include the SST k of the total energy in the convective numerics With SST the total energy contains k (CNSVariable subtracts it from the static energy, the free-stream and boundary energies add it), but the convective schemes computed the speed of sound, the eigenvector matrices and the Jacobians as if it did not. Add a k argument (held fixed, default 0) to GetPMatrix, GetPMatrix_inv and GetInviscidProjJac, and to the SIMD pMatrix, pMatrixInv, inviscidProjJac and Roe average. Remove k from the speed of sound of Roe, HLLC, AUSM-type and FVS schemes, use the Roe-averaged k in the Roe matrices, advect the part of Delta(rho E) due to Delta k with the contact wave (Roe, JST-mat), and include k in the accurate AUSM and HLLC Jacobians and in the preaccumulation inputs. Upwind_Residual passes the k of the cells to the numerics, adds it to the total enthalpy of the consistent and low-Mach extrapolations, and checks the speed of sound of each MUSCL face state as well as of the Roe average. Unit tests for the Roe and AUSM contacts with a k jump and the HLLC Jacobians with k. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics/CNumerics.hpp | 24 ++- .../include/numerics/flow/convection/roe.hpp | 1 + .../flow/convection/centered.hpp | 33 +++- .../numerics_simd/flow/convection/common.hpp | 29 ++- .../numerics_simd/flow/convection/upwind.hpp | 44 +++-- .../include/numerics_simd/flow/variables.hpp | 9 +- SU2_CFD/include/solvers/CEulerSolver.hpp | 10 +- SU2_CFD/src/numerics/CNumerics.cpp | 25 +-- .../numerics/flow/convection/ausm_slau.cpp | 56 +++--- SU2_CFD/src/numerics/flow/convection/fvs.cpp | 17 +- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 44 +++-- SU2_CFD/src/numerics/flow/convection/roe.cpp | 61 ++++-- SU2_CFD/src/solvers/CEulerSolver.cpp | 39 +++- UnitTests/SU2_CFD/numerics/ausm_tke_tests.cpp | 173 +++++++++++++++++ .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 11 +- UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp | 176 ++++++++++++++++++ UnitTests/meson.build | 2 + 17 files changed, 625 insertions(+), 129 deletions(-) create mode 100644 UnitTests/SU2_CFD/numerics/ausm_tke_tests.cpp create mode 100644 UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index ec511a3fa1db..b26e911c3542 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -1146,10 +1146,11 @@ class CNumerics { * \param[in] val_normal - Normal vector, the norm of the vector is the area of the face. * \param[in] val_scale - Scale of the projection. * \param[out] val_Proj_Jac_tensor - Pointer to the projected inviscid Jacobian. + * \param[in] val_tke - Turbulent kinetic energy contained in the total energy (SST), held fixed. */ void GetInviscidProjJac(const su2double *val_velocity, const su2double *val_energy, const su2double *val_normal, su2double val_scale, - su2double **val_Proj_Jac_tensor) const; + su2double **val_Proj_Jac_tensor, su2double val_tke = 0.0) const; /*! * \brief Compute the projection of the inviscid Jacobian matrices (incompressible). @@ -1222,11 +1223,12 @@ class CNumerics { * \param[in] val_normal - Normal vector, the norm of the vector is the area of the face. * \param[in] val_scale - Scale of the projection. * \param[out] val_Proj_Jac_tensor - Pointer to the projected inviscid Jacobian. + * \param[in] val_tke - Turbulent kinetic energy contained in the total energy (SST), held fixed. */ void GetInviscidProjJac(const su2double *val_velocity, const su2double *val_enthalphy, const su2double *val_chi, const su2double *val_kappa, const su2double *val_normal, su2double val_scale, - su2double **val_Proj_Jac_tensor) const; + su2double **val_Proj_Jac_tensor, su2double val_tke = 0.0) const; /*! * \brief Mapping between primitives variables P and conservatives variables C. @@ -1253,7 +1255,7 @@ class CNumerics { void GetPMatrix(const su2double *val_density, const su2double *val_velocity, const su2double *val_soundspeed, const su2double *val_enthalpy, const su2double *val_chi, const su2double *val_kappa, - const su2double *val_normal, su2double **val_p_tensor) const; + const su2double *val_normal, su2double **val_p_tensor, su2double val_tke = 0.0) const; /*! * \brief Computation of the matrix P, this matrix diagonalize the conservative Jacobians in @@ -1267,12 +1269,13 @@ class CNumerics { template void GetPMatrix(const su2double& density, const su2double* velocity, const su2double& soundspeed, const su2double* normal, - Matrix& p_tensor) const { + Matrix& p_tensor, su2double tke = 0.0) const { + /*--- With SST the total energy contains k (tke): it is added to the kinetic energy of the energy row. ---*/ const su2double rhooc = density / soundspeed; const su2double rhoxc = density * soundspeed; if (nDim == 2) { - const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity); + const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity) + tke; const su2double projvel = GeometryToolbox::DotProduct(2, velocity, normal); p_tensor[0][0] = 1.0; @@ -1295,7 +1298,7 @@ class CNumerics { p_tensor[3][2] = 0.5 * (ke * rhooc + density * projvel + rhoxc / Gamma_Minus_One); p_tensor[3][3] = 0.5 * (ke * rhooc - density * projvel + rhoxc / Gamma_Minus_One); } else { - const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity); + const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity) + tke; const su2double projvel = GeometryToolbox::DotProduct(3, velocity, normal); p_tensor[0][0] = normal[0]; @@ -1430,7 +1433,7 @@ class CNumerics { void GetPMatrix_inv(su2double **val_invp_tensor, const su2double *val_density, const su2double *val_velocity, const su2double *val_soundspeed, const su2double *val_chi, const su2double *val_kappa, - const su2double *val_normal) const; + const su2double *val_normal, su2double val_tke = 0.0) const; /*! * \brief Computation of the matrix P^{-1}, this matrix diagonalize the conservative Jacobians @@ -1444,7 +1447,8 @@ class CNumerics { template void GetPMatrix_inv(const su2double& density, const su2double* velocity, const su2double& soundspeed, const su2double* normal, - Matrix& inv_p_tensor) const { + Matrix& inv_p_tensor, su2double tke = 0.0) const { + /*--- With SST the total energy contains k (tke), dp/drho = (gamma-1) (|u|^2/2 - k). ---*/ const su2double rhoxc = density * soundspeed; const su2double c2 = pow(soundspeed, 2); const su2double gm1 = Gamma_Minus_One; @@ -1455,7 +1459,7 @@ class CNumerics { if (nDim == 3) { const su2double k2orho = normal[2] / density; - const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity); + const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity) - tke; const su2double projvel_o_rho = GeometryToolbox::DotProduct(3, velocity, normal) / density; inv_p_tensor[0][0] = normal[0] + k1orho * velocity[2] - k2orho * velocity[1] - normal[0] * gm1_o_c2 * ke; @@ -1488,7 +1492,7 @@ class CNumerics { inv_p_tensor[4][3] = -k2orho - gm1_o_rhoxc * velocity[2]; inv_p_tensor[4][4] = gm1_o_rhoxc; } else { - const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity); + const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity) - tke; const su2double projvel_o_rho = GeometryToolbox::DotProduct(2, velocity, normal) / density; inv_p_tensor[0][0] = 1 - gm1_o_c2 * ke; diff --git a/SU2_CFD/include/numerics/flow/convection/roe.hpp b/SU2_CFD/include/numerics/flow/convection/roe.hpp index 01c0874f8e98..8664c60e49e1 100644 --- a/SU2_CFD/include/numerics/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics/flow/convection/roe.hpp @@ -45,6 +45,7 @@ class CUpwRoeBase_Flow : public CNumerics { su2double *ProjFlux_j = nullptr, *Conservatives_j = nullptr; su2double **P_Tensor = nullptr, **invP_Tensor = nullptr; su2double RoeDensity, RoeEnthalpy, RoeSoundSpeed, ProjVelocity, RoeSoundSpeed2, kappa; + su2double RoeTke = 0.0; /*!< \brief Roe-averaged k (SST, contained in the total energy). */ su2double* Flux = nullptr; /*!< \brief The flux accross the face. */ su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */ diff --git a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp index faaf56912351..193b5ec7624f 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp @@ -52,6 +52,7 @@ class CCenteredBase : public Base { const su2double fixFactor; const bool dynamicGrid; const su2double stretchParam = 0.3; + const CVariable* const tkeVars; /*!< \brief SST turbulence variables (k is part of the total energy), else nullptr. */ /*! * \brief Constructor, store some constants and forward args to base. @@ -60,7 +61,8 @@ class CCenteredBase : public Base { CCenteredBase(const CConfig& config, Ts&... args) : Base(config, args...), gamma(config.GetGamma()), fixFactor(config.GetCent_Jac_Fix_Factor()), - dynamicGrid(config.GetDynamic_Grid()) { + dynamicGrid(config.GetDynamic_Grid()), + tkeVars(config.GetKind_Turb_Model() == TURB_MODEL::SST ? findTurbVars(args...) : nullptr) { } /*! @@ -140,8 +142,14 @@ class CCenteredBase : public Base { MatrixDbl jac_i, jac_j; if (implicit) { - jac_i = inviscidProjJac(gamma, V.i.velocity(), U.i.energy(), normal, 0.5); - jac_j = inviscidProjJac(gamma, V.j.velocity(), U.j.energy(), normal, 0.5); + /*--- With SST the total energy contains k, held fixed in the Jacobian. ---*/ + Double tke_i = 0.0, tke_j = 0.0; + if (tkeVars) { + tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); + tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + } + jac_i = inviscidProjJac(gamma, V.i.velocity(), U.i.energy(), normal, 0.5, tke_i); + jac_j = inviscidProjJac(gamma, V.j.velocity(), U.j.energy(), normal, 0.5, tke_j); } /*--- Grid motion. ---*/ @@ -283,6 +291,7 @@ class CJSTmatScheme : public CCenteredBase,Decorator> { using Base::nVar; using Base::gamma; using Base::fixFactor; + using Base::tkeVars; const su2double kappa2; const su2double kappa4; const su2double entropyFix; @@ -350,11 +359,24 @@ class CJSTmatScheme : public CCenteredBase,Decorator> { const auto unitProjVel = dot(avgV.velocity(), unitNormal); + /*--- With SST the total energy contains k, averaged between the cells. ---*/ + Double tke_i = 0.0, tke_j = 0.0; + if (tkeVars) { + tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); + tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + } + const Double avgTke = 0.5 * (tke_i + tke_j); + + /*--- Delta(rho k) = avg(rho) Delta k + avg(k) Delta rho. The part with Delta k is not a pressure jump: remove it + from the 2nd order dissipation before the projection and advect it with the contact wave. The 4th order term + keeps it (the Laplacian of k is not available). ---*/ + const Double rhoDeltaTke = eps2 * avgV.density() * (tke_i - tke_j); + scalarDissip(nVar-1) -= rhoDeltaTke; auto pMat = pMatrix(gamma, avgV.density(), avgV.velocity(), - unitProjVel, avgV.speedSound(), unitNormal); + unitProjVel, avgV.speedSound(), unitNormal, avgTke); auto pMatInv = pMatrixInv(gamma, avgV.density(), avgV.velocity(), - unitProjVel, avgV.speedSound(), unitNormal); + unitProjVel, avgV.speedSound(), unitNormal, avgTke); /*--- Compute limited absolute eigenvalues (times area). ---*/ @@ -394,6 +416,7 @@ class CJSTmatScheme : public CCenteredBase,Decorator> { } } } + flux(nVar-1) += lambda(0) * rhoDeltaTke; } }; diff --git a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp index 800167d4b0f5..2d09e62d6b3b 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp @@ -134,9 +134,11 @@ FORCEINLINE CPair reconstructPrimitives(const Int& iEdge, */ template FORCEINLINE MatrixDbl pMatrix(const Double& gamma, const Double& density, const RandomAccessIterator& velocity, - const Double& projVel, const Double& speedSound, const VectorDbl& normal) { + const Double& projVel, const Double& speedSound, const VectorDbl& normal, + const Double& tke = Double(0.0)) { MatrixDbl pMat; - const Double vel2 = 0.5*squaredNorm(velocity); + /*--- With SST the total energy contains k (tke). ---*/ + const Double vel2 = 0.5*squaredNorm(velocity) + tke; if (nDim == 2) { pMat(0,0) = 1.0; @@ -197,11 +199,13 @@ FORCEINLINE MatrixDbl pMatrix(const Double& gamma, const Double& density template FORCEINLINE MatrixDbl pMatrixInv(const Double& gamma, const Double& density, const RandomAccessIterator& velocity, const Double& projVel, - const Double& speedSound, const VectorDbl& normal) { + const Double& speedSound, const VectorDbl& normal, + const Double& tke = Double(0.0)) { MatrixDbl pMatInv; const Double c2 = pow(speedSound,2); - const Double vel2 = 0.5*squaredNorm(velocity); + /*--- With SST the total energy contains k (tke), dp/drho = (gamma-1) (|u|^2/2 - k). ---*/ + const Double vel2 = 0.5*squaredNorm(velocity) - tke; const Double oneOnRho = 1 / density; if (nDim == 2) { @@ -273,19 +277,30 @@ FORCEINLINE VectorDbl inviscidProjFlux(const PrimVarType& V, return flux; } +/*! + * \brief Turbulence variables among the constructor arguments of a scheme (nullptr if there are none). + */ +inline const CVariable* findTurbVars() { return nullptr; } +template +const CVariable* findTurbVars(T& first, Ts&... rest) { + if constexpr (std::is_convertible::value) return first; + else return findTurbVars(rest...); +} + /*! * \brief Jacobian of the convective flux (compressible flow, ideal gas). + * \note With SST the total energy contains k (tke), which is held fixed. */ template FORCEINLINE MatrixDbl inviscidProjJac(const Double& gamma, RandomAccessIterator velocity, const Double& energy, const VectorDbl& normal, - const Double& scale) { + const Double& scale, const Double& tke = Double(0.0)) { MatrixDbl jac; Double projVel = dot(velocity, normal); Double gamma_m_1 = gamma-1; - Double phi = 0.5*gamma_m_1*squaredNorm(velocity); - Double a1 = gamma*energy - phi; + Double phi = gamma_m_1*(0.5*squaredNorm(velocity) - tke); // dp/drho, k held fixed + Double a1 = gamma*energy - gamma_m_1*(0.5*squaredNorm(velocity) + tke); // total enthalpy jac(0,0) = 0.0; for (size_t iDim = 0; iDim < nDim; ++iDim) { diff --git a/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp b/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp index 38ec02c902b5..f8f0e43e983a 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp @@ -61,6 +61,7 @@ class CUpwindBase : public Base { const bool muscl; const su2double umusclKappa; const LIMITER typeLimiter; + const CVariable* const tkeVars; /*!< \brief SST turbulence variables (k is part of the total energy), else nullptr. */ /*! * \brief Constructor, store some constants and forward args to base. @@ -73,7 +74,8 @@ class CUpwindBase : public Base { dynamicGrid(config.GetDynamic_Grid()), muscl(finestGrid && config.GetMUSCL_Flow()), umusclKappa(config.GetMUSCL_Kappa_Flow()), - typeLimiter(config.GetKind_SlopeLimit_Flow()) { + typeLimiter(config.GetKind_SlopeLimit_Flow()), + tkeVars(config.GetKind_Turb_Model() == TURB_MODEL::SST ? findTurbVars(args...) : nullptr) { } public: @@ -178,6 +180,7 @@ class CRoeScheme : public CUpwindBase, Decorator> { using Base::gamma; using Base::gasConst; using Base::dynamicGrid; + using Base::tkeVars; public: /*! @@ -190,6 +193,7 @@ class CRoeScheme : public CUpwindBase, Decorator> { typeDissip(static_cast(config.GetKind_RoeLowDiss())) { } + /*! * \brief Updates flux and Jacobians with standard Roe dissipation. * \note "Ts" is here just in case other schemes in the family need extra args. @@ -210,9 +214,14 @@ class CRoeScheme : public CUpwindBase, Decorator> { const CEulerVariable& solution, const CGeometry& geometry, Ts&...) const { - /*--- Roe averaged variables. ---*/ + /*--- Roe averaged variables. With SST the total enthalpy of the cells contains k. ---*/ - auto roeAvg = roeAveragedVariables(gamma, V, unitNormal); + Double tke_i = 0.0, tke_j = 0.0; + if (tkeVars) { + tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); + tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + } + auto roeAvg = roeAveragedVariables(gamma, V, unitNormal, tke_i, tke_j); /*--- Grid motion. ---*/ @@ -249,8 +258,8 @@ class CRoeScheme : public CUpwindBase, Decorator> { flux(iVar) = 0.5 * (flux_i(iVar) + flux_j(iVar)); } if (implicit) { - jac_i = inviscidProjJac(gamma, V.i.velocity(), U.i.energy(), normal, kappa); - jac_j = inviscidProjJac(gamma, V.j.velocity(), U.j.energy(), normal, kappa); + jac_i = inviscidProjJac(gamma, V.i.velocity(), U.i.energy(), normal, kappa, tke_i); + jac_j = inviscidProjJac(gamma, V.j.velocity(), U.j.energy(), normal, kappa, tke_j); } /*--- Correct for grid motion. ---*/ @@ -270,12 +279,12 @@ class CRoeScheme : public CUpwindBase, Decorator> { /*--- P tensor. ---*/ auto pMat = pMatrix(gamma, roeAvg.density, roeAvg.velocity, - roeAvg.projVel, roeAvg.speedSound, unitNormal); + roeAvg.projVel, roeAvg.speedSound, unitNormal, roeAvg.tke); /*--- Inverse P tensor. ---*/ auto pMatInv = pMatrixInv(gamma, roeAvg.density, roeAvg.velocity, - roeAvg.projVel, roeAvg.speedSound, unitNormal); + roeAvg.projVel, roeAvg.speedSound, unitNormal, roeAvg.tke); /*--- Diference between conservative variables at jPoint and iPoint. ---*/ @@ -284,6 +293,11 @@ class CRoeScheme : public CUpwindBase, Decorator> { deltaU(iVar) = U.j.all(iVar) - U.i.all(iVar); } + /*--- With SST rho*E contains rho*k, and Delta(rho k) = rho_roe Delta k + k_roe Delta rho. The part with Delta k + is not a pressure jump: remove it before the projection and advect it with the contact wave. ---*/ + const Double rhoDeltaTke = roeAvg.density * (tke_j - tke_i); + deltaU(nVar-1) -= rhoDeltaTke; + /*--- Dissipation terms. ---*/ Double dissipation = roeDissipation(iPoint, jPoint, typeDissip, solution); @@ -309,6 +323,7 @@ class CRoeScheme : public CUpwindBase, Decorator> { } } } + flux(nVar-1) -= (1-kappa) * area * dissipation * lambda(0) * rhoDeltaTke; } }; @@ -330,6 +345,7 @@ class CMSWScheme : public CUpwindBase, Decorator> { using Base::gamma; using Base::gasConst; using Base::dynamicGrid; + using Base::tkeVars; public: /*! @@ -397,10 +413,16 @@ class CMSWScheme : public CUpwindBase, Decorator> { lambda(nDim) = fmax(projVel_i + soundSpeed_i, 0); lambda(nDim+1) = fmax(projVel_i - soundSpeed_i, 0); + /*--- With SST the total energy contains k, taken from the cells. ---*/ + Double tke_i = 0.0, tke_j = 0.0; + if (tkeVars) { + tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); + tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + } auto pMat = pMatrix(gamma, Vweighted.i.density(), Vweighted.i.velocity(), - projVel_i, soundSpeed_i, unitNormal); + projVel_i, soundSpeed_i, unitNormal, tke_i); auto pMatInv = pMatrixInv(gamma, Vweighted.i.density(), Vweighted.i.velocity(), - projVel_i, soundSpeed_i, unitNormal); + projVel_i, soundSpeed_i, unitNormal, tke_i); auto updateFlux = [&](const auto& u, auto& jac) { for (size_t iVar = 0; iVar < nVar; ++iVar) { @@ -429,9 +451,9 @@ class CMSWScheme : public CUpwindBase, Decorator> { lambda(nDim+1) = fmin(projVel_j - soundSpeed_j, 0); pMat = pMatrix(gamma, Vweighted.j.density(), Vweighted.j.velocity(), - projVel_j, soundSpeed_j, unitNormal); + projVel_j, soundSpeed_j, unitNormal, tke_j); pMatInv = pMatrixInv(gamma, Vweighted.j.density(), Vweighted.j.velocity(), - projVel_j, soundSpeed_j, unitNormal); + projVel_j, soundSpeed_j, unitNormal, tke_j); updateFlux(U.j.all, jac_j); } }; diff --git a/SU2_CFD/include/numerics_simd/flow/variables.hpp b/SU2_CFD/include/numerics_simd/flow/variables.hpp index 4406a06abf7c..abeabf049ed1 100644 --- a/SU2_CFD/include/numerics_simd/flow/variables.hpp +++ b/SU2_CFD/include/numerics_simd/flow/variables.hpp @@ -107,15 +107,19 @@ struct CRoeVariables { Double enthalpy; Double speedSound; Double projVel; + Double tke; /*!< \brief Roe-averaged k (SST, part of the total enthalpy). */ }; /*! * \brief Compute Roe-averaged variables from pair of primitive variables. + * \note With SST the total enthalpy contains k (tke_i, tke_j), which is not part of the speed of sound. */ template FORCEINLINE CRoeVariables roeAveragedVariables(const Double& gamma, const CPair& V, - const VectorDbl& normal) { + const VectorDbl& normal, + const Double& tke_i = Double(0.0), + const Double& tke_j = Double(0.0)) { CRoeVariables roeAvg; Double R = sqrt(V.j.density() / V.i.density()); Double D = 1 / (R+1); @@ -124,7 +128,8 @@ FORCEINLINE CRoeVariables roeAveragedVariables(const Double& gamma, roeAvg.velocity(iDim) = (R*V.j.velocity(iDim) + V.i.velocity(iDim)) * D; } roeAvg.enthalpy = (R*V.j.enthalpy() + V.i.enthalpy()) * D; - roeAvg.speedSound = sqrt((gamma-1) * (roeAvg.enthalpy - 0.5*squaredNorm(roeAvg.velocity))); + roeAvg.tke = (R*tke_j + tke_i) * D; + roeAvg.speedSound = sqrt((gamma-1) * (roeAvg.enthalpy - 0.5*squaredNorm(roeAvg.velocity) - roeAvg.tke)); roeAvg.projVel = dot(roeAvg.velocity, normal); return roeAvg; } diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 345be6d3d3a4..ed4b5db05748 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -419,11 +419,13 @@ class CEulerSolver : public CFVMFlowSolverBase CUpwAUSMPLUS_SLAU_Base_Flow::ComputeResidual(const CCo AD::SetPreaccIn(Normal, nDim); AD::SetPreaccIn(V_i, nDim+4); AD::SetPreaccIn(V_j, nDim+4); + AD::SetPreaccIn(turb_ke_i); AD::SetPreaccIn(turb_ke_j); // SST: k in the total energy /*--- Variables for the general form and primitives for mass flux and pressure calculation. ---*/ /*--- F_{1/2} = ||A|| ( 0.5 * mdot * (psi_i+psi_j) - 0.5 * |mdot| * (psi_i-psi_j) + N * pf ) ---*/ @@ -413,8 +416,9 @@ void CUpwAUSMPLUSUP_Flow::ComputeMassAndPressureFluxes(const CConfig* config, su /*--- Compute interface speed of sound (aF) ---*/ - su2double astarL = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*Enthalpy_i); - su2double astarR = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*Enthalpy_j); + /*--- With SST the total enthalpy contains k, which is not part of the critical speed of sound. ---*/ + su2double astarL = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*(Enthalpy_i-turb_ke_i)); + su2double astarR = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*(Enthalpy_j-turb_ke_j)); su2double ahatL = astarL*astarL/max(astarL, ProjVelocity_i); su2double ahatR = astarR*astarR/max(astarR,-ProjVelocity_j); @@ -584,7 +588,7 @@ void CUpwAUSMPLUSUP_Flow::ComputeMassAndPressureFluxes(const CConfig* config, su astar_b *= 2.0*tmp; Vn_i_b -= tmp*tmp * aF_b; } - H_i_b = sqrt(0.5*(Gamma-1.0)/((Gamma+1.0)*Enthalpy_i)) * astar_b; + H_i_b = sqrt(0.5*(Gamma-1.0)/((Gamma+1.0)*(Enthalpy_i-turb_ke_i))) * astar_b; H_j_b = 0.0; } else { @@ -593,7 +597,7 @@ void CUpwAUSMPLUSUP_Flow::ComputeMassAndPressureFluxes(const CConfig* config, su astar_b *= 2.0*tmp; Vn_j_b += tmp*tmp * aF_b; } - H_j_b = sqrt(0.5*(Gamma-1.0)/((Gamma+1.0)*Enthalpy_j)) * astar_b; + H_j_b = sqrt(0.5*(Gamma-1.0)/((Gamma+1.0)*(Enthalpy_j-turb_ke_j))) * astar_b; H_i_b = 0.0; } @@ -639,8 +643,9 @@ void CUpwAUSMPLUSUP2_Flow::ComputeMassAndPressureFluxes(const CConfig* config, s /*--- Compute interface speed of sound (aF) ---*/ - su2double astarL = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*Enthalpy_i); - su2double astarR = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*Enthalpy_j); + /*--- With SST the total enthalpy contains k, which is not part of the critical speed of sound. ---*/ + su2double astarL = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*(Enthalpy_i-turb_ke_i)); + su2double astarR = sqrt(2.0*(Gamma-1.0)/(Gamma+1.0)*(Enthalpy_j-turb_ke_j)); su2double ahatL = astarL*astarL/max(astarL, ProjVelocity_i); su2double ahatR = astarR*astarR/max(astarR,-ProjVelocity_j); @@ -731,11 +736,12 @@ void CUpwSLAU_Flow::ComputeMassAndPressureFluxes(const CConfig* config, su2doubl sq_velj += Velocity_j[iDim]*Velocity_j[iDim]; } + /*--- With SST the total energy contains k, which is not part of the speed of sound. ---*/ su2double Energy_i = Enthalpy_i - Pressure_i/Density_i; - SoundSpeed_i = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_i-0.5*sq_veli))); + SoundSpeed_i = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_i-0.5*sq_veli-turb_ke_i))); su2double Energy_j = Enthalpy_j - Pressure_j/Density_j; - SoundSpeed_j = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_j-0.5*sq_velj))); + SoundSpeed_j = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_j-0.5*sq_velj-turb_ke_j))); /*--- Compute interface speed of sound (aF), and left/right Mach number ---*/ @@ -842,6 +848,7 @@ CNumerics::ResidualType<> CUpwAUSM_Flow::ComputeResidual(const CConfig* config) AD::SetPreaccIn(Normal, nDim); AD::SetPreaccIn(V_i, nDim+4); AD::SetPreaccIn(V_j, nDim+4); + AD::SetPreaccIn(turb_ke_i); AD::SetPreaccIn(turb_ke_j); // SST: k in the total energy /*--- Face area (norm or the normal vector) ---*/ Area = GeometryToolbox::Norm(nDim, Normal); @@ -860,7 +867,7 @@ CNumerics::ResidualType<> CUpwAUSM_Flow::ComputeResidual(const CConfig* config) Density_i = V_i[nDim+2]; Enthalpy_i = V_i[nDim+3]; Energy_i = Enthalpy_i - Pressure_i/Density_i; - SoundSpeed_i = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_i-0.5*sq_vel))); + SoundSpeed_i = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_i-0.5*sq_vel-turb_ke_i))); // SST: E contains k /*--- Primitive variables at point j ---*/ sq_vel = 0.0; @@ -872,7 +879,7 @@ CNumerics::ResidualType<> CUpwAUSM_Flow::ComputeResidual(const CConfig* config) Density_j = V_j[nDim+2]; Enthalpy_j = V_j[nDim+3]; Energy_j = Enthalpy_j - Pressure_j/Density_j; - SoundSpeed_j = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_j-0.5*sq_vel))); + SoundSpeed_j = sqrt(fabs(Gamma*Gamma_Minus_One*(Energy_j-0.5*sq_vel-turb_ke_j))); // SST: E contains k /*--- Projected velocities ---*/ ProjVelocity_i = 0.0; ProjVelocity_j = 0.0; @@ -925,10 +932,11 @@ CNumerics::ResidualType<> CUpwAUSM_Flow::ComputeResidual(const CConfig* config) sq_vel += RoeVelocity[iDim]*RoeVelocity[iDim]; } RoeEnthalpy = (R*Enthalpy_j+Enthalpy_i)/(R+1); - RoeSoundSpeed = sqrt(fabs((Gamma-1)*(RoeEnthalpy-0.5*sq_vel))); + /*--- With SST the total enthalpy contains k, which is not part of the speed of sound. ---*/ + RoeSoundSpeed = sqrt(fabs((Gamma-1)*(RoeEnthalpy-0.5*sq_vel-(R*turb_ke_j+turb_ke_i)/(R+1)))); /*--- Compute P and Lambda (do it with the Normal) ---*/ - GetPMatrix(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, P_Tensor); + GetPMatrix(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, P_Tensor, (R*turb_ke_j+turb_ke_i)/(R+1)); ProjVelocity = 0.0; ProjVelocity_i = 0.0; ProjVelocity_j = 0.0; for (iDim = 0; iDim < nDim; iDim++) { @@ -944,11 +952,11 @@ CNumerics::ResidualType<> CUpwAUSM_Flow::ComputeResidual(const CConfig* config) Lambda[nVar-1] = ProjVelocity - RoeSoundSpeed; /*--- Compute inverse P ---*/ - GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor); + GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor, (R*turb_ke_j+turb_ke_i)/(R+1)); /*--- Jacobias of the inviscid flux, scale = 0.5 because val_residual ~ 0.5*(fc_i+fc_j)*Normal ---*/ - GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i); - GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j); + GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i, turb_ke_i); + GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j, turb_ke_j); /*--- Roe's Flux approximation ---*/ for (iVar = 0; iVar < nVar; iVar++) { diff --git a/SU2_CFD/src/numerics/flow/convection/fvs.cpp b/SU2_CFD/src/numerics/flow/convection/fvs.cpp index 7655b793c851..83684cb34b7a 100644 --- a/SU2_CFD/src/numerics/flow/convection/fvs.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fvs.cpp @@ -45,6 +45,8 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { AD::StartPreacc(); AD::SetPreaccIn(V_i, nDim + 4); AD::SetPreaccIn(V_j, nDim + 4); + AD::SetPreaccIn(turb_ke_i); // SST: k in the total energy + AD::SetPreaccIn(turb_ke_j); AD::SetPreaccIn(Sensor_i, Sensor_j); AD::SetPreaccIn(Normal, nDim); if (dynamic_grid) { @@ -71,8 +73,9 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { /*--- Recompute the speed of sound because it is not MUSCL-reconstructed. ---*/ const su2double sqvel_i = GeometryToolbox::SquaredNorm(nDim, V_i + 1); const su2double sqvel_j = GeometryToolbox::SquaredNorm(nDim, V_j + 1); - const su2double c_i = sqrt(fmax((Gamma - 1) * (H_i - 0.5 * sqvel_i), EPS)); - const su2double c_j = sqrt(fmax((Gamma - 1) * (H_j - 0.5 * sqvel_j), EPS)); + /*--- With SST the total enthalpy contains k, which is not part of the speed of sound. ---*/ + const su2double c_i = sqrt(fmax((Gamma - 1) * (H_i - 0.5 * sqvel_i - turb_ke_i), EPS)); + const su2double c_j = sqrt(fmax((Gamma - 1) * (H_j - 0.5 * sqvel_j - turb_ke_j), EPS)); /*--- Recompute conservatives ---*/ @@ -109,6 +112,8 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { } Vst_i[nDim + 4] = onemw * c_i + w * c_j; Vst_j[nDim + 4] = onemw * c_j + w * c_i; + const su2double tkest_i = onemw * turb_ke_i + w * turb_ke_j; + const su2double tkest_j = onemw * turb_ke_j + w * turb_ke_i; su2double Velst_i[MAXNDIM] = {}, Velst_j[MAXNDIM] = {}; su2double ProjVelst_i{}, ProjVelst_j{}; @@ -132,8 +137,8 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { /*--- Compute projected P, invP, and Lambda ---*/ su2double P_Tensor[MAXNVAR][MAXNVAR], invP_Tensor[MAXNVAR][MAXNVAR]; - GetPMatrix(Vst_i[nDim + 2], Velst_i, Vst_i[nDim + 4], UnitNormal, P_Tensor); - GetPMatrix_inv(Vst_i[nDim + 2], Velst_i, Vst_i[nDim + 4], UnitNormal, invP_Tensor); + GetPMatrix(Vst_i[nDim + 2], Velst_i, Vst_i[nDim + 4], UnitNormal, P_Tensor, tkest_i); + GetPMatrix_inv(Vst_i[nDim + 2], Velst_i, Vst_i[nDim + 4], UnitNormal, invP_Tensor, tkest_i); /*--- Projected flux (f+) at i ---*/ @@ -167,8 +172,8 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { /*--- Compute projected P, invP, and Lambda ---*/ - GetPMatrix(Vst_j[nDim + 2], Velst_j, Vst_j[nDim + 4], UnitNormal, P_Tensor); - GetPMatrix_inv(Vst_j[nDim + 2], Velst_j, Vst_j[nDim + 4], UnitNormal, invP_Tensor); + GetPMatrix(Vst_j[nDim + 2], Velst_j, Vst_j[nDim + 4], UnitNormal, P_Tensor, tkest_j); + GetPMatrix_inv(Vst_j[nDim + 2], Velst_j, Vst_j[nDim + 4], UnitNormal, invP_Tensor, tkest_j); /*--- Projected flux (f-) ---*/ diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 18b210e72381..4fa644208e74 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -177,8 +177,9 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) Energy_i = Enthalpy_i - Pressure_i / Density_i; Energy_j = Enthalpy_j - Pressure_j / Density_j; - SoundSpeed_i = sqrt((Enthalpy_i - 0.5 * sq_vel_i) * Gamma_Minus_One); - SoundSpeed_j = sqrt((Enthalpy_j - 0.5 * sq_vel_j) * Gamma_Minus_One); + /*--- With SST the total enthalpy contains k, which is not part of the speed of sound. ---*/ + SoundSpeed_i = sqrt((Enthalpy_i - 0.5 * sq_vel_i - turb_ke_i) * Gamma_Minus_One); + SoundSpeed_j = sqrt((Enthalpy_j - 0.5 * sq_vel_j - turb_ke_j) * Gamma_Minus_One); /*--- Projected velocities ---*/ @@ -202,7 +203,8 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Roe-averaged speed of sound ---*/ - RoeSoundSpeed = sqrt( Gamma_Minus_One * ( RoeEnthalpy - 0.5 * sq_velRoe ) ); + const su2double RoeTke = ( sqrt(Density_j) * turb_ke_j + sqrt(Density_i) * turb_ke_i ) / Rrho; + RoeSoundSpeed = sqrt( Gamma_Minus_One * ( RoeEnthalpy - 0.5 * sq_velRoe - RoeTke ) ); /*--- Speed of sound at L and R ---*/ @@ -310,7 +312,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) for (jVar = 0; jVar < nVar; jVar++) Jacobian_j[iVar][jVar] = 0; - GetInviscidProjJac(Velocity_i, &Energy_i, UnitNormal, 1.0, Jacobian_i); + GetInviscidProjJac(Velocity_i, &Energy_i, UnitNormal, 1.0, Jacobian_i, turb_ke_i); } else { @@ -326,7 +328,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing pressure derivatives d/dU_L (PI) ---*/ - dPI_dU[0] = 0.5 * Gamma_Minus_One * sq_vel_i; + dPI_dU[0] = Gamma_Minus_One * (0.5 * sq_vel_i - turb_ke_i); // k (SST) held fixed for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Gamma_Minus_One * Velocity_i[iDim]; dPI_dU[nVar-1] = Gamma_Minus_One; @@ -399,7 +401,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing d/dU_R (Sm) ---*/ - dSm_dU[0] = ( ProjVelocity_j * ProjVelocity_j - sM * sR - 0.5 * Gamma_Minus_One * sq_vel_j ) / RHO; + dSm_dU[0] = ( ProjVelocity_j * ProjVelocity_j - sM * sR - Gamma_Minus_One * (0.5 * sq_vel_j - turb_ke_j) ) / RHO; for (iDim = 0; iDim < nDim; iDim++) dSm_dU[iDim+1] = - ( UnitNormal[iDim] * ( 2 * ProjVelocity_j - sR - sM) - Gamma_Minus_One * Velocity_j[iDim] ) / RHO; dSm_dU[nVar-1] = - Gamma_Minus_One / RHO; @@ -445,7 +447,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0; - GetInviscidProjJac(Velocity_j, &Energy_j, UnitNormal, 1.0, Jacobian_j); + GetInviscidProjJac(Velocity_j, &Energy_j, UnitNormal, 1.0, Jacobian_j, turb_ke_j); } else { @@ -461,7 +463,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing d/dU_L (Sm) ---*/ - dSm_dU[0] = ( - ProjVelocity_i * ProjVelocity_i + sM * sL + 0.5 * Gamma_Minus_One * sq_vel_i ) / RHO; + dSm_dU[0] = ( - ProjVelocity_i * ProjVelocity_i + sM * sL + Gamma_Minus_One * (0.5 * sq_vel_i - turb_ke_i) ) / RHO; for (iDim = 0; iDim < nDim; iDim++) dSm_dU[iDim+1] = ( UnitNormal[iDim] * ( 2 * ProjVelocity_i - sL - sM ) - Gamma_Minus_One * Velocity_i[iDim] ) / RHO; dSm_dU[nVar-1] = Gamma_Minus_One / RHO; @@ -504,7 +506,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Computing pressure derivatives d/dU_R (PI) ---*/ - dPI_dU[0] = 0.5 * Gamma_Minus_One * sq_vel_j; + dPI_dU[0] = Gamma_Minus_One * (0.5 * sq_vel_j - turb_ke_j); // k (SST) held fixed for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Gamma_Minus_One * Velocity_j[iDim]; dPI_dU[nVar-1] = Gamma_Minus_One; @@ -695,8 +697,9 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c } Energy_i = Enthalpy_i - Pressure_i / Density_i; - StaticEnthalpy_i = Enthalpy_i - 0.5 * sq_vel_i; - StaticEnergy_i = Energy_i - 0.5 * sq_vel_i; + /*--- With SST the total energy and enthalpy contain k. ---*/ + StaticEnthalpy_i = Enthalpy_i - 0.5 * sq_vel_i - turb_ke_i; + StaticEnergy_i = Energy_i - 0.5 * sq_vel_i - turb_ke_i; Kappa_i = S_i[1] / Density_i; Chi_i = S_i[0] - Kappa_i * StaticEnergy_i; @@ -704,8 +707,8 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c Energy_j = Enthalpy_j - Pressure_j / Density_j; - StaticEnthalpy_j = Enthalpy_j - 0.5 * sq_vel_j; - StaticEnergy_j = Energy_j - 0.5 * sq_vel_j; + StaticEnthalpy_j = Enthalpy_j - 0.5 * sq_vel_j - turb_ke_j; + StaticEnergy_j = Energy_j - 0.5 * sq_vel_j - turb_ke_j; Kappa_j = S_j[1] / Density_j; Chi_j = S_j[0] - Kappa_j * StaticEnergy_j; @@ -747,7 +750,8 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Roe-averaged speed of sound ---*/ //RoeSoundSpeed2 = RoeChi + RoeKappa * ( RoeEnthalpy - 0.5 * sq_velRoe ); - RoeSoundSpeed = sqrt( RoeChi + RoeKappa * ( RoeEnthalpy - 0.5 * sq_velRoe ) ); + RoeSoundSpeed = sqrt( RoeChi + RoeKappa * ( RoeEnthalpy - 0.5 * sq_velRoe + - ( sqrt(Density_j) * turb_ke_j + sqrt(Density_i) * turb_ke_i ) / Rrho ) ); /*--- Speed of sound at L and R ---*/ @@ -855,7 +859,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c Jacobian_j[iVar][jVar] = 0; - GetInviscidProjJac(Velocity_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, 1.0, Jacobian_i); + GetInviscidProjJac(Velocity_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, 1.0, Jacobian_i, turb_ke_i); } else { @@ -871,7 +875,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_L (PI) ---*/ - dPI_dU[0] = Chi_i + 0.5 * Kappa_i * sq_vel_i; + dPI_dU[0] = Chi_i + Kappa_i * (0.5 * sq_vel_i - turb_ke_i); // k (SST) held fixed for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_i * Velocity_i[iDim]; dPI_dU[nVar-1] = Kappa_i; @@ -945,7 +949,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_R (PI) ---*/ - dPI_dU[0] = Chi_j + 0.5 * Kappa_j * sq_vel_j; + dPI_dU[0] = Chi_j + Kappa_j * (0.5 * sq_vel_j - turb_ke_j); // k (SST) held fixed for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_j * Velocity_j[iDim]; dPI_dU[nVar-1] = Kappa_j; @@ -999,7 +1003,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0; - GetInviscidProjJac(Velocity_j, &Enthalpy_j, &Chi_j, &Kappa_j, UnitNormal, 1.0, Jacobian_j); + GetInviscidProjJac(Velocity_j, &Enthalpy_j, &Chi_j, &Kappa_j, UnitNormal, 1.0, Jacobian_j, turb_ke_j); } else { @@ -1015,7 +1019,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_L (PI) ---*/ - dPI_dU[0] = Chi_i + 0.5 * Kappa_i * sq_vel_i; + dPI_dU[0] = Chi_i + Kappa_i * (0.5 * sq_vel_i - turb_ke_i); // k (SST) held fixed for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_i * Velocity_i[iDim]; dPI_dU[nVar-1] = Kappa_i; @@ -1066,7 +1070,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Computing pressure derivatives d/dU_R (PI) ---*/ - dPI_dU[0] = Chi_j + 0.5 * Kappa_j * sq_vel_j; + dPI_dU[0] = Chi_j + Kappa_j * (0.5 * sq_vel_j - turb_ke_j); // k (SST) held fixed for (iDim = 0; iDim < nDim; iDim++) dPI_dU[iDim+1] = - Kappa_j * Velocity_j[iDim]; dPI_dU[nVar-1] = Kappa_j; diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 37c697515cfb..ad965e01621d 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -101,6 +101,7 @@ CNumerics::ResidualType<> CUpwRoeBase_Flow::ComputeResidual(const CConfig* confi AD::StartPreacc(); AD::SetPreaccIn(V_i, nDim+4); AD::SetPreaccIn(V_j, nDim+4); AD::SetPreaccIn(Normal, nDim); + AD::SetPreaccIn(turb_ke_i); AD::SetPreaccIn(turb_ke_j); // SST: k in the total energy if (dynamic_grid) { AD::SetPreaccIn(GridVel_i, nDim); AD::SetPreaccIn(GridVel_j, nDim); } @@ -146,7 +147,9 @@ CNumerics::ResidualType<> CUpwRoeBase_Flow::ComputeResidual(const CConfig* confi sq_vel += RoeVelocity[iDim]*RoeVelocity[iDim]; } RoeEnthalpy = (R*Enthalpy_j+Enthalpy_i)/(R+1); - RoeSoundSpeed2 = (Gamma-1)*(RoeEnthalpy-0.5*sq_vel); + /*--- With SST the total enthalpy contains k, which is not part of the speed of sound. ---*/ + RoeTke = (R*turb_ke_j+turb_ke_i)/(R+1); + RoeSoundSpeed2 = (Gamma-1)*(RoeEnthalpy-0.5*sq_vel-RoeTke); /*--- Negative RoeSoundSpeed^2, the jump variables is too large, clear fluxes and exit. ---*/ @@ -170,7 +173,7 @@ CNumerics::ResidualType<> CUpwRoeBase_Flow::ComputeResidual(const CConfig* confi /*--- P tensor ---*/ - GetPMatrix(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, P_Tensor); + GetPMatrix(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, P_Tensor, RoeTke); /*--- Projected velocity adjusted for mesh motion ---*/ @@ -222,8 +225,8 @@ CNumerics::ResidualType<> CUpwRoeBase_Flow::ComputeResidual(const CConfig* confi Flux[iVar] = 0.5*(ProjFlux_i[iVar]+ProjFlux_j[iVar]); if (implicit) { - GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i); - GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j); + GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i, turb_ke_i); + GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j, turb_ke_j); } /*--- Finalize in children class ---*/ @@ -261,12 +264,17 @@ void CUpwRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_Jac unsigned short iVar, jVar, kVar; /*--- Compute inverse P tensor ---*/ - GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor); + GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor, RoeTke); /*--- Diference between conservative variables at jPoint and iPoint ---*/ for (iVar = 0; iVar < nVar; iVar++) Diff_U[iVar] = Conservatives_j[iVar]-Conservatives_i[iVar]; + /*--- With SST rho*E contains rho*k, and Delta(rho k) = RoeDensity Delta k + RoeTke Delta rho. The part with + Delta k is not a pressure jump: remove it before the projection and advect it with the contact wave. ---*/ + const su2double rhoDeltaTke = RoeDensity*(turb_ke_j-turb_ke_i); + Diff_U[nVar-1] -= rhoDeltaTke; + /*--- Low dissipation formulation ---*/ if (roe_low_dissipation) Dissipation_ij = GetRoe_Dissipation(Dissipation_i, Dissipation_j, Sensor_i, Sensor_j, config); @@ -291,6 +299,7 @@ void CUpwRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_Jac } } } + val_residual[nVar-1] -= (1.0-kappa)*Lambda[0]*rhoDeltaTke*Area*Dissipation_ij; } @@ -350,11 +359,14 @@ void CUpwL2Roe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J for (kVar = 0; kVar < nVar; kVar++) val_residual[iVar] -= (1.0-kappa)*Lambda[kVar]*delta_wave[kVar]*P_Tensor[iVar][kVar]*Area; + /*--- With SST, the jump of k in rho*E is advected with the contact wave. ---*/ + val_residual[nVar-1] -= (1.0-kappa)*Lambda[0]*RoeDensity*(turb_ke_j-turb_ke_i)*Area; + if (!implicit) return; /*--- If implicit use the Jacobians of the standard Roe scheme as an approximation ---*/ - GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor); + GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor, RoeTke); for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { @@ -426,11 +438,14 @@ void CUpwLMRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J for (kVar = 0; kVar < nVar; kVar++) val_residual[iVar] -= (1.0-kappa)*Lambda[kVar]*delta_wave[kVar]*P_Tensor[iVar][kVar]*Area; + /*--- With SST, the jump of k in rho*E is advected with the contact wave. ---*/ + val_residual[nVar-1] -= (1.0-kappa)*Lambda[0]*RoeDensity*(turb_ke_j-turb_ke_i)*Area; + if (!implicit) return; /*--- If implicit use the Jacobians of the standard Roe scheme as an approximation ---*/ - GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor); + GetPMatrix_inv(RoeDensity, RoeVelocity, RoeSoundSpeed, UnitNormal, invP_Tensor, RoeTke); for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { @@ -568,7 +583,8 @@ CNumerics::ResidualType<> CUpwTurkel_Flow::ComputeResidual(const CConfig* config sq_vel += RoeVelocity[iDim]*RoeVelocity[iDim]; } RoeEnthalpy = (R*Enthalpy_j+Enthalpy_i)/(R+1); - RoeSoundSpeed = sqrt(fabs((Gamma-1)*(RoeEnthalpy-0.5*sq_vel))); + /*--- With SST the total enthalpy contains k, which is not part of the speed of sound. ---*/ + RoeSoundSpeed = sqrt(fabs((Gamma-1)*(RoeEnthalpy-0.5*sq_vel-(R*turb_ke_j+turb_ke_i)/(R+1)))); RoePressure = RoeDensity/Gamma*RoeSoundSpeed*RoeSoundSpeed; /*--- Compute ProjFlux_i ---*/ @@ -635,8 +651,8 @@ CNumerics::ResidualType<> CUpwTurkel_Flow::ComputeResidual(const CConfig* config if (implicit) { /*--- Jacobians of the inviscid flux, scaled by 0.5 because Flux ~ 0.5*(fc_i+fc_j)*Normal ---*/ - GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i); - GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j); + GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i, turb_ke_i); + GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j, turb_ke_j); } for (iVar = 0; iVar < nVar; iVar ++) { @@ -747,6 +763,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co AD::StartPreacc(); AD::SetPreaccIn(V_i, nDim+4); AD::SetPreaccIn(V_j, nDim+4); AD::SetPreaccIn(Normal, nDim); + AD::SetPreaccIn(turb_ke_i); AD::SetPreaccIn(turb_ke_j); // SST: k in the total energy AD::SetPreaccIn(S_i, 2); AD::SetPreaccIn(S_j, 2); if (dynamic_grid) { AD::SetPreaccIn(GridVel_i, nDim); AD::SetPreaccIn(GridVel_j, nDim); @@ -774,7 +791,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co Density_i = V_i[nDim+2]; Enthalpy_i = V_i[nDim+3]; Energy_i = Enthalpy_i - Pressure_i/Density_i; - StaticEnthalpy_i = Enthalpy_i - 0.5*Velocity2_i; + StaticEnthalpy_i = Enthalpy_i - 0.5*Velocity2_i - turb_ke_i; // SST: H contains k StaticEnergy_i = StaticEnthalpy_i - Pressure_i/Density_i; Kappa_i = S_i[1]/Density_i; @@ -794,7 +811,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co Enthalpy_j = V_j[nDim+3]; Energy_j = Enthalpy_j - Pressure_j/Density_j; - StaticEnthalpy_j = Enthalpy_j - 0.5*Velocity2_j; + StaticEnthalpy_j = Enthalpy_j - 0.5*Velocity2_j - turb_ke_j; // SST: H contains k StaticEnergy_j = StaticEnthalpy_j - Pressure_j/Density_j; Kappa_j = S_j[1]/Density_j; @@ -837,7 +854,8 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co /*--- Compute P and Lambda (do it with the Normal) ---*/ - GetPMatrix(&RoeDensity, RoeVelocity, &RoeSoundSpeed, &RoeEnthalpy, &RoeChi, &RoeKappa, UnitNormal, P_Tensor); + GetPMatrix(&RoeDensity, RoeVelocity, &RoeSoundSpeed, &RoeEnthalpy, &RoeChi, &RoeKappa, UnitNormal, P_Tensor, + (R*turb_ke_j+turb_ke_i)/(R+1)); ProjVelocity = 0.0; ProjVelocity_i = 0.0; ProjVelocity_j = 0.0; for (iDim = 0; iDim < nDim; iDim++) { @@ -923,6 +941,8 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co for (jVar = 0; jVar < nVar; jVar++) Flux[iVar] -= 0.5*Lambda[jVar]*delta_wave[jVar]*P_Tensor[iVar][jVar]*Area; } + /*--- With SST, the jump of k in rho*E is advected with the contact wave. ---*/ + Flux[nVar-1] -= 0.5*Lambda[0]*RoeDensity*(turb_ke_j-turb_ke_i)*Area; /*--- Flux contribution due to grid motion ---*/ if (dynamic_grid) { @@ -938,20 +958,26 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co /*--- Compute inverse P ---*/ - GetPMatrix_inv(invP_Tensor, &RoeDensity, RoeVelocity, &RoeSoundSpeed, &RoeChi , &RoeKappa, UnitNormal); + GetPMatrix_inv(invP_Tensor, &RoeDensity, RoeVelocity, &RoeSoundSpeed, &RoeChi , &RoeKappa, UnitNormal, + (R*turb_ke_j+turb_ke_i)/(R+1)); /*--- Jacobians of the inviscid flux, scaled by 0.5 because val_resconv ~ 0.5*(fc_i+fc_j)*Normal ---*/ - GetInviscidProjJac(Velocity_i, &Enthalpy_i, &Chi_i, &Kappa_i, Normal, 0.5, Jacobian_i); + GetInviscidProjJac(Velocity_i, &Enthalpy_i, &Chi_i, &Kappa_i, Normal, 0.5, Jacobian_i, turb_ke_i); - GetInviscidProjJac(Velocity_j, &Enthalpy_j, &Chi_j, &Kappa_j, Normal, 0.5, Jacobian_j); + GetInviscidProjJac(Velocity_j, &Enthalpy_j, &Chi_j, &Kappa_j, Normal, 0.5, Jacobian_j, turb_ke_j); /*--- Diference variables iPoint and jPoint ---*/ for (iVar = 0; iVar < nVar; iVar++) Diff_U[iVar] = U_j[iVar]-U_i[iVar]; + /*--- With SST, the part of the jump of rho*E due to the jump of k is not a pressure jump: remove it before the + projection and advect it with the contact wave. ---*/ + const su2double rhoDeltaTke = RoeDensity*(turb_ke_j-turb_ke_i); + Diff_U[nVar-1] -= rhoDeltaTke; + /*--- Roe's Flux approximation ---*/ for (iVar = 0; iVar < nVar; iVar++) { Flux[iVar] = 0.5*(ProjFlux_i[iVar]+ProjFlux_j[iVar]); @@ -968,6 +994,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co Jacobian_j[iVar][jVar] -= (1.0-kappa)*Proj_ModJac_Tensor_ij*Area; } } + Flux[nVar-1] -= (1.0-kappa)*Lambda[0]*rhoDeltaTke*Area; /*--- Jacobian contributions due to grid motion ---*/ if (dynamic_grid) { @@ -1026,6 +1053,6 @@ void CUpwGeneralRoe_Flow::ComputeRoeAverage() { // // } - RoeSoundSpeed2 = RoeChi + RoeKappa*(RoeEnthalpy-0.5*sq_vel); + RoeSoundSpeed2 = RoeChi + RoeKappa*(RoeEnthalpy-0.5*sq_vel-(R*turb_ke_j+turb_ke_i)/(R+1)); // SST: H contains k } diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 6b8784f228aa..e556d0e4aecc 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1843,6 +1843,9 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain const bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); const bool limiter = (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE); + /*--- SST: the total enthalpy of the cells contains k. ---*/ + const bool tkeInEnergy = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + const CVariable* turbNodes = tkeInEnergy ? solver_container[TURB_SOL]->GetNodes() : nullptr; const bool van_albada = (config->GetKind_SlopeLimit_Flow() == LIMITER::VAN_ALBADA_EDGE); const su2double kappa = config->GetMUSCL_Kappa_Flow(); @@ -1883,6 +1886,13 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain numerics->SetNormal(geometry->edges->GetNormal(iEdge)); + su2double tke_i = 0.0, tke_j = 0.0; + if (tkeInEnergy) { + tke_i = turbNodes->GetSolution(iPoint, 0); + tke_j = turbNodes->GetSolution(jPoint, 0); + numerics->SetTurbKineticEnergy(tke_i, tke_j); + } + auto Coord_i = geometry->nodes->GetCoord(iPoint); auto Coord_j = geometry->nodes->GetCoord(jPoint); @@ -1958,17 +1968,18 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain if (!neg_pres_or_rho_i && !neg_pres_or_rho_j) { - /*--- Recompute the reconstructed quantities in a thermodynamically consistent way. ---*/ + /*--- Recompute the reconstructed quantities in a thermodynamically consistent way. + With SST the total enthalpy contains k, taken from the cells (as the vectorized reconstruction does). ---*/ if (!ideal_gas || low_mach_corr) { - ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_i, Secondary_i); - ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_j, Secondary_j); + ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_i, Secondary_i, tke_i); + ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_j, Secondary_j, tke_j); } /*--- Low-Mach number correction. ---*/ if (low_mach_corr) { - LowMachPrimitiveCorrection(GetFluidModel(), nDim, Primitive_i, Primitive_j); + LowMachPrimitiveCorrection(GetFluidModel(), nDim, Primitive_i, Primitive_j, tke_i, tke_j); } /*--- The correction changes the face states, check them again. ---*/ @@ -1988,7 +1999,14 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain } su2double RoeEnthalpy = (R * Primitive_j[prim_idx.Enthalpy()] + Primitive_i[prim_idx.Enthalpy()]) / (R+1); - const bool neg_sound_speed = ((Gamma-1)*(RoeEnthalpy-0.5*sq_vel) < 0.0); + const su2double RoeTke = (R * tke_j + tke_i) / (R+1); // SST: the total enthalpy contains k + /*--- Speed of sound of the Roe average and of each side (schemes such as HLLC use both). ---*/ + auto negSoundSpeed2 = [&](const su2double* prim, su2double tke) { + const su2double vel2 = GeometryToolbox::SquaredNorm(nDim, &prim[prim_idx.Velocity()]); + return (Gamma-1)*(prim[prim_idx.Enthalpy()] - 0.5*vel2 - tke) < 0.0; + }; + const bool neg_sound_speed = ((Gamma-1)*(RoeEnthalpy-0.5*sq_vel-RoeTke) < 0.0) || + negSoundSpeed2(Primitive_i, tke_i) || negSoundSpeed2(Primitive_j, tke_j); bool bad_recon = neg_sound_speed || neg_pres_or_rho_i || neg_pres_or_rho_j; bad_recon = nodes->UpdateNonPhysicalEdgeCounter(iEdge, bad_recon); counter_local += bad_recon; @@ -2048,7 +2066,7 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain } void CEulerSolver::ComputeConsistentExtrapolation(CFluidModel *fluidModel, unsigned short nDim, - su2double *primitive, su2double *secondary) { + su2double *primitive, su2double *secondary, su2double tke) { SU2_ZONE_SCOPED const CEulerVariable::CIndices prim_idx(nDim, 0); const su2double density = primitive[prim_idx.Density()]; @@ -2058,7 +2076,7 @@ void CEulerSolver::ComputeConsistentExtrapolation(CFluidModel *fluidModel, unsig fluidModel->SetTDState_Prho(pressure, density); primitive[prim_idx.Temperature()] = fluidModel->GetTemperature(); - primitive[prim_idx.Enthalpy()] = fluidModel->GetStaticEnergy() + pressure / density + 0.5*velocity2; + primitive[prim_idx.Enthalpy()] = fluidModel->GetStaticEnergy() + pressure / density + 0.5*velocity2 + tke; primitive[prim_idx.SoundSpeed()] = fluidModel->GetSoundSpeed(); secondary[0] = fluidModel->GetdPdrho_e(); secondary[1] = fluidModel->GetdPde_rho(); @@ -2066,7 +2084,8 @@ void CEulerSolver::ComputeConsistentExtrapolation(CFluidModel *fluidModel, unsig } void CEulerSolver::LowMachPrimitiveCorrection(CFluidModel *fluidModel, unsigned short nDim, - su2double *primitive_i, su2double *primitive_j) { + su2double *primitive_i, su2double *primitive_j, + su2double tke_i, su2double tke_j) { SU2_ZONE_SCOPED unsigned short iDim; @@ -2097,10 +2116,10 @@ void CEulerSolver::LowMachPrimitiveCorrection(CFluidModel *fluidModel, unsigned } fluidModel->SetEnergy_Prho(primitive_i[nDim+1], primitive_i[nDim+2]); - primitive_i[nDim+3]= fluidModel->GetStaticEnergy() + primitive_i[nDim+1]/primitive_i[nDim+2] + 0.5*velocity2_i; + primitive_i[nDim+3]= fluidModel->GetStaticEnergy() + primitive_i[nDim+1]/primitive_i[nDim+2] + 0.5*velocity2_i + tke_i; fluidModel->SetEnergy_Prho(primitive_j[nDim+1], primitive_j[nDim+2]); - primitive_j[nDim+3]= fluidModel->GetStaticEnergy() + primitive_j[nDim+1]/primitive_j[nDim+2] + 0.5*velocity2_j; + primitive_j[nDim+3]= fluidModel->GetStaticEnergy() + primitive_j[nDim+1]/primitive_j[nDim+2] + 0.5*velocity2_j + tke_j; } diff --git a/UnitTests/SU2_CFD/numerics/ausm_tke_tests.cpp b/UnitTests/SU2_CFD/numerics/ausm_tke_tests.cpp new file mode 100644 index 000000000000..1a8decc8a0a0 --- /dev/null +++ b/UnitTests/SU2_CFD/numerics/ausm_tke_tests.cpp @@ -0,0 +1,173 @@ +/*! + * \file ausm_tke_tests.cpp + * \brief SLAU, SLAU2 and AUSM with the turbulent kinetic energy of SST in the total energy. + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include +#include +#include +#include +#include +#include "../../../SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp" +#include "../../../SU2_CFD/include/numerics/flow/convection/fvs.hpp" + +namespace { + +constexpr su2double gamma = 1.4; + +std::unique_ptr MakeConfig(bool implicit = false) { + std::stringstream options; + options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= SLAU\nMACH_NUMBER= 0.5\n"; + options << "TIME_DISCRE_FLOW= " + << (implicit ? "EULER_IMPLICIT\nUSE_ACCURATE_FLUX_JACOBIANS= YES\n" : "EULER_EXPLICIT\n"); + return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); +} + +/*--- Primitive variables (T, u, v, [w], p, rho, h, c) of an ideal gas whose total energy contains k. ---*/ +void Primitives(unsigned short nDim, su2double rho, const su2double* vel, su2double p, su2double k, su2double* V) { + su2double q2 = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + V[iDim + 1] = vel[iDim]; + q2 += vel[iDim] * vel[iDim]; + } + V[0] = p / (rho * 287.058); + V[nDim + 1] = p; + V[nDim + 2] = rho; + V[nDim + 3] = gamma / (gamma - 1) * p / rho + 0.5 * q2 + k; + V[nDim + 4] = sqrt(gamma * p / rho); +} + +/*--- k changes neither the pressure nor the speed of sound: with the same density, velocity and pressure, the mass + and momentum fluxes must not depend on k, and the energy flux changes only by the advected k. ---*/ +void CheckTkeIndependence(CNumerics& numerics, const CConfig* config, unsigned short nDim, bool uniformTke = false) { + const su2double vel_i[3] = {0.8, 0.1, -0.05}, vel_j[3] = {0.6, -0.1, 0.05}, n[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; + const su2double n2[2] = {0.6, 0.8}; + su2double Vi[10] = {0.0}, Vj[10] = {0.0}; + numerics.SetNormal(nDim == 2 ? n2 : n); + + su2double flux[2][5] = {{0.0}}; + /*--- MSW mixes the two states, so k must be uniform for the fluxes to be independent of it. ---*/ + const su2double k_i[2] = {0.0, 0.3}, k_j[2] = {0.0, uniformTke ? 0.3 : 0.2}; + for (int c = 0; c < 2; c++) { + Primitives(nDim, 1.2, vel_i, 1.1, k_i[c], Vi); + Primitives(nDim, 0.9, vel_j, 0.8, k_j[c], Vj); + numerics.SetPrimitive(Vi, Vj); + numerics.SetTurbKineticEnergy(k_i[c], k_j[c]); + const auto res = numerics.ComputeResidual(config); + for (unsigned short iVar = 0; iVar < nDim + 2; iVar++) flux[c][iVar] = res.residual[iVar]; + } + CAPTURE(nDim); + for (unsigned short iVar = 0; iVar < nDim + 1; iVar++) CHECK(flux[1][iVar] == Approx(flux[0][iVar]).epsilon(1e-12)); + /*--- Energy: the extra flux is the mass flux times the upwind k (the flow is from i to j here). ---*/ + CHECK(flux[1][nDim + 1] - flux[0][nDim + 1] == Approx(flux[0][0] * k_i[1]).epsilon(1e-10)); +} + +/*--- Largest difference between the (accurate) Jacobians and central differences of the flux with respect to the + conservative variables, k held fixed, relative to the largest entry. ---*/ +su2double JacobianError(CNumerics& numerics, const CConfig* config, su2double k) { + constexpr unsigned short nDim = 2, nVar = 4; + using State = std::array; + const su2double normal[2] = {0.6, 0.8}; + numerics.SetNormal(normal); + auto evaluate = [&](const State& Ui, const State& Uj, su2double* flux, su2double(*jac_i)[nVar], + su2double(*jac_j)[nVar]) { + su2double Vi[10] = {0.0}, Vj[10] = {0.0}; + for (int side = 0; side < 2; side++) { + const State& U = side ? Uj : Ui; + const su2double vel[2] = {U[1] / U[0], U[2] / U[0]}; + const su2double p = (gamma - 1) * (U[3] - 0.5 * (U[1] * U[1] + U[2] * U[2]) / U[0] - U[0] * k); + Primitives(nDim, U[0], vel, p, k, side ? Vj : Vi); + } + numerics.SetPrimitive(Vi, Vj); + numerics.SetTurbKineticEnergy(k, k); + const auto res = numerics.ComputeResidual(config); + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + flux[iVar] = res.residual[iVar]; + if (jac_i) + for (unsigned short jVar = 0; jVar < nVar; jVar++) { + jac_i[iVar][jVar] = res.jacobian_i[iVar][jVar]; + jac_j[iVar][jVar] = res.jacobian_j[iVar][jVar]; + } + } + }; + const State Ui = {1.2, 0.72, 0.24, 1.1 / (gamma - 1) + 0.5 * (0.72 * 0.72 + 0.24 * 0.24) / 1.2 + 1.2 * k}; + const State Uj = {0.9, 0.36, -0.18, 0.8 / (gamma - 1) + 0.5 * (0.36 * 0.36 + 0.18 * 0.18) / 0.9 + 0.9 * k}; + su2double flux[nVar], jac_i[nVar][nVar], jac_j[nVar][nVar]; + evaluate(Ui, Uj, flux, jac_i, jac_j); + su2double maxErr = 0.0, maxJac = 0.0; + for (int side = 0; side < 2; side++) { + for (unsigned short jVar = 0; jVar < nVar; jVar++) { + State Up = side ? Uj : Ui, Um = Up; + const su2double h = 1e-6; + Up[jVar] += h; + Um[jVar] -= h; + su2double fp[nVar], fm[nVar]; + if (side) { + evaluate(Ui, Up, fp, nullptr, nullptr); + evaluate(Ui, Um, fm, nullptr, nullptr); + } else { + evaluate(Up, Uj, fp, nullptr, nullptr); + evaluate(Um, Uj, fm, nullptr, nullptr); + } + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + const su2double jac = side ? jac_j[iVar][jVar] : jac_i[iVar][jVar]; + maxErr = std::max(maxErr, std::abs(jac - (fp[iVar] - fm[iVar]) / (2 * h))); + maxJac = std::max(maxJac, std::abs(jac)); + } + } + } + return maxErr / maxJac; +} + +} // namespace + +TEST_CASE("Accurate SLAU and AUSM+up Jacobians hold k fixed", "[AUSM][SST]") { + auto config = MakeConfig(true); + for (const su2double k : {0.0, 0.2}) { + CAPTURE(k); + CUpwSLAU_Flow slau(2, 4, config.get(), false); + CHECK(JacobianError(slau, config.get(), k) < 1e-4); + CUpwAUSMPLUSUP_Flow ausmup(2, 4, config.get()); + CHECK(JacobianError(ausmup, config.get(), k) < 1e-4); + } +} + +TEST_CASE("SLAU, SLAU2, AUSM, AUSM+up, AUSM+up2 and MSW do not use k in the speed of sound", "[AUSM][SST]") { + auto config = MakeConfig(); + for (const unsigned short nDim : {2, 3}) { + CUpwSLAU_Flow slau(nDim, nDim + 2, config.get(), false); + CheckTkeIndependence(slau, config.get(), nDim); + CUpwSLAU2_Flow slau2(nDim, nDim + 2, config.get(), false); + CheckTkeIndependence(slau2, config.get(), nDim); + CUpwAUSM_Flow ausm(nDim, nDim + 2, config.get()); + CheckTkeIndependence(ausm, config.get(), nDim); + CUpwAUSMPLUSUP_Flow ausmup(nDim, nDim + 2, config.get()); + CheckTkeIndependence(ausmup, config.get(), nDim); + CUpwAUSMPLUSUP2_Flow ausmup2(nDim, nDim + 2, config.get()); + CheckTkeIndependence(ausmup2, config.get(), nDim); + CUpwMSW_Flow msw(nDim, nDim + 2, config.get()); + CheckTkeIndependence(msw, config.get(), nDim, true); + } +} diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index 0a14682612ed..050de8503571 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -1,7 +1,8 @@ /*! * \file hllc_jacobian_tests.cpp * \brief Finite-difference verification of the HLLC Jacobians (ideal and general gas, 2D and 3D), on fixed and moving - * faces, exact (USE_ACCURATE_FLUX_JACOBIANS) or default. + * faces, with the turbulent kinetic energy of SST in the total energy, exact (USE_ACCURATE_FLUX_JACOBIANS) or + * default. * \version 8.5.0 "Harrier" * * SU2 Project Website: https://su2code.github.io @@ -211,9 +212,11 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura TEST_CASE("HLLC Jacobians match finite differences", "[HLLC]") { for (const unsigned short nDim : {2, 3}) { for (const bool moving : {false, true}) { - for (const bool accurate : {false, true}) { - CheckAllBranches(nDim, moving, 0.0, accurate); - CheckAllBranches(nDim, moving, 0.0, accurate); + for (const su2double k : {0.0, 0.2}) { + for (const bool accurate : {false, true}) { + CheckAllBranches(nDim, moving, k, accurate); + CheckAllBranches(nDim, moving, k, accurate); + } } } } diff --git a/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp b/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp new file mode 100644 index 000000000000..c33e4ae38735 --- /dev/null +++ b/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp @@ -0,0 +1,176 @@ +/*! + * \file roe_tke_tests.cpp + * \brief Roe eigenvector matrices with the turbulent kinetic energy of SST in the total energy. + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include +#include +#include +#include "../../../SU2_CFD/include/numerics/flow/convection/roe.hpp" + +namespace { + +constexpr su2double gamma = 1.4; + +std::unique_ptr MakeConfig(bool implicit = true) { + std::stringstream options; + options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= ROE\nENTROPY_FIX_COEFF= 0.0\nROE_KAPPA= 0.5\n"; + options << "TIME_DISCRE_FLOW= " << (implicit ? "EULER_IMPLICIT" : "EULER_EXPLICIT") << "\n"; + return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); +} + +/*--- Primitive variables (T, u, v, [w], p, rho, h, c) of an ideal gas whose total energy contains k. ---*/ +void Primitives(unsigned short nDim, su2double rho, const su2double* vel, su2double p, su2double k, su2double* V) { + su2double q2 = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + V[iDim + 1] = vel[iDim]; + q2 += vel[iDim] * vel[iDim]; + } + V[0] = p / (rho * 287.058); + V[nDim + 1] = p; + V[nDim + 2] = rho; + V[nDim + 3] = gamma / (gamma - 1) * p / rho + 0.5 * q2 + k; + V[nDim + 4] = sqrt(gamma * p / rho); +} + +/*--- Secondary variables (dp/drho_e, dp/de_rho) of the ideal gas, for the general-gas schemes. ---*/ +void Secondary(su2double rho, su2double p, su2double* S) { + S[0] = p / rho; + S[1] = (gamma - 1) * rho; +} + +/*--- Common constructor for the schemes of the family. ---*/ +template +std::unique_ptr MakeScheme(unsigned short nDim, unsigned short nVar, const CConfig* config) { + return std::make_unique(nDim, nVar, config); +} +template <> +std::unique_ptr MakeScheme(unsigned short nDim, unsigned short nVar, const CConfig* config) { + return std::make_unique(nDim, nVar, config, false); +} + +/*--- Roe flux between two states with the same pressure and normal velocity and different density, k and (with + shear) tangential velocity. With the entropy fix off this is a contact discontinuity, whose exact (upwind) flux is + the flux of the upstream state. ---*/ +template +void CheckContactWithTkeJump(const char* name, unsigned short nDim, const su2double* vel, bool implicit, bool shear) { + auto config = MakeConfig(implicit); + const unsigned short nVar = nDim + 2; + auto numerics = MakeScheme(nDim, nVar, config.get()); + + const su2double p = 1.0, rho_i = 1.4, rho_j = 0.7, k_i = 0.1, k_j = 0.3; + const su2double n2[2] = {0.6, 0.8}, n3[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; + const su2double* n = (nDim == 2) ? n2 : n3; + const su2double t2[2] = {0.16, -0.12}, t3[3] = {0.15, -0.1, 0.0}; // tangential velocity jumps + const su2double* t = (nDim == 2) ? t2 : t3; + su2double vel_j[3] = {0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) vel_j[iDim] = vel[iDim] + (shear ? t[iDim] : 0.0); + su2double Vi[10] = {0.0}, Vj[10] = {0.0}, Si[2], Sj[2]; + Primitives(nDim, rho_i, vel, p, k_i, Vi); + Primitives(nDim, rho_j, vel_j, p, k_j, Vj); + Secondary(rho_i, p, Si); + Secondary(rho_j, p, Sj); + numerics->SetPrimitive(Vi, Vj); + numerics->SetSecondary(Si, Sj); + numerics->SetNormal(n); + numerics->SetTurbKineticEnergy(k_i, k_j); + const auto res = numerics->ComputeResidual(config.get()); + + su2double un = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) un += vel[iDim] * n[iDim]; + const su2double rho_up = (un >= 0.0) ? rho_i : rho_j; + const su2double* V_up = (un >= 0.0) ? Vi : Vj; + + CAPTURE(name, nDim, un, implicit, shear); + CHECK(res.residual[0] == Approx(rho_up * un).margin(1e-12)); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + CHECK(res.residual[iDim + 1] == Approx(rho_up * V_up[iDim + 1] * un + p * n[iDim]).margin(1e-12)); + CHECK(res.residual[nVar - 1] == Approx(rho_up * V_up[nDim + 3] * un).margin(1e-12)); +} + +template +void CheckContactsWithTkeJump(const char* name, bool implicit = true, bool shear = true) { + const su2double zero[3] = {0.0, 0.0, 0.0}, moving[3] = {0.3, -0.1, 0.2}, reverse[3] = {-0.3, 0.1, -0.2}; + for (const unsigned short nDim : {2, 3}) { + for (const auto* vel : {zero, moving, reverse}) { + CheckContactWithTkeJump(name, nDim, vel, implicit, false); + if (shear) CheckContactWithTkeJump(name, nDim, vel, implicit, true); + } + } +} + +} // namespace + +TEST_CASE("Roe schemes resolve a contact with a jump of k exactly", "[Roe][SST]") { + CheckContactsWithTkeJump("Roe"); + CheckContactsWithTkeJump("general Roe", true); + CheckContactsWithTkeJump("general Roe", false); + CheckContactsWithTkeJump("LMRoe"); + /*--- L2Roe scales the tangential velocity jump at low Mach number (not upwind by design). ---*/ + CheckContactsWithTkeJump("L2Roe", true, false); +} + +TEST_CASE("Roe eigenvector matrices are inverse with k in the total energy", "[Roe][SST]") { + auto config = MakeConfig(); + for (const unsigned short nDim : {2, 3}) { + const unsigned short nVar = nDim + 2; + CUpwRoe_Flow numerics(nDim, nVar, config.get(), false); + const su2double velocity[3] = {0.4, -0.3, 0.2}, normal[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; + const su2double n2[3] = {0.6, 0.8, 0.0}; + su2double P[5][5], Pinv[5][5]; + numerics.GetPMatrix(1.1, velocity, 1.2, nDim == 3 ? normal : n2, P, 0.3); + numerics.GetPMatrix_inv(1.1, velocity, 1.2, nDim == 3 ? normal : n2, Pinv, 0.3); + for (unsigned short i = 0; i < nVar; i++) { + for (unsigned short j = 0; j < nVar; j++) { + su2double prod = 0.0; + for (unsigned short l = 0; l < nVar; l++) prod += P[i][l] * Pinv[l][j]; + CAPTURE(nDim, i, j); + CHECK(prod == Approx(i == j ? 1.0 : 0.0).margin(1e-12)); + } + } + } +} + +TEST_CASE("Roe does not dissipate a stationary contact with k in the total energy", "[Roe][SST]") { + /*--- Zero velocity, same pressure and k on both sides, different density: a contact discontinuity at rest. + The Roe flux must be the pressure only (no mass or energy flux) when the entropy fix is off. ---*/ + auto config = MakeConfig(); + constexpr unsigned short nDim = 2, nVar = nDim + 2; + CUpwRoe_Flow numerics(nDim, nVar, config.get(), false); + + const su2double zero[2] = {0.0, 0.0}, p = 1.0, k = 0.2; + su2double Vi[10] = {0.0}, Vj[10] = {0.0}, normal[2] = {0.6, 0.8}; + Primitives(nDim, 1.4, zero, p, k, Vi); + Primitives(nDim, 0.7, zero, p, k, Vj); + numerics.SetPrimitive(Vi, Vj); + numerics.SetNormal(normal); + numerics.SetTurbKineticEnergy(k, k); + const auto res = numerics.ComputeResidual(config.get()); + + CHECK(res.residual[0] == Approx(0.0).margin(1e-12)); + CHECK(res.residual[1] == Approx(p * normal[0]).epsilon(1e-12)); + CHECK(res.residual[2] == Approx(p * normal[1]).epsilon(1e-12)); + CHECK(res.residual[3] == Approx(0.0).margin(1e-12)); +} diff --git a/UnitTests/meson.build b/UnitTests/meson.build index 8c2e61614e74..7bc1de9e4b5e 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -17,6 +17,8 @@ su2_cfd_tests = files(['Common/CConfig_tests.cpp', 'SU2_CFD/numerics/CNumerics_tests.cpp', 'SU2_CFD/numerics/roe_contact_tests.cpp', 'SU2_CFD/numerics/hllc_jacobian_tests.cpp', + 'SU2_CFD/numerics/roe_tke_tests.cpp', + 'SU2_CFD/numerics/ausm_tke_tests.cpp', 'SU2_CFD/fluid/CFluidModel_tests.cpp', 'SU2_CFD/gradients.cpp', 'SU2_CFD/solvers/CNEMOEulerSolver_tests.cpp', From 3eb9dc89be1cc001d2ef714d4df5149f7539b76b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 13:54:02 +0200 Subject: [PATCH 14/43] Use the k of the boundary node in the boundary states of the compressible solver With SST the boundary states added the free-stream k to the total energy, while the domain next to the boundary has its own k (the free-stream value decays right away, #1851): the Riemann problem at the boundary then sees a jump of total energy that is not a jump of pressure. Use the k of the boundary node in the far-field, Riemann, turbo Riemann, inlet, outlet, supersonic inlet, engine and actuator-disk states, and pass it to the convective numerics of every boundary. Where the interior state is used, remove k from it: static energy of the interior state in BC_Riemann, BC_TurboRiemann and BC_Giles, energy of the DENSITY_VELOCITY Riemann state, total speed of sound at the inlet, engine exhaust and actuator disk. The P, P^-1 and Jacobian matrices of the Riemann boundaries take k, and the boundary total enthalpy of BC_Giles includes it. The initial check for non-physical points also subtracts the free-stream k from the energy. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/solvers/CEulerSolver.cpp | 181 ++++++++++++++++++++++----- 1 file changed, 148 insertions(+), 33 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e556d0e4aecc..76e26dafe04c 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -65,6 +65,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool time_stepping = (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING); const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); + const bool tkeNeeded = (rans && config->GetKind_Turb_Model() == TURB_MODEL::SST); int Unst_RestartIter = 0; unsigned long iPoint, iMarker, counter_local = 0, counter_global = 0; @@ -246,6 +247,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Density_Inf = config->GetDensity_FreeStreamND(); Energy_Inf = config->GetEnergy_FreeStreamND(); Mach_Inf = config->GetMach(); + const su2double TKE_Inf = config->GetTke_FreeStreamND(); /*--- Initialize the secondary values for direct derivative approximations ---*/ @@ -315,6 +317,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Velocity2 += pow(nodes->GetSolution(iPoint,iDim+1)/Density,2); StaticEnergy= nodes->GetEnergy(iPoint) - 0.5*Velocity2; + if (tkeNeeded) StaticEnergy -= TKE_Inf; GetFluidModel()->SetTDState_rhoe(Density, StaticEnergy); Pressure= GetFluidModel()->GetPressure(); @@ -5050,7 +5053,9 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, bool implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT; bool viscous = config->GetViscous(); - bool tkeNeeded = config->GetKind_Turb_Model() == TURB_MODEL::SST; + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); auto *Normal = new su2double[nDim]; @@ -5200,7 +5205,8 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, } Pressure = Density*SoundSpeed*SoundSpeed/Gamma; Energy = Pressure/(Gamma_Minus_One*Density) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Store new primitive state for computing the flux. ---*/ @@ -5217,6 +5223,16 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, conv_numerics->SetPrimitive(V_domain, V_infty); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + + conv_numerics->SetTurbKineticEnergy(tke, tke); + + } + if (dynamic_grid) { conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); @@ -5297,6 +5313,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, tkeNeeded = config->GetKind_Turb_Model() == TURB_MODEL::SST, ideal_gas = config->GetKind_FluidModel() == STANDARD_AIR || config->GetKind_FluidModel() == IDEAL_GAS; + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); su2double **P_Tensor = new su2double*[nVar], **invP_Tensor = new su2double*[nVar]; @@ -5342,7 +5360,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, const auto Density_i = nodes->GetDensity(iPoint); const auto Energy_i = nodes->GetEnergy(iPoint); - const su2double StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + su2double StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + if (tkeNeeded) StaticEnergy_i -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_rhoe(Density_i, StaticEnergy_i); @@ -5396,7 +5415,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); break; case STATIC_SUPERSONIC_INFLOW_PT: @@ -5422,7 +5440,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); break; case STATIC_SUPERSONIC_INFLOW_PD: @@ -5449,7 +5466,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); break; case DENSITY_VELOCITY: @@ -5465,7 +5481,9 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, for (auto iDim = 0u; iDim < nDim; iDim++) Velocity_e[iDim] = VelMag_e*Flow_Dir[iDim]; + /*--- The total energy of the node already contains k, which is added below to every case. ---*/ Energy_e = Energy_i; + if (tkeNeeded) Energy_e -= turbNodes->GetSolution(iPoint, 0); break; case STATIC_PRESSURE: @@ -5489,11 +5507,18 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, break; } + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). + It is also removed from the static energy of the boundary state. ---*/ + const su2double Tke_e = tkeNeeded ? turbNodes->GetSolution(iPoint, 0) : 0.0; + Energy_e += Tke_e; + /*--- Compute P (matrix of right eigenvectors) ---*/ - conv_numerics->GetPMatrix(&Density_i, Velocity_i, &SoundSpeed_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, P_Tensor); + conv_numerics->GetPMatrix(&Density_i, Velocity_i, &SoundSpeed_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, P_Tensor, + Tke_e); /*--- Compute inverse P (matrix of left eigenvectors)---*/ - conv_numerics->GetPMatrix_inv(invP_Tensor, &Density_i, Velocity_i, &SoundSpeed_i, &Chi_i, &Kappa_i, UnitNormal); + conv_numerics->GetPMatrix_inv(invP_Tensor, &Density_i, Velocity_i, &SoundSpeed_i, &Chi_i, &Kappa_i, UnitNormal, + Tke_e); /*--- eigenvalues contribution due to grid motion ---*/ su2double ProjVelocity_i = GeometryToolbox::DotProduct(nDim, Velocity_i, UnitNormal); @@ -5542,7 +5567,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, const auto Velocity2_b = GeometryToolbox::SquaredNorm(nDim, Velocity_b); const su2double Energy_b = u_b[nVar-1]/Density_b; - const su2double StaticEnergy_b = Energy_b - 0.5*Velocity2_b; + const su2double StaticEnergy_b = Energy_b - 0.5*Velocity2_b - Tke_e; GetFluidModel()->SetTDState_rhoe(Density_b, StaticEnergy_b); /*--- Store number of Newton iterations at BC ---*/ @@ -5596,7 +5621,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, } /*--- Compute flux Jacobian in state b ---*/ - conv_numerics->GetInviscidProjJac(Velocity_b, &Enthalpy_b, &Chi_b, &Kappa_b, Normal, 1.0, Jacobian_b); + conv_numerics->GetInviscidProjJac(Velocity_b, &Enthalpy_b, &Chi_b, &Kappa_b, Normal, 1.0, Jacobian_b, Tke_e); /*--- Jacobian contribution due to grid motion ---*/ if (dynamic_grid){ @@ -5686,7 +5711,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if (config->GetKind_Turb_Model() == TURB_MODEL::SST) + if (tkeNeeded) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -5742,6 +5767,8 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); const bool ideal_gas = config->GetKind_FluidModel() == STANDARD_AIR || config->GetKind_FluidModel() == IDEAL_GAS; + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); su2double *Normal, *turboNormal, *UnitNormal, *FlowDirMix, FlowDirMixMag, *turboVelocity; Normal = new su2double[nDim]; @@ -5815,6 +5842,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Energy_i = nodes->GetEnergy(iPoint); StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + if (tkeNeeded) StaticEnergy_i -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_rhoe(Density_i, StaticEnergy_i); @@ -5878,7 +5906,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; case MIXING_IN: @@ -5913,7 +5941,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - // if (tkeNeeded) Energy_e += GetTke_Inf(); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; @@ -5931,6 +5959,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; case STATIC_PRESSURE: @@ -5948,6 +5977,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; @@ -5965,6 +5995,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; default: @@ -5973,10 +6004,13 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain } /*--- Compute P (matrix of right eigenvectors) ---*/ - conv_numerics->GetPMatrix(&Density_i, Velocity_i, &SoundSpeed_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, P_Tensor); + const su2double Tke_i = tkeNeeded ? turbNodes->GetSolution(iPoint, 0) : 0.0; // SST: k in the total energy + conv_numerics->GetPMatrix(&Density_i, Velocity_i, &SoundSpeed_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, P_Tensor, + Tke_i); /*--- Compute inverse P (matrix of left eigenvectors)---*/ - conv_numerics->GetPMatrix_inv(invP_Tensor, &Density_i, Velocity_i, &SoundSpeed_i, &Chi_i, &Kappa_i, UnitNormal); + conv_numerics->GetPMatrix_inv(invP_Tensor, &Density_i, Velocity_i, &SoundSpeed_i, &Chi_i, &Kappa_i, UnitNormal, + Tke_i); /*--- eigenvalues contribution due to grid motion ---*/ if (dynamic_grid){ @@ -6040,7 +6074,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_b += Velocity_b[iDim]*Velocity_b[iDim]; } Energy_b = u_b[nVar-1]/Density_b; - StaticEnergy_b = Energy_b - 0.5*Velocity2_b; + StaticEnergy_b = Energy_b - 0.5*Velocity2_b - Tke_i; // SST: k in the total energy GetFluidModel()->SetTDState_rhoe(Density_b, StaticEnergy_b); Pressure_b = GetFluidModel()->GetPressure(); Temperature_b = GetFluidModel()->GetTemperature(); @@ -6096,7 +6130,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain } /*--- Compute flux Jacobian in state b ---*/ - conv_numerics->GetInviscidProjJac(Velocity_b, &Enthalpy_b, &Chi_b, &Kappa_b, Normal, 1.0, Jacobian_b); + conv_numerics->GetInviscidProjJac(Velocity_b, &Enthalpy_b, &Chi_b, &Kappa_b, Normal, 1.0, Jacobian_b, Tke_i); /*--- Jacobian contribution due to grid motion ---*/ if (dynamic_grid) @@ -6798,6 +6832,9 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu Energy_i = nodes->GetEnergy(iPoint); StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + /*--- SST: the total energy contains k. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) + StaticEnergy_i -= solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_rhoe(Density_i, StaticEnergy_i); @@ -7054,6 +7091,9 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu Energy_b = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_b; Temperature_b= GetFluidModel()->GetTemperature(); Enthalpy_b = Energy_b + Pressure_b/Density_b; + /*--- SST: the boundary state carries the k of the node in its total enthalpy, as the interior one. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) + Enthalpy_b += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); /*--- Primitive variables, using the derived quantities ---*/ V_boundary[0] = Temperature_b; @@ -7071,6 +7111,16 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu /*--- Set various quantities in the solver class ---*/ conv_numerics->SetPrimitive(V_domain, V_boundary); + + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + + conv_numerics->SetTurbKineticEnergy(tke, tke); + + } conv_numerics->SetSecondary(S_domain, S_boundary); @@ -7294,6 +7344,8 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = V_domain[nDim+3] - V_domain[nDim+1]/V_domain[nDim+2]; + /*--- SST: the total enthalpy of the domain contains k, the imposed total enthalpy does not. ---*/ + if (tkeNeeded) Energy -= solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); Pressure = V_domain[nDim+1]; H_Total = (Gamma*Gas_Constant/Gamma_Minus_One)*T_Total; SoundSpeed2 = Gamma*Pressure/Density; @@ -7364,7 +7416,6 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Using pressure, density, & velocity, compute the energy ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); /*--- Primitive variables, using the derived quantities ---*/ @@ -7375,6 +7426,9 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+2] = Density; V_inlet[nDim+3] = Energy + Pressure/Density; + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); + break; } /*--- Mass flow has been specified at the inlet. ---*/ @@ -7436,7 +7490,6 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Energy for the fictitious inlet state ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Vel_Mag*Vel_Mag; - if (tkeNeeded) Energy += GetTke_Inf(); /*--- Primitive variables, using the derived quantities ---*/ Temperature = Pressure / ( Gas_Constant * Density); @@ -7447,6 +7500,9 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+2] = Density; V_inlet[nDim+3] = Energy + Pressure/Density; + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); + break; } default: @@ -7458,6 +7514,16 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, conv_numerics->SetPrimitive(V_domain, V_inlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + + conv_numerics->SetTurbKineticEnergy(tke, tke); + + } + if (dynamic_grid) conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); @@ -7495,6 +7561,9 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, bool gravity = (config->GetGravityForce()); bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); + auto *Normal = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -7576,7 +7645,7 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = P_Exit/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Conservative variables, using the derived quantities ---*/ V_outlet[0] = Pressure / ( Gas_Constant * Density); @@ -7590,6 +7659,11 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Set various quantities in the solver class ---*/ conv_numerics->SetPrimitive(V_domain, V_outlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } if (dynamic_grid) conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); @@ -7687,13 +7761,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con /*--- Compute the energy from the specified state. ---*/ const su2double Velocity2 = GeometryToolbox::SquaredNorm(int(MAXNDIM), Velocity); - su2double Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; - if (tkeNeeded) { - const su2double* Turb_Properties = config->GetInlet_TurbVal(Marker_Tag); - const su2double Intensity = Turb_Properties[0]; - const su2double Tke = 3.0 / 2.0 * (Velocity2 * pow(Intensity, 2)); - Energy += Tke; - } + const su2double Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; /*--- Primitive variables, using the derived quantities. ---*/ @@ -7705,6 +7773,9 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con for (unsigned short iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+prim_idx.Velocity()] = Velocity[iDim]; + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) V_inlet[prim_idx.Enthalpy()] += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); + /*--- Current solution at this boundary node. ---*/ const auto* V_domain = nodes->GetPrimitive(iPoint); @@ -7719,6 +7790,11 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con conv_numerics->SetNormal(Normal); conv_numerics->SetPrimitive(V_domain, V_inlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } if (dynamic_grid) conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), @@ -7800,6 +7876,11 @@ void CEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_co conv_numerics->SetNormal(Normal); conv_numerics->SetPrimitive(V_domain, V_outlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } if (dynamic_grid) conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), @@ -8016,7 +8097,7 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai } Energy = Inflow_Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Conservative variables, using the derived quantities ---*/ @@ -8032,6 +8113,11 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai conv_numerics->SetNormal(Normal); conv_numerics->SetPrimitive(V_domain, V_inflow); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } /*--- Set grid movement ---*/ @@ -8181,6 +8267,8 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = V_domain[nDim+3] - V_domain[nDim+1]/V_domain[nDim+2]; + /*--- SST: the total enthalpy of the domain contains k, the imposed total enthalpy does not. ---*/ + if (tkeNeeded) Energy -= solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); Pressure = V_domain[nDim+1]; H_Exhaust = (Gamma*Gas_Constant/Gamma_Minus_One)*Exhaust_Temperature; SoundSpeed2 = Gamma*Pressure/Density; @@ -8253,7 +8341,7 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta /*--- Using pressure, density, & velocity, compute the energy ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Primitive variables, using the derived quantities ---*/ @@ -8284,6 +8372,11 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta conv_numerics->SetNormal(Normal); conv_numerics->SetPrimitive(V_domain, V_exhaust); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } /*--- Set grid movement ---*/ @@ -8545,7 +8638,7 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Conservative variables, using the derived quantities ---*/ @@ -8557,6 +8650,11 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C V_inlet[nDim+3] = Energy + Pressure/Density; V_inlet[nDim+4] = SoundSpeed; conv_numerics->SetPrimitive(V_domain, V_inlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } } @@ -8632,6 +8730,8 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = V_domain[nDim+3] - V_domain[nDim+1]/V_domain[nDim+2]; + /*--- SST: the total enthalpy of the domain contains k, the imposed total enthalpy does not. ---*/ + if (tkeNeeded) Energy -= solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); Pressure = V_domain[nDim+1]; H_Total = (Gamma*Gas_Constant/Gamma_Minus_One)*T_Total; SoundSpeed2 = Gamma*Pressure/Density; @@ -8700,7 +8800,7 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C /*--- Using pressure, density, & velocity, compute the energy ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Primitive variables, using the derived quantities ---*/ @@ -8712,6 +8812,11 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C V_outlet[nDim+3] = Energy + Pressure/Density; V_outlet[nDim+4] = sqrt(SoundSpeed2); conv_numerics->SetPrimitive(V_domain, V_outlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } } @@ -8948,7 +9053,7 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Conservative variables, using the derived quantities ---*/ @@ -8959,6 +9064,11 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver V_inlet[nDim+3] = Energy + Pressure/Density; V_inlet[nDim+4] = SoundSpeed; conv_numerics->SetPrimitive(V_domain, V_inlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } } else { /*--- Acoustic Riemann invariant extrapolation form the interior domain. ---*/ @@ -8996,7 +9106,7 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver /*--- Computation of the enthalpy, total energy, temperature and speed of sound. ---*/ H_out = H_in/Density_in + Fa/Density_out; Energy = H_out - Pressure_out/Density_out; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 Temperature_out = (Energy-0.5*Velocity2/(pow(Density_out,2)))*(Gamma_Minus_One/Gas_Constant); SoS_out = sqrt(Gamma*Gas_Constant*Temperature_out); @@ -9010,6 +9120,11 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver V_outlet[nDim+3] = H_out; V_outlet[nDim+4] = SoS_out; conv_numerics->SetPrimitive(V_domain, V_outlet); + /*--- SST: both states contain the k of the node in their total enthalpy. ---*/ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + conv_numerics->SetTurbKineticEnergy(tke, tke); + } } /*--- Grid Movement (NOT TESTED!)---*/ From 8536636377cbf7237192a84a5eef5b87c87a0266 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 13:54:51 +0200 Subject: [PATCH 15/43] Include the SST k in the pressure of the axisymmetric source, remove a wrong viscous term The axisymmetric source computed the pressure from the total energy without removing k (SST). Subtract it in the pressure and in the energy row of the Jacobian (k held fixed). The viscous part added mu_tot*v*2/3*rho*k/y to the energy equation for every RANS model (with the SA variable in place of k): this term does not come from the stress tensor of the flow solver, remove it. k is set only for SST. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics/flow/flow_sources.hpp | 3 ++- SU2_CFD/src/numerics/flow/flow_sources.cpp | 11 ++++++----- SU2_CFD/src/solvers/CEulerSolver.cpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 83c3811326cd..ca0613a0ebfc 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -72,7 +72,8 @@ class CSourceBase_Flow : public CNumerics { */ class CSourceAxisymmetric_Flow : public CSourceBase_Flow { protected: - bool implicit, viscous, rans; + bool implicit, viscous; + bool tkeInEnergy; /*!< \brief SST: k is part of the total energy (turb_ke_i is set by the solver). */ su2double yinv{0.0}; /*! diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 87784e73f39f..44e5cf579dcf 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -54,7 +54,7 @@ CSourceAxisymmetric_Flow::CSourceAxisymmetric_Flow(unsigned short val_nDim, unsi implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); viscous = config->GetViscous(); - rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); + tkeInEnergy = (config->GetKind_Turb_Model() == TURB_MODEL::SST); } @@ -74,7 +74,9 @@ CNumerics::ResidualType<> CSourceAxisymmetric_Flow::ComputeResidual(const CConfi Velocity_i = U_i[iDim+1] / U_i[0]; sq_vel += Velocity_i * Velocity_i; } - Pressure_i = Gamma_Minus_One*U_i[0]*(U_i[nDim+1]/U_i[0]-0.5*sq_vel); + /*--- With SST the total energy contains k. ---*/ + const su2double tke = tkeInEnergy ? turb_ke_i : 0.0; + Pressure_i = Gamma_Minus_One*U_i[0]*(U_i[nDim+1]/U_i[0]-0.5*sq_vel-tke); Enthalpy_i = (U_i[nDim+1] + Pressure_i) / U_i[0]; /*--- Smooth blending between gradient formulation and standard formulation ---*/ @@ -140,6 +142,7 @@ CNumerics::ResidualType<> CSourceAxisymmetric_Flow::ComputeResidual(const CConfi jacobian[3][1] = -(Gamma-1)*U_i[2]*U_i[1]/(U_i[0]*U_i[0]); jacobian[3][2] = Gamma*U_i[3]/U_i[0] - 0.5*(Gamma-1)*( (U_i[1]*U_i[1]+U_i[2]*U_i[2])/(U_i[0]*U_i[0]) + 2*U_i[2]*U_i[2]/(U_i[0]*U_i[0]) ); jacobian[3][3] = Gamma*U_i[2]/U_i[0]; + jacobian[3][2] -= Gamma_Minus_One*tke; // k is a variable of the turbulence solver for (iVar=0; iVar < nVar; iVar++) for (jVar=0; jVar < nVar; jVar++) @@ -161,8 +164,6 @@ CNumerics::ResidualType<> CSourceAxisymmetric_Flow::ComputeResidual(const CConfi void CSourceAxisymmetric_Flow::ResidualDiffusion(){ - if (!rans){ turb_ke_i = 0.0; } - su2double laminar_viscosity_i = V_i[nDim+5]; su2double eddy_viscosity_i = V_i[nDim+6]; su2double thermal_conductivity_i = V_i[nDim+7]; @@ -181,7 +182,7 @@ void CSourceAxisymmetric_Flow::ResidualDiffusion(){ -TWO3*AuxVar_Grad_i[0][1]); residual[3] -= Volume*(yinv*(total_viscosity_i*(u*(PrimVar_Grad_i[2][0]+PrimVar_Grad_i[1][1]) +v*TWO3*(2*PrimVar_Grad_i[2][1]-PrimVar_Grad_i[1][0] - -v*yinv+U_i[0]*turb_ke_i)) + -v*yinv)) +total_conductivity_i*PrimVar_Grad_i[0][1]) -TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][0])); } diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 76e26dafe04c..8d490cb2c9d1 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2239,7 +2239,7 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain numerics->SetAuxVarGrad(nodes->GetAuxVarGradient(iPoint), nullptr); /*--- Set turbulence kinetic energy ---*/ - if (rans){ + if (config->GetKind_Turb_Model() == TURB_MODEL::SST){ CVariable* turbNodes = solver_container[TURB_SOL]->GetNodes(); numerics->SetTurbKineticEnergy(turbNodes->GetSolution(iPoint,0), turbNodes->GetSolution(iPoint,0)); } From 580800a8ec34eafd88fb43d57eca214b56dd1d3a Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 13:56:04 +0200 Subject: [PATCH 16/43] Apply the SST compressibility corrections together with the production modifiers COMPRESSIBILITY-WILCOX and COMPRESSIBILITY-SARKAR were stored as the production option, overwriting VORTICITY, KATO-LAUNDER or UQ when combined with them (and their switch cases used the strain production). They are already stored in compWilcox and compSarkar: use these flags for the correction, independently of the production modifier. Use beta_star in place of the literal 0.09 in the corrected dissipation of omega. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/option_structure.hpp | 7 ++--- Common/src/CConfig.cpp | 8 ++--- .../numerics/turbulent/turb_sources.hpp | 30 ++++++++----------- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index bcd2e9c06328..b8222da53784 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1200,13 +1200,10 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.production = SST_OPTIONS::UQ; } - // Parse compressibility options + // Parse compressibility options, stored in compWilcox and compSarkar so that they can be combined with a + // production modifier if (sst_compWilcox && sst_compSarkar) { SU2_MPI::Error("Please select only one compressibility correction (COMPRESSIBILITY-WILCOX or COMPRESSIBILITY-SARKAR).", CURRENT_FUNCTION); - } else if (sst_compWilcox) { - SSTParsedOptions.production = SST_OPTIONS::COMP_Wilcox; - } else if (sst_compSarkar) { - SSTParsedOptions.production = SST_OPTIONS::COMP_Sarkar; } SSTParsedOptions.sust = sst_sust; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 3a5bfee8f713..a4c17da1b4d9 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -6713,16 +6713,12 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "\nperturbing the Reynold's Stress Matrix towards " << eig_val_comp << " component turbulence"; if (uq_permute) cout << " (permuting eigenvectors)"; break; - case SST_OPTIONS::COMP_Wilcox: - cout << " with compressibility correction of Wilcox"; - break; - case SST_OPTIONS::COMP_Sarkar: - cout << " with compressibility correction of Sarkar"; - break; default: cout << " with no production modification"; break; } + if (sstParsedOptions.compWilcox) cout << ", with compressibility correction of Wilcox"; + if (sstParsedOptions.compSarkar) cout << ", with compressibility correction of Sarkar"; if (sstParsedOptions.dll){ cout << "\nusing non dimensional lower limits relative to infinity values clipping by Coefficients:" ; diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 9f72b6e37cc4..d1cfd2f09054 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -938,33 +938,27 @@ class CSourcePieceWise_TurbSST final : public CNumerics { P_Base = sqrt(StrainMag_i*VorticityMag); break; - case SST_OPTIONS::COMP_Wilcox: - P_Base = StrainMag_i; - if (Mt >= 0.25) { - zetaFMt = 2.0 * (Mt * Mt - 0.25 * 0.25); - } - break; - - case SST_OPTIONS::COMP_Sarkar: - P_Base = StrainMag_i; - if (Mt >= 0.25) { - zetaFMt = 0.5 * (Mt * Mt); - } - break; - default: /*--- Base production term for SST-1994 and SST-2003 ---*/ P_Base = StrainMag_i; break; } + /*--- Compressibility corrections, independent of the production modifier. ---*/ + if (sstParsedOptions.compWilcox && Mt >= 0.25) { + zetaFMt = 2.0 * (Mt * Mt - 0.25 * 0.25); + } + if (sstParsedOptions.compSarkar && Mt >= 0.25) { + zetaFMt = 0.5 * (Mt * Mt); + } + /*--- Production limiter. ---*/ const su2double prod_limit = prod_lim_const * beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0]; su2double P = Eddy_Viscosity_i * pow(P_Base, 2); su2double pk = max(0.0, min(P, prod_limit)); - const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; + const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); /*--- Production limiter only for V2003, recompute for V1994. ---*/ @@ -988,7 +982,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { pw = max(pw, sust_w); } - if (sstParsedOptions.production == SST_OPTIONS::COMP_Sarkar) { + if (sstParsedOptions.compSarkar) { const su2double Dilatation_Sarkar = -0.15 * pk * Mt + 0.2 * beta_star * (1.0 +zetaFMt) * Density_i * ScalarVar_i[1] * ScalarVar_i[0] * Mt * Mt; pk += Dilatation_Sarkar; } @@ -996,7 +990,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Dissipation ---*/ su2double dk = beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0] * (1.0 + zetaFMt); - su2double dw = beta_blended * Density_i * ScalarVar_i[1] * ScalarVar_i[1] * (1.0 - 0.09/beta_blended * zetaFMt); + su2double dw = beta_blended * Density_i * ScalarVar_i[1] * ScalarVar_i[1] * (1.0 - beta_star/beta_blended * zetaFMt); /*--- LM model coupling with production and dissipation term for k transport equation---*/ if (config->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM) { @@ -1025,7 +1019,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume * (1.0 + zetaFMt); Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * (1.0 + zetaFMt); Jacobian_i[1][0] = 0.0; - Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt); + Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - beta_star/beta_blended * zetaFMt); } AD::SetPreaccOut(Residual, nVar); From a002e777053715f19f9e00e41f49db05dd527999 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 13:56:23 +0200 Subject: [PATCH 17/43] Check the SST free-stream values and markers, fix the omega of the turbo inlet - Stop with an error if the free-stream k or omega of SST is not positive and finite (zero turbulence intensity, viscosity ratio or velocity), which gave mu_t = 0/0 in the whole field. - Reject SST with engine and actuator-disk markers: the turbulence solver has no boundary condition for them (checked after the turbulence model of Euler zones is cleared). - BC_Inlet_Turbo computed omega from the averaged k of the flow solver instead of the imposed k. - Remove a dead write of the wall node solution in the SST wall function. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/src/CConfig.cpp | 8 ++++++++ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index a4c17da1b4d9..852909cff588 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -5011,6 +5011,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Kind_Solver == MAIN_SOLVER::FEM_EULER) Kind_Turb_Model = TURB_MODEL::NONE; + /*--- SST has no engine or actuator-disk boundary conditions: the faces would get no turbulence flux at all. + Checked after the turbulence model of Euler zones is cleared (multizone). ---*/ + if (Kind_Turb_Model == TURB_MODEL::SST && + (nMarker_EngineInflow + nMarker_EngineExhaust + nMarker_ActDiskInlet + nMarker_ActDiskOutlet) > 0) { + SU2_MPI::Error("MARKER_ENGINE_INFLOW, MARKER_ENGINE_EXHAUST and MARKER_ACTDISK are not supported with the SST model.", + CURRENT_FUNCTION); + } + Kappa_2nd_Flow = jst_coeff[0]; Kappa_4th_Flow = jst_coeff[1]; Kappa_2nd_AdjFlow = jst_adj_coeff[0]; diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index d6f98ecdee6b..1377defbaefc 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -124,6 +124,15 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, const CSolv su2double kine_Inf = 3.0/2.0*(VelMag2*Intensity*Intensity); su2double omega_Inf = rhoInf*kine_Inf/(muLamInf*viscRatio); + /*--- A zero turbulence intensity, viscosity ratio or free-stream velocity gives k = 0 or omega = 0 (or infinite), + and then mu_t = 0/0 in the whole field. ---*/ + if (!(kine_Inf > 0.0 && omega_Inf > 0.0 && std::isfinite(SU2_TYPE::GetValue(kine_Inf)) && + std::isfinite(SU2_TYPE::GetValue(omega_Inf)))) { + SU2_MPI::Error("SST: the free-stream k and omega must be positive and finite.\n" + "Set FREESTREAM_TURBULENCEINTENSITY > 0 and FREESTREAM_TURB2LAMVISCRATIO > 0 with a nonzero\n" + "free-stream velocity.", CURRENT_FUNCTION); + } + Solution_Inf[0] = kine_Inf; Solution_Inf[1] = omega_Inf; @@ -251,7 +260,7 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai const su2double kine = nodes->GetSolution(iPoint,0); const su2double omega = nodes->GetSolution(iPoint,1); - const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag; + const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag; const su2double muT = max(0.0, rho * a1 * kine / max(a1 * omega, eddy_visc_var * F2)); nodes->SetmuT(iPoint, muT); @@ -580,7 +589,6 @@ void CTurbSSTSolver::SetTurbVars_WF(CGeometry *geometry, CSolver **solver_contai su2double solution[MAXNVAR] = {k, omega}; nodes->SetSolution_Old(iPoint_Neighbor,solution); - nodes->SetSolution(iPoint,solution); LinSysRes.SetBlock_Zero(iPoint_Neighbor); @@ -777,15 +785,15 @@ void CTurbSSTSolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contai su2double rho = flowSolver->GetAverageDensity(val_marker, iSpan); su2double pressure = flowSolver->GetAveragePressure(val_marker, iSpan); - su2double kine = flowSolver->GetAverageKine(val_marker, iSpan); FluidModel->SetTDState_Prho(pressure, rho); su2double muLam = FluidModel->GetLaminarViscosity(); su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, flowSolver->GetAverageTurboVelocity(val_marker, iSpan)); + /*--- Imposed k from the intensity, omega from the imposed k and the viscosity ratio. ---*/ su2double kine_b = 3.0/2.0*(VelMag2*Intensity*Intensity); - su2double omega_b = rho*kine/(muLam*viscRatio); + su2double omega_b = rho*kine_b/(muLam*viscRatio); const su2double solution_j[] = {kine_b, omega_b}; From 37dcfedd0e07553af04066473fb386fb6af1516c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 14:07:43 +0200 Subject: [PATCH 18/43] Add a regression test of the Riemann DENSITY_VELOCITY inlet with SST Axisymmetric air nozzle with the inlet as a Riemann DENSITY_VELOCITY boundary, whose boundary state takes the energy of the node (containing k) and must remove k before adding it back with the other cases. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- .../air_nozzle_density_velocity.cfg | 100 ++++++++++++++++++ TestCases/parallel_regression.py | 8 ++ TestCases/serial_regression.py | 8 ++ 3 files changed, 116 insertions(+) create mode 100644 TestCases/axisymmetric_rans/air_nozzle/air_nozzle_density_velocity.cfg diff --git a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_density_velocity.cfg b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_density_velocity.cfg new file mode 100644 index 000000000000..208ad6b63159 --- /dev/null +++ b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_density_velocity.cfg @@ -0,0 +1,100 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Axisymmetric supersonic converging-diverging air nozzle, % +% Riemann DENSITY_VELOCITY inlet (k in the boundary energy) % +% Author: Florian Dittmann % +% Date: 2021.12.02 % +% File Version 8.5.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= RANS +KIND_TURB_MODEL= SST +RESTART_SOL= YES +AXISYMMETRIC= YES + +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +MACH_NUMBER= 1E-9 +INIT_OPTION= TD_CONDITIONS +FREESTREAM_OPTION= TEMPERATURE_FS +FREESTREAM_PRESSURE= 1400000 +FREESTREAM_TEMPERATURE= 373.15 +REF_DIMENSIONALIZATION= DIMENSIONAL + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +FLUID_MODEL= STANDARD_AIR + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 1.716E-5 + +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM= 0.72 +PRANDTL_TURB= 0.90 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( WALL, 0.0 ) +MARKER_SYM= ( SYMMETRY ) +MARKER_RIEMANN= ( INFLOW, DENSITY_VELOCITY, 13.07, 100.0, 1.0, 0.0, 0.0, \ + OUTFLOW, STATIC_PRESSURE, 100000.0, 0.0, 0.0, 0.0, 0.0 ) +MARKER_MONITORING = (WALL) +MARKER_ANALYZE= (INFLOW) +% +% High free-stream turbulence, so that k is not negligible in the energy of the inlet state +FREESTREAM_TURBULENCEINTENSITY= 0.2 + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1000.0 +CFL_ADAPT= NO +MAX_DELTA_TIME= 1E6 +OBJECTIVE_FUNCTION= DRAG + +% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% +% +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ILU_FILL_IN= 0 +LINEAR_SOLVER_ERROR= 0.01 +LINEAR_SOLVER_ITER= 10 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= ROE +ENTROPY_FIX_COEFF= 0.1 +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +TIME_DISCRE_TURB= EULER_IMPLICIT +CFL_REDUCTION_TURB= 1.0 + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +ITER= 3000 +CONV_RESIDUAL_MINVAL= -12 +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= nozzle.su2 +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= restart_flow +OUTPUT_WRT_FREQ= 1000 +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, RMS_TKE, RMS_DISSIPATION, SURFACE_STATIC_TEMPERATURE) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index e85b5b7be660..8fff340267e9 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -624,6 +624,14 @@ def main(): axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) + # Riemann DENSITY_VELOCITY inlet with SST: k of the node in the energy of the boundary state + axi_rans_air_nozzle_density_velocity = TestCase('axi_rans_air_nozzle_density_velocity') + axi_rans_air_nozzle_density_velocity.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle_density_velocity.cfg_file = "air_nozzle_density_velocity.cfg" + axi_rans_air_nozzle_density_velocity.test_iter = 10 + axi_rans_air_nozzle_density_velocity.test_vals = [-1.879323, 4.022709, 0.514084, 4.414617, 702.55, 702.55] + test_list.append(axi_rans_air_nozzle_density_velocity) + ################################# ## Compressible RANS Restart ### ################################# diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index c34fe6f47225..77bf40b28fa1 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -372,6 +372,14 @@ def main(): axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) + # Riemann DENSITY_VELOCITY inlet with SST: k of the node in the energy of the boundary state + axi_rans_air_nozzle_density_velocity = TestCase('axi_rans_air_nozzle_density_velocity') + axi_rans_air_nozzle_density_velocity.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle_density_velocity.cfg_file = "air_nozzle_density_velocity.cfg" + axi_rans_air_nozzle_density_velocity.test_iter = 10 + axi_rans_air_nozzle_density_velocity.test_vals = [-1.879849, 4.023872, 0.501157, 4.419530, 704.80, 704.80] + test_list.append(axi_rans_air_nozzle_density_velocity) + # Axisymmetric air nozzle species axi_rans_air_nozzle_species = TestCase('axi_rans_air_nozzle_species') axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" From b2e8375d8b6060b75badb3322f8b8690a6735294 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 15:41:36 +0200 Subject: [PATCH 19/43] Update the reference values of the regression tests from CI Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- TestCases/hybrid_regression.py | 30 +- TestCases/parallel_regression.py | 70 +-- TestCases/parallel_regression_AD.py | 4 +- .../translating_NACA0012/forces_0.csv.ref | 400 +++++++++--------- .../forces_0.csv.ref | 400 +++++++++--------- TestCases/serial_regression.py | 50 +-- TestCases/serial_regression_AD.py | 2 +- TestCases/tutorials.py | 20 +- TestCases/vandv.py | 4 +- 9 files changed, 490 insertions(+), 490 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index f63748ba9283..4102f44efa42 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -72,7 +72,7 @@ def main(): naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 20 - naca0012.test_vals = [-4.031227, -3.524077, 0.272155, 0.009374] + naca0012.test_vals = [-4.029205, -3.521852, 0.272095, 0.009425] test_list.append(naca0012) # Supersonic wedge @@ -80,7 +80,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-0.480786, 5.329367, -0.244869, 0.043126] + wedge.test_vals = [-4.223565, 1.506875, -0.249526, 0.043953] test_list.append(wedge) # ONERA M6 Wing @@ -104,7 +104,7 @@ def main(): bluntbody.cfg_dir = "euler/bluntbody" bluntbody.cfg_file = "blunt.cfg" bluntbody.test_iter = 20 - bluntbody.test_vals = [0.666182, 7.055173, -0.000631, 3.917770] + bluntbody.test_vals = [0.565173, 6.945846, 0.000171, 1.970669] test_list.append(bluntbody) ########################## @@ -170,7 +170,7 @@ def main(): rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 20 - rae2822_sa.test_vals = [-2.639525, -4.027096, 0.792680, 0.020549, 1000.000000] + rae2822_sa.test_vals = [-2.858565, -4.906734, 0.782692, 0.018639, 1000.000000] test_list.append(rae2822_sa) # RAE2822 SST @@ -178,7 +178,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.501958, 5.889330, 0.635453, 0.021771, 100.000000] + rae2822_sst.test_vals = [-1.461774, 5.883885, 0.630267, 0.020404, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -202,7 +202,7 @@ def main(): turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 - turb_oneram6.test_vals = [-2.418707, -6.631575, 0.238586, 0.159599, 0.000000] + turb_oneram6.test_vals = [-2.419971, -6.631992, 0.238576, 0.159694, 0.000000] test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) @@ -265,7 +265,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-2.663059, 2.911787, -2.522191, 1.990732, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.068875, 0.504406, -2.840213, 1.705449, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.140441, -9.154674, -10.886121, -5.806594, 0.000000] test_list.append(axi_rans_air_nozzle_restart) @@ -348,7 +348,7 @@ def main(): hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" hb_rans_preconditioning.cfg_file = "davis.cfg" hb_rans_preconditioning.test_iter = 25 - hb_rans_preconditioning.test_vals = [-1.905220, 0.481910, 0.598990, 3.605349, -5.945852] + hb_rans_preconditioning.test_vals = [-1.905523, 0.482128, 0.598472, 3.605108, -5.946081] test_list.append(hb_rans_preconditioning) ############################# @@ -581,7 +581,7 @@ def main(): edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 25 - edge_VW.test_vals = [-11.670757, -5.483973, -0.000009, 0.000000] + edge_VW.test_vals = [-11.723086, -5.536517, -0.000009, 0.000000] test_list.append(edge_VW) # Rarefaction shock wave edge_PPR @@ -589,7 +589,7 @@ def main(): edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 20 - edge_PPR.test_vals = [-12.338051, -6.157966, -0.000034, 0.000000] + edge_PPR.test_vals = [-10.993286, -4.827527, -0.000034, 0.000000] edge_PPR.test_vals_aarch64 = [ -7.139211, -0.980821, -0.000034, 0.000000] test_list.append(edge_PPR) @@ -659,7 +659,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.466194, 0.350087, 0.398979] + channel_2D.test_vals = [2.000000, 0.000000, 0.466339, 0.346858, 0.397486] channel_2D.unsteady = True channel_2D.multizone = True test_list.append(channel_2D) @@ -669,7 +669,7 @@ def main(): channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_WA.cfg" channel_3D.test_iter = 2 - channel_3D.test_vals = [2.000000, 0.000000, 0.632251, 0.534213, 0.431803] + channel_3D.test_vals = [2.000000, 0.000000, 0.632749, 0.522745, 0.423269] channel_3D.test_vals_aarch64 = [2.000000, 0.000000, 0.629112, 0.524948, 0.422396] channel_3D.unsteady = True channel_3D.multizone = True @@ -681,7 +681,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.092415, 0.568971, 0.692864, 0.989451, 1.048245] + pipe.test_vals = [0.070225, 0.528891, 0.684177, 0.970350, 1.065268] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -691,7 +691,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.664817, 1.125803, 1.117608] + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686432, 1.159463, 1.151135] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -701,7 +701,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 0.899645, 1.076181] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.126036, 1.081765] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index e85b5b7be660..c51154847e16 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -266,7 +266,7 @@ def main(): naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe_su2bin.cfg" naca0012.test_iter = 20 - naca0012.test_vals = [-4.026356, -3.521920, 0.274929, 0.009852] + naca0012.test_vals = [-4.024996, -3.520626, 0.275033, 0.009889] test_list.append(naca0012) # Supersonic wedge @@ -274,7 +274,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-4.142624, 1.585638, -0.249527, 0.043953] + wedge.test_vals = [-4.018855, 1.708167, -0.249527, 0.043953] test_list.append(wedge) # ONERA M6 Wing @@ -300,7 +300,7 @@ def main(): polar_naca0012.cfg_file = "inv_NACA0012.cfg" polar_naca0012.polar = True polar_naca0012.test_iter = 10 - polar_naca0012.test_vals = [-1.315764, 4.158361, 0.002646, 0.114559] + polar_naca0012.test_vals = [-1.315882, 4.158313, 0.002698, 0.114644] polar_naca0012.test_vals_aarch64 = [-1.083394, 4.386134, 0.001588, 0.033513] polar_naca0012.command = TestCase.Command(exec = "compute_polar.py", param = "-i 11") # flaky test on arm64 @@ -312,7 +312,7 @@ def main(): bluntbody.cfg_dir = "euler/bluntbody" bluntbody.cfg_file = "blunt.cfg" bluntbody.test_iter = 20 - bluntbody.test_vals = [0.666133, 7.054751, -0.000051, 3.912894] + bluntbody.test_vals = [0.565207, 6.945909, -0.000001, 1.970304] test_list.append(bluntbody) # Equivalent area NACA64-206 @@ -320,7 +320,7 @@ def main(): ea_naca64206.cfg_dir = "optimization_euler/equivalentarea_naca64206" ea_naca64206.cfg_file = "NACA64206.cfg" ea_naca64206.test_iter = 10 - ea_naca64206.test_vals = [-1.125734, -0.473873, -0.002416, 67775.000000] + ea_naca64206.test_vals = [-1.126282, -0.474499, -0.002405, 67775.000000] test_list.append(ea_naca64206) # SUPERSONIC FLOW PAST A RAMP IN A CHANNEL @@ -345,7 +345,7 @@ def main(): MFR_coupling.cfg_dir = "euler/turbofan_MFR_coupling" MFR_coupling.cfg_file = "MFR_coupling.cfg" MFR_coupling.test_iter = 100 - MFR_coupling.test_vals = [-211.240000, 150.030000, 20.151000] + MFR_coupling.test_vals = [-211.250000, 150.030000, 20.151000] test_list.append(MFR_coupling) ########################## @@ -390,7 +390,7 @@ def main(): cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 - cylinder.test_vals = [-8.557685, -3.072812, -0.018904, 1.610320, 0.000000] + cylinder.test_vals = [-8.557718, -3.072847, -0.018912, 1.610317, 0.000000] test_list.append(cylinder) # Laminar cylinder (low Mach correction) @@ -430,7 +430,7 @@ def main(): rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 20 - rae2822_sa.test_vals = [-2.888183, -5.136146, 0.788144, 0.019032, 1000.000000] + rae2822_sa.test_vals = [-2.998634, -4.043296, 0.794248, 0.019260, 1000.000000] test_list.append(rae2822_sa) # RAE2822 SST @@ -438,7 +438,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.495621, 5.875629, 0.638353, 0.020410, 100.000000] + rae2822_sst.test_vals = [-1.485957, 5.891491, 0.675200, 0.023427, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -470,7 +470,7 @@ def main(): turb_flatplate_CC_Wilcox.cfg_dir = "rans/flatplate" turb_flatplate_CC_Wilcox.cfg_file = "turb_SST_flatplate_compressibility_Wilcox.cfg" turb_flatplate_CC_Wilcox.test_iter = 20 - turb_flatplate_CC_Wilcox.test_vals = [-1.169750, 2.167973, 1.488567, 5.244807, -3.795767, 9.699598] + turb_flatplate_CC_Wilcox.test_vals = [-1.204997, 2.149390, 1.396996, 5.216302, -3.821981, 9.707535] test_list.append(turb_flatplate_CC_Wilcox) # Flat plate SST compressibility correction Sarkar @@ -478,7 +478,7 @@ def main(): turb_flatplate_CC_Sarkar.cfg_dir = "rans/flatplate" turb_flatplate_CC_Sarkar.cfg_file = "turb_SST_flatplate_compressibility_Sarkar.cfg" turb_flatplate_CC_Sarkar.test_iter = 20 - turb_flatplate_CC_Sarkar.test_vals = [-1.169750, 2.167973, 1.488567, 5.244807, -3.795765, 9.699598] + turb_flatplate_CC_Sarkar.test_vals = [-1.204997, 2.149390, 1.396996, 5.216302, -3.821978, 9.707535] test_list.append(turb_flatplate_CC_Sarkar) # FLAT PLATE, ROUGHNESS BC KNOPP SST @@ -502,7 +502,7 @@ def main(): turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 - turb_oneram6.test_vals = [-2.418711, -6.631576, 0.238587, 0.159599, 0.000000] + turb_oneram6.test_vals = [-2.419976, -6.631992, 0.238577, 0.159694, 0.000000] turb_oneram6.timeout = 3200 test_list.append(turb_oneram6) @@ -511,7 +511,7 @@ def main(): turb_oneram6_vc.cfg_dir = "rans/oneram6" turb_oneram6_vc.cfg_file = "turb_ONERAM6_vc.cfg" turb_oneram6_vc.test_iter = 15 - turb_oneram6_vc.test_vals = [-2.294311, -6.572307, 0.234416, 0.144830, 0.000000] + turb_oneram6_vc.test_vals = [-2.295077, -6.572734, 0.234428, 0.145063, 0.000000] turb_oneram6_vc.timeout = 3200 test_list.append(turb_oneram6_vc) @@ -520,7 +520,7 @@ def main(): turb_oneram6_nk.cfg_dir = "rans/oneram6" turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" turb_oneram6_nk.test_iter = 20 - turb_oneram6_nk.test_vals = [-4.848809, -4.451213, -11.426556, 0.221554, 0.049197, 2.000000, -0.880072, 10.000000] + turb_oneram6_nk.test_vals = [-4.848121, -4.450658, -11.426212, 0.221522, 0.049358, 2.000000, -0.879182, 10.000000] turb_oneram6_nk.timeout = 600 turb_oneram6_nk.tol = 0.0001 test_list.append(turb_oneram6_nk) @@ -619,7 +619,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-2.662880, 2.912015, -2.712454, 1.890642, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.144760, 0.426779, -2.900513, 1.606061, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143310, -9.163287, -10.858232, -5.787715, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -883,7 +883,7 @@ def main(): turbmod_sa_bsl_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_bsl_rae2822.cfg_file = "turb_SA_BSL_RAE2822.cfg" turbmod_sa_bsl_rae2822.test_iter = 20 - turbmod_sa_bsl_rae2822.test_vals = [-3.182935, -0.447793, -0.875861, -3.286652, 0.769925, 0.017709] + turbmod_sa_bsl_rae2822.test_vals = [-3.191783, -0.473872, -0.892710, -5.169793, 0.777160, 0.017964] test_list.append(turbmod_sa_bsl_rae2822) # SA Negative @@ -891,7 +891,7 @@ def main(): turbmod_sa_neg_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_neg_rae2822.cfg_file = "turb_SA_NEG_RAE2822.cfg" turbmod_sa_neg_rae2822.test_iter = 10 - turbmod_sa_neg_rae2822.test_vals = [1.570952, 1.355242, -0.869320, 1.244343, 0.452923, 0.000000] + turbmod_sa_neg_rae2822.test_vals = [1.429980, 1.127884, 4.865536, 1.277981, 0.472937, 0.000000] turbmod_sa_neg_rae2822.test_vals_aarch64 = [-1.345593, 1.448310, 1.208721, -0.846597, 1.248410, 0.489117, 0.000000] test_list.append(turbmod_sa_neg_rae2822) @@ -900,7 +900,7 @@ def main(): turbmod_sa_comp_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_comp_rae2822.cfg_file = "turb_SA_COMP_RAE2822.cfg" turbmod_sa_comp_rae2822.test_iter = 20 - turbmod_sa_comp_rae2822.test_vals = [-3.192776, -0.471890, -0.893254, -5.190537, 0.777261, 0.017904] + turbmod_sa_comp_rae2822.test_vals = [-3.190862, -0.473847, -0.893269, -5.195424, 0.777296, 0.017920] test_list.append(turbmod_sa_comp_rae2822) # SA Edwards @@ -908,7 +908,7 @@ def main(): turbmod_sa_edw_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_edw_rae2822.cfg_file = "turb_SA_EDW_RAE2822.cfg" turbmod_sa_edw_rae2822.test_iter = 20 - turbmod_sa_edw_rae2822.test_vals = [-3.198033, -0.439446, -0.883563, -3.899428, 0.786167, 0.017883] + turbmod_sa_edw_rae2822.test_vals = [-3.189014, -0.465457, -0.890004, -5.206434, 0.781697, 0.017765] test_list.append(turbmod_sa_edw_rae2822) # SA Compressibility and Edwards @@ -916,7 +916,7 @@ def main(): turbmod_sa_comp_edw_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_comp_edw_rae2822.cfg_file = "turb_SA_COMP_EDW_RAE2822.cfg" turbmod_sa_comp_edw_rae2822.test_iter = 20 - turbmod_sa_comp_edw_rae2822.test_vals = [-2.943295, -0.168387, -0.632480, -5.127730, 0.802507, 0.020196] + turbmod_sa_comp_edw_rae2822.test_vals = [-3.056328, -0.293497, -0.766206, -5.230932, 0.798848, 0.019838] test_list.append(turbmod_sa_comp_edw_rae2822) # SA QCR @@ -924,7 +924,7 @@ def main(): turbmod_sa_qcr_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_qcr_rae2822.cfg_file = "turb_SA_QCR_RAE2822.cfg" turbmod_sa_qcr_rae2822.test_iter = 20 - turbmod_sa_qcr_rae2822.test_vals = [-3.056565, -0.419621, -0.805532, -3.857890, 0.760796, 0.016908] + turbmod_sa_qcr_rae2822.test_vals = [-3.149635, -0.387144, -0.827745, -2.226502, 0.780050, 0.015548] test_list.append(turbmod_sa_qcr_rae2822) ############################ @@ -1050,7 +1050,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482691, 1.262918, 0.529450, -0.023537] + turb_naca0012_2c.test_vals = [-5.482691, 1.262918, 0.529442, -0.023584] turb_naca0012_2c.test_vals_aarch64 = [-5.484365, 1.264701, 0.501741, -0.033109] test_list.append(turb_naca0012_2c) @@ -1097,7 +1097,7 @@ def main(): hb_rans_preconditioning.cfg_file = "davis.cfg" hb_rans_preconditioning.test_iter = 25 hb_rans_preconditioning.tol = 0.00001 - hb_rans_preconditioning.test_vals = [-1.905206, 0.481900, 0.599004, 3.605361, -5.945837] + hb_rans_preconditioning.test_vals = [-1.905509, 0.482119, 0.598486, 3.605120, -5.946067] test_list.append(hb_rans_preconditioning) ###################################### @@ -1109,7 +1109,7 @@ def main(): rot_naca0012.cfg_dir = "rotating/naca0012" rot_naca0012.cfg_file = "rot_NACA0012.cfg" rot_naca0012.test_iter = 25 - rot_naca0012.test_vals = [-0.023432, 0.083323, 2.000000, -1.181593] + rot_naca0012.test_vals = [-0.023360, 0.082942, 2.000000, -1.182142] test_list.append(rot_naca0012) # Lid-driven cavity @@ -1125,7 +1125,7 @@ def main(): spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 - spinning_cylinder.test_vals = [-7.471334, -2.007097, 2.183550, 1.847845] + spinning_cylinder.test_vals = [-7.471322, -2.007082, 2.183565, 1.847848] test_list.append(spinning_cylinder) ###################################### @@ -1197,7 +1197,7 @@ def main(): edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 20 - edge_VW.test_vals = [-4.444040, 1.757269, -0.000009, 0.000000] + edge_VW.test_vals = [-4.478306, 1.723006, -0.000009, 0.000000] test_list.append(edge_VW) # Rarefaction shock wave edge_PPR @@ -1205,7 +1205,7 @@ def main(): edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 20 - edge_PPR.test_vals = [-9.533869, -3.385210, -0.000034, 0.000000] + edge_PPR.test_vals = [-8.395110, -2.236894, -0.000034, 0.000000] test_list.append(edge_PPR) # Rarefaction Q1D nozzle, include CoolProp fluid model @@ -1231,7 +1231,7 @@ def main(): datadriven_fluidModel.cfg_dir = "nicf/datadriven" datadriven_fluidModel.cfg_file = "datadriven_nozzle.cfg" datadriven_fluidModel.test_iter = 50 - datadriven_fluidModel.test_vals = [-4.879421, -2.353319, -2.344004, 0.390613, -1.559800, 1.322761] + datadriven_fluidModel.test_vals = [-6.283594, -3.253961, -4.172935, -0.949415, -2.046039, 1.546933] test_list.append(datadriven_fluidModel) ###################################### @@ -1260,7 +1260,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [1.167491, 1.598507, -2.928578, 2.573644, -2.527392, 3.016170, 106370.000000, 106370.000000, 5.726800, 64.383000] + axial_stage2D.test_vals = [1.167500, 1.598546, -2.928573, 2.573647, -2.527331, 3.016254, 106370.000000, 106370.000000, 5.726800, 64.383000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -1308,7 +1308,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.466215, 0.350091, 0.398996] + channel_2D.test_vals = [2.000000, 0.000000, 0.466408, 0.346806, 0.397328] channel_2D.timeout = 100 channel_2D.unsteady = True channel_2D.multizone = True @@ -1319,7 +1319,7 @@ def main(): channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_WA.cfg" channel_3D.test_iter = 2 - channel_3D.test_vals = [2.000000, 0.000000, 0.632256, 0.534230, 0.431926] + channel_3D.test_vals = [2.000000, 0.000000, 0.632752, 0.522763, 0.423355] channel_3D.test_vals_aarch64 = [2.000000, 0.000000, 0.629119, 0.524959, 0.422390] channel_3D.unsteady = True channel_3D.multizone = True @@ -1330,7 +1330,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.092415, 0.568973, 0.692859, 0.989459, 1.048237] + pipe.test_vals = [0.070225, 0.528893, 0.684173, 0.970355, 1.065262] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -1340,7 +1340,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.664821, 1.125807, 1.117610] + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686431, 1.159459, 1.151139] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -1350,7 +1350,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 0.899643, 1.076189] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.126036, 1.081775] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -1551,7 +1551,7 @@ def main(): pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 80 - pywrapper_naca0012.test_vals = [-5.699819, -5.186257, 0.334856, 0.023343] + pywrapper_naca0012.test_vals = [-5.701280, -5.186480, 0.334856, 0.023342] pywrapper_naca0012.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") test_list.append(pywrapper_naca0012) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 26a32c3e2762..ce0c6fd881c5 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.911310, 5.072379, 7.118130, 2.484452] + discadj_axisymmetric_rans_nozzle.test_vals = [9.742490, 5.136585, 7.107742, 2.488366] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) @@ -239,7 +239,7 @@ def main(): discadj_sliding_interface.cfg_dir = "disc_adj_ffi/sliding_interface" discadj_sliding_interface.cfg_file = "circles.cfg" discadj_sliding_interface.test_iter = 10 - discadj_sliding_interface.test_vals = [10.000000, -4.395153, -4.419435] + discadj_sliding_interface.test_vals = [10.000000, -4.403529, -4.419435] test_list.append(discadj_sliding_interface) ####################################################### diff --git a/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref b/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref index 3aa219b7120e..0c9091d233ae 100644 --- a/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref +++ b/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref @@ -1,200 +1,200 @@ -199, -0.99, -0.00, 0.00 -0, -2.91, 20.02, 0.00 -1, -4.27, 29.42, 0.00 -2, -5.43, 37.48, 0.00 -3, -6.49, 44.88, 0.00 -4, -7.43, 51.52, 0.00 -5, -8.23, 57.28, 0.00 -6, -8.93, 62.42, 0.00 -7, -9.50, 66.76, 0.00 -8, -9.96, 70.36, 0.00 -9, -10.31, 73.26, 0.00 -10, -10.55, 75.47, 0.00 -11, -10.71, 77.10, 0.00 -12, -10.75, 78.01, 0.00 -13, -10.71, 78.35, 0.00 -14, -10.57, 78.03, 0.00 -15, -10.36, 77.16, 0.00 -16, -10.07, 75.79, 0.00 -17, -9.73, 73.92, 0.00 -18, -9.31, 71.49, 0.00 -19, -8.85, 68.73, 0.00 -20, -8.32, 65.37, 0.00 -21, -7.77, 61.78, 0.00 -22, -7.15, 57.64, 0.00 -23, -6.53, 53.27, 0.00 -24, -5.85, 48.43, 0.00 -25, -5.18, 43.45, 0.00 -26, -4.46, 37.94, 0.00 -27, -3.74, 32.28, 0.00 -28, -2.99, 26.23, 0.00 -29, -2.26, 20.13, 0.00 -30, -1.50, 13.62, 0.00 -31, -0.77, 7.14, 0.00 -32, -0.03, 0.27, 0.00 -33, 0.64, -6.16, 0.00 -34, 1.33, -12.94, 0.00 -35, 1.88, -18.69, 0.00 -36, 2.50, -25.43, 0.00 -37, 2.94, -30.60, 0.00 -38, 3.61, -38.39, 0.00 -39, 4.12, -44.94, 0.00 -40, 5.20, -58.26, 0.00 -41, 6.45, -74.32, 0.00 -42, 8.48, -100.75, 0.00 -43, 10.40, -127.62, 0.00 -44, 12.32, -156.48, 0.00 -45, 14.32, -188.86, 0.00 -46, 15.99, -219.70, 0.00 -47, 17.77, -255.19, 0.00 -48, 19.05, -287.25, 0.00 -49, 20.43, -325.17, 0.00 -50, 21.21, -358.33, 0.00 -51, 21.60, -390.04, 0.00 -52, 20.80, -404.89, 0.00 -53, 19.46, -412.52, 0.00 -54, 17.55, -410.28, 0.00 -55, 15.38, -403.24, 0.00 -56, 12.80, -384.55, 0.00 -57, 10.01, -354.85, 0.00 -58, 7.33, -320.56, 0.00 -59, 5.62, -325.28, 0.00 -60, 4.54, -398.71, 0.00 -61, 2.33, -444.80, 0.00 -62, -0.55, -444.61, 0.00 -63, -3.45, -430.49, 0.00 -64, -6.33, -418.34, 0.00 -65, -9.16, -405.22, 0.00 -66, -11.93, -391.89, 0.00 -67, -14.56, -376.47, 0.00 -68, -17.08, -360.79, 0.00 -69, -19.39, -343.61, 0.00 -70, -21.54, -326.20, 0.00 -71, -23.38, -307.04, 0.00 -72, -25.04, -288.42, 0.00 -73, -26.35, -268.52, 0.00 -74, -27.44, -249.13, 0.00 -75, -28.26, -229.94, 0.00 -76, -28.70, -210.22, 0.00 -77, -28.76, -190.36, 0.00 -78, -28.57, -171.29, 0.00 -79, -27.84, -151.55, 0.00 -80, -26.53, -131.24, 0.00 -81, -24.47, -110.11, 0.00 -82, -22.10, -90.41, 0.00 -83, -17.63, -65.56, 0.00 -84, -13.82, -46.59, 0.00 -85, -9.00, -27.47, 0.00 -86, -3.97, -10.94, 0.00 -87, 2.04, 5.04, 0.00 -88, 8.66, 19.11, 0.00 -89, 17.22, 33.67, 0.00 -90, 26.22, 44.98, 0.00 -91, 38.13, 56.68, 0.00 -92, 50.18, 63.55, 0.00 -93, 64.64, 68.16, 0.00 -94, 81.14, 68.93, 0.00 -95, 92.61, 60.32, 0.00 -96, 98.61, 45.20, 0.00 -97, 91.85, 24.86, 0.00 -98, 60.95, 8.18, 0.00 -99, 54.21, -0.00, 0.00 -100, 87.82, -11.78, 0.00 -101, 110.00, -29.77, 0.00 -102, 92.95, -42.60, 0.00 -103, 73.45, -47.84, 0.00 -104, 54.95, -46.68, 0.00 -105, 39.22, -41.36, 0.00 -106, 29.77, -37.70, 0.00 -107, 13.13, -19.52, 0.00 -108, 1.46, -2.51, 0.00 -109, -12.03, 23.53, 0.00 -110, -21.14, 46.66, 0.00 -111, -30.42, 75.21, 0.00 -112, -36.34, 100.05, 0.00 -113, -42.50, 129.72, 0.00 -114, -45.24, 152.58, 0.00 -115, -47.68, 177.27, 0.00 -116, -48.11, 196.85, 0.00 -117, -49.30, 221.84, 0.00 -118, -49.86, 246.67, 0.00 -119, -50.26, 273.55, 0.00 -120, -49.99, 299.73, 0.00 -121, -49.24, 325.87, 0.00 -122, -47.80, 350.18, 0.00 -123, -46.06, 374.79, 0.00 -124, -43.92, 398.75, 0.00 -125, -41.45, 422.34, 0.00 -126, -38.71, 445.76, 0.00 -127, -35.65, 468.20, 0.00 -128, -32.39, 490.54, 0.00 -129, -28.90, 511.99, 0.00 -130, -25.24, 533.17, 0.00 -131, -21.41, 553.63, 0.00 -132, -17.46, 573.42, 0.00 -133, -13.40, 592.80, 0.00 -134, -9.25, 611.37, 0.00 -135, -5.04, 629.20, 0.00 -136, -0.80, 646.64, 0.00 -137, 3.47, 662.94, 0.00 -138, 7.73, 678.10, 0.00 -139, 11.96, 692.64, 0.00 -140, 16.15, 706.26, 0.00 -141, 20.27, 718.38, 0.00 -142, 24.31, 730.12, 0.00 -143, 28.27, 741.00, 0.00 -144, 32.10, 750.49, 0.00 -145, 35.79, 758.77, 0.00 -146, 39.36, 766.12, 0.00 -147, 42.77, 772.47, 0.00 -148, 46.02, 777.49, 0.00 -149, 49.12, 781.76, 0.00 -150, 52.03, 784.73, 0.00 -151, 54.76, 786.49, 0.00 -152, 57.27, 786.70, 0.00 -153, 59.65, 786.61, 0.00 -154, 62.04, 787.97, 0.00 -155, 63.93, 784.13, 0.00 -156, 65.88, 782.40, 0.00 -157, 67.06, 772.81, 0.00 -158, 69.82, 782.23, 0.00 -159, 35.12, 383.21, 0.00 -160, -13.10, -139.35, 0.00 -161, -9.96, -103.51, 0.00 -162, -7.72, -78.42, 0.00 -163, -7.29, -72.50, 0.00 -164, -7.05, -68.73, 0.00 -165, -6.60, -63.13, 0.00 -166, -6.57, -61.71, 0.00 -167, -6.59, -60.74, 0.00 -168, -6.81, -61.72, 0.00 -169, -7.08, -63.08, 0.00 -170, -7.42, -65.08, 0.00 -171, -7.76, -67.01, 0.00 -172, -8.15, -69.40, 0.00 -173, -8.55, -71.76, 0.00 -174, -8.94, -73.94, 0.00 -175, -9.30, -75.91, 0.00 -176, -9.67, -77.93, 0.00 -177, -10.01, -79.65, 0.00 -178, -10.32, -81.15, 0.00 -179, -10.61, -82.44, 0.00 -180, -10.85, -83.37, 0.00 -181, -11.06, -84.05, 0.00 -182, -11.21, -84.33, 0.00 -183, -11.31, -84.26, 0.00 -184, -11.35, -83.81, 0.00 -185, -11.34, -82.98, 0.00 -186, -11.25, -81.65, 0.00 -187, -11.11, -80.01, 0.00 -188, -10.89, -77.90, 0.00 -189, -10.54, -74.91, 0.00 -190, -10.09, -71.22, 0.00 -191, -9.54, -66.99, 0.00 -192, -8.89, -62.12, 0.00 -193, -8.13, -56.59, 0.00 -194, -7.28, -50.53, 0.00 -195, -6.31, -43.67, 0.00 -196, -5.23, -36.08, 0.00 -197, -4.05, -27.89, 0.00 -198, -2.67, -18.38, 0.00 +199, -0.94, -0.00, 0.00 +0, -2.79, 19.21, 0.00 +1, -4.07, 28.05, 0.00 +2, -5.12, 35.35, 0.00 +3, -6.07, 41.99, 0.00 +4, -6.89, 47.80, 0.00 +5, -7.57, 52.73, 0.00 +6, -8.16, 57.03, 0.00 +7, -8.63, 60.64, 0.00 +8, -8.99, 63.49, 0.00 +9, -9.25, 65.69, 0.00 +10, -9.40, 67.22, 0.00 +11, -9.47, 68.21, 0.00 +12, -9.44, 68.52, 0.00 +13, -9.32, 68.22, 0.00 +14, -9.13, 67.36, 0.00 +15, -8.84, 65.83, 0.00 +16, -8.50, 63.93, 0.00 +17, -8.06, 61.28, 0.00 +18, -7.60, 58.37, 0.00 +19, -7.04, 54.67, 0.00 +20, -6.48, 50.91, 0.00 +21, -5.83, 46.37, 0.00 +22, -5.21, 41.95, 0.00 +23, -4.50, 36.73, 0.00 +24, -3.85, 31.89, 0.00 +25, -3.13, 26.30, 0.00 +26, -2.48, 21.12, 0.00 +27, -1.81, 15.63, 0.00 +28, -1.16, 10.19, 0.00 +29, -0.56, 5.01, 0.00 +30, -0.01, 0.07, 0.00 +31, 0.30, -2.76, 0.00 +32, 0.83, -7.82, 0.00 +33, 0.85, -8.14, 0.00 +34, 1.47, -14.33, 0.00 +35, 1.50, -14.91, 0.00 +36, 2.34, -23.79, 0.00 +37, 2.58, -26.78, 0.00 +38, 3.60, -38.33, 0.00 +39, 4.15, -45.32, 0.00 +40, 5.35, -59.93, 0.00 +41, 6.34, -73.02, 0.00 +42, 7.53, -89.47, 0.00 +43, 8.62, -105.75, 0.00 +44, 9.52, -120.93, 0.00 +45, 10.46, -137.99, 0.00 +46, 10.89, -149.59, 0.00 +47, 11.06, -158.86, 0.00 +48, 10.91, -164.51, 0.00 +49, 10.20, -162.29, 0.00 +50, 10.41, -175.95, 0.00 +51, 10.69, -193.01, 0.00 +52, 11.35, -220.88, 0.00 +53, 12.09, -256.22, 0.00 +54, 11.70, -273.60, 0.00 +55, 11.18, -293.17, 0.00 +56, 9.73, -292.14, 0.00 +57, 8.95, -317.19, 0.00 +58, 8.19, -357.93, 0.00 +59, 7.34, -424.98, 0.00 +60, 5.17, -454.05, 0.00 +61, 2.26, -432.87, 0.00 +62, -0.52, -418.79, 0.00 +63, -3.27, -407.56, 0.00 +64, -5.99, -395.49, 0.00 +65, -8.62, -381.54, 0.00 +66, -11.16, -366.54, 0.00 +67, -13.55, -350.35, 0.00 +68, -15.82, -334.23, 0.00 +69, -17.87, -316.57, 0.00 +70, -19.66, -297.72, 0.00 +71, -21.14, -277.56, 0.00 +72, -22.40, -258.00, 0.00 +73, -23.24, -236.77, 0.00 +74, -23.93, -217.26, 0.00 +75, -23.95, -194.85, 0.00 +76, -23.92, -175.24, 0.00 +77, -23.06, -152.62, 0.00 +78, -22.31, -133.79, 0.00 +79, -20.38, -110.93, 0.00 +80, -18.51, -91.56, 0.00 +81, -14.90, -67.05, 0.00 +82, -11.41, -46.70, 0.00 +83, -4.97, -18.48, 0.00 +84, -0.30, -1.01, 0.00 +85, 9.93, 30.30, 0.00 +86, 16.77, 46.17, 0.00 +87, 32.33, 79.93, 0.00 +88, 43.53, 96.08, 0.00 +89, 60.42, 118.16, 0.00 +90, 71.17, 122.11, 0.00 +91, 98.75, 146.81, 0.00 +92, 112.94, 143.03, 0.00 +93, 162.93, 171.80, 0.00 +94, 168.48, 143.12, 0.00 +95, 162.93, 106.12, 0.00 +96, 161.49, 74.02, 0.00 +97, 226.14, 61.20, 0.00 +98, 173.55, 23.29, 0.00 +99, 81.85, -0.00, 0.00 +100, 101.93, -13.68, 0.00 +101, 111.85, -30.27, 0.00 +102, 83.84, -38.43, 0.00 +103, 59.18, -38.55, 0.00 +104, 39.46, -33.52, 0.00 +105, 20.52, -21.64, 0.00 +106, 9.26, -11.73, 0.00 +107, -5.26, 7.82, 0.00 +108, -14.72, 25.25, 0.00 +109, -24.47, 47.86, 0.00 +110, -30.46, 67.22, 0.00 +111, -36.98, 91.44, 0.00 +112, -40.61, 111.80, 0.00 +113, -44.24, 135.04, 0.00 +114, -47.23, 159.29, 0.00 +115, -50.25, 186.80, 0.00 +116, -52.01, 212.78, 0.00 +117, -49.79, 224.02, 0.00 +118, -49.93, 247.03, 0.00 +119, -50.10, 272.69, 0.00 +120, -49.50, 296.79, 0.00 +121, -48.43, 320.54, 0.00 +122, -46.68, 341.98, 0.00 +123, -45.16, 367.44, 0.00 +124, -43.12, 391.55, 0.00 +125, -41.04, 418.22, 0.00 +126, -38.38, 441.96, 0.00 +127, -35.65, 468.10, 0.00 +128, -32.39, 490.58, 0.00 +129, -29.12, 515.86, 0.00 +130, -25.43, 537.19, 0.00 +131, -21.72, 561.44, 0.00 +132, -17.69, 581.14, 0.00 +133, -13.62, 602.77, 0.00 +134, -9.39, 620.72, 0.00 +135, -5.13, 639.76, 0.00 +136, -0.81, 656.52, 0.00 +137, 3.52, 673.60, 0.00 +138, 7.84, 688.01, 0.00 +139, 12.15, 703.61, 0.00 +140, 16.38, 716.38, 0.00 +141, 20.56, 728.93, 0.00 +142, 24.62, 739.26, 0.00 +143, 28.61, 749.93, 0.00 +144, 32.43, 758.20, 0.00 +145, 36.13, 765.81, 0.00 +146, 39.66, 772.00, 0.00 +147, 43.08, 777.93, 0.00 +148, 46.29, 782.12, 0.00 +149, 49.44, 786.83, 0.00 +150, 52.29, 788.58, 0.00 +151, 54.86, 787.96, 0.00 +152, 57.31, 787.22, 0.00 +153, 59.58, 785.72, 0.00 +154, 62.23, 790.29, 0.00 +155, 62.41, 765.50, 0.00 +156, 64.45, 765.33, 0.00 +157, 54.69, 630.25, 0.00 +158, 48.23, 540.32, 0.00 +159, -12.34, -134.66, 0.00 +160, -29.22, -310.97, 0.00 +161, -7.18, -74.61, 0.00 +162, -3.54, -35.94, 0.00 +163, -3.39, -33.73, 0.00 +164, -3.11, -30.30, 0.00 +165, -2.96, -28.33, 0.00 +166, -2.85, -26.76, 0.00 +167, -2.79, -25.71, 0.00 +168, -2.88, -26.13, 0.00 +169, -3.27, -29.13, 0.00 +170, -3.57, -31.34, 0.00 +171, -3.86, -33.32, 0.00 +172, -4.21, -35.80, 0.00 +173, -4.70, -39.42, 0.00 +174, -5.09, -42.12, 0.00 +175, -5.57, -45.47, 0.00 +176, -6.00, -48.33, 0.00 +177, -6.47, -51.51, 0.00 +178, -6.92, -54.40, 0.00 +179, -7.37, -57.26, 0.00 +180, -7.77, -59.72, 0.00 +181, -8.16, -62.01, 0.00 +182, -8.49, -63.90, 0.00 +183, -8.78, -65.39, 0.00 +184, -9.01, -66.52, 0.00 +185, -9.18, -67.19, 0.00 +186, -9.30, -67.46, 0.00 +187, -9.30, -67.00, 0.00 +188, -9.21, -65.84, 0.00 +189, -9.06, -64.37, 0.00 +190, -8.81, -62.23, 0.00 +191, -8.46, -59.42, 0.00 +192, -8.00, -55.90, 0.00 +193, -7.42, -51.65, 0.00 +194, -6.74, -46.78, 0.00 +195, -5.94, -41.07, 0.00 +196, -5.00, -34.54, 0.00 +197, -3.98, -27.42, 0.00 +198, -2.72, -18.72, 0.00 diff --git a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref index 1c87fcffcb67..5168d86660a2 100644 --- a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref +++ b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref @@ -1,200 +1,200 @@ -199, -0.98, -0.00, 0.00 -0, -2.89, 19.89, 0.00 -1, -4.12, 28.36, 0.00 -2, -5.17, 35.67, 0.00 -3, -6.10, 42.20, 0.00 -4, -6.93, 48.05, 0.00 -5, -7.63, 53.11, 0.00 -6, -8.21, 57.37, 0.00 -7, -8.68, 60.97, 0.00 -8, -8.99, 63.51, 0.00 -9, -9.20, 65.36, 0.00 -10, -9.28, 66.37, 0.00 -11, -9.27, 66.73, 0.00 -12, -9.17, 66.55, 0.00 -13, -8.99, 65.76, 0.00 -14, -8.76, 64.65, 0.00 -15, -8.46, 63.02, 0.00 -16, -8.12, 61.09, 0.00 -17, -7.73, 58.74, 0.00 -18, -7.26, 55.80, 0.00 -19, -6.76, 52.48, 0.00 -20, -6.17, 48.47, 0.00 -21, -5.53, 44.02, 0.00 -22, -4.86, 39.16, 0.00 -23, -4.13, 33.74, 0.00 -24, -3.43, 28.38, 0.00 -25, -2.68, 22.45, 0.00 -26, -1.99, 16.92, 0.00 -27, -1.26, 10.86, 0.00 -28, -0.62, 5.40, 0.00 -29, 0.05, -0.48, 0.00 -30, 0.57, -5.20, 0.00 -31, 1.09, -10.01, 0.00 -32, 1.48, -13.85, 0.00 -33, 1.88, -17.94, 0.00 -34, 2.18, -21.27, 0.00 -35, 2.56, -25.45, 0.00 -36, 2.72, -27.60, 0.00 -37, 2.84, -29.52, 0.00 -38, 2.54, -27.06, 0.00 -39, 2.39, -26.05, 0.00 -40, 2.12, -23.72, 0.00 -41, 2.85, -32.88, 0.00 -42, 0.07, -0.80, 0.00 -43, -7.64, 93.76, 0.00 -44, -15.56, 197.66, 0.00 -45, -18.11, 238.88, 0.00 -46, 4.57, -62.81, 0.00 -47, 28.46, -408.83, 0.00 -48, 30.15, -454.80, 0.00 -49, 29.55, -470.30, 0.00 -50, 27.36, -462.29, 0.00 -51, 25.32, -457.28, 0.00 -52, 23.08, -449.36, 0.00 -53, 21.91, -464.51, 0.00 -54, 21.44, -501.19, 0.00 -55, 21.98, -576.18, 0.00 -56, 20.44, -613.98, 0.00 -57, 16.27, -576.74, 0.00 -58, 12.57, -549.58, 0.00 -59, 9.29, -537.86, 0.00 -60, 6.03, -529.16, 0.00 -61, 2.72, -519.13, 0.00 -62, -0.62, -505.94, 0.00 -63, -3.93, -490.73, 0.00 -64, -7.20, -475.71, 0.00 -65, -10.38, -459.45, 0.00 -66, -13.47, -442.43, 0.00 -67, -16.41, -424.36, 0.00 -68, -19.21, -405.79, 0.00 -69, -21.81, -386.39, 0.00 -70, -24.21, -366.71, 0.00 -71, -26.37, -346.30, 0.00 -72, -28.28, -325.64, 0.00 -73, -29.91, -304.75, 0.00 -74, -31.21, -283.42, 0.00 -75, -32.28, -262.70, 0.00 -76, -32.88, -240.86, 0.00 -77, -33.29, -220.29, 0.00 -78, -33.20, -199.09, 0.00 -79, -33.11, -180.21, 0.00 -80, -32.42, -160.41, 0.00 -81, -32.04, -144.14, 0.00 -82, -30.93, -126.55, 0.00 -83, -30.26, -112.49, 0.00 -84, -28.67, -96.70, 0.00 -85, -26.72, -81.57, 0.00 -86, -23.77, -65.45, 0.00 -87, -19.10, -47.23, 0.00 -88, -13.13, -28.97, 0.00 -89, -4.87, -9.52, 0.00 -90, 5.12, 8.78, 0.00 -91, 16.89, 25.11, 0.00 -92, 29.83, 37.77, 0.00 -93, 43.55, 45.92, 0.00 -94, 58.79, 49.94, 0.00 -95, 71.13, 46.33, 0.00 -96, 80.33, 36.82, 0.00 -97, 91.25, 24.70, 0.00 -98, 89.60, 12.02, 0.00 -99, 52.39, -0.00, 0.00 -100, 121.03, -16.24, 0.00 -101, 165.10, -44.68, 0.00 -102, 144.64, -66.30, 0.00 -103, 117.07, -76.25, 0.00 -104, 94.88, -80.60, 0.00 -105, 66.02, -69.62, 0.00 -106, 47.83, -60.58, 0.00 -107, 28.23, -41.96, 0.00 -108, 15.85, -27.20, 0.00 -109, 3.13, -6.12, 0.00 -110, -5.71, 12.59, 0.00 -111, -14.69, 36.31, 0.00 -112, -21.31, 58.67, 0.00 -113, -28.22, 86.14, 0.00 -114, -33.21, 112.01, 0.00 -115, -38.21, 142.05, 0.00 -116, -41.32, 169.06, 0.00 -117, -44.19, 198.82, 0.00 -118, -45.47, 224.95, 0.00 -119, -46.71, 254.22, 0.00 -120, -46.59, 279.39, 0.00 -121, -46.26, 306.19, 0.00 -122, -45.07, 330.17, 0.00 -123, -43.64, 355.12, 0.00 -124, -41.58, 377.56, 0.00 -125, -39.33, 400.75, 0.00 -126, -36.72, 422.86, 0.00 -127, -33.87, 444.82, 0.00 -128, -30.76, 465.82, 0.00 -129, -27.43, 486.02, 0.00 -130, -23.94, 505.83, 0.00 -131, -20.30, 524.79, 0.00 -132, -16.54, 543.40, 0.00 -133, -12.68, 561.07, 0.00 -134, -8.75, 578.23, 0.00 -135, -4.76, 594.19, 0.00 -136, -0.75, 610.20, 0.00 -137, 3.27, 624.70, 0.00 -138, 7.28, 638.58, 0.00 -139, 11.25, 651.52, 0.00 -140, 15.19, 664.02, 0.00 -141, 19.03, 674.72, 0.00 -142, 22.82, 685.17, 0.00 -143, 26.50, 694.58, 0.00 -144, 30.07, 703.02, 0.00 -145, 33.49, 710.00, 0.00 -146, 36.80, 716.33, 0.00 -147, 39.96, 721.72, 0.00 -148, 42.96, 725.88, 0.00 -149, 45.80, 729.01, 0.00 -150, 48.40, 730.04, 0.00 -151, 50.69, 728.06, 0.00 -152, 53.19, 730.63, 0.00 -153, 53.67, 707.80, 0.00 -154, 40.89, 519.28, 0.00 -155, -10.41, -127.67, 0.00 -156, -9.92, -117.86, 0.00 -157, -0.17, -2.01, 0.00 -158, 0.20, 2.24, 0.00 -159, -0.45, -4.95, 0.00 -160, 0.03, 0.33, 0.00 -161, 0.43, 4.50, 0.00 -162, 0.61, 6.20, 0.00 -163, 0.63, 6.25, 0.00 -164, 0.56, 5.43, 0.00 -165, 0.40, 3.85, 0.00 -166, 0.18, 1.72, 0.00 -167, -0.12, -1.09, 0.00 -168, -0.49, -4.46, 0.00 -169, -0.97, -8.64, 0.00 -170, -1.49, -13.10, 0.00 -171, -2.10, -18.13, 0.00 -172, -2.71, -23.05, 0.00 -173, -3.37, -28.27, 0.00 -174, -4.02, -33.22, 0.00 -175, -4.70, -38.39, 0.00 -176, -5.37, -43.29, 0.00 -177, -6.05, -48.13, 0.00 -178, -6.69, -52.54, 0.00 -179, -7.31, -56.81, 0.00 -180, -7.88, -60.56, 0.00 -181, -8.40, -63.82, 0.00 -182, -8.85, -66.57, 0.00 -183, -9.18, -68.42, 0.00 -184, -9.47, -69.89, 0.00 -185, -9.62, -70.38, 0.00 -186, -9.71, -70.43, 0.00 -187, -9.68, -69.72, 0.00 -188, -9.58, -68.53, 0.00 -189, -9.42, -66.89, 0.00 -190, -9.15, -64.59, 0.00 -191, -8.81, -61.89, 0.00 -192, -8.34, -58.33, 0.00 -193, -7.78, -54.16, 0.00 -194, -7.09, -49.18, 0.00 -195, -6.25, -43.20, 0.00 -196, -5.26, -36.32, 0.00 -197, -4.13, -28.49, 0.00 -198, -2.86, -19.72, 0.00 +199, -0.99, -0.00, 0.00 +0, -2.91, 20.03, 0.00 +1, -4.14, 28.50, 0.00 +2, -5.20, 35.86, 0.00 +3, -6.14, 42.47, 0.00 +4, -6.97, 48.37, 0.00 +5, -7.67, 53.42, 0.00 +6, -8.25, 57.65, 0.00 +7, -8.70, 61.14, 0.00 +8, -9.00, 63.59, 0.00 +9, -9.19, 65.26, 0.00 +10, -9.25, 66.17, 0.00 +11, -9.21, 66.36, 0.00 +12, -9.11, 66.11, 0.00 +13, -8.91, 65.21, 0.00 +14, -8.68, 64.05, 0.00 +15, -8.38, 62.39, 0.00 +16, -8.03, 60.38, 0.00 +17, -7.63, 58.02, 0.00 +18, -7.15, 54.94, 0.00 +19, -6.64, 51.57, 0.00 +20, -6.03, 47.40, 0.00 +21, -5.39, 42.89, 0.00 +22, -4.70, 37.86, 0.00 +23, -3.97, 32.41, 0.00 +24, -3.25, 26.89, 0.00 +25, -2.49, 20.93, 0.00 +26, -1.80, 15.28, 0.00 +27, -1.07, 9.26, 0.00 +28, -0.43, 3.74, 0.00 +29, 0.22, -2.00, 0.00 +30, 0.74, -6.72, 0.00 +31, 1.23, -11.32, 0.00 +32, 1.61, -15.15, 0.00 +33, 1.99, -19.02, 0.00 +34, 2.29, -22.32, 0.00 +35, 2.64, -26.26, 0.00 +36, 2.79, -28.35, 0.00 +37, 2.88, -29.98, 0.00 +38, 2.58, -27.41, 0.00 +39, 2.40, -26.23, 0.00 +40, 2.14, -23.97, 0.00 +41, 2.88, -33.18, 0.00 +42, 0.07, -0.88, 0.00 +43, -7.69, 94.38, 0.00 +44, -15.57, 197.73, 0.00 +45, -17.94, 236.64, 0.00 +46, 4.70, -64.62, 0.00 +47, 28.52, -409.61, 0.00 +48, 30.19, -455.33, 0.00 +49, 29.54, -470.12, 0.00 +50, 27.35, -462.05, 0.00 +51, 25.31, -457.07, 0.00 +52, 23.08, -449.24, 0.00 +53, 21.94, -465.13, 0.00 +54, 21.48, -502.18, 0.00 +55, 22.02, -577.36, 0.00 +56, 20.47, -614.69, 0.00 +57, 16.29, -577.49, 0.00 +58, 12.59, -550.58, 0.00 +59, 9.32, -539.47, 0.00 +60, 6.05, -531.03, 0.00 +61, 2.73, -521.29, 0.00 +62, -0.63, -508.34, 0.00 +63, -3.96, -493.40, 0.00 +64, -7.24, -478.67, 0.00 +65, -10.46, -462.56, 0.00 +66, -13.57, -445.82, 0.00 +67, -16.54, -427.72, 0.00 +68, -19.38, -409.38, 0.00 +69, -22.00, -389.70, 0.00 +70, -24.45, -370.21, 0.00 +71, -26.59, -349.18, 0.00 +72, -28.53, -328.51, 0.00 +73, -30.06, -306.33, 0.00 +74, -31.33, -284.50, 0.00 +75, -32.15, -261.58, 0.00 +76, -32.58, -238.65, 0.00 +77, -32.48, -214.97, 0.00 +78, -32.01, -191.95, 0.00 +79, -31.12, -169.41, 0.00 +80, -29.76, -147.23, 0.00 +81, -28.42, -127.89, 0.00 +82, -26.46, -108.25, 0.00 +83, -25.23, -93.79, 0.00 +84, -23.18, -78.17, 0.00 +85, -22.06, -67.33, 0.00 +86, -20.11, -55.36, 0.00 +87, -17.52, -43.33, 0.00 +88, -14.90, -32.88, 0.00 +89, -7.49, -14.65, 0.00 +90, -1.78, -3.05, 0.00 +91, 11.94, 17.75, 0.00 +92, 21.51, 27.24, 0.00 +93, 37.02, 39.03, 0.00 +94, 47.69, 40.51, 0.00 +95, 60.96, 39.71, 0.00 +96, 70.98, 32.53, 0.00 +97, 78.52, 21.25, 0.00 +98, 83.66, 11.23, 0.00 +99, 49.17, -0.00, 0.00 +100, 124.12, -16.66, 0.00 +101, 184.07, -49.82, 0.00 +102, 164.48, -75.39, 0.00 +103, 133.69, -87.08, 0.00 +104, 109.43, -92.96, 0.00 +105, 76.86, -81.04, 0.00 +106, 57.12, -72.34, 0.00 +107, 33.93, -50.44, 0.00 +108, 19.70, -33.80, 0.00 +109, 3.84, -7.50, 0.00 +110, -6.08, 13.41, 0.00 +111, -17.27, 42.71, 0.00 +112, -24.34, 67.01, 0.00 +113, -32.29, 98.57, 0.00 +114, -37.23, 125.57, 0.00 +115, -42.27, 157.13, 0.00 +116, -45.00, 184.10, 0.00 +117, -47.22, 212.46, 0.00 +118, -48.02, 237.54, 0.00 +119, -48.54, 264.19, 0.00 +120, -48.03, 288.01, 0.00 +121, -47.18, 312.25, 0.00 +122, -45.73, 334.99, 0.00 +123, -43.96, 357.74, 0.00 +124, -41.77, 379.29, 0.00 +125, -39.34, 400.82, 0.00 +126, -36.68, 422.40, 0.00 +127, -33.75, 443.26, 0.00 +128, -30.64, 464.03, 0.00 +129, -27.30, 483.59, 0.00 +130, -23.83, 503.39, 0.00 +131, -20.19, 522.07, 0.00 +132, -16.46, 540.78, 0.00 +133, -12.62, 558.35, 0.00 +134, -8.71, 575.65, 0.00 +135, -4.74, 591.58, 0.00 +136, -0.75, 607.73, 0.00 +137, 3.26, 622.30, 0.00 +138, 7.25, 636.34, 0.00 +139, 11.22, 649.44, 0.00 +140, 15.14, 662.10, 0.00 +141, 18.99, 673.05, 0.00 +142, 22.76, 683.64, 0.00 +143, 26.45, 693.25, 0.00 +144, 30.01, 701.79, 0.00 +145, 33.44, 708.94, 0.00 +146, 36.75, 715.33, 0.00 +147, 39.92, 720.85, 0.00 +148, 42.91, 725.05, 0.00 +149, 45.76, 728.29, 0.00 +150, 48.36, 729.34, 0.00 +151, 50.65, 727.41, 0.00 +152, 53.13, 729.86, 0.00 +153, 53.65, 707.51, 0.00 +154, 41.35, 525.16, 0.00 +155, -10.50, -128.78, 0.00 +156, -10.40, -123.56, 0.00 +157, -0.38, -4.42, 0.00 +158, 0.07, 0.74, 0.00 +159, -0.56, -6.11, 0.00 +160, -0.06, -0.63, 0.00 +161, 0.35, 3.66, 0.00 +162, 0.54, 5.47, 0.00 +163, 0.57, 5.63, 0.00 +164, 0.50, 4.88, 0.00 +165, 0.34, 3.29, 0.00 +166, 0.13, 1.18, 0.00 +167, -0.18, -1.65, 0.00 +168, -0.56, -5.04, 0.00 +169, -1.04, -9.24, 0.00 +170, -1.56, -13.68, 0.00 +171, -2.17, -18.73, 0.00 +172, -2.78, -23.65, 0.00 +173, -3.45, -28.94, 0.00 +174, -4.09, -33.84, 0.00 +175, -4.78, -39.02, 0.00 +176, -5.44, -43.83, 0.00 +177, -6.12, -48.67, 0.00 +178, -6.74, -52.99, 0.00 +179, -7.38, -57.30, 0.00 +180, -7.94, -61.00, 0.00 +181, -8.47, -64.36, 0.00 +182, -8.92, -67.13, 0.00 +183, -9.27, -69.09, 0.00 +184, -9.56, -70.59, 0.00 +185, -9.71, -71.08, 0.00 +186, -9.80, -71.10, 0.00 +187, -9.76, -70.26, 0.00 +188, -9.64, -68.96, 0.00 +189, -9.45, -67.16, 0.00 +190, -9.17, -64.76, 0.00 +191, -8.82, -61.96, 0.00 +192, -8.34, -58.34, 0.00 +193, -7.78, -54.14, 0.00 +194, -7.08, -49.13, 0.00 +195, -6.24, -43.17, 0.00 +196, -5.26, -36.30, 0.00 +197, -4.14, -28.53, 0.00 +198, -2.87, -19.79, 0.00 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index c34fe6f47225..7d42cf06fab1 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -103,7 +103,7 @@ def main(): naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 20 - naca0012.test_vals = [-4.032065, -3.525196, 0.273051, 0.009680] + naca0012.test_vals = [-4.031446, -3.524530, 0.273056, 0.009703] test_list.append(naca0012) # NACA0012 - FMG test @@ -111,7 +111,7 @@ def main(): naca0012_FMG.cfg_dir = "euler/naca0012" naca0012_FMG.cfg_file = "inv_NACA0012.cfg" naca0012_FMG.test_iter = 20 - naca0012_FMG.test_vals = [-4.160277, -3.553897, 0.296156, 0.016889] + naca0012_FMG.test_vals = [-4.160287, -3.553906, 0.296154, 0.016890] test_list.append(naca0012_FMG) # Supersonic wedge @@ -119,7 +119,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-4.399745, 1.331048, -0.249527, 0.043953] + wedge.test_vals = [-4.359580, 1.370530, -0.249526, 0.043953] test_list.append(wedge) # ONERA M6 Wing @@ -127,7 +127,7 @@ def main(): oneram6.cfg_dir = "euler/oneram6" oneram6.cfg_file = "inv_ONERAM6.cfg" oneram6.test_iter = 10 - oneram6.test_vals = [-4.825465, -4.205219, 0.277033, 0.006614] + oneram6.test_vals = [-4.825509, -4.205271, 0.277086, 0.006619] oneram6.timeout = 9600 test_list.append(oneram6) @@ -145,7 +145,7 @@ def main(): polar_naca0012.cfg_file = "inv_NACA0012.cfg" polar_naca0012.polar = True polar_naca0012.test_iter = 10 - polar_naca0012.test_vals = [-1.311660, 4.165589, 0.000067, 0.113157] + polar_naca0012.test_vals = [-1.311796, 4.165508, 0.000092, 0.113306] polar_naca0012.test_vals_aarch64 = [-1.063447, 4.401847, 0.000291, 0.031696] polar_naca0012.command = TestCase.Command(exec = "compute_polar.py", param = "-n 1 -i 11") # flaky test on arm64 @@ -157,7 +157,7 @@ def main(): bluntbody.cfg_dir = "euler/bluntbody" bluntbody.cfg_file = "blunt.cfg" bluntbody.test_iter = 20 - bluntbody.test_vals = [0.666162, 7.055023, -0.000093, 3.916825] + bluntbody.test_vals = [0.565185, 6.945875, 0.000007, 1.970309] test_list.append(bluntbody) ########################## @@ -184,7 +184,7 @@ def main(): cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 - cylinder.test_vals = [-8.725123, -3.234819, -0.028022, 1.605527, 0.000000] + cylinder.test_vals = [-8.725171, -3.234867, -0.028017, 1.605526, 0.000000] test_list.append(cylinder) # Laminar cylinder (low Mach correction) @@ -228,7 +228,7 @@ def main(): rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 20 - rae2822_sa.test_vals = [-3.131221, -5.161756, 0.778275, 0.019566, 1000.000000] + rae2822_sa.test_vals = [-3.056253, -5.155475, 0.783190, 0.020552, 1000.000000] test_list.append(rae2822_sa) # RAE2822 SST @@ -236,7 +236,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.745363, -1.484660, 5.883796, 0.579910, 0.017299, 100.000000] + rae2822_sst.test_vals = [-1.916371, -1.461911, 5.894621, 0.611793, 0.016873, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -244,7 +244,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.464319, 5.852571, 0.490309, 0.042521] + rae2822_sst_sust.test_vals = [-2.464309, 5.852571, 0.490309, 0.042519] test_list.append(rae2822_sst_sust) # Flat plate @@ -284,7 +284,7 @@ def main(): turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 - turb_oneram6.test_vals = [-2.418713, -6.631577, 0.238587, 0.159599, 0.000000] + turb_oneram6.test_vals = [-2.419977, -6.631993, 0.238577, 0.159694, 0.000000] turb_oneram6.timeout = 3200 test_list.append(turb_oneram6) @@ -367,7 +367,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-2.662936, 2.911899, -2.338516, 2.161131, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.135350, 0.436347, -2.878865, 1.663300, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143715, -9.170705, -10.848554, -5.776746, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -377,7 +377,7 @@ def main(): axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_species.cfg_file = "air_nozzle_species.cfg" axi_rans_air_nozzle_species.test_iter = 10 - axi_rans_air_nozzle_species.test_vals = [-1.676190, 3.896581, -2.912396, 5.762790, -3.565909, 0.000000] + axi_rans_air_nozzle_species.test_vals = [-2.243181, 3.273075, -1.958732, 5.883857, -2.469621, 0.000000] axi_rans_air_nozzle_species.tol = 0.0001 test_list.append(axi_rans_air_nozzle_species) @@ -744,7 +744,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.981181, 1.343583, 0.597121, 0.017223] + turb_naca0012_1c.test_vals = [-4.981181, 1.343583, 0.597111, 0.017244] turb_naca0012_1c.test_vals_aarch64 = [-4.992791, 1.342873, 0.557941, 0.003269] test_list.append(turb_naca0012_1c) @@ -798,7 +798,7 @@ def main(): hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" hb_rans_preconditioning.cfg_file = "davis.cfg" hb_rans_preconditioning.test_iter = 25 - hb_rans_preconditioning.test_vals = [-1.905206, 0.481900, 0.599004, 3.605363, -5.945837] + hb_rans_preconditioning.test_vals = [-1.905509, 0.482119, 0.598486, 3.605121, -5.946067] test_list.append(hb_rans_preconditioning) ###################################### @@ -810,7 +810,7 @@ def main(): rot_naca0012.cfg_dir = "rotating/naca0012" rot_naca0012.cfg_file = "rot_NACA0012.cfg" rot_naca0012.test_iter = 25 - rot_naca0012.test_vals = [-1.242808, 4.266616, -0.022207, 0.084206, 2.000000, -1.252601] + rot_naca0012.test_vals = [-1.240352, 4.268727, -0.022164, 0.083891, 2.000000, -1.253214] test_list.append(rot_naca0012) # Lid-driven cavity @@ -928,7 +928,7 @@ def main(): edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 20 - edge_VW.test_vals = [-8.395792, -2.198370, -0.000009, 0.000000] + edge_VW.test_vals = [-8.901513, -2.707051, -0.000009, 0.000000] test_list.append(edge_VW) # Rarefaction shock wave edge_PPR @@ -936,7 +936,7 @@ def main(): edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 20 - edge_PPR.test_vals = [-12.584167, -6.372084, -0.000034, 0.000000] + edge_PPR.test_vals = [-12.051551, -5.877885, -0.000034, 0.000000] test_list.append(edge_PPR) @@ -966,7 +966,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [1.167512, 1.598496, -2.928579, 2.573642, -2.527392, 3.016170, 106370.000000, 106370.000000, 5.726800, 64.383000] + axial_stage2D.test_vals = [1.167521, 1.598536, -2.928575, 2.573646, -2.527330, 3.016253, 106370.000000, 106370.000000, 5.726800, 64.383000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -1025,7 +1025,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.466202, 0.350093, 0.399014] + channel_2D.test_vals = [2.000000, 0.000000, 0.466389, 0.346857, 0.397472] channel_2D.timeout = 100 channel_2D.unsteady = True channel_2D.multizone = True @@ -1036,7 +1036,7 @@ def main(): channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_WA.cfg" channel_3D.test_iter = 1 - channel_3D.test_vals = [1.000000, 0.000000, 0.617237, 0.798808, 0.692608] + channel_3D.test_vals = [1.000000, 0.000000, 0.620573, 0.810294, 0.718984] channel_3D.test_vals_aarch64 = [1.000000, 0.000000, 0.611996, 0.798988, 0.702357] channel_3D.unsteady = True channel_3D.multizone = True @@ -1048,7 +1048,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.568972, 0.692858, 0.989456, 1.048237] + pipe.test_vals = [0.528897, 0.684175, 0.970353, 1.065262] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -1058,7 +1058,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.664822, 1.125812, 1.117605] + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686432, 1.159461, 1.151134] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -1068,7 +1068,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 0.899641, 1.076189] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.126036, 1.081775] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -1632,7 +1632,7 @@ def main(): pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 20 - pywrapper_naca0012.test_vals = [-4.032065, -3.525196, 0.273051, 0.009680] + pywrapper_naca0012.test_vals = [-4.031446, -3.524530, 0.273056, 0.009703] pywrapper_naca0012.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 8a0277294406..288f8a47efd3 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -188,7 +188,7 @@ def main(): discadj_sliding_interface.cfg_dir = "disc_adj_ffi/sliding_interface" discadj_sliding_interface.cfg_file = "circles.cfg" discadj_sliding_interface.test_iter = 10 - discadj_sliding_interface.test_vals = [10.000000, -4.395143, -4.419431] + discadj_sliding_interface.test_vals = [10.000000, -4.403519, -4.419431] test_list.append(discadj_sliding_interface) ####################################################### diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index d59aad17bf96..f2e16e6a3dbb 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -187,7 +187,7 @@ def main(): tutorial_inv_bump.cfg_dir = "../Tutorials/compressible_flow/Inviscid_Bump" tutorial_inv_bump.cfg_file = "inv_channel.cfg" tutorial_inv_bump.test_iter = 0 - tutorial_inv_bump.test_vals = [-1.437425, 4.075857, 0.086038, 0.127546] + tutorial_inv_bump.test_vals = [-1.437425, 4.075857, 0.085674, 0.123798] test_list.append(tutorial_inv_bump) # Inviscid Wedge @@ -195,7 +195,7 @@ def main(): tutorial_inv_wedge.cfg_dir = "../Tutorials/compressible_flow/Inviscid_Wedge" tutorial_inv_wedge.cfg_file = "inv_wedge_HLLC.cfg" tutorial_inv_wedge.test_iter = 0 - tutorial_inv_wedge.test_vals = [-0.481460, 5.253008, -0.215274, 0.037861] + tutorial_inv_wedge.test_vals = [-0.481460, 5.253008, -0.191841, 0.033699] tutorial_inv_wedge.no_restart = True test_list.append(tutorial_inv_wedge) @@ -204,7 +204,7 @@ def main(): tutorial_inv_onera.cfg_dir = "../Tutorials/compressible_flow/Inviscid_ONERAM6" tutorial_inv_onera.cfg_file = "inv_ONERAM6.cfg" tutorial_inv_onera.test_iter = 0 - tutorial_inv_onera.test_vals = [-5.204928, -4.597762, 0.256743, 0.113097] + tutorial_inv_onera.test_vals = [-5.204928, -4.597762, 0.243530, 0.111160] tutorial_inv_onera.no_restart = True test_list.append(tutorial_inv_onera) @@ -213,7 +213,7 @@ def main(): tutorial_lam_cylinder.cfg_dir = "../Tutorials/compressible_flow/Laminar_Cylinder" tutorial_lam_cylinder.cfg_file = "lam_cylinder.cfg" tutorial_lam_cylinder.test_iter = 0 - tutorial_lam_cylinder.test_vals = [-6.162141, -0.699617, -0.080518, 43.028531] + tutorial_lam_cylinder.test_vals = [-6.162141, -0.699617, -0.080602, 42.990503] tutorial_lam_cylinder.no_restart = True test_list.append(tutorial_lam_cylinder) @@ -287,7 +287,7 @@ def main(): tutorial_turb_oneram6.cfg_dir = "../Tutorials/compressible_flow/Turbulent_ONERAM6" tutorial_turb_oneram6.cfg_file = "turb_ONERAM6.cfg" tutorial_turb_oneram6.test_iter = 0 - tutorial_turb_oneram6.test_vals = [-4.564441, -11.537596, 0.293674, 0.087628] + tutorial_turb_oneram6.test_vals = [-4.564441, -11.534937, 0.250153, 0.080951] test_list.append(tutorial_turb_oneram6) # NICFD Nozzle @@ -295,7 +295,7 @@ def main(): tutorial_nicfd_nozzle.cfg_dir = "../Tutorials/compressible_flow/NICFD_nozzle" tutorial_nicfd_nozzle.cfg_file = "NICFD_nozzle.cfg" tutorial_nicfd_nozzle.test_iter = 20 - tutorial_nicfd_nozzle.test_vals = [-1.800072, -6.002691, 4.635204, 0.000000, 0.000000] + tutorial_nicfd_nozzle.test_vals = [-1.799851, -6.002738, 4.635397, 0.000000, 0.000000] tutorial_nicfd_nozzle.no_restart = True test_list.append(tutorial_nicfd_nozzle) @@ -314,7 +314,7 @@ def main(): tutorial_unst_naca0012.cfg_dir = "../Tutorials/compressible_flow/Unsteady_NACA0012" tutorial_unst_naca0012.cfg_file = "unsteady_naca0012.cfg" tutorial_unst_naca0012.test_iter = 520 - tutorial_unst_naca0012.test_vals = [520.000000, 0.000000, -5.292139, 0.000000, 0.306930, 0.787006, 0.001794, 0.011018] + tutorial_unst_naca0012.test_vals = [520.000000, 0.000000, -5.292186, 0.000000, 0.304255, 0.792893, 0.001907, 0.010888] tutorial_unst_naca0012.test_vals_aarch64 = [520, 0, -5.292359, 0, 0.284720, 0.766329, 0.000954, 0.007565] tutorial_unst_naca0012.unsteady = True test_list.append(tutorial_unst_naca0012) @@ -324,7 +324,7 @@ def main(): propeller_var_load.cfg_dir = "../Tutorials/compressible_flow/ActuatorDisk_VariableLoad" propeller_var_load.cfg_file = "propeller_variable_load.cfg" propeller_var_load.test_iter = 20 - propeller_var_load.test_vals = [-1.831126, -4.534989, -0.000323, 0.171579] + propeller_var_load.test_vals = [-1.831998, -4.534991, -0.000323, 0.171494] propeller_var_load.timeout = 3200 test_list.append(propeller_var_load) @@ -335,7 +335,7 @@ def main(): tutorial_design_inv_naca0012.cfg_dir = "../Tutorials/design/Inviscid_2D_Unconstrained_NACA0012" tutorial_design_inv_naca0012.cfg_file = "inv_NACA0012_basic.cfg" tutorial_design_inv_naca0012.test_iter = 0 - tutorial_design_inv_naca0012.test_vals = [-3.585391, -2.989014, 0.146155, 0.179374] + tutorial_design_inv_naca0012.test_vals = [-3.585391, -2.989014, 0.141838, 0.172252] tutorial_design_inv_naca0012.no_restart = True test_list.append(tutorial_design_inv_naca0012) @@ -344,7 +344,7 @@ def main(): tutorial_design_turb_rae2822.cfg_dir = "../Tutorials/design/Turbulent_2D_Constrained_RAE2822" tutorial_design_turb_rae2822.cfg_file = "turb_SA_RAE2822.cfg" tutorial_design_turb_rae2822.test_iter = 0 - tutorial_design_turb_rae2822.test_vals = [-1.700114, -4.941829, 0.205309, 0.184990] + tutorial_design_turb_rae2822.test_vals = [-1.700114, -4.941830, 0.161066, 0.170510] tutorial_design_turb_rae2822.no_restart = True test_list.append(tutorial_design_turb_rae2822) diff --git a/TestCases/vandv.py b/TestCases/vandv.py index 516f51cc5ebd..aa9fb4398d52 100644 --- a/TestCases/vandv.py +++ b/TestCases/vandv.py @@ -81,7 +81,7 @@ def main(): swbli_sa.cfg_dir = "vandv/rans/swbli" swbli_sa.cfg_file = "config_sa.cfg" swbli_sa.test_iter = 5 - swbli_sa.test_vals = [-11.502718, -10.939184, -12.034284, -10.581169, -16.088844, 0.002242, -1.664946, 1.258100] + swbli_sa.test_vals = [-11.504424, -10.941741, -12.049925, -10.586263, -16.090385, 0.002242, -1.614365, 1.340100] swbli_sa.test_vals_aarch64 = [-11.504424, -10.941741, -12.049925, -10.586263, -16.090385, 0.002242, -1.614365, 1.340100] test_list.append(swbli_sa) @@ -91,7 +91,7 @@ def main(): swbli_sst.cfg_dir = "vandv/rans/swbli" swbli_sst.cfg_file = "config_sst.cfg" swbli_sst.test_iter = 5 - swbli_sst.test_vals = [-11.319578, -10.641523, -11.224600, -10.150215, -11.407538, -2.637660, 0.001816, -1.839484, -3.514593, 11.136000] + swbli_sst.test_vals = [-11.569218, -10.909086, -11.607984, -10.431163, -11.407588, -2.637660, 0.001816, -1.305818, -3.514590, 13.399000] test_list.append(swbli_sst) # DSMA661 - SA From d875b761191b1d3193b163fbdcaa0851c851cf10 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 30 Sep 2026 16:36:25 +0200 Subject: [PATCH 20/43] Update the reference files of the gradient regression tests from CI Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- .../cont_adj_euler/naca0012/of_grad_directdiff.dat.ref | 6 +++--- TestCases/multiple_ffd/naca0012/of_grad_cd.dat.ref | 4 ++-- TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref b/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref index c87c1c9a2a49..2e6cd4903a0d 100644 --- a/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref +++ b/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref @@ -1,4 +1,4 @@ VARIABLES="VARIABLE" , "DRAG" , "EFFICIENCY" , "FORCE_X" , "FORCE_Y" , "FORCE_Z" , "LIFT" , "MOMENT_X" , "MOMENT_Y" , "MOMENT_Z" , "SIDEFORCE" - 0 , -0.4704786435 , -33.40446141 , -0.3888715474 , -3.745132593 , 0.0 , -3.735758164 , 0.0 , 0.0 , 0.4834798526 , 0.0 - 1 , 0.412031843 , -39.78218403 , 0.4880368175 , -3.47876392 , 0.0 , -3.488582535 , 0.0 , 0.0 , 0.2021305183 , 0.0 - 2 , 0.8908446367 , -37.475187 , 0.9514902759 , -2.769632304 , 0.0 , -2.789729858 , 0.0 , 0.0 , -0.1182204408 , 0.0 + 0 , -0.4834688689 , -33.38043366 , -0.4014654728 , -3.763436475 , 0.0 , -3.753782956 , 0.0 , 0.0 , 0.4865376034 , 0.0 + 1 , 0.4087842111 , -39.69099805 , 0.4848740806 , -3.482690031 , 0.0 , -3.492438718 , 0.0 , 0.0 , 0.2039858924 , 0.0 + 2 , 0.8921290437 , -37.32658951 , 0.9526325615 , -2.763104959 , 0.0 , -2.783228985 , 0.0 , 0.0 , -0.117214663 , 0.0 diff --git a/TestCases/multiple_ffd/naca0012/of_grad_cd.dat.ref b/TestCases/multiple_ffd/naca0012/of_grad_cd.dat.ref index 2f2e345e4221..e98387350993 100644 --- a/TestCases/multiple_ffd/naca0012/of_grad_cd.dat.ref +++ b/TestCases/multiple_ffd/naca0012/of_grad_cd.dat.ref @@ -1,3 +1,3 @@ VARIABLES="VARIABLE" , "GRADIENT" , "FINDIFF_STEP" - 0 , 0.0440381 , 0.001 - 1 , -0.0848429 , 0.001 + 0 , 0.0439624 , 0.001 + 1 , -0.0848386 , 0.001 diff --git a/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref b/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref index ef3b2d9f463a..dfad81314570 100644 --- a/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref +++ b/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref @@ -1,3 +1,3 @@ VARIABLES="VARIABLE" , "DRAG" , "EFFICIENCY" , "FORCE_X" , "FORCE_Y" , "FORCE_Z" , "LIFT" , "MOMENT_X" , "MOMENT_Y" , "MOMENT_Z" , "SIDEFORCE" - 0 , 0.04790586765 , -0.4797536912 , 0.04825151062 , -0.01531800012 , 0.0 , -0.01636695601 , 0.0 , 0.0 , 0.03036927931 , 0.0 - 1 , -0.09320474204 , 0.3762440542 , -0.0926027588 , -0.02860524743 , 0.0 , -0.02657832162 , 0.0 , 0.0 , 0.06626460628 , 0.0 + 0 , 0.04764411115 , -0.463384101 , 0.04796070834 , -0.01398970686 , 0.0 , -0.01503263502 , 0.0 , 0.0 , 0.03019600866 , 0.0 + 1 , -0.09347608871 , 0.3646170468 , -0.0928475452 , -0.02982544755 , 0.0 , -0.02779289138 , 0.0 , 0.0 , 0.06643204278 , 0.0 From 2d0857d78bc72fc12ca715149a2c66ffc3159ff5 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 11:17:41 +0200 Subject: [PATCH 21/43] Apply under-relaxation review style suggestions --- SU2_CFD/src/solvers/CEulerSolver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 8259e1630520..2e6c92785888 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2552,9 +2552,9 @@ void CEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config) { su2double e_old = nodes->GetSolution(iPoint, nVar - 1); su2double e_new = e_old + LinSysSol(iPoint, nVar - 1); /*--- rho*e = rho*E - |rho*u|^2 / (2*rho), with the old and the proposed new density. ---*/ - const su2double rho_old = max(nodes->GetSolution(iPoint, 0), EPS); - const su2double rho_new = max(rho_old + LinSysSol(iPoint, 0), EPS); - for (unsigned short jVar = 1; jVar <= nDim; jVar++) { + const auto rho_old = max(nodes->GetSolution(iPoint, 0), EPS); + const auto rho_new = max(rho_old + LinSysSol(iPoint, 0), EPS); + for (auto jVar = 1u; jVar <= nDim; jVar++) { e_old -= 0.5 * pow(nodes->GetSolution(iPoint, jVar), 2) / rho_old; e_new -= 0.5 * pow(nodes->GetSolution(iPoint, jVar) + LinSysSol(iPoint, jVar), 2) / rho_new; } From 4960dd03be7ea4ea1a621a100319c67486ae209b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 14:48:57 +0200 Subject: [PATCH 22/43] Fix HLLC supersonic Jacobians for reconstructed face enthalpy Reuse the enthalpy-based flux Jacobian helper in both ideal-gas supersonic branches. Check independently reconstructed face pressure and enthalpy in both Jacobian modes, 2D/3D, and on fixed/moving faces. Remove the general robustness claim from the code comments. --- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 12 ++-- .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 63 +++++++++++++++++++ 2 files changed, 69 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 18b210e72381..2e315d6a1d91 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -292,8 +292,7 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198): in our tests it was more robust with inexact linear solves than the exact - derivative, which USE_ACCURATE_FLUX_JACOBIANS= YES gives. ---*/ + of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; @@ -310,7 +309,8 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) for (jVar = 0; jVar < nVar; jVar++) Jacobian_j[iVar][jVar] = 0; - GetInviscidProjJac(Velocity_i, &Energy_i, UnitNormal, 1.0, Jacobian_i); + const su2double chi = 0.0; + GetInviscidProjJac(Velocity_i, &Enthalpy_i, &chi, &Gamma_Minus_One, UnitNormal, 1.0, Jacobian_i); } else { @@ -445,7 +445,8 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0; - GetInviscidProjJac(Velocity_j, &Energy_j, UnitNormal, 1.0, Jacobian_j); + const su2double chi = 0.0; + GetInviscidProjJac(Velocity_j, &Enthalpy_j, &chi, &Gamma_Minus_One, UnitNormal, 1.0, Jacobian_j); } else { @@ -836,8 +837,7 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198): in our tests it was more robust with inexact linear solves than the exact - derivative, which USE_ACCURATE_FLUX_JACOBIANS= YES gives. ---*/ + of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index 0a14682612ed..b03edb3f1414 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -218,3 +218,66 @@ TEST_CASE("HLLC Jacobians match finite differences", "[HLLC]") { } } } + +TEST_CASE("HLLC supersonic Jacobian uses reconstructed face enthalpy", "[HLLC-face]") { + for (unsigned short nDim : {2, 3}) { + for (bool moving : {false, true}) { + for (const bool accurate : {false, true}) { + for (su2double direction : {-1.0, 1.0}) { + auto config = MakeConfig(moving, accurate); + CUpwHLLC_Flow numerics(nDim, nDim + 2, config.get()); + const su2double n2[3] = {0.8, 0.6, 0.0}, n3[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; + const auto* normal = nDim == 2 ? n2 : n3; + su2double velocity[3] = {}, gridVelocity[3] = {}; + for (auto dim = 0u; dim < nDim; ++dim) { + velocity[dim] = direction * 2.5 * normal[dim]; + gridVelocity[dim] = moving ? 0.3 * normal[dim] : 0.0; + } + numerics.SetNormal(normal); + numerics.SetGridVel(gridVelocity, gridVelocity); + numerics.SetFixedWaveSpeeds(true, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); + const State state = Conservative(nDim, 1.2, velocity, 1.1, 0.0); + for (su2double pressureOffset : {0.0, 0.1}) { + auto evaluate = [&](const State& Ui, const State& Uj) { + su2double Vi[20] = {}, Vj[20] = {}, Si[2], Sj[2]; + Primitives(nDim, Ui, 0.0, Vi, Si); + Primitives(nDim, Uj, 0.0, Vj, Sj); + // A fixed pressure offset models independently reconstructed p and h. + Vi[nDim + 1] += pressureOffset; + Vj[nDim + 1] += pressureOffset; + Vi[nDim + 3] += pressureOffset / Ui[0]; + Vj[nDim + 3] += pressureOffset / Uj[0]; + numerics.SetPrimitive(Vi, Vj); + numerics.SetTurbKineticEnergy(0.0, 0.0); + const auto residual = numerics.ComputeResidual(config.get()); + Result result{}; + for (auto i = 0u; i < nDim + 2; ++i) { + result.flux[i] = residual.residual[i]; + for (auto j = 0u; j < nDim + 2; ++j) { + result.jac_i[i][j] = residual.jacobian_i[i][j]; + result.jac_j[i][j] = residual.jacobian_j[i][j]; + } + } + return result; + }; + CAPTURE(nDim, moving, accurate, direction, pressureOffset); + const auto reference = evaluate(state, state); + for (auto column = 0u; column < nDim + 2; ++column) { + State plus = state, minus = state; + const su2double step = 1e-6; + plus[column] += step; + minus[column] -= step; + const auto fp = direction > 0 ? evaluate(plus, state) : evaluate(state, plus); + const auto fm = direction > 0 ? evaluate(minus, state) : evaluate(state, minus); + for (auto row = 0u; row < nDim + 2; ++row) { + const su2double fd = (fp.flux[row] - fm.flux[row]) / (2 * step); + const su2double jac = direction > 0 ? reference.jac_i[row][column] : reference.jac_j[row][column]; + CHECK(jac == Approx(fd).margin(1e-6)); + } + } + } + } + } + } + } +} From e0d3ee8d72598767227e62a9be5834a4554532b6 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 21:19:39 +0200 Subject: [PATCH 23/43] Correct compressible moving-wall projection and multigrid coupling --- .../include/solvers/CFVMFlowSolverBase.inl | 45 ++++- .../SU2_CFD/solvers/moving_wall_tests.cpp | 182 ++++++++++++++++++ UnitTests/meson.build | 1 + 3 files changed, 218 insertions(+), 10 deletions(-) create mode 100644 UnitTests/SU2_CFD/solvers/moving_wall_tests.cpp diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index cb44757c6280..650b26b91e7f 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1155,6 +1155,7 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve const bool ideal_gas = (config->GetKind_FluidModel() == STANDARD_AIR) || (config->GetKind_FluidModel() == IDEAL_GAS); const auto iVel = prim_idx.Velocity(); + const bool compressibleProjection = FlowRegime == ENUM_REGIME::COMPRESSIBLE && iVel == 1 && nVar == nDim + 2; /*--- Blazek chapter 8.: * The components of the momentum residual normal to the symmetry plane are zeroed out. @@ -1184,8 +1185,8 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve for (auto iDim = 0u; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim] / Area; } - /*--- Energy terms due to grid movement (aka work of pressure forces). ---*/ - if (dynamic_grid) { + /*--- The classical compressible projection below already supplies wall pressure work. ---*/ + if (dynamic_grid && !compressibleProjection) { su2double* V_reflected = GetCharacPrimVar(val_marker, iVertex); conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), @@ -1217,8 +1218,7 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve /*--- Compute the residual using an upwind scheme. ---*/ auto residual = conv_numerics->ComputeResidual(config); - /*--- Use just the energy fluxes to update the residual, adding the others would - * increase numerical diffusion which we wish to avoid if possible. ---*/ + /*--- Energy fluxes for the other conservative layouts. ---*/ for (auto iVar = iVel + nDim; iVar < nVar; iVar++) { LinSysRes(iPoint, iVar) += residual.residual[iVar]; } @@ -1243,14 +1243,16 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve su2double* solutionOld = nodes->GetSolution_Old(iPoint); su2double gridVel[MAXNDIM] = {}; + su2double gridNormalVel = 0.0; if (dynamic_grid) { for (auto iDim = 0u; iDim < nDim; iDim++) { gridVel[iDim] = geometry->nodes->GetGridVel(iPoint)[iDim]; } + gridNormalVel = GeometryToolbox::DotProduct(nDim, gridVel, UnitNormal); if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) { for(auto iDim = 0u; iDim < nDim; iDim++) { /*--- Multiply by density since we are correcting conservative variables. ---*/ - gridVel[iDim] *= nodes->GetDensity(iPoint); + gridVel[iDim] *= compressibleProjection ? solutionOld[0] : nodes->GetDensity(iPoint); } } } @@ -1261,20 +1263,27 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve for (auto iDim = 0u; iDim < nDim; iDim++) { solutionOld[iVel + iDim] -= vp * UnitNormal[iDim]; } + if (compressibleProjection) { + solutionOld[iVel + nDim] -= gridNormalVel * vp; + } /*--- Keep only the tangential part of the momentum residuals. ---*/ su2double normalRes = 0.0; for (auto iDim = 0u; iDim < nDim; iDim++) { normalRes += LinSysRes(iPoint, iVel + iDim) * UnitNormal[iDim]; } + if (compressibleProjection) { + /*--- Project in the wall frame: normal momentum follows density, with consistent pressure work. ---*/ + normalRes -= gridNormalVel * LinSysRes(iPoint, 0); + LinSysRes(iPoint, iVel + nDim) -= gridNormalVel * normalRes; + } for (auto iDim = 0u; iDim < nDim; iDim++) { LinSysRes(iPoint, iVel + iDim) -= normalRes * UnitNormal[iDim]; } /*--- Jacobian contribution for implicit integration. ---*/ if (implicit) { - /*--- Modify the Jacobians according to the modification of the residual - * J_new = (I - n * n^T) * J where n = {0, nx, ny, nz, 0, ...} ---*/ + /*--- Apply the same wall-frame projection to the Jacobians. ---*/ su2double mat[MAXNVAR * MAXNVAR] = {}; for (auto iVar = 0u; iVar < nVar; iVar++) @@ -1282,6 +1291,13 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve for (auto iDim = 0u; iDim < nDim; iDim++) for (auto jDim = 0u; jDim < nDim; jDim++) mat[(iDim + iVel) * nVar + jDim + iVel] -= UnitNormal[iDim] * UnitNormal[jDim]; + if (compressibleProjection) { + for (auto iDim = 0u; iDim < nDim; iDim++) { + mat[(iDim + iVel) * nVar] += gridNormalVel * UnitNormal[iDim]; + mat[(iVel + nDim) * nVar + iVel + iDim] -= gridNormalVel * UnitNormal[iDim]; + } + mat[(iVel + nDim) * nVar] += gridNormalVel * gridNormalVel; + } auto ModifyJacobian = [&](const unsigned long jPoint) { su2double jac[MAXNVAR * MAXNVAR], newJac[MAXNVAR * MAXNVAR]; @@ -1306,6 +1322,10 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolve for (auto iDim = 0u; iDim < nDim; iDim++) { normalRes += Res_TruncError[iVel + iDim] * UnitNormal[iDim]; } + if (compressibleProjection) { + normalRes -= gridNormalVel * Res_TruncError[0]; + Res_TruncError[iVel + nDim] -= gridNormalVel * normalRes; + } for (auto iDim = 0u; iDim < nDim; iDim++) { Res_TruncError[iVel + iDim] -= normalRes * UnitNormal[iDim]; } @@ -2974,6 +2994,7 @@ void CFVMFlowSolverBase::MultigridProjectEulerWall(CGeometry* geo bool use_solution_old) { const auto iVel = prim_idx.Velocity(); const auto nDim = geometry->GetnDim(); + const bool compressibleProjection = FlowRegime == ENUM_REGIME::COMPRESSIBLE && iVel == 1 && nVar == nDim + 2; for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) != EULER_WALL) continue; @@ -3004,12 +3025,15 @@ void CFVMFlowSolverBase::MultigridProjectEulerWall(CGeometry* geo * For dynamic grids subtract the grid velocity to enforce (v - v_grid).n = 0, * multiplying by density for compressible flow (conservative variables). ---*/ su2double gridVel[MAXNDIM] = {}; - if (dynamic_grid && !use_solution_old) { + su2double gridNormalVel = 0.0; + if (dynamic_grid && (compressibleProjection || !use_solution_old)) { for (auto iDim = 0u; iDim < nDim; iDim++) gridVel[iDim] = geometry->nodes->GetGridVel(iPoint)[iDim]; + gridNormalVel = GeometryToolbox::DotProduct(nDim, gridVel, UnitNormal); if constexpr (FlowRegime == ENUM_REGIME::COMPRESSIBLE) { - for (auto iDim = 0u; iDim < nDim; iDim++) - gridVel[iDim] *= nodes->GetDensity(iPoint); + /*--- Corrections carry their own density increment, rather than the current solution density. ---*/ + const auto density = compressibleProjection ? sol[0] : nodes->GetDensity(iPoint); + for (auto iDim = 0u; iDim < nDim; iDim++) gridVel[iDim] *= density; } } @@ -3019,6 +3043,7 @@ void CFVMFlowSolverBase::MultigridProjectEulerWall(CGeometry* geo /*--- Project to tangent plane. ---*/ for (auto iDim = 0u; iDim < nDim; iDim++) sol[iVel + iDim] -= momentum_n * UnitNormal[iDim]; + if (compressibleProjection) sol[iVel + nDim] -= gridNormalVel * momentum_n; } END_SU2_OMP_FOR } diff --git a/UnitTests/SU2_CFD/solvers/moving_wall_tests.cpp b/UnitTests/SU2_CFD/solvers/moving_wall_tests.cpp new file mode 100644 index 000000000000..1baf0c271428 --- /dev/null +++ b/UnitTests/SU2_CFD/solvers/moving_wall_tests.cpp @@ -0,0 +1,182 @@ +/*! + * \file moving_wall_tests.cpp + * \brief Regression for compressible wall projection in fixed and uniformly translating frames. + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include +#include +#include "../../UnitQuadTestCase.hpp" +#include "../../../SU2_CFD/include/numerics/flow/convection/hllc.hpp" +#include "../../../SU2_CFD/include/fluid/CPengRobinson.hpp" + +TEST_CASE("Compressible wall projection commutes with a Galilean boost", "[HLLC-wall]") { + for (const auto nDim : {2u, 3u}) { + for (const bool realGas : {false, true}) { + UnitQuadTestCase fixed, moving; + const std::string markers = + nDim == 2 ? "(x_minus,x_plus,y_minus,y_plus)" : "(x_minus,x_plus,y_minus,y_plus,z_minus,z_plus)"; + const std::string options = "SOLVER= EULER\nMESH_FORMAT= " + std::string(nDim == 2 ? "RECTANGLE" : "BOX") + + "\nMESH_BOX_SIZE= 5,5,5\nREF_DIMENSIONALIZATION= DIMENSIONAL\n" + "MACH_NUMBER= 0.1\nFREESTREAM_OPTION= DENSITY_FS\nFREESTREAM_DENSITY= 230\n" + "FREESTREAM_PRESSURE= 1500112\nGAS_CONSTANT= 35.152\n" + "CONV_NUM_METHOD_FLOW= HLLC\nTIME_DISCRE_FLOW= EULER_IMPLICIT\n" + "GRID_MOVEMENT= STEADY_TRANSLATION\nTRANSLATION_RATE= 0,0,0\nMARKER_EULER= " + + markers + "\nMARKER_MONITORING= (x_minus)\n" + + (realGas ? "FLUID_MODEL= PR_GAS\nGAMMA_VALUE= 1.0125\nCRITICAL_PRESSURE= " + "1415200\nCRITICAL_TEMPERATURE= 564.1\nACENTRIC_FACTOR= 0.529\n" + : "FLUID_MODEL= IDEAL_GAS\nGAMMA_VALUE= 1.4\n"); + fixed.config_options = moving.config_options = options; + fixed.InitConfig(); + fixed.InitGeometry(); + fixed.InitSolver(); + moving.InitConfig(); + moving.InitGeometry(); + moving.InitSolver(); + const auto nVar = nDim + 2; + const su2double boost[3] = {20, -7, 3}; + const su2double velocity[3] = {11, 4, -2}; + su2double B[5][5] = {}, T[5][5] = {}, baseJac[5][5] = {}, boostedJac[5][5] = {}; + su2double c2 = 0; + for (auto i = 0u; i < nVar; ++i) { + B[i][i] = T[i][i] = 1; + for (auto j = 0u; j < nVar; ++j) baseJac[i][j] = 1 + i + 2 * j; + } + for (auto i = 0u; i < nDim; ++i) { + c2 += boost[i] * boost[i]; + B[i + 1][0] = boost[i]; + T[i + 1][0] = -boost[i]; + B[nVar - 1][i + 1] = boost[i]; + T[nVar - 1][i + 1] = -boost[i]; + } + B[nVar - 1][0] = T[nVar - 1][0] = 0.5 * c2; + for (auto i = 0u; i < nVar; ++i) + for (auto j = 0u; j < nVar; ++j) + for (auto k = 0u; k < nVar; ++k) + for (auto l = 0u; l < nVar; ++l) boostedJac[i][j] += B[i][k] * baseJac[k][l] * T[l][j]; + std::unique_ptr fluid = + realGas ? std::unique_ptr(new CPengRobinson(1.0125, 35.152, 1415200, 564.1, 0.529)) + : std::unique_ptr(new CIdealGas(1.4, 35.152)); + fluid->SetTDState_Prho(1500112, 230); + std::array baseState{}; + baseState[0] = 230; + su2double speed2 = 0; + for (auto i = 0u; i < nDim; ++i) { + baseState[i + 1] = 230 * velocity[i]; + speed2 += velocity[i] * velocity[i]; + } + baseState[nVar - 1] = 230 * (fluid->GetStaticEnergy() + 0.5 * speed2); + const su2double baseResidual[5] = {0.3, -0.5, 0.2, 0.7, -0.1}; + for (auto frame = 0u; frame < 2; ++frame) { + auto& test = frame ? moving : fixed; + auto* solver = test.solver[FLOW_SOL]; + auto* nodes = static_cast(solver->GetNodes()); + for (auto p = 0ul; p < test.geometry->GetnPoint(); ++p) { + su2double state[5] = {}, residual[5] = {}; + for (auto i = 0u; i < nVar; ++i) + for (auto j = 0u; j < nVar; ++j) { + state[i] += (frame ? B[i][j] : (i == j)) * baseState[j]; + residual[i] += (frame ? B[i][j] : (i == j)) * baseResidual[j]; + } + nodes->SetSolution(p, state); + nodes->SetSolution_Old(p, state); + REQUIRE(nodes->SetPrimVar(p, fluid.get())); + nodes->SetSecondaryVar(p, fluid.get()); + for (auto i = 0u; i < nDim; ++i) test.geometry->nodes->SetGridVel(p, i, frame ? boost[i] : 0); + for (auto i = 0u; i < nVar; ++i) { + solver->LinSysRes(p, i) = residual[i]; + nodes->GetResTruncError(p)[i] = residual[i]; + } + su2double block[25] = {}; + for (auto i = 0u; i < nVar; ++i) + for (auto j = 0u; j < nVar; ++j) block[i * nVar + j] = frame ? boostedJac[i][j] : baseJac[i][j]; + solver->Jacobian.SetBlock(p, p, block); + for (auto k = 0u; k < test.geometry->nodes->GetnPoint(p); ++k) + solver->Jacobian.SetBlock(p, test.geometry->nodes->GetPoint(p, k), block); + } + std::unique_ptr numerics = + realGas ? std::unique_ptr(new CUpwGeneralHLLC_Flow(nDim, nVar, test.config.get())) + : std::unique_ptr(new CUpwHLLC_Flow(nDim, nVar, test.config.get())); + for (auto marker = 0u; marker < test.config->GetnMarker_All(); ++marker) + if (test.config->GetMarker_All_TagBound(marker) == "x_minus") + solver->BC_Sym_Plane(test.geometry.get(), test.solver, numerics.get(), nullptr, test.config.get(), marker); + } + for (auto p = 0ul; p < fixed.geometry->GetnPoint(); ++p) { + auto* f = fixed.solver[FLOW_SOL]; + auto* m = moving.solver[FLOW_SOL]; + for (auto i = 0u; i < nVar; ++i) { + su2double state = 0, residual = 0, truncation = 0; + for (auto j = 0u; j < nVar; ++j) { + state += B[i][j] * f->GetNodes()->GetSolution_Old(p)[j]; + residual += B[i][j] * f->LinSysRes(p, j); + truncation += B[i][j] * f->GetNodes()->GetResTruncError(p)[j]; + } + CHECK(m->GetNodes()->GetSolution_Old(p)[i] == Approx(state).margin(1e-6)); + CHECK(m->LinSysRes(p, i) == Approx(residual).margin(1e-8)); + CHECK(m->GetNodes()->GetResTruncError(p)[i] == Approx(truncation).margin(1e-8)); + for (auto block = 0u; block <= fixed.geometry->nodes->GetnPoint(p); ++block) { + const auto neighbor = block ? fixed.geometry->nodes->GetPoint(p, block - 1) : p; + for (auto j = 0u; j < nVar; ++j) { + su2double expected = 0; + for (auto k = 0u; k < nVar; ++k) + for (auto l = 0u; l < nVar; ++l) + expected += B[i][k] * f->Jacobian.GetBlock(p, neighbor)[k * nVar + l] * T[l][j]; + CHECK(m->Jacobian.GetBlock(p, neighbor)[i * nVar + j] == Approx(expected).margin(1e-5)); + } + } + } + } + + for (const bool correction : {false, true}) { + const su2double delta[5] = {0.3, -0.5, 0.2, 0.7, -0.1}; + for (auto frame = 0u; frame < 2; ++frame) { + auto& test = frame ? moving : fixed; + auto* solver = test.solver[FLOW_SOL]; + for (auto p = 0ul; p < test.geometry->GetnPoint(); ++p) { + su2double state[5] = {}; + for (auto i = 0u; i < nVar; ++i) + for (auto j = 0u; j < nVar; ++j) + state[i] += (frame ? B[i][j] : (i == j)) * (correction ? delta[j] : baseState[j]); + if (correction) + solver->GetNodes()->SetSolution_Old(p, state); + else + solver->GetNodes()->SetSolution(p, state); + } + solver->MultigridProjectEulerWall(test.geometry.get(), test.config.get(), correction); + } + for (auto p = 0ul; p < fixed.geometry->GetnPoint(); ++p) { + const auto* f = correction ? fixed.solver[FLOW_SOL]->GetNodes()->GetSolution_Old(p) + : fixed.solver[FLOW_SOL]->GetNodes()->GetSolution(p); + const auto* m = correction ? moving.solver[FLOW_SOL]->GetNodes()->GetSolution_Old(p) + : moving.solver[FLOW_SOL]->GetNodes()->GetSolution(p); + for (auto i = 0u; i < nVar; ++i) { + su2double expected = 0; + for (auto j = 0u; j < nVar; ++j) expected += B[i][j] * f[j]; + CHECK(m[i] == Approx(expected).margin(1e-6)); + } + } + } + } + } +} diff --git a/UnitTests/meson.build b/UnitTests/meson.build index bb5448765af6..46a9c9b3cbbc 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -22,6 +22,7 @@ su2_cfd_tests = files(['Common/CConfig_tests.cpp', 'SU2_CFD/output/COutput_convergence_tests.cpp', 'SU2_CFD/gradients.cpp', 'SU2_CFD/solvers/CNEMOEulerSolver_tests.cpp', + 'SU2_CFD/solvers/moving_wall_tests.cpp', 'SU2_CFD/nemo_viscous_assembly.cpp', 'SU2_CFD/windowing.cpp', 'Common/toolboxes/random_toolbox_tests.cpp', From 211d1770f93b8e8aa5f5022471e98bb68d852fc2 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 22:28:44 +0200 Subject: [PATCH 24/43] Separate the HLLC Jacobian option and keep verification access private --- Common/include/CConfig.hpp | 4 +++ Common/src/CConfig.cpp | 4 ++- .../include/numerics/flow/convection/hllc.hpp | 30 +++---------------- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 12 +++----- UnitTests/Common/CConfig_tests.cpp | 16 ++++++++++ .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 19 ++++++++---- config_template.cfg | 5 +++- 7 files changed, 49 insertions(+), 41 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 9d4920c871b0..183ecde303af 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -607,6 +607,7 @@ class CConfig { MUSCL_Kappa_Heat, /*!< \brief Blending coefficient for U-MUSCL scheme for the (fvm) heat equation.*/ MUSCL_Kappa_AdjFlow, /*!< \brief Blending coefficient for U-MUSCL scheme for the adj flow equations.*/ MUSCL_Kappa_Species; /*!< \brief Blending coefficient for U-MUSCL scheme for the species equations.*/ + bool Use_Exact_HLLC_Jacobians; /*!< \brief Exact HLLC Jacobians with wave speeds held fixed. */ bool Use_Accurate_Jacobians; /*!< \brief Use numerically computed Jacobians for AUSM+up(2) and SLAU(2). */ bool Use_Accurate_Turb_Jacobians; /*!< \brief Use numerically computed Jacobians for standard SA turbulence model. */ bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */ @@ -4800,6 +4801,9 @@ class CConfig { */ bool GetUse_Accurate_Jacobians(void) const { return Use_Accurate_Jacobians; } + /*!\brief Get whether to use exact HLLC Jacobians with wave speeds held fixed. */ + bool GetUse_Exact_HLLC_Jacobians(void) const { return Use_Exact_HLLC_Jacobians; } + /*! * \brief Get whether to "Use Accurate Jacobians" for Standard SA turbulence model. * \return yes/no. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 4cabe516d7c7..550729877fba 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2176,8 +2176,10 @@ void CConfig::SetConfig_Options() { addDoubleArrayOption("JST_SENSOR_COEFF", 2, false, jst_coeff); /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2), exact Jacobians (for fixed wave speeds) for HLLC \ingroup Config*/ + /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); + /*!\brief USE_EXACT_HLLC_JACOBIANS \n DESCRIPTION: Exact HLLC Jacobians with wave speeds held fixed \ingroup Config*/ + addBoolOption("USE_EXACT_HLLC_JACOBIANS", Use_Exact_HLLC_Jacobians, false); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ addDoubleOption("CENTRAL_JACOBIAN_FIX_FACTOR", Cent_Jac_Fix_Factor, 4.0); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using a multiplication factor for incompressible central schemes \ingroup Config*/ diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index 29f7ce727a34..8684862fa520 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -38,8 +38,9 @@ */ class CUpwHLLC_Flow final : public CNumerics { private: + friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -81,19 +82,6 @@ class CUpwHLLC_Flow final : public CNumerics { * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ ResidualType<> ComputeResidual(const CConfig* config) override; - - /*! - * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which - * treat them as constants. - * \param[in] active - Use the fixed values. - * \param[in] val_sL, val_sR - Left and right wave speeds. - */ - inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { - fixedWaveSpeeds = active; - fixed_sL = val_sL; - fixed_sR = val_sR; - } - }; /*! @@ -105,8 +93,9 @@ class CUpwHLLC_Flow final : public CNumerics { */ class CUpwGeneralHLLC_Flow final : public CNumerics { private: + friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -150,17 +139,6 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { */ ResidualType<> ComputeResidual(const CConfig* config) override; - /*! - * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which - * treat them as constants. - * \param[in] active - Use the fixed values. - * \param[in] val_sL, val_sR - Left and right wave speeds. - */ - inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { - fixedWaveSpeeds = active; - fixed_sL = val_sL; - fixed_sR = val_sR; - } /*! * \brief Compute the Average quantities for a general fluid flux between two nodes i and j. diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 2e315d6a1d91..131ee5b65fa7 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -80,7 +80,7 @@ CUpwHLLC_Flow::CUpwHLLC_Flow(unsigned short val_nDim, unsigned short val_nVar, c /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Accurate_Jacobians(); + useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -292,13 +292,11 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ + of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; - - if (sM > 0.0) { if (sL > 0.0) { @@ -597,7 +595,7 @@ CUpwGeneralHLLC_Flow::CUpwGeneralHLLC_Flow(unsigned short val_nDim, unsigned sho /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Accurate_Jacobians(); + useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -837,13 +835,11 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ + of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; - - if (sM > 0.0) { if (sL > 0.0) { diff --git a/UnitTests/Common/CConfig_tests.cpp b/UnitTests/Common/CConfig_tests.cpp index 111918785545..a499a075fa1d 100644 --- a/UnitTests/Common/CConfig_tests.cpp +++ b/UnitTests/Common/CConfig_tests.cpp @@ -87,3 +87,19 @@ TEST_CASE("INIT_OPTION_INC defaults", "[Config]") { INIT_OPTION_INC::OPERATING_PRESSURE); CHECK(GetInitOptionInc(ideal_gas_options + "INIT_OPTION_INC= DENSITY_INIT\n") == INIT_OPTION_INC::DENSITY_INIT); } + +TEST_CASE("HLLC and AUSM SLAU Jacobian options are independent", "[Config][HLLCOptions]") { + for (const auto accurate : {false, true}) { + for (const auto exactHLLC : {false, true}) { + std::stringstream options(base_options + "USE_ACCURATE_FLUX_JACOBIANS= " + (accurate ? "YES" : "NO") + + "\nUSE_EXACT_HLLC_JACOBIANS= " + (exactHLLC ? "YES" : "NO") + "\n"); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK(config.GetUse_Accurate_Jacobians() == accurate); + CHECK(config.GetUse_Exact_HLLC_Jacobians() == exactHLLC); + } + } + std::stringstream options(base_options); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK_FALSE(config.GetUse_Accurate_Jacobians()); + CHECK_FALSE(config.GetUse_Exact_HLLC_Jacobians()); +} diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index b03edb3f1414..fc36c6cc9eba 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -1,7 +1,7 @@ /*! * \file hllc_jacobian_tests.cpp * \brief Finite-difference verification of the HLLC Jacobians (ideal and general gas, 2D and 3D), on fixed and moving - * faces, exact (USE_ACCURATE_FLUX_JACOBIANS) or default. + * faces, exact (USE_EXACT_HLLC_JACOBIANS) or default. * \version 8.5.0 "Harrier" * * SU2 Project Website: https://su2code.github.io @@ -32,6 +32,15 @@ #include #include "../../../SU2_CFD/include/numerics/flow/convection/hllc.hpp" +struct HLLCJacobianTestAccess { + template + static void SetFixedWaveSpeeds(Numerics& numerics, su2double sL, su2double sR) { + numerics.fixedWaveSpeeds = true; + numerics.fixed_sL = sL; + numerics.fixed_sR = sR; + } +}; + namespace { constexpr su2double gamma = 1.4; @@ -142,12 +151,12 @@ su2double ContactSpeed(unsigned short nDim, const State& Ui, const State& Uj, su std::unique_ptr MakeConfig(bool moving, bool accurate) { std::stringstream options; options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= HLLC\nTIME_DISCRE_FLOW= EULER_IMPLICIT\n"; - options << "USE_ACCURATE_FLUX_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; + options << "USE_EXACT_HLLC_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; if (moving) options << "GRID_MOVEMENT= STEADY_TRANSLATION\nTRANSLATION_RATE= 0.0 0.0 0.0\n"; return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); } -/*--- With USE_ACCURATE_FLUX_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default +/*--- With USE_EXACT_HLLC_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default the derivative of p* is approximated (star states), the supersonic branches remain exact. ---*/ template void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accurate) { @@ -186,7 +195,7 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura const su2double supersonicSpeeds[2] = {dir > 0 ? 0.02 : -2.0, dir > 0 ? 2.0 : -0.02}; const su2double starSpeeds[2] = {-2.0, 2.0}; for (const auto* s : {supersonicSpeeds, starSpeeds}) { - numerics.SetFixedWaveSpeeds(true, s[0], s[1]); + HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, s[0], s[1]); const bool supersonic = (s[0] > 0.0) || (s[1] < 0.0); const su2double sM = ContactSpeed(nDim, Ui, Uj, k, 0.8 * k, n, w, s[0], s[1]); CAPTURE(nDim, moving, k, accurate, dir, s[0], s[1], sM); @@ -235,7 +244,7 @@ TEST_CASE("HLLC supersonic Jacobian uses reconstructed face enthalpy", "[HLLC-fa } numerics.SetNormal(normal); numerics.SetGridVel(gridVelocity, gridVelocity); - numerics.SetFixedWaveSpeeds(true, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); + HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); const State state = Conservative(nDim, 1.2, velocity, 1.1, 0.0); for (su2double pressureOffset : {0.0, 0.1}) { auto evaluate = [&](const State& Ui, const State& Uj) { diff --git a/config_template.cfg b/config_template.cfg index 0d58bc62727a..8795186ab3d9 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1856,9 +1856,12 @@ LOW_MACH_PREC= NO % % Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) % Slower per iteration but potentialy more stable and capable of higher CFL -% For HLLC: exact Jacobians for fixed wave speeds (the default approximation is more robust with inexact linear solves) USE_ACCURATE_FLUX_JACOBIANS= NO % +% Use exact HLLC Jacobians with wave speeds held fixed (NO, YES). +% The default retains the previous approximation; wave-speed derivatives are omitted in both modes. +USE_EXACT_HLLC_JACOBIANS= NO +% % Use the vectorized version of the selected numerical method (available for JST family and Roe). % SU2 should be compiled for an AVX or AVX512 architecture for best performance. % NOTE: Currently vectorization always used for schemes that support it. From 07760e64c2fe2407148341615dbfb183551f8419 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 22:28:45 +0200 Subject: [PATCH 25/43] Use deduced types for Roe entropy wave strengths --- SU2_CFD/src/numerics/flow/convection/roe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 37c697515cfb..3fd23d644584 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -336,7 +336,7 @@ void CUpwL2Roe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J } else { /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ - const su2double delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; + const auto delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; delta_wave[0] = UnitNormal[0]*delta_entropy + (delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1])*zeta; delta_wave[1] = UnitNormal[1]*delta_entropy + (delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2])*zeta; delta_wave[2] = UnitNormal[2]*delta_entropy + (delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0])*zeta; @@ -412,7 +412,7 @@ void CUpwLMRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J } else { /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ - const su2double delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; + const auto delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; delta_wave[0] = UnitNormal[0]*delta_entropy + (delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1]); delta_wave[1] = UnitNormal[1]*delta_entropy + (delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2]); delta_wave[2] = UnitNormal[2]*delta_entropy + (delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0]); @@ -909,7 +909,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co } else { /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ - const su2double delta_entropy = delta_rho - delta_p/(RoeSoundSpeed*RoeSoundSpeed); + const auto delta_entropy = delta_rho - delta_p/(RoeSoundSpeed*RoeSoundSpeed); delta_wave[0] = UnitNormal[0]*delta_entropy + delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1]; delta_wave[1] = UnitNormal[1]*delta_entropy + delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2]; delta_wave[2] = UnitNormal[2]*delta_entropy + delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0]; From a950f3d3cbea0501415a76aa2484486d9278b68b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 22:29:00 +0200 Subject: [PATCH 26/43] Reject unsupported multigrid levels and align centered density handling --- Common/src/CConfig.cpp | 6 ++---- .../src/numerics/flow/convection/centered.cpp | 8 ++++---- UnitTests/Common/CConfig_tests.cpp | 14 ++++++++++++++ UnitTests/Common/check_multigrid_limits.py | 16 ++++++++++++++++ UnitTests/meson.build | 2 ++ 5 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 UnitTests/Common/check_multigrid_limits.py diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index ae6f75fbc969..be485288aaf0 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4994,11 +4994,9 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Restart || ((Kind_MGCycle == MG_CYCLE::FULL) && ContinuousAdjoint)) Kind_MGCycle = MG_CYCLE::V; - /*--- The multigrid arrays hold at most 10 coarse levels (CMultiGridIntegration::MAX_MG_LEVELS). Clamp instead of - stopping, MG_MIN_MESHSIZE can still reduce the number of levels during the agglomeration. ---*/ + /*--- The multigrid arrays hold at most 10 coarse levels (CMultiGridIntegration::MAX_MG_LEVELS). ---*/ if (nMGLevels > 10) { - if (rank == MASTER_NODE) cout << "WARNING: MGLEVEL > 10 is not supported, using MGLEVEL= 10." << endl; - nMGLevels = 10; + SU2_MPI::Error("MGLEVEL must be between 0 and 10; larger multigrid hierarchies are not supported.", CURRENT_FUNCTION); } FinestMesh = MESH_0; diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index 54fdbdfdd8f9..713ca2e86662 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -31,7 +31,7 @@ CCentLaxInc_Flow::CCentLaxInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = ((config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE) || (config->GetKind_DensityModel() == INC_DENSITYMODEL::FLAMELET)); + variable_density = config->GetVariable_Density_Model(); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); fix_factor = config->GetCent_Inc_Jac_Fix_Factor(); @@ -169,7 +169,7 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi if (implicit) { auto addGridJacobian = [&](su2double **Jac, su2double rho, const su2double *vel, su2double h, su2double T, su2double cp) { - const su2double dRhodh = variable_density ? su2double(-rho / (T * cp)) : su2double(0.0); + const auto dRhodh = variable_density ? su2double(-rho / (T * cp)) : su2double(0.0); const su2double factor = 0.5*ProjVelocity; Jac[0][nDim+1] -= factor*dRhodh; for (iDim = 0; iDim < nDim; iDim++) { @@ -258,7 +258,7 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi CCentJSTInc_Flow::CCentJSTInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetVariable_Density_Model()); + variable_density = config->GetVariable_Density_Model(); energy = config->GetEnergy_Equation(); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -417,7 +417,7 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi if (implicit) { auto addGridJacobian = [&](su2double **Jac, su2double rho, const su2double *vel, su2double h, su2double T, su2double cp) { - const su2double dRhodh = variable_density ? su2double(-rho / (T * cp)) : su2double(0.0); + const auto dRhodh = variable_density ? su2double(-rho / (T * cp)) : su2double(0.0); const su2double factor = 0.5*ProjVelocity; Jac[0][nDim+1] -= factor*dRhodh; for (iDim = 0; iDim < nDim; iDim++) { diff --git a/UnitTests/Common/CConfig_tests.cpp b/UnitTests/Common/CConfig_tests.cpp index 111918785545..20a34724fadc 100644 --- a/UnitTests/Common/CConfig_tests.cpp +++ b/UnitTests/Common/CConfig_tests.cpp @@ -87,3 +87,17 @@ TEST_CASE("INIT_OPTION_INC defaults", "[Config]") { INIT_OPTION_INC::OPERATING_PRESSURE); CHECK(GetInitOptionInc(ideal_gas_options + "INIT_OPTION_INC= DENSITY_INIT\n") == INIT_OPTION_INC::DENSITY_INIT); } + +TEST_CASE("Supported multigrid levels are retained", "[Config][MultigridLimits]") { + for (const auto levels : {0, 10}) { + std::stringstream options(base_options + "MGLEVEL= " + std::to_string(levels) + "\n"); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK(config.GetnMGLevels() == levels); + } +} + +TEST_CASE("Excessive multigrid levels are rejected", "[.MultigridLimitError]") { + std::stringstream options(base_options + "MGLEVEL= 11\n"); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + FAIL("An unsupported multigrid hierarchy was accepted."); +} diff --git a/UnitTests/Common/check_multigrid_limits.py b/UnitTests/Common/check_multigrid_limits.py new file mode 100644 index 000000000000..5070fdaed3cc --- /dev/null +++ b/UnitTests/Common/check_multigrid_limits.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +"""Check the fatal configuration diagnostic in its own process.""" +import subprocess +import sys + +result = subprocess.run( + [sys.argv[1], "[.MultigridLimitError]"], capture_output=True, text=True, timeout=30 +) +expected = "MGLEVEL must be between 0 and 10" +if result.returncode == 0 or expected not in result.stdout + result.stderr: + raise RuntimeError( + "Unsupported MGLEVEL did not fail with its diagnostic:\n" + + result.stdout + + result.stderr + ) +print("PASS: MGLEVEL=11 is rejected with its supported range") diff --git a/UnitTests/meson.build b/UnitTests/meson.build index 46a9c9b3cbbc..de7945480f08 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -53,6 +53,8 @@ if get_option('enable-tests') cpp_args: ['-fPIC', default_warning_flags, su2_cpp_args] ) test('Catch2 test driver', test_driver) + test('Multigrid configuration limits', python, + args: files('Common/check_multigrid_limits.py') + [test_driver.full_path()]) test('NEMO convergence field migration', python, args: files('SU2_CFD/output/check_nemo_convergence_migration.py') + [test_driver.full_path()], timeout: 300) From 6c571f3d47a221d7270c45e7cb2a4997eb2228fd Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 22:28:44 +0200 Subject: [PATCH 27/43] Separate the HLLC Jacobian option and keep verification access private --- Common/include/CConfig.hpp | 4 +++ Common/src/CConfig.cpp | 4 ++- .../include/numerics/flow/convection/hllc.hpp | 30 +++---------------- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 12 +++----- UnitTests/Common/CConfig_tests.cpp | 16 ++++++++++ .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 19 ++++++++---- config_template.cfg | 5 +++- 7 files changed, 49 insertions(+), 41 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 9d4920c871b0..183ecde303af 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -607,6 +607,7 @@ class CConfig { MUSCL_Kappa_Heat, /*!< \brief Blending coefficient for U-MUSCL scheme for the (fvm) heat equation.*/ MUSCL_Kappa_AdjFlow, /*!< \brief Blending coefficient for U-MUSCL scheme for the adj flow equations.*/ MUSCL_Kappa_Species; /*!< \brief Blending coefficient for U-MUSCL scheme for the species equations.*/ + bool Use_Exact_HLLC_Jacobians; /*!< \brief Exact HLLC Jacobians with wave speeds held fixed. */ bool Use_Accurate_Jacobians; /*!< \brief Use numerically computed Jacobians for AUSM+up(2) and SLAU(2). */ bool Use_Accurate_Turb_Jacobians; /*!< \brief Use numerically computed Jacobians for standard SA turbulence model. */ bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */ @@ -4800,6 +4801,9 @@ class CConfig { */ bool GetUse_Accurate_Jacobians(void) const { return Use_Accurate_Jacobians; } + /*!\brief Get whether to use exact HLLC Jacobians with wave speeds held fixed. */ + bool GetUse_Exact_HLLC_Jacobians(void) const { return Use_Exact_HLLC_Jacobians; } + /*! * \brief Get whether to "Use Accurate Jacobians" for Standard SA turbulence model. * \return yes/no. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 4cabe516d7c7..550729877fba 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2176,8 +2176,10 @@ void CConfig::SetConfig_Options() { addDoubleArrayOption("JST_SENSOR_COEFF", 2, false, jst_coeff); /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2), exact Jacobians (for fixed wave speeds) for HLLC \ingroup Config*/ + /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); + /*!\brief USE_EXACT_HLLC_JACOBIANS \n DESCRIPTION: Exact HLLC Jacobians with wave speeds held fixed \ingroup Config*/ + addBoolOption("USE_EXACT_HLLC_JACOBIANS", Use_Exact_HLLC_Jacobians, false); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ addDoubleOption("CENTRAL_JACOBIAN_FIX_FACTOR", Cent_Jac_Fix_Factor, 4.0); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using a multiplication factor for incompressible central schemes \ingroup Config*/ diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index 29f7ce727a34..8684862fa520 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -38,8 +38,9 @@ */ class CUpwHLLC_Flow final : public CNumerics { private: + friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -81,19 +82,6 @@ class CUpwHLLC_Flow final : public CNumerics { * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ ResidualType<> ComputeResidual(const CConfig* config) override; - - /*! - * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which - * treat them as constants. - * \param[in] active - Use the fixed values. - * \param[in] val_sL, val_sR - Left and right wave speeds. - */ - inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { - fixedWaveSpeeds = active; - fixed_sL = val_sL; - fixed_sR = val_sR; - } - }; /*! @@ -105,8 +93,9 @@ class CUpwHLLC_Flow final : public CNumerics { */ class CUpwGeneralHLLC_Flow final : public CNumerics { private: + friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -150,17 +139,6 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { */ ResidualType<> ComputeResidual(const CConfig* config) override; - /*! - * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which - * treat them as constants. - * \param[in] active - Use the fixed values. - * \param[in] val_sL, val_sR - Left and right wave speeds. - */ - inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { - fixedWaveSpeeds = active; - fixed_sL = val_sL; - fixed_sR = val_sR; - } /*! * \brief Compute the Average quantities for a general fluid flux between two nodes i and j. diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 2e315d6a1d91..131ee5b65fa7 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -80,7 +80,7 @@ CUpwHLLC_Flow::CUpwHLLC_Flow(unsigned short val_nDim, unsigned short val_nVar, c /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Accurate_Jacobians(); + useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -292,13 +292,11 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ + of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; - - if (sM > 0.0) { if (sL > 0.0) { @@ -597,7 +595,7 @@ CUpwGeneralHLLC_Flow::CUpwGeneralHLLC_Flow(unsigned short val_nDim, unsigned sho /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Accurate_Jacobians(); + useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -837,13 +835,11 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ + of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; - - if (sM > 0.0) { if (sL > 0.0) { diff --git a/UnitTests/Common/CConfig_tests.cpp b/UnitTests/Common/CConfig_tests.cpp index 111918785545..a499a075fa1d 100644 --- a/UnitTests/Common/CConfig_tests.cpp +++ b/UnitTests/Common/CConfig_tests.cpp @@ -87,3 +87,19 @@ TEST_CASE("INIT_OPTION_INC defaults", "[Config]") { INIT_OPTION_INC::OPERATING_PRESSURE); CHECK(GetInitOptionInc(ideal_gas_options + "INIT_OPTION_INC= DENSITY_INIT\n") == INIT_OPTION_INC::DENSITY_INIT); } + +TEST_CASE("HLLC and AUSM SLAU Jacobian options are independent", "[Config][HLLCOptions]") { + for (const auto accurate : {false, true}) { + for (const auto exactHLLC : {false, true}) { + std::stringstream options(base_options + "USE_ACCURATE_FLUX_JACOBIANS= " + (accurate ? "YES" : "NO") + + "\nUSE_EXACT_HLLC_JACOBIANS= " + (exactHLLC ? "YES" : "NO") + "\n"); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK(config.GetUse_Accurate_Jacobians() == accurate); + CHECK(config.GetUse_Exact_HLLC_Jacobians() == exactHLLC); + } + } + std::stringstream options(base_options); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK_FALSE(config.GetUse_Accurate_Jacobians()); + CHECK_FALSE(config.GetUse_Exact_HLLC_Jacobians()); +} diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index b03edb3f1414..fc36c6cc9eba 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -1,7 +1,7 @@ /*! * \file hllc_jacobian_tests.cpp * \brief Finite-difference verification of the HLLC Jacobians (ideal and general gas, 2D and 3D), on fixed and moving - * faces, exact (USE_ACCURATE_FLUX_JACOBIANS) or default. + * faces, exact (USE_EXACT_HLLC_JACOBIANS) or default. * \version 8.5.0 "Harrier" * * SU2 Project Website: https://su2code.github.io @@ -32,6 +32,15 @@ #include #include "../../../SU2_CFD/include/numerics/flow/convection/hllc.hpp" +struct HLLCJacobianTestAccess { + template + static void SetFixedWaveSpeeds(Numerics& numerics, su2double sL, su2double sR) { + numerics.fixedWaveSpeeds = true; + numerics.fixed_sL = sL; + numerics.fixed_sR = sR; + } +}; + namespace { constexpr su2double gamma = 1.4; @@ -142,12 +151,12 @@ su2double ContactSpeed(unsigned short nDim, const State& Ui, const State& Uj, su std::unique_ptr MakeConfig(bool moving, bool accurate) { std::stringstream options; options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= HLLC\nTIME_DISCRE_FLOW= EULER_IMPLICIT\n"; - options << "USE_ACCURATE_FLUX_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; + options << "USE_EXACT_HLLC_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; if (moving) options << "GRID_MOVEMENT= STEADY_TRANSLATION\nTRANSLATION_RATE= 0.0 0.0 0.0\n"; return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); } -/*--- With USE_ACCURATE_FLUX_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default +/*--- With USE_EXACT_HLLC_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default the derivative of p* is approximated (star states), the supersonic branches remain exact. ---*/ template void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accurate) { @@ -186,7 +195,7 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura const su2double supersonicSpeeds[2] = {dir > 0 ? 0.02 : -2.0, dir > 0 ? 2.0 : -0.02}; const su2double starSpeeds[2] = {-2.0, 2.0}; for (const auto* s : {supersonicSpeeds, starSpeeds}) { - numerics.SetFixedWaveSpeeds(true, s[0], s[1]); + HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, s[0], s[1]); const bool supersonic = (s[0] > 0.0) || (s[1] < 0.0); const su2double sM = ContactSpeed(nDim, Ui, Uj, k, 0.8 * k, n, w, s[0], s[1]); CAPTURE(nDim, moving, k, accurate, dir, s[0], s[1], sM); @@ -235,7 +244,7 @@ TEST_CASE("HLLC supersonic Jacobian uses reconstructed face enthalpy", "[HLLC-fa } numerics.SetNormal(normal); numerics.SetGridVel(gridVelocity, gridVelocity); - numerics.SetFixedWaveSpeeds(true, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); + HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); const State state = Conservative(nDim, 1.2, velocity, 1.1, 0.0); for (su2double pressureOffset : {0.0, 0.1}) { auto evaluate = [&](const State& Ui, const State& Uj) { diff --git a/config_template.cfg b/config_template.cfg index 0d58bc62727a..8795186ab3d9 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1856,9 +1856,12 @@ LOW_MACH_PREC= NO % % Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) % Slower per iteration but potentialy more stable and capable of higher CFL -% For HLLC: exact Jacobians for fixed wave speeds (the default approximation is more robust with inexact linear solves) USE_ACCURATE_FLUX_JACOBIANS= NO % +% Use exact HLLC Jacobians with wave speeds held fixed (NO, YES). +% The default retains the previous approximation; wave-speed derivatives are omitted in both modes. +USE_EXACT_HLLC_JACOBIANS= NO +% % Use the vectorized version of the selected numerical method (available for JST family and Roe). % SU2 should be compiled for an AVX or AVX512 architecture for best performance. % NOTE: Currently vectorization always used for schemes that support it. From 27fc17589a63258d16db9589bc58df540b313355 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 22:28:44 +0200 Subject: [PATCH 28/43] Separate the HLLC Jacobian option and keep verification access private --- Common/include/CConfig.hpp | 4 +++ Common/src/CConfig.cpp | 4 ++- .../include/numerics/flow/convection/hllc.hpp | 30 +++---------------- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 12 +++----- UnitTests/Common/CConfig_tests.cpp | 16 ++++++++++ .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 19 ++++++++---- config_template.cfg | 5 +++- 7 files changed, 49 insertions(+), 41 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 9d4920c871b0..183ecde303af 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -607,6 +607,7 @@ class CConfig { MUSCL_Kappa_Heat, /*!< \brief Blending coefficient for U-MUSCL scheme for the (fvm) heat equation.*/ MUSCL_Kappa_AdjFlow, /*!< \brief Blending coefficient for U-MUSCL scheme for the adj flow equations.*/ MUSCL_Kappa_Species; /*!< \brief Blending coefficient for U-MUSCL scheme for the species equations.*/ + bool Use_Exact_HLLC_Jacobians; /*!< \brief Exact HLLC Jacobians with wave speeds held fixed. */ bool Use_Accurate_Jacobians; /*!< \brief Use numerically computed Jacobians for AUSM+up(2) and SLAU(2). */ bool Use_Accurate_Turb_Jacobians; /*!< \brief Use numerically computed Jacobians for standard SA turbulence model. */ bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */ @@ -4800,6 +4801,9 @@ class CConfig { */ bool GetUse_Accurate_Jacobians(void) const { return Use_Accurate_Jacobians; } + /*!\brief Get whether to use exact HLLC Jacobians with wave speeds held fixed. */ + bool GetUse_Exact_HLLC_Jacobians(void) const { return Use_Exact_HLLC_Jacobians; } + /*! * \brief Get whether to "Use Accurate Jacobians" for Standard SA turbulence model. * \return yes/no. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index be485288aaf0..81fb736ce20d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2176,8 +2176,10 @@ void CConfig::SetConfig_Options() { addDoubleArrayOption("JST_SENSOR_COEFF", 2, false, jst_coeff); /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2), exact Jacobians (for fixed wave speeds) for HLLC \ingroup Config*/ + /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); + /*!\brief USE_EXACT_HLLC_JACOBIANS \n DESCRIPTION: Exact HLLC Jacobians with wave speeds held fixed \ingroup Config*/ + addBoolOption("USE_EXACT_HLLC_JACOBIANS", Use_Exact_HLLC_Jacobians, false); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ addDoubleOption("CENTRAL_JACOBIAN_FIX_FACTOR", Cent_Jac_Fix_Factor, 4.0); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using a multiplication factor for incompressible central schemes \ingroup Config*/ diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index 29f7ce727a34..8684862fa520 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -38,8 +38,9 @@ */ class CUpwHLLC_Flow final : public CNumerics { private: + friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -81,19 +82,6 @@ class CUpwHLLC_Flow final : public CNumerics { * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ ResidualType<> ComputeResidual(const CConfig* config) override; - - /*! - * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which - * treat them as constants. - * \param[in] active - Use the fixed values. - * \param[in] val_sL, val_sR - Left and right wave speeds. - */ - inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { - fixedWaveSpeeds = active; - fixed_sL = val_sL; - fixed_sR = val_sR; - } - }; /*! @@ -105,8 +93,9 @@ class CUpwHLLC_Flow final : public CNumerics { */ class CUpwGeneralHLLC_Flow final : public CNumerics { private: + friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_ACCURATE_FLUX_JACOBIANS). */ + bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -150,17 +139,6 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { */ ResidualType<> ComputeResidual(const CConfig* config) override; - /*! - * \brief Fix the left and right wave speeds (relative to the face), for the verification of the Jacobians, which - * treat them as constants. - * \param[in] active - Use the fixed values. - * \param[in] val_sL, val_sR - Left and right wave speeds. - */ - inline void SetFixedWaveSpeeds(bool active, su2double val_sL, su2double val_sR) { - fixedWaveSpeeds = active; - fixed_sL = val_sL; - fixed_sR = val_sR; - } /*! * \brief Compute the Average quantities for a general fluid flux between two nodes i and j. diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 2e315d6a1d91..131ee5b65fa7 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -80,7 +80,7 @@ CUpwHLLC_Flow::CUpwHLLC_Flow(unsigned short val_nDim, unsigned short val_nVar, c /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Accurate_Jacobians(); + useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -292,13 +292,11 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ + of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; - - if (sM > 0.0) { if (sL > 0.0) { @@ -597,7 +595,7 @@ CUpwGeneralHLLC_Flow::CUpwGeneralHLLC_Flow(unsigned short val_nDim, unsigned sho /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Accurate_Jacobians(); + useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -837,13 +835,11 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_ACCURATE_FLUX_JACOBIANS= YES gives the exact derivative. ---*/ + of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; - - if (sM > 0.0) { if (sL > 0.0) { diff --git a/UnitTests/Common/CConfig_tests.cpp b/UnitTests/Common/CConfig_tests.cpp index 20a34724fadc..2dfe8b65cf70 100644 --- a/UnitTests/Common/CConfig_tests.cpp +++ b/UnitTests/Common/CConfig_tests.cpp @@ -101,3 +101,19 @@ TEST_CASE("Excessive multigrid levels are rejected", "[.MultigridLimitError]") { CConfig config(options, SU2_COMPONENT::SU2_CFD, false); FAIL("An unsupported multigrid hierarchy was accepted."); } + +TEST_CASE("HLLC and AUSM SLAU Jacobian options are independent", "[Config][HLLCOptions]") { + for (const auto accurate : {false, true}) { + for (const auto exactHLLC : {false, true}) { + std::stringstream options(base_options + "USE_ACCURATE_FLUX_JACOBIANS= " + (accurate ? "YES" : "NO") + + "\nUSE_EXACT_HLLC_JACOBIANS= " + (exactHLLC ? "YES" : "NO") + "\n"); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK(config.GetUse_Accurate_Jacobians() == accurate); + CHECK(config.GetUse_Exact_HLLC_Jacobians() == exactHLLC); + } + } + std::stringstream options(base_options); + CConfig config(options, SU2_COMPONENT::SU2_CFD, false); + CHECK_FALSE(config.GetUse_Accurate_Jacobians()); + CHECK_FALSE(config.GetUse_Exact_HLLC_Jacobians()); +} diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index b03edb3f1414..fc36c6cc9eba 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -1,7 +1,7 @@ /*! * \file hllc_jacobian_tests.cpp * \brief Finite-difference verification of the HLLC Jacobians (ideal and general gas, 2D and 3D), on fixed and moving - * faces, exact (USE_ACCURATE_FLUX_JACOBIANS) or default. + * faces, exact (USE_EXACT_HLLC_JACOBIANS) or default. * \version 8.5.0 "Harrier" * * SU2 Project Website: https://su2code.github.io @@ -32,6 +32,15 @@ #include #include "../../../SU2_CFD/include/numerics/flow/convection/hllc.hpp" +struct HLLCJacobianTestAccess { + template + static void SetFixedWaveSpeeds(Numerics& numerics, su2double sL, su2double sR) { + numerics.fixedWaveSpeeds = true; + numerics.fixed_sL = sL; + numerics.fixed_sR = sR; + } +}; + namespace { constexpr su2double gamma = 1.4; @@ -142,12 +151,12 @@ su2double ContactSpeed(unsigned short nDim, const State& Ui, const State& Uj, su std::unique_ptr MakeConfig(bool moving, bool accurate) { std::stringstream options; options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= HLLC\nTIME_DISCRE_FLOW= EULER_IMPLICIT\n"; - options << "USE_ACCURATE_FLUX_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; + options << "USE_EXACT_HLLC_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; if (moving) options << "GRID_MOVEMENT= STEADY_TRANSLATION\nTRANSLATION_RATE= 0.0 0.0 0.0\n"; return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); } -/*--- With USE_ACCURATE_FLUX_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default +/*--- With USE_EXACT_HLLC_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default the derivative of p* is approximated (star states), the supersonic branches remain exact. ---*/ template void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accurate) { @@ -186,7 +195,7 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura const su2double supersonicSpeeds[2] = {dir > 0 ? 0.02 : -2.0, dir > 0 ? 2.0 : -0.02}; const su2double starSpeeds[2] = {-2.0, 2.0}; for (const auto* s : {supersonicSpeeds, starSpeeds}) { - numerics.SetFixedWaveSpeeds(true, s[0], s[1]); + HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, s[0], s[1]); const bool supersonic = (s[0] > 0.0) || (s[1] < 0.0); const su2double sM = ContactSpeed(nDim, Ui, Uj, k, 0.8 * k, n, w, s[0], s[1]); CAPTURE(nDim, moving, k, accurate, dir, s[0], s[1], sM); @@ -235,7 +244,7 @@ TEST_CASE("HLLC supersonic Jacobian uses reconstructed face enthalpy", "[HLLC-fa } numerics.SetNormal(normal); numerics.SetGridVel(gridVelocity, gridVelocity); - numerics.SetFixedWaveSpeeds(true, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); + HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); const State state = Conservative(nDim, 1.2, velocity, 1.1, 0.0); for (su2double pressureOffset : {0.0, 0.1}) { auto evaluate = [&](const State& Ui, const State& Uj) { diff --git a/config_template.cfg b/config_template.cfg index 0d58bc62727a..8795186ab3d9 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1856,9 +1856,12 @@ LOW_MACH_PREC= NO % % Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) % Slower per iteration but potentialy more stable and capable of higher CFL -% For HLLC: exact Jacobians for fixed wave speeds (the default approximation is more robust with inexact linear solves) USE_ACCURATE_FLUX_JACOBIANS= NO % +% Use exact HLLC Jacobians with wave speeds held fixed (NO, YES). +% The default retains the previous approximation; wave-speed derivatives are omitted in both modes. +USE_EXACT_HLLC_JACOBIANS= NO +% % Use the vectorized version of the selected numerical method (available for JST family and Roe). % SU2 should be compiled for an AVX or AVX512 architecture for best performance. % NOTE: Currently vectorization always used for schemes that support it. From 815aa5c610e5d0b6bb10086b4cf8a62a327ba5d1 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Oct 2026 22:28:45 +0200 Subject: [PATCH 29/43] Use deduced types for Roe entropy wave strengths --- SU2_CFD/src/numerics/flow/convection/roe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 37c697515cfb..3fd23d644584 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -336,7 +336,7 @@ void CUpwL2Roe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J } else { /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ - const su2double delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; + const auto delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; delta_wave[0] = UnitNormal[0]*delta_entropy + (delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1])*zeta; delta_wave[1] = UnitNormal[1]*delta_entropy + (delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2])*zeta; delta_wave[2] = UnitNormal[2]*delta_entropy + (delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0])*zeta; @@ -412,7 +412,7 @@ void CUpwLMRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J } else { /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ - const su2double delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; + const auto delta_entropy = delta_rho - delta_p/RoeSoundSpeed2; delta_wave[0] = UnitNormal[0]*delta_entropy + (delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1]); delta_wave[1] = UnitNormal[1]*delta_entropy + (delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2]); delta_wave[2] = UnitNormal[2]*delta_entropy + (delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0]); @@ -909,7 +909,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co } else { /*--- The first three columns of the 3D P matrix combine the entropy wave (weighted by the normal) with the shear waves, so their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j. ---*/ - const su2double delta_entropy = delta_rho - delta_p/(RoeSoundSpeed*RoeSoundSpeed); + const auto delta_entropy = delta_rho - delta_p/(RoeSoundSpeed*RoeSoundSpeed); delta_wave[0] = UnitNormal[0]*delta_entropy + delta_vel[1]*UnitNormal[2]-delta_vel[2]*UnitNormal[1]; delta_wave[1] = UnitNormal[1]*delta_entropy + delta_vel[2]*UnitNormal[0]-delta_vel[0]*UnitNormal[2]; delta_wave[2] = UnitNormal[2]*delta_entropy + delta_vel[0]*UnitNormal[1]-delta_vel[1]*UnitNormal[0]; From 3062a0482225d6a8788fedda52ca68aee965f268 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 13 Oct 2026 10:26:05 +0200 Subject: [PATCH 30/43] Materialize AD densities in compressible under-relaxation --- SU2_CFD/src/solvers/CEulerSolver.cpp | 5 +- .../solvers/under_relaxation_ad_tests.cpp | 77 +++++++++++++++++++ UnitTests/meson.build | 4 +- 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 2e6c92785888..b1c61ad377de 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2552,8 +2552,9 @@ void CEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config) { su2double e_old = nodes->GetSolution(iPoint, nVar - 1); su2double e_new = e_old + LinSysSol(iPoint, nVar - 1); /*--- rho*e = rho*E - |rho*u|^2 / (2*rho), with the old and the proposed new density. ---*/ - const auto rho_old = max(nodes->GetSolution(iPoint, 0), EPS); - const auto rho_new = max(rho_old + LinSysSol(iPoint, 0), EPS); + /*--- Materialize CoDi expressions: GetSolution returns temporary active scalars. ---*/ + const su2double rho_old = max(nodes->GetSolution(iPoint, 0), EPS); + const su2double rho_new = max(rho_old + LinSysSol(iPoint, 0), EPS); for (auto jVar = 1u; jVar <= nDim; jVar++) { e_old -= 0.5 * pow(nodes->GetSolution(iPoint, jVar), 2) / rho_old; e_new -= 0.5 * pow(nodes->GetSolution(iPoint, jVar) + LinSysSol(iPoint, jVar), 2) / rho_new; diff --git a/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp b/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp new file mode 100644 index 000000000000..ee1f8659f124 --- /dev/null +++ b/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp @@ -0,0 +1,77 @@ +/*! + * \file under_relaxation_ad_tests.cpp + * \brief Tests density ownership and derivatives in compressible under-relaxation. + * \author SU2 Contributors + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include "../../UnitQuadTestCase.hpp" + +TEST_CASE("Compressible under-relaxation owns its AD density values", "[UnderRelaxationAD]") { + UnitQuadTestCase test; + test.config_options = + "SOLVER= EULER\nMESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" + "MARKER_EULER= (x_minus,x_plus,y_minus,y_plus)\n" + "TIME_DISCRE_FLOW= EULER_IMPLICIT\nMAX_UPDATE_FLOW= 0.01\n"; + test.InitConfig(); + test.InitGeometry(); + test.InitSolver(); + auto* solver = static_cast(test.solver[FLOW_SOL]); + auto* nodes = solver->GetNodes(); + for (auto p = 0ul; p < test.geometry->GetnPoint(); ++p) + for (auto v = 0u; v < 4; ++v) solver->LinSysSol(p, v) = 0.0; + + for (const bool densityLimited : {true, false}) { + su2double rho = 2.0; +#ifdef CODI_REVERSE_TYPE + AD::StartRecording(); + AD::RegisterInput(rho); +#else + SU2_TYPE::SetDerivative(rho, 1.0); +#endif + nodes->SetSolution(0, 0, rho); + nodes->SetSolution(0, 1, 3.0); + nodes->SetSolution(0, 2, 0.0); + nodes->SetSolution(0, 3, 10.0); + solver->LinSysSol(0, 0) = densityLimited ? 0.1 : 0.0; + solver->LinSysSol(0, 1) = densityLimited ? 0.2 : 0.0; + solver->LinSysSol(0, 3) = densityLimited ? 0.4 : 4.0; + solver->ComputeUnderRelaxationFactor(test.config.get()); + su2double factor = nodes->GetUnderRelaxation(0); +#ifdef CODI_REVERSE_TYPE + AD::RegisterOutput(factor); + AD::StopRecording(); + SU2_TYPE::SetDerivative(factor, 1.0); + AD::ComputeAdjoint(); + const auto derivative = SU2_TYPE::GetDerivative(rho); +#else + const auto derivative = SU2_TYPE::GetDerivative(factor); +#endif + CHECK(SU2_TYPE::GetValue(factor) == Approx(densityLimited ? 0.2 : 0.019375)); + CHECK(derivative == Approx(densityLimited ? 0.1 : 0.0028125)); +#ifdef CODI_REVERSE_TYPE + AD::Reset(); +#endif + } +} diff --git a/UnitTests/meson.build b/UnitTests/meson.build index ba3c63afce92..76d85e251574 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -28,11 +28,13 @@ su2_cfd_tests = files(['Common/CConfig_tests.cpp', # Reverse-mode (algorithmic differentiation) tests: su2_cfd_tests_ad = files(['Common/simple_ad_test.cpp', + 'SU2_CFD/solvers/under_relaxation_ad_tests.cpp', 'SU2_CFD/fluid/CFluidModel_tests_AD.cpp', 'Common/toolboxes/multilayer_perceptron/MLP_Jacobian_tests.cpp']) # Forward-mode (direct differentiation) tests: -su2_cfd_tests_dd = files(['Common/simple_directdiff_test.cpp']) +su2_cfd_tests_dd = files(['Common/simple_directdiff_test.cpp', + 'SU2_CFD/solvers/under_relaxation_ad_tests.cpp']) # ------------------------------------------------------------------------- # End of unit test listings From ab5c0801c7a8b433623418b323139166642b0674 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 20 Oct 2026 10:31:30 +0200 Subject: [PATCH 31/43] Update the HLLC wedge references from CI run 39388009966 Co-Authored-By: Claude Opus 5.5 --- TestCases/hybrid_regression.py | 2 +- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index b59d77ab237a..c545a84a8eba 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -80,7 +80,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-4.220803, 1.509389, -0.249526, 0.043953] + wedge.test_vals = [-4.160450, 1.566828, -0.249526, 0.043953] test_list.append(wedge) # ONERA M6 Wing diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 1a4c4335b12e..64c9c7b2195d 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -274,7 +274,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-4.018537, 1.708493, -0.249527, 0.043953] + wedge.test_vals = [-4.017572, 1.709456, -0.249527, 0.043953] test_list.append(wedge) # ONERA M6 Wing diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index a79f4161e855..dccf3b6a8a4f 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -119,7 +119,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-4.359544, 1.370567, -0.249526, 0.043953] + wedge.test_vals = [-4.350003, 1.379848, -0.249526, 0.043953] test_list.append(wedge) # ONERA M6 Wing From 8152f7c5ece0d615380e9b47addda0b03f017fc6 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 22 Oct 2026 09:44:44 +0200 Subject: [PATCH 32/43] Update the reference values from the CI Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013YFdgQwrRqCQ2ihG446aNe --- TestCases/parallel_regression_AD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 250f96e66c12..99e31c3124a0 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -315,7 +315,7 @@ def main(): discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 8 - discadj_fsi2.test_vals = [-3.824633, 1.979516, -3.863368, 0.295450, 3.839800] + discadj_fsi2.test_vals = [-3.824591, 1.979595, -3.863368, 0.295450, 3.839800] discadj_fsi2.test_vals_aarch64 = [-3.824870, 1.979160, -3.863368, 0.295450, 3.839800] discadj_fsi2.tol = 0.00001 test_list.append(discadj_fsi2) From 05187b6b09560a549b11ac8c90dcbd41c2cd7059 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 22 Oct 2026 09:44:45 +0200 Subject: [PATCH 33/43] Update the reference values from the CI Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013YFdgQwrRqCQ2ihG446aNe --- TestCases/hybrid_regression.py | 30 ++++++++++++------------- TestCases/hybrid_regression_AD.py | 2 +- TestCases/parallel_regression.py | 34 ++++++++++++++--------------- TestCases/parallel_regression_AD.py | 4 ++-- TestCases/serial_regression.py | 34 ++++++++++++++--------------- TestCases/serial_regression_AD.py | 4 ++-- 6 files changed, 54 insertions(+), 54 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index c545a84a8eba..60e5c01fbc7f 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -265,7 +265,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.068875, 0.504406, -2.840213, 1.705449, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.069624, 0.505288, -2.816368, 1.728267, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.140441, -9.154674, -10.886121, -5.806594, 0.000000] test_list.append(axi_rans_air_nozzle_restart) @@ -340,7 +340,7 @@ def main(): harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 - harmonic_balance.test_vals = [-1.559187, 0.829574, 0.931511, 3.954440] + harmonic_balance.test_vals = [-1.556450, 0.840516, 0.943600, 3.957290] test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -510,7 +510,7 @@ def main(): sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 - sine_gust.test_vals = [-1.977498, 3.481817, -0.010724, -0.005369] + sine_gust.test_vals = [-1.977498, 3.481833, -0.012152, -0.004132] sine_gust.unsteady = True test_list.append(sine_gust) @@ -519,7 +519,7 @@ def main(): cosine_gust.cfg_dir = "gust" cosine_gust.cfg_file = "cosine_gust_zdir.cfg" cosine_gust.test_iter = 79 - cosine_gust.test_vals = [-2.418805, 0.002212, -0.001249, 0.000439, -0.000592] + cosine_gust.test_vals = [-2.418805, 0.003015, -0.001242, 0.000500, -0.000592] cosine_gust.unsteady = True cosine_gust.enabled_with_tsan = False test_list.append(cosine_gust) @@ -529,7 +529,7 @@ def main(): gust_mesh_defo.cfg_dir = "gust" gust_mesh_defo.cfg_file = "gust_with_mesh_deformation.cfg" gust_mesh_defo.test_iter = 6 - gust_mesh_defo.test_vals = [-1.844761, 0.001290, -0.000316] + gust_mesh_defo.test_vals = [-1.844761, 0.001449, -0.000344] gust_mesh_defo.unsteady = True gust_mesh_defo.enabled_with_tsan = False test_list.append(gust_mesh_defo) @@ -539,7 +539,7 @@ def main(): aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 - aeroelastic.test_vals = [-1.876632, 4.021071, 0.080087, 0.027953, -0.001641, -0.000127, -1.052229] + aeroelastic.test_vals = [-1.876631, 4.021081, 0.082286, 0.026921, -0.001638, -0.000130, -1.019527] aeroelastic.unsteady = True aeroelastic.enabled_on_cpu_arch = ["x86_64"] # Requires AVX-capable architecture test_list.append(aeroelastic) @@ -558,7 +558,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.008640, -6.889022, 1.435181, 0.433567] + unst_inc_turb_naca0015_sa.test_vals = [-3.007258, -6.887901, 1.435511, 0.433955] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) @@ -567,7 +567,7 @@ def main(): unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" unst_deforming_naca0012.test_iter = 5 - unst_deforming_naca0012.test_vals = [-3.666867, -3.796806, -3.719022, -3.150288] + unst_deforming_naca0012.test_vals = [-3.666017, -3.794928, -3.717606, -3.149231] unst_deforming_naca0012.unsteady = True unst_deforming_naca0012.enabled_with_tsan = False test_list.append(unst_deforming_naca0012) @@ -640,7 +640,7 @@ def main(): uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" uniform_flow.test_iter = 5 - uniform_flow.test_vals = [5.000000, 0.000000, -0.195002, -10.624453] + uniform_flow.test_vals = [5.000000, 0.000000, -0.193990, -10.624443] uniform_flow.unsteady = True uniform_flow.multizone = True test_list.append(uniform_flow) @@ -659,7 +659,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.466339, 0.346858, 0.397486] + channel_2D.test_vals = [2.000000, 0.000000, 0.399109, 0.350302, 0.405582] channel_2D.unsteady = True channel_2D.multizone = True test_list.append(channel_2D) @@ -681,7 +681,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.070225, 0.528891, 0.684177, 0.970350, 1.065268] + pipe.test_vals = [0.024970, 0.452310, 0.562858, 0.974611, 1.031083] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -691,7 +691,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686432, 1.159463, 1.151135] + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686419, 1.152596, 1.145896] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -701,7 +701,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.126036, 1.081765] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064252] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -752,7 +752,7 @@ def main(): fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [4.000000, 0.000000, -3.726029, -4.277532] + fsi2d.test_vals = [4.000000, 0.000000, -3.725535, -4.278762] fsi2d.multizone= True fsi2d.unsteady = True fsi2d.enabled_with_tsan = False @@ -763,7 +763,7 @@ def main(): dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" dyn_fsi.test_iter = 4 - dyn_fsi.test_vals = [-4.330727, -4.152808, 0.000000, 102.000000] + dyn_fsi.test_vals = [-4.328791, -4.152991, 0.000000, 103.000000] dyn_fsi.multizone = True dyn_fsi.unsteady = True test_list.append(dyn_fsi) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index b2086915f9df..6a693812d903 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -188,7 +188,7 @@ def main(): discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 - discadj_pitchingNACA0012.test_vals = [-1.041975, -1.513011, -0.006202, 0.000012] + discadj_pitchingNACA0012.test_vals = [-1.128086, -1.582652, -0.006613, 0.000011] discadj_pitchingNACA0012.tol = 0.01 discadj_pitchingNACA0012.unsteady = True discadj_pitchingNACA0012.enabled_with_tsan = False diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 64c9c7b2195d..855c7d2f8cc8 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -660,7 +660,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.144760, 0.426779, -2.900513, 1.606061, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.130654, 0.443770, -2.934019, 1.603840, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143310, -9.163287, -10.858232, -5.787715, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -713,7 +713,7 @@ def main(): inc_nozzle.cfg_dir = "incomp_euler/nozzle" inc_nozzle.cfg_file = "inv_nozzle.cfg" inc_nozzle.test_iter = 20 - inc_nozzle.test_vals = [-6.051005, -5.361765, 0.006999, 0.127295] + inc_nozzle.test_vals = [-6.357399, -5.618580, 0.004548, 0.126243] test_list.append(inc_nozzle) # Laminar wall mounted cylinder, Euler walls, cylinder wall diagonally split @@ -1154,7 +1154,7 @@ def main(): harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 - harmonic_balance.test_vals = [-1.559187, 0.829575, 0.931512, 3.954440] + harmonic_balance.test_vals = [-1.556449, 0.840517, 0.943602, 3.957291] test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -1175,7 +1175,7 @@ def main(): rot_naca0012.cfg_dir = "rotating/naca0012" rot_naca0012.cfg_file = "rot_NACA0012.cfg" rot_naca0012.test_iter = 25 - rot_naca0012.test_vals = [-0.023360, 0.082942, 2.000000, -1.182142] + rot_naca0012.test_vals = [-0.028757, 0.058709, 2.000000, -1.147370] test_list.append(rot_naca0012) # Lid-driven cavity @@ -1225,7 +1225,7 @@ def main(): sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 - sine_gust.test_vals = [-1.977498, 3.481817, -0.011360, -0.005241] + sine_gust.test_vals = [-1.977498, 3.481833, -0.013388, -0.003910] sine_gust.unsteady = True test_list.append(sine_gust) @@ -1254,7 +1254,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.004011, -6.876257, 1.487888, 0.421869] + unst_inc_turb_naca0015_sa.test_vals = [-3.002783, -6.875096, 1.487783, 0.421690] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) @@ -1369,7 +1369,7 @@ def main(): uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" uniform_flow.test_iter = 5 - uniform_flow.test_vals = [5.000000, 0.000000, -0.195001, -10.624448] + uniform_flow.test_vals = [5.000000, 0.000000, -0.193989, -10.624451] uniform_flow.unsteady = True uniform_flow.multizone = True test_list.append(uniform_flow) @@ -1387,7 +1387,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.466408, 0.346806, 0.397328] + channel_2D.test_vals = [2.000000, 0.000000, 0.399141, 0.350260, 0.405570] channel_2D.timeout = 100 channel_2D.unsteady = True channel_2D.multizone = True @@ -1409,7 +1409,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.070225, 0.528893, 0.684173, 0.970355, 1.065262] + pipe.test_vals = [0.024970, 0.452312, 0.562852, 0.974613, 1.031075] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -1419,7 +1419,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686431, 1.159459, 1.151139] + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686417, 1.152593, 1.145900] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -1429,7 +1429,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.126036, 1.081775] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064262] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -1538,7 +1538,7 @@ def main(): fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [4, 0, -3.726013, -4.277529] + fsi2d.test_vals = [4.000000, 0.000000, -3.725519, -4.278760] fsi2d.command = TestCase.Command(exec = "parallel_computation_fsi.py", param = "-f") fsi2d.multizone= True fsi2d.unsteady = True @@ -1549,7 +1549,7 @@ def main(): dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" dyn_fsi.test_iter = 4 - dyn_fsi.test_vals = [-4.330741, -4.152826, 0.000000, 75.000000] + dyn_fsi.test_vals = [-4.328805, -4.153009, 0.000000, 75.000000] dyn_fsi.multizone = True dyn_fsi.unsteady = True test_list.append(dyn_fsi) @@ -1660,7 +1660,7 @@ def main(): pywrapper_aeroelastic.cfg_dir = "aeroelastic" pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" pywrapper_aeroelastic.test_iter = 2 - pywrapper_aeroelastic.test_vals = [-1.876636, 4.021064, 0.080986, 0.027812, -0.001643, -0.000126, -0.965663] + pywrapper_aeroelastic.test_vals = [-1.876625, 4.021088, 0.083361, 0.026765, -0.001638, -0.000130, -0.947102] pywrapper_aeroelastic.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) @@ -1679,7 +1679,7 @@ def main(): pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI.cfg" pywrapper_fsi2d.test_iter = 4 - pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.726013, -4.277529] + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.725519, -4.278760] pywrapper_fsi2d.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--nZone 2 --fsi True --parallel -f") pywrapper_fsi2d.unsteady = True pywrapper_fsi2d.multizone = True @@ -1690,7 +1690,7 @@ def main(): pywrapper_unsteadyFSI.cfg_dir = "py_wrapper/dyn_fsi" pywrapper_unsteadyFSI.cfg_file = "config.cfg" pywrapper_unsteadyFSI.test_iter = 4 - pywrapper_unsteadyFSI.test_vals = [0, 31, 5, 47, -1.756677, -2.828286, -7.638545, -6.863930, 0.000156] + pywrapper_unsteadyFSI.test_vals = [0.000000, 30.000000, 5.000000, 48.000000, -1.756676, -2.828284, -7.625018, -6.863923, 0.000156] pywrapper_unsteadyFSI.command = TestCase.Command("mpirun -np 2", "python", "run.py") pywrapper_unsteadyFSI.unsteady = True pywrapper_unsteadyFSI.multizone = True @@ -1721,7 +1721,7 @@ def main(): pywrapper_deformingBump.cfg_dir = "py_wrapper/deforming_bump_in_channel" pywrapper_deformingBump.cfg_file = "config.cfg" pywrapper_deformingBump.test_iter = 1 - pywrapper_deformingBump.test_vals = [0.500000, 0.000000, -2.556310, -1.270841, -2.350592, 2.606850, 8.015020, -0.301652] + pywrapper_deformingBump.test_vals = [0.500000, 0.000000, -2.556310, -1.270836, -2.351316, 2.905858, 9.953163, -0.946408] pywrapper_deformingBump.command = TestCase.Command("mpirun -np 2", "python", "run.py") pywrapper_deformingBump.unsteady = True test_list.append(pywrapper_deformingBump) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 99e31c3124a0..ebd1193f4b0c 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.742490, 5.136585, 7.107742, 2.488366] + discadj_axisymmetric_rans_nozzle.test_vals = [9.738854, 5.135195, 7.108430, 2.487299] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) @@ -217,7 +217,7 @@ def main(): discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 - discadj_pitchingNACA0012.test_vals = [-1.039711, -1.508402, -0.006059, 0.000012] + discadj_pitchingNACA0012.test_vals = [-1.115587, -1.573317, -0.006474, 0.000010] discadj_pitchingNACA0012.tol = 0.01 discadj_pitchingNACA0012.unsteady = True test_list.append(discadj_pitchingNACA0012) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index dccf3b6a8a4f..eb6c08d5ffc4 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -375,7 +375,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.135350, 0.436347, -2.878865, 1.663300, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.121517, 0.452804, -2.910659, 1.662143, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143715, -9.170705, -10.848554, -5.776746, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -385,7 +385,7 @@ def main(): axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_species.cfg_file = "air_nozzle_species.cfg" axi_rans_air_nozzle_species.test_iter = 10 - axi_rans_air_nozzle_species.test_vals = [-2.243181, 3.273075, -1.958732, 5.883857, -2.469621, 0.000000] + axi_rans_air_nozzle_species.test_vals = [-2.148980, 3.342062, -1.939182, 5.883411, -2.443141, 0.000000] axi_rans_air_nozzle_species.tol = 0.0001 test_list.append(axi_rans_air_nozzle_species) @@ -798,7 +798,7 @@ def main(): harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 - harmonic_balance.test_vals = [-1.559187, 0.829575, 0.931512, 3.954440] + harmonic_balance.test_vals = [-1.556449, 0.840517, 0.943602, 3.957291] test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -818,7 +818,7 @@ def main(): rot_naca0012.cfg_dir = "rotating/naca0012" rot_naca0012.cfg_file = "rot_NACA0012.cfg" rot_naca0012.test_iter = 25 - rot_naca0012.test_vals = [-1.240352, 4.268727, -0.022164, 0.083891, 2.000000, -1.253214] + rot_naca0012.test_vals = [-1.281757, 4.222928, -0.027656, 0.059256, 2.000000, -1.218300] test_list.append(rot_naca0012) # Lid-driven cavity @@ -855,7 +855,7 @@ def main(): sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 - sine_gust.test_vals = [-1.977498, 3.481817, -0.010871, -0.005083] + sine_gust.test_vals = [-1.977498, 3.481833, -0.012952, -0.003623] sine_gust.unsteady = True test_list.append(sine_gust) @@ -864,7 +864,7 @@ def main(): aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 - aeroelastic.test_vals = [-1.876632, 4.021072, 0.080240, 0.027935, -0.001641, -0.000127, -1.133898] + aeroelastic.test_vals = [-1.876630, 4.021083, 0.082484, 0.026820, -0.001638, -0.000129, -1.081133] aeroelastic.unsteady = True test_list.append(aeroelastic) @@ -882,7 +882,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.007635, -6.879816, 1.445300, 0.419281] + unst_inc_turb_naca0015_sa.test_vals = [-3.005435, -6.878657, 1.445291, 0.420526] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) # unsteady pitching NACA64A010, RANS, SA @@ -898,7 +898,7 @@ def main(): unst_pitching_naca64a010_euler.cfg_dir = "unsteady/pitching_naca64a010_euler" unst_pitching_naca64a010_euler.cfg_file = "pitching_NACA64A010.cfg" unst_pitching_naca64a010_euler.test_iter = 2 - unst_pitching_naca64a010_euler.test_vals = [-1.186839, 4.280301, -0.039724, 0.000927] + unst_pitching_naca64a010_euler.test_vals = [-1.186839, 4.280671, -0.026619, 0.000937] unst_pitching_naca64a010_euler.unsteady = True test_list.append(unst_pitching_naca64a010_euler) # unsteady plunging NACA0012, Laminar NS @@ -915,7 +915,7 @@ def main(): unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" unst_deforming_naca0012.test_iter = 5 - unst_deforming_naca0012.test_vals = [-3.667005, -3.796733, -3.719112, -3.150401] + unst_deforming_naca0012.test_vals = [-3.666074, -3.794974, -3.717659, -3.149285] unst_deforming_naca0012.unsteady = True test_list.append(unst_deforming_naca0012) @@ -1012,7 +1012,7 @@ def main(): uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" uniform_flow.test_iter = 2 - uniform_flow.test_vals = [2.000000, 0.000000, -0.230639, -13.250208] + uniform_flow.test_vals = [2.000000, 0.000000, -0.230680, -13.251592] uniform_flow.test_vals_aarch64 = [2.000000, 0.000000, -0.230641, -13.249000] uniform_flow.tol = 0.000001 uniform_flow.unsteady = True @@ -1033,7 +1033,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.466389, 0.346857, 0.397472] + channel_2D.test_vals = [2.000000, 0.000000, 0.399122, 0.350309, 0.405616] channel_2D.timeout = 100 channel_2D.unsteady = True channel_2D.multizone = True @@ -1056,7 +1056,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.528897, 0.684175, 0.970353, 1.065262] + pipe.test_vals = [0.452310, 0.562852, 0.974610, 1.031075] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -1066,7 +1066,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686432, 1.159461, 1.151134] + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686419, 1.152594, 1.145895] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -1076,7 +1076,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.126036, 1.081775] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064261] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -1154,7 +1154,7 @@ def main(): fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [4, 0, -3.726015, -4.277528] + fsi2d.test_vals = [4.000000, 0.000000, -3.725521, -4.278759] fsi2d.multizone = True fsi2d.unsteady = True test_list.append(fsi2d) @@ -1173,7 +1173,7 @@ def main(): dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" dyn_fsi.test_iter = 4 - dyn_fsi.test_vals = [-4.330728, -4.152820, 0.000000, 85.000000] + dyn_fsi.test_vals = [-4.328792, -4.153004, 0.000000, 86.000000] dyn_fsi.multizone = True dyn_fsi.unsteady = True test_list.append(dyn_fsi) @@ -1716,7 +1716,7 @@ def main(): pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI.cfg" pywrapper_fsi2d.test_iter = 4 - pywrapper_fsi2d.test_vals = [4, 0, -3.726015, -4.277528] + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.725521, -4.278759] pywrapper_fsi2d.command = TestCase.Command(exec = "SU2_CFD.py", param = "--nZone 2 --fsi True -f") pywrapper_fsi2d.unsteady = True pywrapper_fsi2d.multizone = True diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 288f8a47efd3..83e768e954e8 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -158,7 +158,7 @@ def main(): discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 - discadj_pitchingNACA0012.test_vals = [-1.057526, -1.512609, -0.004842, 0.000013] + discadj_pitchingNACA0012.test_vals = [-1.138369, -1.575068, -0.005301, 0.000003] discadj_pitchingNACA0012.unsteady = True test_list.append(discadj_pitchingNACA0012) @@ -167,7 +167,7 @@ def main(): unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform_ad.cfg" unst_deforming_naca0012.test_iter = 4 - unst_deforming_naca0012.test_vals = [-1.874283, -1.768562, 4274.000000, 0.000003] + unst_deforming_naca0012.test_vals = [-1.875062, -1.766683, 4307.900000, 0.000003] unst_deforming_naca0012.unsteady = True test_list.append(unst_deforming_naca0012) From bcdd766c017eff4e1bbef7ca86cbaecc2f65a6a2 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 22 Oct 2026 09:44:45 +0200 Subject: [PATCH 34/43] Update the reference values from the CI Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013YFdgQwrRqCQ2ihG446aNe --- TestCases/hybrid_regression.py | 46 +++++++++++------------ TestCases/hybrid_regression_AD.py | 2 +- TestCases/parallel_regression.py | 58 ++++++++++++++--------------- TestCases/parallel_regression_AD.py | 10 ++--- TestCases/serial_regression.py | 54 +++++++++++++-------------- TestCases/serial_regression_AD.py | 6 +-- TestCases/tutorials.py | 6 +-- TestCases/vandv.py | 10 ++--- 8 files changed, 96 insertions(+), 96 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 60e5c01fbc7f..fa01e5b51118 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -149,7 +149,7 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.004080, -7.638116, -0.000000, 2.089953] + poiseuille_profile.test_vals = [-12.004086, -7.637842, -0.000000, 2.089953] poiseuille_profile.test_vals_aarch64 = [-12.004276, -7.636719, -0.000000, 2.089953] test_list.append(poiseuille_profile) @@ -178,7 +178,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.461774, 5.883885, 0.630267, 0.020404, 100.000000] + rae2822_sst.test_vals = [-1.436649, 5.889182, 0.659764, 0.021350, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -194,7 +194,7 @@ def main(): turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 20 - turb_flatplate.test_vals = [-0.187373, 0.003723, 10.000000, -1.443902] + turb_flatplate.test_vals = [-0.187373, 0.003723, 10.000000, -1.444398] test_list.append(turb_flatplate) # ONERA M6 Wing @@ -210,7 +210,7 @@ def main(): turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 5 - turb_naca0012_sa.test_vals = [-12.038075, -16.332088, 1.080346, 0.018385, 20.000000, -2.873507, 0.000000, -14.250270, 0.000000] + turb_naca0012_sa.test_vals = [-12.038098, -16.332088, 1.080346, 0.018385, 20.000000, -2.873012, 0.000000, -14.250270, 0.000000] turb_naca0012_sa.test_vals_aarch64 = [-12.038091, -16.332090, 1.080346, 0.018385, 20.000000, -2.873236, 0.000000, -14.250271, 0.000000] test_list.append(turb_naca0012_sa) @@ -219,7 +219,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.094026, -15.250728, -5.906323, 1.070413, 0.015775, -2.854334, 0.000000] + turb_naca0012_sst.test_vals = [-5.948963, -10.295280, -3.740016, 1.069295, 0.015905, -3.049395, 0.000000] turb_naca0012_sst.test_vals_aarch64 = [-12.075928, -15.246732, -5.861249, 1.070036, 0.015841, -2.835263, 0] test_list.append(turb_naca0012_sst) @@ -228,7 +228,7 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-12.080919, -14.837175, -5.732906, 1.000893, 0.019109, -2.119961] + turb_naca0012_sst_sust.test_vals = [-9.951719, -11.674782, -5.092201, 1.000888, 0.019126, -1.639020] turb_naca0012_sst_sust.test_vals_aarch64 = [-12.073210, -14.836724, -5.732627, 1.000050, 0.019144, -2.629689] test_list.append(turb_naca0012_sst_sust) @@ -245,7 +245,7 @@ def main(): turb_naca0012_sst_expliciteuler.cfg_dir = "rans/naca0012" turb_naca0012_sst_expliciteuler.cfg_file = "turb_NACA0012_sst_expliciteuler.cfg" turb_naca0012_sst_expliciteuler.test_iter = 10 - turb_naca0012_sst_expliciteuler.test_vals = [-3.532365, -3.157224, 3.743381, 1.124798, 0.501715, -16.000000] + turb_naca0012_sst_expliciteuler.test_vals = [-3.408465, -3.157224, 3.743383, 1.124790, 0.501715, -16.000000] test_list.append(turb_naca0012_sst_expliciteuler) # PROPELLER @@ -265,7 +265,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.069624, 0.505288, -2.816368, 1.728267, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.066047, 0.510609, -1.717316, 2.920473, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.140441, -9.154674, -10.886121, -5.806594, 0.000000] test_list.append(axi_rans_air_nozzle_restart) @@ -279,7 +279,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.551665, -5.057150, 0.830240, -0.008811, 0.078187] + turb_naca0012_sst_restart_mg.test_vals = [-3.689602, -5.056964, 0.830559, -0.008732, 0.078126] test_list.append(turb_naca0012_sst_restart_mg) ############################# @@ -291,7 +291,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.978722, 1.343530, 0.443909, -0.029125] + turb_naca0012_1c.test_vals = [-4.964592, 1.345541, 0.446118, -0.028439] turb_naca0012_1c.test_vals_aarch64 = [-4.976620, 1.345983, 0.433171, -0.033685] test_list.append(turb_naca0012_1c) @@ -300,7 +300,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482844, 1.260870, 0.404376, -0.040361] + turb_naca0012_2c.test_vals = [-5.482846, 1.260731, 0.404913, -0.040192] turb_naca0012_2c.test_vals_aarch64 = [-5.485484, 1.263406, 0.411442, -0.040859] test_list.append(turb_naca0012_2c) @@ -309,7 +309,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583730, 1.228732, 0.381967, -0.046233] + turb_naca0012_3c.test_vals = [-5.583734, 1.228655, 0.379717, -0.047003] turb_naca0012_3c.test_vals_aarch64 = [-5.583737, 1.232005, 0.390258, -0.046305] test_list.append(turb_naca0012_3c) @@ -318,7 +318,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.134181, 1.283464, 0.553971, 0.011916] + turb_naca0012_p1c1.test_vals = [-5.165277, 1.279520, 0.549254, 0.010996] turb_naca0012_p1c1.test_vals_aarch64 = [-5.114189, 1.285037, 0.406851, -0.043003] test_list.append(turb_naca0012_p1c1) @@ -327,7 +327,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.553988, 1.234031, 0.424168, -0.033501] + turb_naca0012_p1c2.test_vals = [-5.553200, 1.234059, 0.424695, -0.033351] turb_naca0012_p1c2.test_vals_aarch64 = [-5.548245, 1.236384, 0.381821, -0.050337] test_list.append(turb_naca0012_p1c2) @@ -501,7 +501,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-2.560678, -1.175981, 0.062204, 1.399351, 2.219223, 1.399297, 2.217470, 0.000000] + square_cylinder.test_vals = [-2.560698, -1.175955, 0.062131, 1.399399, 2.220356, 1.399347, 2.218595, 0.000000] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -602,7 +602,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.959252, -12.213981, -19.314222, -13.600248, -19.076384, -13.444335, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-0.170804, -0.162041, -8.236409, -2.533080, -7.364785, -1.876220, 73290.000000, 73290.000000, 0.020065, 82.291000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -610,7 +610,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [1.167512, 1.598494, -2.928579, 2.573642, -2.527390, 3.016171, 106370.000000, 106370.000000, 5.726800, 64.383000] + axial_stage2D.test_vals = [1.166038, 1.598534, -2.928564, 2.573650, -2.527328, 3.016255, 106370.000000, 106370.000000, 5.726800, 64.395000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -618,7 +618,7 @@ def main(): transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" transonic_stator_restart.test_iter = 20 - transonic_stator_restart.test_vals = [-4.367144, -2.487733, -2.079075, 1.728173, -1.464952, 3.225025, -471620.000000, 94.839000, -0.051124] + transonic_stator_restart.test_vals = [-4.363280, -2.484853, -2.078097, 1.730856, -1.464954, 3.223391, -471620.000000, 94.839000, -0.098969] transonic_stator_restart.test_vals_aarch64 = [-4.442510, -2.561369, -2.165778, 1.652750, -1.355494, 3.172712, -471620.000000, 94.843000, -0.043825] test_list.append(transonic_stator_restart) @@ -640,7 +640,7 @@ def main(): uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" uniform_flow.test_iter = 5 - uniform_flow.test_vals = [5.000000, 0.000000, -0.193990, -10.624443] + uniform_flow.test_vals = [5.000000, 0.000000, -0.193990, -10.624456] uniform_flow.unsteady = True uniform_flow.multizone = True test_list.append(uniform_flow) @@ -659,7 +659,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.399109, 0.350302, 0.405582] + channel_2D.test_vals = [2.000000, 0.000000, 0.399108, 0.350302, 0.405584] channel_2D.unsteady = True channel_2D.multizone = True test_list.append(channel_2D) @@ -701,7 +701,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064252] + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064251] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -763,7 +763,7 @@ def main(): dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" dyn_fsi.test_iter = 4 - dyn_fsi.test_vals = [-4.328791, -4.152991, 0.000000, 103.000000] + dyn_fsi.test_vals = [-4.328791, -4.152991, 0.000000, 102.000000] dyn_fsi.multizone = True dyn_fsi.unsteady = True test_list.append(dyn_fsi) @@ -773,7 +773,7 @@ def main(): fsi_cht_restart.cfg_dir = "fea_fsi/stat_fsi" fsi_cht_restart.cfg_file = "config_restart.cfg" fsi_cht_restart.test_iter = 0 - fsi_cht_restart.test_vals = [5.000000, 0.006352, -1.960362, -9.327033, -9.644570, -9.319618, 608.380000, -0.012974, 0.000000, 20.000000] + fsi_cht_restart.test_vals = [5.000000, 0.006352, -1.960362, -9.327033, -9.619476, -9.319378, 608.380000, -0.012974, 0.000000, 20.000000] fsi_cht_restart.multizone = True test_list.append(fsi_cht_restart) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index 6a693812d903..5f168cba1b67 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -87,7 +87,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.201555, -0.175213, 3.045200, -0.041846] + discadj_rans_naca0012_sst.test_vals = [-2.201606, -0.172546, 3.045700, -0.041853] discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.201855, -0.172443, 3.043400, -0.041820] test_list.append(discadj_rans_naca0012_sst) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 8180634dddf9..05eb8db8ec33 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -336,7 +336,7 @@ def main(): ramp_msw.cfg_dir = "euler/ramp" ramp_msw.cfg_file = "inv_ramp_msw.cfg" ramp_msw.test_iter = 100 - ramp_msw.test_vals = [-7.242600, -1.471141, -0.077507, 0.054419] + ramp_msw.test_vals = [-6.972874, -1.216000, -0.077507, 0.054419] ramp_msw.tol = [0.2, 0.2, 0.00001, 0.00001] test_list.append(ramp_msw) @@ -471,7 +471,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.485957, 5.891491, 0.675200, 0.023427, 100.000000] + rae2822_sst.test_vals = [-1.493359, 5.883418, 0.657627, 0.022989, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -519,7 +519,7 @@ def main(): turb_flatplate_sst_roughBCKnopp.cfg_dir = "rans/flatplate/roughness/bc_knopp" turb_flatplate_sst_roughBCKnopp.cfg_file = "turb_SST_flatplate_roughBCKnopp.cfg" turb_flatplate_sst_roughBCKnopp.test_iter = 10 - turb_flatplate_sst_roughBCKnopp.test_vals = [-5.058634, -2.460850, -2.847064, 0.447200, -2.595042, 1.497149, -0.188079, 0.004571] + turb_flatplate_sst_roughBCKnopp.test_vals = [-4.619122, -2.026481, -2.392910, 0.885845, -2.501638, 1.532115, -0.188182, 0.004571] test_list.append(turb_flatplate_sst_roughBCKnopp) # FLAT PLATE, ROUGHNESS BC AUPOIX SST @@ -527,7 +527,7 @@ def main(): turb_flatplate_sst_roughBCAupoix.cfg_dir = "rans/flatplate/roughness/bc_aupoix" turb_flatplate_sst_roughBCAupoix.cfg_file = "turb_SST_flatplate_roughBCAupoix.cfg" turb_flatplate_sst_roughBCAupoix.test_iter = 10 - turb_flatplate_sst_roughBCAupoix.test_vals = [-5.278728, -2.302982, -2.890419, 0.227585, -1.393786, 3.192601, -0.188729, 0.0071821] + turb_flatplate_sst_roughBCAupoix.test_vals = [-4.844108, -2.112938, -2.523195, 0.663960, -1.393641, 3.192483, -0.188503, 0.007182] test_list.append(turb_flatplate_sst_roughBCAupoix) # FLAT PLATE, WALL FUNCTIONS, COMPRESSIBLE SA, restart from a solution without wall functions @@ -571,7 +571,7 @@ def main(): turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 5 - turb_naca0012_sa.test_vals = [-12.037552, -16.376949, 1.080346, 0.018385, 20.000000, -1.564082, 20.000000, -4.180917, 0.000000] + turb_naca0012_sa.test_vals = [-12.037491, -16.376949, 1.080346, 0.018385, 20.000000, -1.564168, 20.000000, -4.180902, 0.000000] turb_naca0012_sa.test_vals_aarch64 = [-12.037489, -16.376949, 1.080346, 0.018385, 20.000000, -1.564143, 20.000000, -4.180945, 0.000000] turb_naca0012_sa.timeout = 3200 test_list.append(turb_naca0012_sa) @@ -581,7 +581,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.094692, -15.251093, -5.906365, 1.070413, 0.015775, -2.376043, 0.000000] + turb_naca0012_sst.test_vals = [-5.949151, -10.294577, -3.763019, 1.069291, 0.015902, -3.459014, 0.000000] turb_naca0012_sst.test_vals_aarch64 = [-12.075620, -15.246688, -5.861276, 1.070036, 0.015841, -1.991001, 0.000000] turb_naca0012_sst.timeout = 3200 test_list.append(turb_naca0012_sst) @@ -591,7 +591,7 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-12.081966, -14.837177, -5.733436, 1.000893, 0.019109, -2.241123] + turb_naca0012_sst_sust.test_vals = [-9.963808, -11.675704, -5.093478, 1.000889, 0.019126, -1.603990] turb_naca0012_sst_sust.test_vals_aarch64 = [-12.073964, -14.836726, -5.732390, 1.000050, 0.019144, -2.229074] turb_naca0012_sst_sust.timeout = 3200 test_list.append(turb_naca0012_sst_sust) @@ -601,7 +601,7 @@ def main(): turb_naca0012_sst_2003_Vm.cfg_dir = "rans/naca0012" turb_naca0012_sst_2003_Vm.cfg_file = "turb_NACA0012_sst_2003-Vm.cfg" turb_naca0012_sst_2003_Vm.test_iter = 10 - turb_naca0012_sst_2003_Vm.test_vals = [-10.168739, -3.668709, 1.060563, 0.019147, -2.282800] + turb_naca0012_sst_2003_Vm.test_vals = [-10.076544, -3.586031, 1.059474, 0.019231, -3.088893] turb_naca0012_sst_2003_Vm.timeout = 3200 test_list.append(turb_naca0012_sst_2003_Vm) @@ -610,7 +610,7 @@ def main(): turb_naca0012_sst_1994_KLm.cfg_dir = "rans/naca0012" turb_naca0012_sst_1994_KLm.cfg_file = "turb_NACA0012_sst_1994-KLm.cfg" turb_naca0012_sst_1994_KLm.test_iter = 10 - turb_naca0012_sst_1994_KLm.test_vals = [-10.390871, -3.701584, 1.062164, 0.019076, -2.426123] + turb_naca0012_sst_1994_KLm.test_vals = [-10.196762, -3.596952, 1.061057, 0.019163, -3.186595] turb_naca0012_sst_1994_KLm.timeout = 3200 test_list.append(turb_naca0012_sst_1994_KLm) @@ -619,7 +619,7 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-10.440016, 0.774146, 1.022363, 0.040546, -3.736437] + turb_naca0012_sst_fixedvalues.test_vals = [-10.440029, 0.774146, 1.022363, 0.040546, -3.736439] turb_naca0012_sst_fixedvalues.timeout = 3200 test_list.append(turb_naca0012_sst_fixedvalues) @@ -628,7 +628,7 @@ def main(): turb_naca0012_sst_expliciteuler.cfg_dir = "rans/naca0012" turb_naca0012_sst_expliciteuler.cfg_file = "turb_NACA0012_sst_expliciteuler.cfg" turb_naca0012_sst_expliciteuler.test_iter = 10 - turb_naca0012_sst_expliciteuler.test_vals = [-3.532365, -3.157224, 3.743381, 1.124798, 0.501715, -16.000000] + turb_naca0012_sst_expliciteuler.test_vals = [-3.408465, -3.157224, 3.743383, 1.124790, 0.501715, -16.000000] turb_naca0012_sst_expliciteuler.timeout = 3200 test_list.append(turb_naca0012_sst_expliciteuler) @@ -660,7 +660,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.130654, 0.443770, -2.934019, 1.603840, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.126464, 0.450358, -1.631056, 2.883065, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143310, -9.163287, -10.858232, -5.787715, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -683,7 +683,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.560190, -5.057149, 0.830238, -0.008812, 0.078167] + turb_naca0012_sst_restart_mg.test_vals = [-3.692233, -5.056998, 0.830505, -0.008795, 0.078083] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -965,7 +965,7 @@ def main(): turbmod_sa_neg_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_neg_rae2822.cfg_file = "turb_SA_NEG_RAE2822.cfg" turbmod_sa_neg_rae2822.test_iter = 10 - turbmod_sa_neg_rae2822.test_vals = [1.275994, 1.062588, -2.067822, 1.300662, 0.480881, 0.000000] + turbmod_sa_neg_rae2822.test_vals = [1.275049, 1.063047, -2.067311, 1.280691, 0.469057, 0.000000] turbmod_sa_neg_rae2822.test_vals_aarch64 = [-1.345593, 1.448310, 1.208721, -0.846597, 1.248410, 0.489117, 0.000000] test_list.append(turbmod_sa_neg_rae2822) @@ -1115,7 +1115,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.979554, 1.344291, 0.666805, 0.010247] + turb_naca0012_1c.test_vals = [-4.965424, 1.346117, 0.672687, 0.011931] turb_naca0012_1c.test_vals_aarch64 = [-4.981036, 1.345868, 0.673232, 0.010091] test_list.append(turb_naca0012_1c) @@ -1124,7 +1124,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482691, 1.262918, 0.529442, -0.023584] + turb_naca0012_2c.test_vals = [-5.482676, 1.262851, 0.535634, -0.021752] turb_naca0012_2c.test_vals_aarch64 = [-5.484365, 1.264701, 0.501741, -0.033109] test_list.append(turb_naca0012_2c) @@ -1133,7 +1133,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583617, 1.229594, 0.463384, -0.035444] + turb_naca0012_3c.test_vals = [-5.583621, 1.229520, 0.465410, -0.035039] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -1141,7 +1141,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.129555, 1.283892, 0.808074, 0.047784] + turb_naca0012_p1c1.test_vals = [-5.164519, 1.279293, 0.810485, 0.048509] turb_naca0012_p1c1.test_vals_aarch64 = [-5.122100, 1.284478, 0.608744, -0.008593] test_list.append(turb_naca0012_p1c1) @@ -1150,7 +1150,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.554045, 1.234446, 0.603731, -0.008717] + turb_naca0012_p1c2.test_vals = [-5.553255, 1.234324, 0.608768, -0.007437] test_list.append(turb_naca0012_p1c2) ###################################### @@ -1211,7 +1211,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-1.175979, 0.062203, 1.399352, 2.219226, 1.399298, 2.217472, 0.000000] + square_cylinder.test_vals = [-1.175953, 0.062131, 1.399400, 2.220360, 1.399348, 2.218598, 0.000000] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -1318,7 +1318,7 @@ def main(): datadriven_fluidModel.cfg_dir = "nicf/datadriven" datadriven_fluidModel.cfg_file = "datadriven_nozzle.cfg" datadriven_fluidModel.test_iter = 50 - datadriven_fluidModel.test_vals = [-6.283594, -3.253961, -4.172935, -0.949415, -2.046039, 1.546933] + datadriven_fluidModel.test_vals = [-5.779669, -2.794058, -3.760455, -0.618981, -1.475343, 1.677566] test_list.append(datadriven_fluidModel) ###################################### @@ -1339,7 +1339,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.905382, -12.212100, -19.212143, -13.508268, -19.078783, -13.446389, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-0.170809, -0.162035, -8.236415, -2.533086, -7.364784, -1.876217, 73290.000000, 73290.000000, 0.020065, 82.291000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1347,7 +1347,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [1.167500, 1.598546, -2.928573, 2.573647, -2.527331, 3.016254, 106370.000000, 106370.000000, 5.726800, 64.383000] + axial_stage2D.test_vals = [1.166016, 1.598547, -2.928563, 2.573651, -2.527330, 3.016254, 106370.000000, 106370.000000, 5.726800, 64.395000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -1355,7 +1355,7 @@ def main(): transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" transonic_stator_restart.test_iter = 20 - transonic_stator_restart.test_vals = [-4.365636, -2.482248, -2.081252, 1.729763, -1.467305, 3.231073, -471620.000000, 94.837000, -0.046834] + transonic_stator_restart.test_vals = [-4.361754, -2.479177, -2.080217, 1.732474, -1.467446, 3.229306, -471620.000000, 94.837000, -0.093140] transonic_stator_restart.test_vals_aarch64 = [-4.437809, -2.553049, -2.164729, 1.657542, -1.356823, 3.178788, -471620.000000, 94.842000, -0.040365] test_list.append(transonic_stator_restart) @@ -1447,7 +1447,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.457912, -1.541047] + bars_SST_2D.test_vals = [13.000000, -0.457935, -1.540951] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -1647,7 +1647,7 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-12.094692, -15.251093, -5.906365, 1.070413, 0.015775, -2.376043, 0.000000] + pywrapper_turb_naca0012_sst.test_vals = [-5.949151, -10.294577, -3.763019, 1.069291, 0.015902, -3.459014, 0.000000] pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.075620, -15.246688, -5.861276, 1.070036, 0.015841, -1.991001, 0.000000] pywrapper_turb_naca0012_sst.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_turb_naca0012_sst.timeout = 3200 @@ -1658,7 +1658,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 10 - pywrapper_square_cylinder.test_vals = [-1.178521, -0.349772, 1.401402, 2.359105, 1.401729, 2.300974, 0.000000] + pywrapper_square_cylinder.test_vals = [-1.178744, -0.349499, 1.401128, 2.358038, 1.401474, 2.301063, 0.000000] pywrapper_square_cylinder.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) @@ -1709,7 +1709,7 @@ def main(): pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" pywrapper_unsteadyCHT.test_iter = 5 - pywrapper_unsteadyCHT.test_vals = [-1.614168, 2.260203, -0.008065, 0.201068] + pywrapper_unsteadyCHT.test_vals = [-1.614169, 2.260208, -0.008127, 0.201931] pywrapper_unsteadyCHT.command = TestCase.Command("mpirun -np 2", "python", "launch_unsteady_CHT_FlatPlate.py --parallel -f") pywrapper_unsteadyCHT.unsteady = True test_list.append(pywrapper_unsteadyCHT) @@ -1977,7 +1977,7 @@ def main(): cgns_writer.cfg_dir = "cgns_writer" cgns_writer.cfg_file = "config.cfg" cgns_writer.test_iter = 1 - cgns_writer.test_vals = [-2.974473, 0.640256, 5.371028, -6.732060] + cgns_writer.test_vals = [-2.974219, 0.639253, 5.371471, -6.721279] cgns_writer.new_output = True test_list.append(cgns_writer) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index ebd1193f4b0c..2f3d24727c4a 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -91,7 +91,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.226820, -0.256327, -2.299900, -0.003171] + discadj_rans_naca0012_sst.test_vals = [-2.226827, -0.253089, -2.299100, -0.003174] discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.226852, -0.253100, -2.299300, -0.003164] test_list.append(discadj_rans_naca0012_sst) @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.738854, 5.135195, 7.108430, 2.487299] + discadj_axisymmetric_rans_nozzle.test_vals = [9.738700, 5.135180, 7.101795, 2.487548] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) @@ -251,7 +251,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -7.555647, -10.335486, -10.356919, -13.629543] + discadj_trans_stator.test_vals = [79.000000, -7.554772, -10.335151, -10.357769, -13.628908] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.555647, -10.335486, -10.356919, -13.629543] test_list.append(discadj_trans_stator) @@ -260,7 +260,7 @@ def main(): discadj_axial_stage.cfg_dir = "disc_adj_turbomachinery/axial_stage_2D" discadj_axial_stage.cfg_file = "Axial_stage2D.cfg" discadj_axial_stage.test_iter = 79 - discadj_axial_stage.test_vals = [79.000000, -6.606356, -7.139726] + discadj_axial_stage.test_vals = [79.000000, -6.605179, -7.180296] discadj_axial_stage.test_vals_aarch64 = [79.000000, -6.606356, -7.139726] test_list.append(discadj_axial_stage) @@ -315,7 +315,7 @@ def main(): discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 8 - discadj_fsi2.test_vals = [-3.824591, 1.979595, -3.863368, 0.295450, 3.839800] + discadj_fsi2.test_vals = [-3.824635, 1.979542, -3.863368, 0.295450, 3.839800] discadj_fsi2.test_vals_aarch64 = [-3.824870, 1.979160, -3.863368, 0.295450, 3.839800] discadj_fsi2.tol = 0.00001 test_list.append(discadj_fsi2) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 16c57318510a..cb017999420a 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -216,7 +216,7 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.003115, -7.626023, -0.000000, 2.089953] + poiseuille_profile.test_vals = [-12.003110, -7.625808, -0.000000, 2.089953] poiseuille_profile.test_vals_aarch64 = [-12.009012, -7.262299, -0.000000, 2.089953] #last 4 columns test_list.append(poiseuille_profile) @@ -244,7 +244,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.916371, -1.461911, 5.894621, 0.611793, 0.016873, 100.000000] + rae2822_sst.test_vals = [-1.849587, -1.466490, 5.887578, 0.592053, 0.015314, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -268,7 +268,7 @@ def main(): turb_wallfunction_flatplate_sst.cfg_dir = "wallfunctions/flatplate/compressible_SST" turb_wallfunction_flatplate_sst.cfg_file = "turb_SST_flatplate.cfg" turb_wallfunction_flatplate_sst.test_iter = 10 - turb_wallfunction_flatplate_sst.test_vals = [-4.036300, -1.916264, -1.821790, 1.443878, -1.579554, 1.521535, 10.000000, -2.351460, 0.030011, 0.002409] + turb_wallfunction_flatplate_sst.test_vals = [-4.021540, -1.941019, -1.835888, 1.458341, -1.581319, 1.513862, 10.000000, -2.562969, 0.029270, 0.002412] test_list.append(turb_wallfunction_flatplate_sst) # FLAT PLATE, ROUGHNESS BC WILCOX2006 SST @@ -276,7 +276,7 @@ def main(): turb_flatplate_sst_roughBCWilcox2006.cfg_dir = "rans/flatplate/roughness/bc_wilcox2006" turb_flatplate_sst_roughBCWilcox2006.cfg_file = "turb_SST_flatplate_roughBCWilcox2006.cfg" turb_flatplate_sst_roughBCWilcox2006.test_iter = 10 - turb_flatplate_sst_roughBCWilcox2006.test_vals = [-5.117900, -2.534224, -2.904279, 0.381710, -3.100346, 1.180161, -0.188797, 0.004029] + turb_flatplate_sst_roughBCWilcox2006.test_vals = [-4.679459, -2.104822, -2.446835, 0.818054, -2.775001, 1.266518, -0.188523, 0.004029] test_list.append(turb_flatplate_sst_roughBCWilcox2006) # FLAT PLATE, WALL FUNCTIONS, COMPRESSIBLE SA @@ -301,7 +301,7 @@ def main(): turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 5 - turb_naca0012_sa.test_vals = [-12.037319, -16.384159, 1.080346, 0.018385, 20.000000, -3.456939, 20.000000, -4.641254, 0.000000] + turb_naca0012_sa.test_vals = [-12.037313, -16.384159, 1.080346, 0.018385, 20.000000, -3.457122, 20.000000, -4.641254, 0.000000] turb_naca0012_sa.test_vals_aarch64 = [-12.037297, -16.384158, 1.080346, 0.018385, 20.000000, -3.455886, 20.000000, -4.641247, 0.000000] turb_naca0012_sa.timeout = 3200 test_list.append(turb_naca0012_sa) @@ -311,7 +311,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.094431, -15.251082, -5.906366, 1.070413, 0.015775, -3.178469, 0.000000] + turb_naca0012_sst.test_vals = [-5.948789, -10.293776, -3.762067, 1.069269, 0.015902, -3.345367, 0.000000] turb_naca0012_sst.test_vals_aarch64 = [-12.076068, -15.246740, -5.861280, 1.070036, 0.015841, -3.297854, 0.000000] turb_naca0012_sst.timeout = 3200 test_list.append(turb_naca0012_sst) @@ -334,7 +334,7 @@ def main(): turb_naca0012_sst_2003m.cfg_dir = "rans/naca0012" turb_naca0012_sst_2003m.cfg_file = "turb_NACA0012_sst_2003m.cfg" turb_naca0012_sst_2003m.test_iter = 10 - turb_naca0012_sst_2003m.test_vals = [-7.129622, -10.410728, -3.699440, 1.061671, 0.019047, -2.435494, 0.000000] + turb_naca0012_sst_2003m.test_vals = [-5.953767, -10.205843, -3.595874, 1.060514, 0.019139, -3.188840, 0.000000] turb_naca0012_sst_2003m.timeout = 3200 test_list.append(turb_naca0012_sst_2003m) @@ -343,7 +343,7 @@ def main(): turb_naca0012_sst_sust_restart.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust_restart.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust_restart.test_iter = 10 - turb_naca0012_sst_sust_restart.test_vals = [-12.080496, -14.837169, -5.733461, 1.000893, 0.019109, -2.634008] + turb_naca0012_sst_sust_restart.test_vals = [-9.962094, -11.675499, -5.093415, 1.000888, 0.019126, -1.923274] turb_naca0012_sst_sust_restart.test_vals_aarch64 = [-12.074189, -14.836725, -5.732398, 1.000050, 0.019144, -3.315560] turb_naca0012_sst_sust_restart.timeout = 3200 test_list.append(turb_naca0012_sst_sust_restart) @@ -353,7 +353,7 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-5.206618, -10.436758, 0.774095, 1.021995, 0.040553, -3.477597] + turb_naca0012_sst_fixedvalues.test_vals = [-5.206619, -10.436774, 0.774095, 1.021995, 0.040553, -3.477596] turb_naca0012_sst_fixedvalues.timeout = 3200 test_list.append(turb_naca0012_sst_fixedvalues) @@ -375,7 +375,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.121517, 0.452804, -2.910659, 1.662143, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.118766, 0.457805, -1.643100, 2.889958, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143715, -9.170705, -10.848554, -5.776746, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -393,7 +393,7 @@ def main(): axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_species.cfg_file = "air_nozzle_species.cfg" axi_rans_air_nozzle_species.test_iter = 10 - axi_rans_air_nozzle_species.test_vals = [-2.148980, 3.342062, -1.939182, 5.883411, -2.443141, 0.000000] + axi_rans_air_nozzle_species.test_vals = [-2.148943, 3.342084, -1.939303, 5.883410, -2.443272, 0.000000] axi_rans_air_nozzle_species.tol = 0.0001 test_list.append(axi_rans_air_nozzle_species) @@ -407,7 +407,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 50 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.570974, -5.081421, 0.810883, -0.008830, 0.077967] + turb_naca0012_sst_restart_mg.test_vals = [-3.649967, -5.081630, 0.810585, -0.009208, 0.078506] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -760,7 +760,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.981181, 1.343583, 0.597111, 0.017244] + turb_naca0012_1c.test_vals = [-4.964306, 1.346025, 0.604256, 0.019699] turb_naca0012_1c.test_vals_aarch64 = [-4.992791, 1.342873, 0.557941, 0.003269] test_list.append(turb_naca0012_1c) @@ -769,7 +769,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482907, 1.262063, 0.459671, -0.026410] + turb_naca0012_2c.test_vals = [-5.482904, 1.261984, 0.464231, -0.024984] test_list.append(turb_naca0012_2c) # NACA0012 3c @@ -777,7 +777,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583768, 1.229824, 0.426258, -0.033150] + turb_naca0012_3c.test_vals = [-5.583772, 1.229781, 0.426469, -0.033207] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -785,7 +785,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.127701, 1.284875, 0.779301, 0.086111] + turb_naca0012_p1c1.test_vals = [-5.163575, 1.280570, 0.794472, 0.091341] turb_naca0012_p1c1.test_vals_aarch64 = [-5.119942, 1.283920, 0.486264, -0.021518] test_list.append(turb_naca0012_p1c1) @@ -794,7 +794,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.553987, 1.235071, 0.521197, -0.004487] + turb_naca0012_p1c2.test_vals = [-5.553130, 1.235035, 0.577646, 0.018241] test_list.append(turb_naca0012_p1c2) ###################################### @@ -854,7 +854,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-2.560678, -1.175979, 0.062202, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] + square_cylinder.test_vals = [-2.560698, -1.175954, 0.062130, 1.399399, 2.220367, 1.399347, 2.218605, 0.000000] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -974,7 +974,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.905642, -12.212181, -19.212554, -13.508053, -19.069991, -13.439494, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-0.170799, -0.162039, -8.236404, -2.533076, -7.364785, -1.876219, 73290.000000, 73290.000000, 0.020065, 82.291000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -982,7 +982,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [1.167521, 1.598536, -2.928575, 2.573646, -2.527330, 3.016253, 106370.000000, 106370.000000, 5.726800, 64.383000] + axial_stage2D.test_vals = [1.166038, 1.598537, -2.928565, 2.573650, -2.527330, 3.016254, 106370.000000, 106370.000000, 5.726800, 64.395000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -990,7 +990,7 @@ def main(): transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" transonic_stator_restart.test_iter = 20 - transonic_stator_restart.test_vals = [-4.367784, -2.492912, -2.082414, 1.727491, -1.466974, 3.224730, -471620.000000, 94.839000, -0.052082] + transonic_stator_restart.test_vals = [-4.363858, -2.489999, -2.081340, 1.730232, -1.467013, 3.223220, -471620.000000, 94.839000, -0.100140] transonic_stator_restart.test_vals_aarch64 = [-4.367784, -2.492912, -2.082414, 1.727491, -1.466974, 3.224730, -471620.000000, 94.839000, -0.052082] test_list.append(transonic_stator_restart) @@ -1020,7 +1020,7 @@ def main(): uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" uniform_flow.test_iter = 2 - uniform_flow.test_vals = [2.000000, 0.000000, -0.230680, -13.251592] + uniform_flow.test_vals = [2.000000, 0.000000, -0.230680, -13.248947] uniform_flow.test_vals_aarch64 = [2.000000, 0.000000, -0.230641, -13.249000] uniform_flow.tol = 0.000001 uniform_flow.unsteady = True @@ -1094,7 +1094,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.456143, -1.541051] + bars_SST_2D.test_vals = [13.000000, -0.456166, -1.540955] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -1172,7 +1172,7 @@ def main(): fsi_cht.cfg_dir = "fea_fsi/stat_fsi" fsi_cht.cfg_file = "config.cfg" fsi_cht.test_iter = 20 - fsi_cht.test_vals = [5.000000, -5.077002, -5.379450, -9.247804, -9.320014, -9.185034, 608.350000, -0.012973, 0.000000, 30.000000] + fsi_cht.test_vals = [5.000000, -5.077011, -5.379457, -9.247803, -9.320382, -9.185192, 608.350000, -0.012973, 0.000000, 29.000000] fsi_cht.multizone = True test_list.append(fsi_cht) @@ -1181,7 +1181,7 @@ def main(): dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" dyn_fsi.test_iter = 4 - dyn_fsi.test_vals = [-4.328792, -4.153004, 0.000000, 86.000000] + dyn_fsi.test_vals = [-4.328792, -4.153004, 0.000000, 85.000000] dyn_fsi.multizone = True dyn_fsi.unsteady = True test_list.append(dyn_fsi) @@ -1696,7 +1696,7 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-12.094431, -15.251082, -5.906366, 1.070413, 0.015775, -3.178469, 0.000000] + pywrapper_turb_naca0012_sst.test_vals = [-5.948789, -10.293776, -3.762067, 1.069269, 0.015902, -3.345367, 0.000000] pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.076068, -15.246740, -5.861280, 1.070036, 0.015841, -3.297854, 0.000000] pywrapper_turb_naca0012_sst.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_turb_naca0012_sst.timeout = 3200 @@ -1710,7 +1710,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 3 - pywrapper_square_cylinder.test_vals = [-2.560678, -1.175979, 0.062202, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] + pywrapper_square_cylinder.test_vals = [-2.560698, -1.175954, 0.062130, 1.399399, 2.220367, 1.399347, 2.218605, 0.000000] pywrapper_square_cylinder.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 83e768e954e8..9f9206919255 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -96,7 +96,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.096075, -0.181237, 0.350380, -0.023435] + discadj_rans_naca0012_sst.test_vals = [-2.096038, -0.178557, 0.351620, -0.023443] test_list.append(discadj_rans_naca0012_sst) ####################################### @@ -200,7 +200,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -7.308168, -9.891121, -10.038669, -13.368502] + discadj_trans_stator.test_vals = [79.000000, -7.306692, -9.889618, -10.037399, -13.367132] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.308167, -9.891117, -10.038669, -13.368501] test_list.append(discadj_trans_stator) @@ -209,7 +209,7 @@ def main(): discadj_axial_stage.cfg_dir = "disc_adj_turbomachinery/axial_stage_2D" discadj_axial_stage.cfg_file = "Axial_stage2D.cfg" discadj_axial_stage.test_iter = 79 - discadj_axial_stage.test_vals = [79.000000, -6.605593, -7.138207] + discadj_axial_stage.test_vals = [79.000000, -6.604508, -7.178602] discadj_axial_stage.test_vals_aarch64 = [79.000000, -6.605593, -7.138207] test_list.append(discadj_axial_stage) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 22e9e55fdb03..40b9366fc0bf 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -249,7 +249,7 @@ def main(): tutorial_trans_flatplate_T3A.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A" tutorial_trans_flatplate_T3A.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3A.test_iter = 20 - tutorial_trans_flatplate_T3A.test_vals = [-5.790137, -2.054834, -3.894659, -0.255074, -1.747220, 5.119341, -3.493237, 0.393262] + tutorial_trans_flatplate_T3A.test_vals = [-5.790225, -2.054843, -3.895225, -0.255157, -1.746780, 5.119343, -3.493256, 0.392487] tutorial_trans_flatplate_T3A.test_vals_aarch64 = [-5.808996, -2.070606, -3.969765, -0.277943, -1.953289, 1.708472, -3.514943, 0.357411] tutorial_trans_flatplate_T3A.no_restart = True test_list.append(tutorial_trans_flatplate_T3A) @@ -259,7 +259,7 @@ def main(): tutorial_trans_flatplate_T3Am.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A-" tutorial_trans_flatplate_T3Am.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3Am.test_iter = 20 - tutorial_trans_flatplate_T3Am.test_vals = [-5.587389, -1.700868, -3.093935, -0.102834, -3.750523, 3.287643, -2.394575, 1.119623] + tutorial_trans_flatplate_T3Am.test_vals = [-5.588634, -1.700867, -3.096990, -0.103933, -3.750523, 3.287644, -2.394576, 1.119624] tutorial_trans_flatplate_T3Am.test_vals_aarch64 = [-5.540938, -1.681627, -2.878831, -0.058224, -3.695533, 3.413628, -2.385345, 1.103633] tutorial_trans_flatplate_T3Am.no_restart = True test_list.append(tutorial_trans_flatplate_T3Am) @@ -314,7 +314,7 @@ def main(): tutorial_unst_naca0012.cfg_dir = "../Tutorials/compressible_flow/Unsteady_NACA0012" tutorial_unst_naca0012.cfg_file = "unsteady_naca0012.cfg" tutorial_unst_naca0012.test_iter = 520 - tutorial_unst_naca0012.test_vals = [520.000000, 0.000000, -5.292186, 0.000000, 0.304255, 0.792893, 0.001907, 0.010888] + tutorial_unst_naca0012.test_vals = [520.000000, 0.000000, -5.299254, 0.000000, 0.306206, 0.779691, 0.003296, 0.016165] tutorial_unst_naca0012.test_vals_aarch64 = [520, 0, -5.292359, 0, 0.284720, 0.766329, 0.000954, 0.007565] tutorial_unst_naca0012.unsteady = True test_list.append(tutorial_unst_naca0012) diff --git a/TestCases/vandv.py b/TestCases/vandv.py index 88602b2d2275..a67d0a574636 100644 --- a/TestCases/vandv.py +++ b/TestCases/vandv.py @@ -63,7 +63,7 @@ def main(): flatplate_sst1994m.cfg_dir = "vandv/rans/flatplate" flatplate_sst1994m.cfg_file = "turb_flatplate_sst.cfg" flatplate_sst1994m.test_iter = 5 - flatplate_sst1994m.test_vals = [-13.040943, -10.136971, -10.942764, -7.985181, -10.323857, -4.732487, 0.002801] + flatplate_sst1994m.test_vals = [-5.418449, -3.351150, -2.912790, 0.065870, -2.985271, 1.227315, 0.002802] flatplate_sst1994m.test_vals_aarch64 = [-13.021715, -9.534786, -10.401912, -7.501836, -9.750800, -4.850665, 0.002807] test_list.append(flatplate_sst1994m) @@ -72,7 +72,7 @@ def main(): bump_sst1994m.cfg_dir = "vandv/rans/bump_in_channel" bump_sst1994m.cfg_file = "turb_bump_sst.cfg" bump_sst1994m.test_iter = 5 - bump_sst1994m.test_vals = [-11.928292, -10.095796, -9.512953, -6.445652, -11.774088, -6.988752, 0.004931] + bump_sst1994m.test_vals = [-6.497322, -4.234388, -3.813607, -1.011693, -4.012643, 0.181789, 0.004933] bump_sst1994m.test_vals_aarch64 = [-13.042689, -10.812982, -10.604523, -7.655547, -10.816257, -5.308083, 0.004911] test_list.append(bump_sst1994m) @@ -91,7 +91,7 @@ def main(): swbli_sst.cfg_dir = "vandv/rans/swbli" swbli_sst.cfg_file = "config_sst.cfg" swbli_sst.test_iter = 5 - swbli_sst.test_vals = [-11.569218, -10.909086, -11.607984, -10.431163, -11.407588, -2.637660, 0.001816, -1.305818, -3.514590, 13.399000] + swbli_sst.test_vals = [-6.628941, -5.974370, -6.441345, -5.452139, -7.663134, 0.071743, 0.001815, -1.199316, -3.785242, 13.399000] test_list.append(swbli_sst) # DSMA661 - SA @@ -99,7 +99,7 @@ def main(): dsma661_sa.cfg_dir = "vandv/rans/dsma661" dsma661_sa.cfg_file = "dsma661_sa_config.cfg" dsma661_sa.test_iter = 5 - dsma661_sa.test_vals = [-11.255379, -8.243275, -9.037314, -5.927070, -10.737675, 0.155687, 0.024232] + dsma661_sa.test_vals = [-11.247085, -8.242815, -8.952043, -5.904549, -10.737668, 0.155687, 0.024232] dsma661_sa.test_vals_aarch64 = [-11.293183, -8.241775, -9.083761, -6.011398, -10.737680, 0.155687, 0.024232] test_list.append(dsma661_sa) @@ -108,7 +108,7 @@ def main(): dsma661_sst.cfg_dir = "vandv/rans/dsma661" dsma661_sst.cfg_file = "dsma661_sst_config.cfg" dsma661_sst.test_iter = 5 - dsma661_sst.test_vals = [-11.025153, -8.156995, -9.057021, -5.947228, -10.650874, -7.884423, 0.155882, 0.023344] + dsma661_sst.test_vals = [-2.616671, 0.009492, -0.244740, 2.840296, -2.180395, 1.413352, 0.156029, 0.023339] dsma661_sst.test_vals_aarch64 = [-10.977195, -8.403731, -8.747068, -5.808899, -10.522786, -7.369851, 0.155875, 0.023353] test_list.append(dsma661_sst) From 649d7a9cbdf6abecd577ace59eedc98caca435c5 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 29 Oct 2026 20:00:42 +0100 Subject: [PATCH 35/43] Restore regression files after develop merge --- TestCases/hybrid_regression.py | 605 ++++++++++ TestCases/parallel_regression.py | 1678 +++++++++++++++++++++++++++ TestCases/parallel_regression_AD.py | 481 ++++++++ TestCases/serial_regression.py | 1410 ++++++++++++++++++++++ 4 files changed, 4174 insertions(+) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 0efa08ae05de..86bac9c010c7 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -266,3 +266,608 @@ def main(): axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 axi_rans_air_nozzle_restart.test_vals = [-5.069624, 0.505288, -2.816368, 1.728267, 0.000000] + axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.140441, -9.154674, -10.886121, -5.806594, 0.000000] + test_list.append(axi_rans_air_nozzle_restart) + + ################################# + ## Compressible RANS Restart ### + ################################# + + # NACA0012 SST Multigrid restart + turb_naca0012_sst_restart_mg = TestCase('turb_naca0012_sst_restart_mg') + turb_naca0012_sst_restart_mg.cfg_dir = "rans/naca0012" + turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" + turb_naca0012_sst_restart_mg.test_iter = 20 + turb_naca0012_sst_restart_mg.ntest_vals = 5 + turb_naca0012_sst_restart_mg.test_vals = [-6.551665, -5.057150, 0.830240, -0.008811, 0.078187] + test_list.append(turb_naca0012_sst_restart_mg) + + ############################# + ### Compressibele RANS UQ ### + ############################# + + # NACA0012 1c + turb_naca0012_1c = TestCase('turb_naca0012_1c') + turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" + turb_naca0012_1c.test_iter = 10 + turb_naca0012_1c.test_vals = [-4.978722, 1.343530, 0.443909, -0.029125] + turb_naca0012_1c.test_vals_aarch64 = [-4.976620, 1.345983, 0.433171, -0.033685] + test_list.append(turb_naca0012_1c) + + # NACA0012 2c + turb_naca0012_2c = TestCase('turb_naca0012_2c') + turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" + turb_naca0012_2c.test_iter = 10 + turb_naca0012_2c.test_vals = [-5.482844, 1.260870, 0.404376, -0.040361] + turb_naca0012_2c.test_vals_aarch64 = [-5.485484, 1.263406, 0.411442, -0.040859] + test_list.append(turb_naca0012_2c) + + # NACA0012 3c + turb_naca0012_3c = TestCase('turb_naca0012_3c') + turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" + turb_naca0012_3c.test_iter = 10 + turb_naca0012_3c.test_vals = [-5.583730, 1.228732, 0.381967, -0.046233] + turb_naca0012_3c.test_vals_aarch64 = [-5.583737, 1.232005, 0.390258, -0.046305] + test_list.append(turb_naca0012_3c) + + # NACA0012 p1c1 + turb_naca0012_p1c1 = TestCase('turb_naca0012_p1c1') + turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" + turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" + turb_naca0012_p1c1.test_iter = 10 + turb_naca0012_p1c1.test_vals = [-5.134181, 1.283464, 0.553971, 0.011916] + turb_naca0012_p1c1.test_vals_aarch64 = [-5.114189, 1.285037, 0.406851, -0.043003] + test_list.append(turb_naca0012_p1c1) + + # NACA0012 p1c2 + turb_naca0012_p1c2 = TestCase('turb_naca0012_p1c2') + turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" + turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" + turb_naca0012_p1c2.test_iter = 10 + turb_naca0012_p1c2.test_vals = [-5.553988, 1.234031, 0.424168, -0.033501] + turb_naca0012_p1c2.test_vals_aarch64 = [-5.548245, 1.236384, 0.381821, -0.050337] + test_list.append(turb_naca0012_p1c2) + + ###################################### + ### Harmonic Balance ### + ###################################### + + # Description of the regression test + harmonic_balance = TestCase('harmonic_balance') + harmonic_balance.cfg_dir = "harmonic_balance" + harmonic_balance.cfg_file = "HB.cfg" + harmonic_balance.test_iter = 25 + harmonic_balance.test_vals = [-1.556450, 0.840516, 0.943600, 3.957290] + test_list.append(harmonic_balance) + + # Turbulent pitching NACA 64a010 airfoil + hb_rans_preconditioning = TestCase('hb_rans_preconditioning') + hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" + hb_rans_preconditioning.cfg_file = "davis.cfg" + hb_rans_preconditioning.test_iter = 25 + hb_rans_preconditioning.test_vals = [-1.905523, 0.482128, 0.598472, 3.605108, -5.946081] + test_list.append(hb_rans_preconditioning) + + ############################# + ### Incompressible Euler ### + ############################# + + # NACA0012 Hydrofoil + inc_euler_naca0012 = TestCase('inc_euler_naca0012') + inc_euler_naca0012.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" + inc_euler_naca0012.test_iter = 20 + inc_euler_naca0012.test_vals = [-6.668256, -5.851153, 0.531532, 0.008487] + test_list.append(inc_euler_naca0012) + + # NACA0012 Hydrofoil, pressure-based. Exercises the OpenMP path of the Poisson + # solver's boundary flux corrections (inlet, far-field, pressure outlet). + inc_euler_naca0012_pb = TestCase('inc_euler_naca0012_pb') + inc_euler_naca0012_pb.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012_pb.cfg_file = "incomp_pb_NACA0012.cfg" + inc_euler_naca0012_pb.test_iter = 20 + inc_euler_naca0012_pb.test_vals = [-4.454835, -4.784268, 0.427448, 0.012084] + test_list.append(inc_euler_naca0012_pb) + + # Laminar cylinder, pressure-based. Viscous counterpart of the hydrofoil above, so the + # threaded momentum and Rhie-Chow stages run with wall markers present. + inc_lam_cylinder_pb = TestCase('inc_lam_cylinder_pb') + inc_lam_cylinder_pb.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder_pb.cfg_file = "incomp_pb_cylinder.cfg" + inc_lam_cylinder_pb.test_iter = 10 + inc_lam_cylinder_pb.test_vals = [-3.486562, -3.776813, 0.012619, 6.205610] + test_list.append(inc_lam_cylinder_pb) + + # Laminar sphere, pressure-based. The only 3D pressure-based case, and the one where the + # alpha_p reduction sums over a different set of Jacobian diagonals per thread. + inc_lam_sphere_pb = TestCase('inc_lam_sphere_pb') + inc_lam_sphere_pb.cfg_dir = "incomp_navierstokes/sphere" + inc_lam_sphere_pb.cfg_file = "pb_sphere.cfg" + inc_lam_sphere_pb.test_iter = 9 + inc_lam_sphere_pb.test_vals = [-6.104969, -2.307895, -2.481829, -2.570423, 0.189098, 170.764342, -6.128569] + test_list.append(inc_lam_sphere_pb) + + # Heated cylinder, pressure-based, coupled energy equation and variable density. + inc_poly_cylinder_pb = TestCase('inc_poly_cylinder_pb') + inc_poly_cylinder_pb.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder_pb.cfg_file = "pb_poly_cylinder.cfg" + inc_poly_cylinder_pb.test_iter = 20 + inc_poly_cylinder_pb.test_vals = [-9.564374, -3.013394, 0.000161, 1.778555, -172.280000] + test_list.append(inc_poly_cylinder_pb) + + # C-D nozzle with pressure inlet and mass flow outlet + inc_nozzle = TestCase('inc_nozzle') + inc_nozzle.cfg_dir = "incomp_euler/nozzle" + inc_nozzle.cfg_file = "inv_nozzle.cfg" + inc_nozzle.test_iter = 20 + inc_nozzle.test_vals = [-6.121917, -5.432144, 0.000056, 0.125551] + test_list.append(inc_nozzle) + + ############################# + ### Incompressible N-S ### + ############################# + + # Laminar cylinder + inc_lam_cylinder = TestCase('inc_lam_cylinder') + inc_lam_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" + inc_lam_cylinder.test_iter = 10 + inc_lam_cylinder.test_vals = [-4.814160, -5.008238, 0.001269, 3.114987] + test_list.append(inc_lam_cylinder) + + # Buoyancy-driven cavity + inc_buoyancy = TestCase('inc_buoyancy') + inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity" + inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" + inc_buoyancy.test_iter = 20 + inc_buoyancy.test_vals = [-3.860465, -3.122402, 1.322722, -23.413000] + test_list.append(inc_buoyancy) + + # Laminar heated cylinder with polynomial fluid model + inc_poly_cylinder = TestCase('inc_poly_cylinder') + inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" + inc_poly_cylinder.test_iter = 20 + inc_poly_cylinder.test_vals = [-8.230355, -2.426276, 0.018487, 1.902089, -173.000000] + inc_poly_cylinder.test_vals_aarch64 = [-8.260165, -2.445453, 0.027209, 1.915447, -171.620000] + test_list.append(inc_poly_cylinder) + + # X-coarse laminar bend as a mixed element CGNS test + inc_lam_bend = TestCase('inc_lam_bend') + inc_lam_bend.cfg_dir = "incomp_navierstokes/bend" + inc_lam_bend.cfg_file = "lam_bend.cfg" + inc_lam_bend.test_iter = 10 + inc_lam_bend.test_vals = [-3.558795, -3.051040, -0.014118, 1.101254] + test_list.append(inc_lam_bend) + + ############################ + ### Incompressible RANS ### + ############################ + + # NACA0012, SA + inc_turb_naca0012 = TestCase('inc_turb_naca0012') + inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012.cfg_file = "naca0012.cfg" + inc_turb_naca0012.test_iter = 20 + inc_turb_naca0012.test_vals = [-4.758114, -10.974548, -0.000006, -0.028637, 4.000000, -4.016988, 2.000000, -4.487046] + test_list.append(inc_turb_naca0012) + + # NACA0012, SST_SUST + inc_turb_naca0012_sst_sust = TestCase('inc_turb_naca0012_sst_sust') + inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" + inc_turb_naca0012_sst_sust.test_iter = 20 + inc_turb_naca0012_sst_sust.test_vals = [-7.170018, 0.332638, 0.000002, 0.312117] + test_list.append(inc_turb_naca0012_sst_sust) + + # Weakly coupled heat equation + inc_weakly_coupled = TestCase('inc_weakly_coupled') + inc_weakly_coupled.cfg_dir = "disc_adj_heat" + inc_weakly_coupled.cfg_file = "primal.cfg" + inc_weakly_coupled.test_iter = 10 + inc_weakly_coupled.test_vals = [-18.106270, -16.302974, -16.484882, -15.006575, -17.858050, -14.024836, 5.609100] + test_list.append(inc_weakly_coupled) + + ###################################### + ### Moving Wall ### + ###################################### + + # Lid-driven cavity + cavity = TestCase('cavity') + cavity.cfg_dir = "moving_wall/cavity" + cavity.cfg_file = "lam_cavity.cfg" + cavity.test_iter = 25 + cavity.test_vals = [-7.887109, -2.429088, 0.013598, 0.005372] + test_list.append(cavity) + + # Spinning cylinder + spinning_cylinder = TestCase('spinning_cylinder') + spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" + spinning_cylinder.cfg_file = "spinning_cylinder.cfg" + spinning_cylinder.test_iter = 25 + spinning_cylinder.test_vals = [-7.614070, -2.155206, 1.804022, 1.893004] + spinning_cylinder.test_vals_aarch64 = [-8.008023, -2.611064, 1.497308, 1.487483] + test_list.append(spinning_cylinder) + + ###################################### + ### Unsteady ### + ###################################### + + # Square cylinder + square_cylinder = TestCase('square_cylinder') + square_cylinder.cfg_dir = "unsteady/square_cylinder" + square_cylinder.cfg_file = "turb_square.cfg" + square_cylinder.test_iter = 3 + square_cylinder.test_vals = [-2.560678, -1.175981, 0.062204, 1.399351, 2.219223, 1.399297, 2.217470, 0.000000] + square_cylinder.unsteady = True + test_list.append(square_cylinder) + + # Gust + sine_gust = TestCase('sine_gust') + sine_gust.cfg_dir = "gust" + sine_gust.cfg_file = "inv_gust_NACA0012.cfg" + sine_gust.test_iter = 5 + sine_gust.test_vals = [-1.977498, 3.481833, -0.012152, -0.004132] + sine_gust.unsteady = True + test_list.append(sine_gust) + + # Cosine gust in z-direction + cosine_gust = TestCase('cosine_gust_zdir') + cosine_gust.cfg_dir = "gust" + cosine_gust.cfg_file = "cosine_gust_zdir.cfg" + cosine_gust.test_iter = 79 + cosine_gust.test_vals = [-2.418805, 0.003015, -0.001242, 0.000500, -0.000592] + cosine_gust.unsteady = True + cosine_gust.enabled_with_tsan = False + test_list.append(cosine_gust) + + # Gust with mesh deformation + gust_mesh_defo = TestCase('gust_with_mesh_deformation') + gust_mesh_defo.cfg_dir = "gust" + gust_mesh_defo.cfg_file = "gust_with_mesh_deformation.cfg" + gust_mesh_defo.test_iter = 6 + gust_mesh_defo.test_vals = [-1.844761, 0.001449, -0.000344] + gust_mesh_defo.unsteady = True + gust_mesh_defo.enabled_with_tsan = False + test_list.append(gust_mesh_defo) + + # Aeroelastic + aeroelastic = TestCase('aeroelastic') + aeroelastic.cfg_dir = "aeroelastic" + aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" + aeroelastic.test_iter = 2 + aeroelastic.test_vals = [-1.876631, 4.021081, 0.082286, 0.026921, -0.001638, -0.000130, -1.019527] + aeroelastic.unsteady = True + aeroelastic.enabled_on_cpu_arch = ["x86_64"] # Requires AVX-capable architecture + test_list.append(aeroelastic) + + # Delayed Detached Eddy Simulation + ddes_flatplate = TestCase('ddes_flatplate') + ddes_flatplate.cfg_dir = "ddes/flatplate" + ddes_flatplate.cfg_file = "ddes_flatplate.cfg" + ddes_flatplate.test_iter = 10 + ddes_flatplate.test_vals = [-2.714713, -5.763299, -0.214960, 0.023758, 0.000000] + ddes_flatplate.unsteady = True + test_list.append(ddes_flatplate) + + # unsteady pitching NACA0015, SA + unst_inc_turb_naca0015_sa = TestCase('unst_inc_turb_naca0015_sa') + unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" + unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" + unst_inc_turb_naca0015_sa.test_iter = 1 + unst_inc_turb_naca0015_sa.test_vals = [-3.007258, -6.887901, 1.435511, 0.433955] + unst_inc_turb_naca0015_sa.unsteady = True + test_list.append(unst_inc_turb_naca0015_sa) + + # unsteady pitching NACA0012, Euler, Deforming + unst_deforming_naca0012 = TestCase('unst_deforming_naca0012') + unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" + unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" + unst_deforming_naca0012.test_iter = 5 + unst_deforming_naca0012.test_vals = [-3.666017, -3.794928, -3.717606, -3.149231] + unst_deforming_naca0012.unsteady = True + unst_deforming_naca0012.enabled_with_tsan = False + test_list.append(unst_deforming_naca0012) + + ###################################### + ### NICFD ### + ###################################### + + # Rarefaction shock wave edge_VW + edge_VW = TestCase('edge_VW') + edge_VW.cfg_dir = "nicf/edge" + edge_VW.cfg_file = "edge_VW.cfg" + edge_VW.test_iter = 25 + edge_VW.test_vals = [-11.723086, -5.536517, -0.000009, 0.000000] + test_list.append(edge_VW) + + # Rarefaction shock wave edge_PPR + edge_PPR = TestCase('edge_PPR') + edge_PPR.cfg_dir = "nicf/edge" + edge_PPR.cfg_file = "edge_PPR.cfg" + edge_PPR.test_iter = 20 + edge_PPR.test_vals = [-10.993286, -4.827527, -0.000034, 0.000000] + edge_PPR.test_vals_aarch64 = [ -7.139211, -0.980821, -0.000034, 0.000000] + test_list.append(edge_PPR) + + ###################################### + ### Turbomachinery ### + ###################################### + + # Jones APU Turbocharger restart + Jones_tc_restart = TestCase('jones_turbocharger_restart') + Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" + Jones_tc_restart.cfg_file = "Jones_restart.cfg" + Jones_tc_restart.test_iter = 5 + Jones_tc_restart.test_vals = [-11.959253, -12.213612, -19.314223, -13.600253, -19.077186, -13.444728, 73286.000000, 73286.000000, 0.020056, 82.286000] + test_list.append(Jones_tc_restart) + + # 2D axial stage + axial_stage2D = TestCase('axial_stage2D') + axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" + axial_stage2D.cfg_file = "Axial_stage2D.cfg" + axial_stage2D.test_iter = 20 + axial_stage2D.test_vals = [1.167512, 1.598494, -2.928579, 2.573642, -2.527390, 3.016171, 106370.000000, 106370.000000, 5.726800, 64.383000] + test_list.append(axial_stage2D) + + # 2D transonic stator restart + transonic_stator_restart = TestCase('transonic_stator_restart') + transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" + transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" + transonic_stator_restart.test_iter = 20 + transonic_stator_restart.test_vals = [-4.367144, -2.487733, -2.079075, 1.728173, -1.464952, 3.225025, -471620.000000, 94.839000, -0.051124] + transonic_stator_restart.test_vals_aarch64 = [-4.442510, -2.561369, -2.165778, 1.652750, -1.355494, 3.172712, -471620.000000, 94.843000, -0.043825] + test_list.append(transonic_stator_restart) + + # Multiple turbomachinery interface restart + multi_interface = TestCase('multi_interface') + multi_interface.cfg_dir = "turbomachinery/multi_interface" + multi_interface.cfg_file = "multi_interface_rst.cfg" + multi_interface.test_iter = 5 + multi_interface.test_vals = [-8.634571, -8.895558, -9.348754] + multi_interface.test_vals_aarch64 = [-8.632229, -8.894737, -9.348730] + test_list.append(multi_interface) + + ###################################### + ### Sliding Mesh ### + ###################################### + + # Uniform flow + uniform_flow = TestCase('uniform_flow') + uniform_flow.cfg_dir = "sliding_interface/uniform_flow" + uniform_flow.cfg_file = "uniform_NN.cfg" + uniform_flow.test_iter = 5 + uniform_flow.test_vals = [5.000000, 0.000000, -0.193990, -10.624443] + uniform_flow.unsteady = True + uniform_flow.multizone = True + test_list.append(uniform_flow) + + # Channel_2D, native SU2 binary mesh format (.su2b) + # channel_2D_WA.cfg loads channel_2D_su2bin.su2b directly, so SU2_DEF must + # first convert channel_2D.su2 (3 zones) into that binary mesh. + channel_2D_su2bin_convert = TestCase('channel_2D_su2bin_convert') + channel_2D_su2bin_convert.cfg_dir = "sliding_interface/channel_2D" + channel_2D_su2bin_convert.cfg_file = "mesh_su2_to_su2bin.cfg" + channel_2D_su2bin_convert.command = TestCase.Command(exec = "SU2_DEF") + channel_2D_su2bin_convert.timeout = 600 + test_list.append(channel_2D_su2bin_convert) + + channel_2D = TestCase('channel_2D') + channel_2D.cfg_dir = "sliding_interface/channel_2D" + channel_2D.cfg_file = "channel_2D_WA.cfg" + channel_2D.test_iter = 2 + channel_2D.test_vals = [2.000000, 0.000000, 0.399109, 0.350302, 0.405582] + channel_2D.unsteady = True + channel_2D.multizone = True + test_list.append(channel_2D) + + # Channel_3D + channel_3D = TestCase('channel_3D') + channel_3D.cfg_dir = "sliding_interface/channel_3D" + channel_3D.cfg_file = "channel_3D_WA.cfg" + channel_3D.test_iter = 2 + channel_3D.test_vals = [2.000000, 0.000000, 0.632749, 0.522745, 0.423269] + channel_3D.test_vals_aarch64 = [2.000000, 0.000000, 0.629112, 0.524948, 0.422396] + channel_3D.unsteady = True + channel_3D.multizone = True + channel_3D.enabled_with_tsan = False + test_list.append(channel_3D) + + # Pipe + pipe = TestCase('pipe') + pipe.cfg_dir = "sliding_interface/pipe" + pipe.cfg_file = "pipe_NN.cfg" + pipe.test_iter = 2 + pipe.test_vals = [0.024970, 0.452310, 0.562858, 0.974611, 1.031083] + pipe.unsteady = True + pipe.multizone = True + test_list.append(pipe) + + # Rotating cylinders + rotating_cylinders = TestCase('rotating_cylinders') + rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" + rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" + rotating_cylinders.test_iter = 3 + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686419, 1.152596, 1.145896] + rotating_cylinders.unsteady = True + rotating_cylinders.multizone = True + test_list.append(rotating_cylinders) + + # Supersonic vortex shedding + supersonic_vortex_shedding = TestCase('supersonic_vortex_shedding') + supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" + supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" + supersonic_vortex_shedding.test_iter = 5 + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064252] + supersonic_vortex_shedding.unsteady = True + supersonic_vortex_shedding.multizone = True + test_list.append(supersonic_vortex_shedding) + + # Bars_SST_2D + bars_SST_2D = TestCase('bars_SST_2D') + bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" + bars_SST_2D.cfg_file = "bars.cfg" + bars_SST_2D.test_iter = 13 + bars_SST_2D.test_vals = [13.000000, -0.455981, -1.541069] + bars_SST_2D.multizone = True + test_list.append(bars_SST_2D) + + # Sliding mesh with incompressible flows (steady) + slinc_steady = TestCase('slinc_steady') + slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" + slinc_steady.cfg_file = "config.cfg" + slinc_steady.test_iter = 19 + slinc_steady.test_vals = [19.000000, -1.144102, -1.424986] + slinc_steady.test_vals_aarch64 = [19.000000, -1.154874, -1.378120] + slinc_steady.multizone = True + test_list.append(slinc_steady) + + ########################## + ### FEA - FSI ### + ########################## + + # Static beam, 3d + statbeam3d = TestCase('statbeam3d') + statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" + statbeam3d.cfg_file = "configBeam_3d.cfg" + statbeam3d.test_iter = 0 + statbeam3d.test_vals = [-2.862081, -1.795143, -2.380136, 110350.000000] + statbeam3d.test_vals_aarch64 = [-2.777602, -1.710976, -2.445072, 110350] + test_list.append(statbeam3d) + + # Dynamic beam, 2d + dynbeam2d = TestCase('dynbeam2d') + dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" + dynbeam2d.cfg_file = "configBeam_2d.cfg" + dynbeam2d.test_iter = 6 + dynbeam2d.test_vals = [-3.240013, 2.895060, -0.353141, 76220] + dynbeam2d.unsteady = True + test_list.append(dynbeam2d) + + # FSI, 2d + fsi2d = TestCase('fsi2d') + fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" + fsi2d.cfg_file = "configFSI.cfg" + fsi2d.test_iter = 4 + fsi2d.test_vals = [4.000000, 0.000000, -3.725535, -4.278762] + fsi2d.multizone= True + fsi2d.unsteady = True + fsi2d.enabled_with_tsan = False + test_list.append(fsi2d) + + # FSI, Dynamic, 2D, new mesh solver + dyn_fsi = TestCase('dyn_fsi') + dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" + dyn_fsi.cfg_file = "config.cfg" + dyn_fsi.test_iter = 4 + dyn_fsi.test_vals = [-4.328791, -4.152991, 0.000000, 103.000000] + dyn_fsi.multizone = True + dyn_fsi.unsteady = True + test_list.append(dyn_fsi) + + # FSI+CHT, Static, 2D, new mesh solver, restart + fsi_cht_restart = TestCase('fsi_cht_restart') + fsi_cht_restart.cfg_dir = "fea_fsi/stat_fsi" + fsi_cht_restart.cfg_file = "config_restart.cfg" + fsi_cht_restart.test_iter = 0 + fsi_cht_restart.test_vals = [5.000000, 0.006352, -1.960362, -9.327033, -9.644570, -9.319618, 608.380000, -0.012974, 0.000000, 20.000000] + fsi_cht_restart.multizone = True + test_list.append(fsi_cht_restart) + + ############################################## + ### Method of Manufactured Solutions (MMS) ### + ############################################## + + # FVM, compressible, laminar N-S + mms_fvm_ns = TestCase('mms_fvm_ns') + mms_fvm_ns.cfg_dir = "mms/fvm_navierstokes" + mms_fvm_ns.cfg_file = "lam_mms_roe.cfg" + mms_fvm_ns.test_iter = 20 + mms_fvm_ns.test_vals = [-2.808514, 2.152654, 0.000000, 0.000000] + test_list.append(mms_fvm_ns) + + # FVM, incompressible, euler + mms_fvm_inc_euler = TestCase('mms_fvm_inc_euler') + mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" + mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" + mms_fvm_inc_euler.test_iter = 20 + mms_fvm_inc_euler.test_vals = [-9.128034, -9.441406, 0.000000, 0.000000] + mms_fvm_inc_euler.test_vals_aarch64 = [-9.128034, -9.441406, 0.000000, 0.000000] + test_list.append(mms_fvm_inc_euler) + + # FVM, incompressible, laminar N-S + mms_fvm_inc_ns = TestCase('mms_fvm_inc_ns') + mms_fvm_inc_ns.cfg_dir = "mms/fvm_incomp_navierstokes" + mms_fvm_inc_ns.cfg_file = "lam_mms_fds.cfg" + mms_fvm_inc_ns.test_iter = 20 + mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] + test_list.append(mms_fvm_inc_ns) + + ########################## + ### Python wrapper ### + ########################## + + # NACA0012 + pywrapper_translating_naca0012 = TestCase('pywrapper_translating_naca0012') + pywrapper_translating_naca0012.cfg_dir = "py_wrapper/translating_NACA0012" + pywrapper_translating_naca0012.cfg_file = "config.cfg" + pywrapper_translating_naca0012.command = TestCase.Command(exec = "python", param = "run_su2.py") + pywrapper_translating_naca0012.timeout = 60 + pywrapper_translating_naca0012.reference_file = "forces_0.csv.ref" + pywrapper_translating_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref" + pywrapper_translating_naca0012.test_file = "forces_0.csv" + pywrapper_translating_naca0012.tol_file_percent = 5.0 + pywrapper_translating_naca0012.enabled_on_cpu_arch = ["x86_64"] + pywrapper_translating_naca0012.enabled_with_tsan = False + file_diff_list.append(pywrapper_translating_naca0012) + + # NACA0012 with updated moving frame + pywrapper_updated_moving_frame_naca0012 = TestCase('pywrapper_updated_moving_frame_naca0012') + pywrapper_updated_moving_frame_naca0012.cfg_dir = "py_wrapper/updated_moving_frame_NACA12" + pywrapper_updated_moving_frame_naca0012.cfg_file = "config.cfg" + pywrapper_updated_moving_frame_naca0012.command = TestCase.Command(exec = "python", param = "run_su2.py") + pywrapper_updated_moving_frame_naca0012.timeout = 60 + pywrapper_updated_moving_frame_naca0012.reference_file = "forces_0.csv.ref" + pywrapper_updated_moving_frame_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref" + pywrapper_updated_moving_frame_naca0012.test_file = "forces_0.csv" + pywrapper_updated_moving_frame_naca0012.tol_file_percent = 5.0 + pywrapper_updated_moving_frame_naca0012.enabled_on_cpu_arch = ["x86_64"] + pywrapper_updated_moving_frame_naca0012.enabled_with_tsan = False + file_diff_list.append(pywrapper_updated_moving_frame_naca0012) + + ###################################### + ### RUN TESTS ### + ###################################### + + for test in test_list: + if test.command.empty(): + test.command = TestCase.Command(exec = "SU2_CFD", param = "-t 2") + if test.timeout == 0: + test.timeout = 600 + test.tol = 1e-4 + #end + + pass_list = [ test.run_test(args.tsan) for test in test_list ] + pass_list += [ test.run_filediff(args.tsan) for test in file_diff_list ] + + # Tests summary + print('==================================================================') + print('Summary of the hybrid parallel tests') + print('python version:', sys.version) + for i, test in enumerate(test_list+file_diff_list): + if (pass_list[i]): + print(' passed - %s'%test.tag) + else: + print('* FAILED - %s'%test.tag) + + if all(pass_list): + sys.exit(0) + else: + sys.exit(1) + # done + +if __name__ == '__main__': + main() diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 590d9a10c252..603cce741de9 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -683,3 +683,1681 @@ def main(): axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 axi_rans_air_nozzle_restart.test_vals = [-5.130654, 0.443770, -2.934019, 1.603840, 0.000000] + axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143310, -9.163287, -10.858232, -5.787715, 0.000000] + axi_rans_air_nozzle_restart.tol = 0.0001 + test_list.append(axi_rans_air_nozzle_restart) + + ################################# + ## Compressible RANS Restart ### + ################################# + + # NACA0012 SST Multigrid restart + turb_naca0012_sst_restart_mg = TestCase('turb_naca0012_sst_restart_mg') + turb_naca0012_sst_restart_mg.cfg_dir = "rans/naca0012" + turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" + turb_naca0012_sst_restart_mg.test_iter = 20 + turb_naca0012_sst_restart_mg.ntest_vals = 5 + turb_naca0012_sst_restart_mg.test_vals = [-6.560190, -5.057149, 0.830238, -0.008812, 0.078167] + turb_naca0012_sst_restart_mg.timeout = 3200 + turb_naca0012_sst_restart_mg.tol = 0.000001 + test_list.append(turb_naca0012_sst_restart_mg) + + ############################# + ### Incompressible Euler ### + ############################# + + # NACA0012 Hydrofoil + inc_euler_naca0012 = TestCase('inc_euler_naca0012') + inc_euler_naca0012.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" + inc_euler_naca0012.test_iter = 20 + inc_euler_naca0012.test_vals = [-6.920909, -6.189139, 0.531865, 0.008472] + test_list.append(inc_euler_naca0012) + + # NACA0012 Hydrofoil + inc_euler_naca0012_pb = TestCase('inc_euler_naca0012_pb') + inc_euler_naca0012_pb.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012_pb.cfg_file = "incomp_pb_NACA0012.cfg" + inc_euler_naca0012_pb.test_iter = 20 + inc_euler_naca0012_pb.test_vals = [-4.454834, -4.784269, 0.427449, 0.012084] + test_list.append(inc_euler_naca0012_pb) + + # NACA0012 Hydrofoil, pressure-based with SIMPLEC + inc_euler_naca0012_pb_simplec = TestCase('inc_euler_naca0012_pb_simplec') + inc_euler_naca0012_pb_simplec.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012_pb_simplec.cfg_file = "incomp_pb_NACA0012_simplec.cfg" + inc_euler_naca0012_pb_simplec.test_iter = 20 + inc_euler_naca0012_pb_simplec.test_vals = [-4.400610, -4.580884, 0.480955, 0.021030] + test_list.append(inc_euler_naca0012_pb_simplec) + + # C-D nozzle with pressure inlet and mass flow outlet + inc_nozzle = TestCase('inc_nozzle') + inc_nozzle.cfg_dir = "incomp_euler/nozzle" + inc_nozzle.cfg_file = "inv_nozzle.cfg" + inc_nozzle.test_iter = 20 + inc_nozzle.test_vals = [-6.357399, -5.618580, 0.004548, 0.126243] + test_list.append(inc_nozzle) + + # Laminar wall mounted cylinder, Euler walls, cylinder wall diagonally split + inc_cylinder_split = TestCase('inc_cylinder_split') + inc_cylinder_split.cfg_dir = "incomp_navierstokes/cylinder_split" + inc_cylinder_split.cfg_file = "cylinder_split.cfg" + inc_cylinder_split.test_iter = 10 + inc_cylinder_split.test_vals = [-10.207060, -11.197502, -11.296847, 10.000000] + test_list.append(inc_cylinder_split) + + ############################# + ### Incompressible N-S ### + ############################# + + # Laminar cylinder + inc_lam_cylinder = TestCase('inc_lam_cylinder') + inc_lam_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" + inc_lam_cylinder.test_iter = 10 + inc_lam_cylinder.test_vals = [-4.816099, -5.029676, -0.000155, 3.113777] + test_list.append(inc_lam_cylinder) + + # Laminar cylinder, pressure-based + inc_lam_cylinder_pb = TestCase('inc_lam_cylinder_pb') + inc_lam_cylinder_pb.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder_pb.cfg_file = "incomp_pb_cylinder.cfg" + inc_lam_cylinder_pb.test_iter = 10 + inc_lam_cylinder_pb.test_vals = [-3.486601, -3.776871, 0.012481, 6.205488] + test_list.append(inc_lam_cylinder_pb) + + # Laminar heated cylinder with polynomial fluid model, pressure-based, coupled energy + # equation and variable density. Convergence is genuine but slow (needs ~40k iterations + # for rms[h] to reach a low residual); this only checks a short trajectory guard, matching + # the pattern used for other hard-to-converge cases in this suite. + inc_poly_cylinder_pb = TestCase('inc_poly_cylinder_pb') + inc_poly_cylinder_pb.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder_pb.cfg_file = "pb_poly_cylinder.cfg" + inc_poly_cylinder_pb.test_iter = 20 + inc_poly_cylinder_pb.test_vals = [-9.820675, -3.000423, 0.002745, 1.778349, -172.280000] + test_list.append(inc_poly_cylinder_pb) + + # Unsteady heated cylinder with a polynomial fluid model, pressure-based with SIMPLEC + inc_poly_cylinder_pb_unsteady = TestCase('inc_poly_cylinder_pb_unsteady') + inc_poly_cylinder_pb_unsteady.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder_pb_unsteady.cfg_file = "pb_poly_cylinder_unsteady.cfg" + inc_poly_cylinder_pb_unsteady.test_iter = 1 + inc_poly_cylinder_pb_unsteady.test_vals = [-6.211300, -0.188735, 50.390122, -3363.100000] + inc_poly_cylinder_pb_unsteady.unsteady = True + test_list.append(inc_poly_cylinder_pb_unsteady) + + # Laminar sphere, Re=1. Last column: Cd=24/Re + inc_lam_sphere = TestCase('inc_lam_sphere') + inc_lam_sphere.cfg_dir = "incomp_navierstokes/sphere" + inc_lam_sphere.cfg_file = "sphere.cfg" + inc_lam_sphere.test_iter = 5 + inc_lam_sphere.test_vals = [-7.599894, -8.023038, -8.135420, -8.783151, 0.121003, 25.782689, -1.574889] + test_list.append(inc_lam_sphere) + + # Laminar sphere, Re=1, pressure-based. Only 3D pressure-based case in the regression suite. + inc_lam_sphere_pb = TestCase('inc_lam_sphere_pb') + inc_lam_sphere_pb.cfg_dir = "incomp_navierstokes/sphere" + inc_lam_sphere_pb.cfg_file = "pb_sphere.cfg" + inc_lam_sphere_pb.test_iter = 9 + inc_lam_sphere_pb.test_vals = [-6.104968, -2.307896, -2.481829, -2.570422, 0.189097, 170.764256, -6.848045] + test_list.append(inc_lam_sphere_pb) + + # Laminar sphere, Re=1, pressure-based, automatic relaxation factors. The only case + # in the suite that exercises USE_AUTOMATIC_RELAXATION_FACTORS, and 3D since the alpha_p + # bug this guards against is invisible in 2D (it sums the wrong set of Jacobian diagonals). + inc_lam_sphere_pb_urf = TestCase('inc_lam_sphere_pb_urf') + inc_lam_sphere_pb_urf.cfg_dir = "incomp_navierstokes/sphere" + inc_lam_sphere_pb_urf.cfg_file = "pb_sphere_urf.cfg" + inc_lam_sphere_pb_urf.test_iter = 9 + inc_lam_sphere_pb_urf.test_vals = [-4.745234, -2.241022, -2.374688, -1.689495, 0.216842, 206.109402, -6.281761] + test_list.append(inc_lam_sphere_pb_urf) + + # Buoyancy-driven cavity + inc_buoyancy = TestCase('inc_buoyancy') + inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity" + inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" + inc_buoyancy.test_iter = 20 + inc_buoyancy.test_vals = [-3.860462, -3.122401, 1.322722, -23.414000] + test_list.append(inc_buoyancy) + + # Laminar heated cylinder with polynomial fluid model + inc_poly_cylinder = TestCase('inc_poly_cylinder') + inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" + inc_poly_cylinder.test_iter = 20 + inc_poly_cylinder.test_vals = [-2.363389, 0.005552, 1.922971, -172.380000] + test_list.append(inc_poly_cylinder) + + # X-coarse laminar bend as a mixed element CGNS test + inc_lam_bend = TestCase('inc_lam_bend') + inc_lam_bend.cfg_dir = "incomp_navierstokes/bend" + inc_lam_bend.cfg_file = "lam_bend.cfg" + inc_lam_bend.test_iter = 10 + inc_lam_bend.test_vals = [-3.585943, -3.096592, -0.022111, 1.064110] + test_list.append(inc_lam_bend) + + # X-coarse laminar bend as a mixed element CGNS test, pressure-based + inc_lam_bend_pb = TestCase('inc_lam_bend_pb') + inc_lam_bend_pb.cfg_dir = "incomp_navierstokes/bend" + inc_lam_bend_pb.cfg_file = "pb_lam_bend.cfg" + inc_lam_bend_pb.test_iter = 10 + inc_lam_bend_pb.test_vals = [-4.137886, -3.477106, -0.014099, 0.306589] + test_list.append(inc_lam_bend_pb) + + # X-coarse laminar bend, pressure-based, variable density with a heated inlet + inc_lam_bend_pb_heated = TestCase('inc_lam_bend_pb_heated') + inc_lam_bend_pb_heated.cfg_dir = "incomp_navierstokes/bend" + inc_lam_bend_pb_heated.cfg_file = "pb_lam_bend_heated.cfg" + inc_lam_bend_pb_heated.test_iter = 10 + inc_lam_bend_pb_heated.test_vals = [-3.938675, -3.367579, 4.059184, 400.000000, 400.000000] + test_list.append(inc_lam_bend_pb_heated) + + # 3D laminar channnel with 1 cell in flow direction, streamwise periodic + sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') + sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipeSlice_3d" + sp_pipeSlice_3d_dp_hf_tp.cfg_file = "sp_pipeSlice_3d_dp_hf_tp.cfg" + sp_pipeSlice_3d_dp_hf_tp.test_iter = 10 + sp_pipeSlice_3d_dp_hf_tp.test_vals = [-11.119796, -11.234737, -9.429479, -0.000023] + test_list.append(sp_pipeSlice_3d_dp_hf_tp) + + # 2D pin array with heat transfer BC on pin surfaces + inc_heatTransfer_BC = TestCase('inc_heatTransfer_BC') + inc_heatTransfer_BC.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + inc_heatTransfer_BC.cfg_file = "BC_HeatTransfer.cfg" + inc_heatTransfer_BC.test_iter = 50 + inc_heatTransfer_BC.test_vals = [-8.904266, -7.745636, -8.064003, -1.079197, -1671.000000] + test_list.append(inc_heatTransfer_BC) + + ############################ + ### Incompressible RANS ### + ############################ + + # NACA0012 + inc_turb_naca0012 = TestCase('inc_turb_naca0012') + inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012.cfg_file = "naca0012.cfg" + inc_turb_naca0012.test_iter = 20 + inc_turb_naca0012.test_vals = [-4.758064, -10.974498, -0.000005, -0.028653, 3, -5.740545, 2, -5.036110] + test_list.append(inc_turb_naca0012) + + # NACA0012, SST_SUST + inc_turb_naca0012_sst_sust = TestCase('inc_turb_naca0012_sst_sust') + inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" + inc_turb_naca0012_sst_sust.test_iter = 20 + inc_turb_naca0012_sst_sust.test_vals = [-7.169837, 0.332730, -0.000001, 0.312131] + test_list.append(inc_turb_naca0012_sst_sust) + + # Flat plate, pressure-based + inc_flatplate_pb = TestCase('inc_flatplate_pb') + inc_flatplate_pb.cfg_dir = "incomp_rans/rough_flatplate" + inc_flatplate_pb.cfg_file = "pb_rough_flatplate_incomp.cfg" + inc_flatplate_pb.test_iter = 10 + inc_flatplate_pb.test_vals = [-4.063342, -9.884401, 0.000010, 0.228472] + test_list.append(inc_flatplate_pb) + + #################### + ### DG-FEM Euler ### + #################### + + # NACA0012 + fem_euler_naca0012 = TestCase('fem_euler_naca0012') + fem_euler_naca0012.cfg_dir = "hom_euler/NACA0012_5thOrder" + fem_euler_naca0012.cfg_file = "fem_NACA0012_reg.cfg" + fem_euler_naca0012.test_iter = 10 + fem_euler_naca0012.test_vals = [-6.519946, -5.976944, 0.255551, 0.000028] + test_list.append(fem_euler_naca0012) + + ############################ + ### DG-FEM Navier-Stokes ### + ############################ + + # Flat plate + fem_ns_flatplate = TestCase('fem_ns_flatplate') + fem_ns_flatplate.cfg_dir = "hom_navierstokes/FlatPlate/nPoly4" + fem_ns_flatplate.cfg_file = "lam_flatplate_reg.cfg" + fem_ns_flatplate.test_iter = 25 + fem_ns_flatplate.test_vals = [1.383727, 3.175247, 0.058387, 0.257951] + test_list.append(fem_ns_flatplate) + + # Steady cylinder + fem_ns_cylinder = TestCase('fem_ns_cylinder') + fem_ns_cylinder.cfg_dir = "hom_navierstokes/CylinderViscous/nPoly3" + fem_ns_cylinder.cfg_file = "fem_Cylinder_reg.cfg" + fem_ns_cylinder.test_iter = 10 + fem_ns_cylinder.test_vals = [0.454960, 0.979123, -0.000028, 79.984799] + test_list.append(fem_ns_cylinder) + + # Steady sphere + fem_ns_sphere = TestCase('fem_ns_sphere') + fem_ns_sphere.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" + fem_ns_sphere.cfg_file = "fem_Sphere_reg.cfg" + fem_ns_sphere.test_iter = 10 + fem_ns_sphere.test_vals = [-0.288121, 0.240324, 0.000258, 21.797363] + test_list.append(fem_ns_sphere) + + # Unsteady sphere ADER + fem_ns_sphere_ader = TestCase('fem_ns_sphere_ader') + fem_ns_sphere_ader.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" + fem_ns_sphere_ader.cfg_file = "fem_Sphere_reg_ADER.cfg" + fem_ns_sphere_ader.test_iter = 10 + fem_ns_sphere_ader.test_vals = [-35.000000, -35.000000, 0.000047, 31.110911] + test_list.append(fem_ns_sphere_ader) + + # Unsteady cylinder + fem_ns_unsteady_cylinder = TestCase('fem_ns_unsteady_cylinder') + fem_ns_unsteady_cylinder.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" + fem_ns_unsteady_cylinder.cfg_file = "fem_unst_cylinder.cfg" + fem_ns_unsteady_cylinder.test_iter = 11 + fem_ns_unsteady_cylinder.test_vals = [-3.558582, -3.014464, -0.038927, 1.383983] + fem_ns_unsteady_cylinder.unsteady = True + test_list.append(fem_ns_unsteady_cylinder) + + # Unsteady cylinder ADER + fem_ns_unsteady_cylinder_ader = TestCase('fem_ns_unsteady_cylinder_ader') + fem_ns_unsteady_cylinder_ader.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" + fem_ns_unsteady_cylinder_ader.cfg_file = "fem_unst_cylinder_ADER.cfg" + fem_ns_unsteady_cylinder_ader.test_iter = 11 + fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000, -35.000000, -0.041003, 1.391339] + fem_ns_unsteady_cylinder_ader.unsteady = True + test_list.append(fem_ns_unsteady_cylinder_ader) + + ########################### + ### Turbulence modeling ### + ########################### + + # SA Baseline (Identical to RANS SA RAE2822) + turbmod_sa_bsl_rae2822 = TestCase('turbmod_sa_bsl_rae2822') + turbmod_sa_bsl_rae2822.cfg_dir = "turbulence_models/sa/rae2822" + turbmod_sa_bsl_rae2822.cfg_file = "turb_SA_BSL_RAE2822.cfg" + turbmod_sa_bsl_rae2822.test_iter = 20 + turbmod_sa_bsl_rae2822.test_vals = [-3.062213, -0.409580, -0.834363, -5.133434, 0.790438, 0.018107] + test_list.append(turbmod_sa_bsl_rae2822) + + # SA Negative + turbmod_sa_neg_rae2822 = TestCase('turbmod_sa_neg_rae2822') + turbmod_sa_neg_rae2822.cfg_dir = "turbulence_models/sa/rae2822" + turbmod_sa_neg_rae2822.cfg_file = "turb_SA_NEG_RAE2822.cfg" + turbmod_sa_neg_rae2822.test_iter = 10 + turbmod_sa_neg_rae2822.test_vals = [1.275994, 1.062588, -2.067822, 1.300662, 0.480881, 0.000000] + turbmod_sa_neg_rae2822.test_vals_aarch64 = [-1.345593, 1.448310, 1.208721, -0.846597, 1.248410, 0.489117, 0.000000] + test_list.append(turbmod_sa_neg_rae2822) + + # SA Compressibility Correction + turbmod_sa_comp_rae2822 = TestCase('turbmod_sa_comp_rae2822') + turbmod_sa_comp_rae2822.cfg_dir = "turbulence_models/sa/rae2822" + turbmod_sa_comp_rae2822.cfg_file = "turb_SA_COMP_RAE2822.cfg" + turbmod_sa_comp_rae2822.test_iter = 20 + turbmod_sa_comp_rae2822.test_vals = [-3.063286, -0.408577, -0.834597, -5.159754, 0.790991, 0.018085] + test_list.append(turbmod_sa_comp_rae2822) + + # SA Edwards + turbmod_sa_edw_rae2822 = TestCase('turbmod_sa_edw_rae2822') + turbmod_sa_edw_rae2822.cfg_dir = "turbulence_models/sa/rae2822" + turbmod_sa_edw_rae2822.cfg_file = "turb_SA_EDW_RAE2822.cfg" + turbmod_sa_edw_rae2822.test_iter = 20 + turbmod_sa_edw_rae2822.test_vals = [-3.069523, -0.405788, -0.835321, -5.185709, 0.794436, 0.017856] + test_list.append(turbmod_sa_edw_rae2822) + + # SA Compressibility and Edwards + turbmod_sa_comp_edw_rae2822 = TestCase('turbmod_sa_comp_edw_rae2822') + turbmod_sa_comp_edw_rae2822.cfg_dir = "turbulence_models/sa/rae2822" + turbmod_sa_comp_edw_rae2822.cfg_file = "turb_SA_COMP_EDW_RAE2822.cfg" + turbmod_sa_comp_edw_rae2822.test_iter = 20 + turbmod_sa_comp_edw_rae2822.test_vals = [-3.067904, -0.338707, -0.811157, -5.279475, 0.809906, 0.019797] + test_list.append(turbmod_sa_comp_edw_rae2822) + + # SA QCR + turbmod_sa_qcr_rae2822 = TestCase('turbmod_sa_qcr_rae2822') + turbmod_sa_qcr_rae2822.cfg_dir = "turbulence_models/sa/rae2822" + turbmod_sa_qcr_rae2822.cfg_file = "turb_SA_QCR_RAE2822.cfg" + turbmod_sa_qcr_rae2822.test_iter = 20 + turbmod_sa_qcr_rae2822.test_vals = [-3.028293, -0.418748, -0.797999, -5.088756, 0.761887, 0.016830] + test_list.append(turbmod_sa_qcr_rae2822) + + ############################ + ### Transition ### + ############################ + + # Schubauer-Klebanoff Natural Transition Case + schubauer_klebanoff_transition = TestCase('Schubauer_Klebanoff') + schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff" + schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" + schubauer_klebanoff_transition.test_iter = 10 + schubauer_klebanoff_transition.test_vals = [-8.215651, -13.239431, 0.000048, 0.007983] + test_list.append(schubauer_klebanoff_transition) + + ##################################### + ### Cont. adj. compressible Euler ### + ##################################### + + # Inviscid NACA0012 + contadj_naca0012 = TestCase('contadj_naca0012') + contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" + contadj_naca0012.cfg_file = "inv_NACA0012.cfg" + contadj_naca0012.test_iter = 5 + contadj_naca0012.test_vals = [-9.547544, -15.069350, -0.726250, 0.020280] + contadj_naca0012.test_vals_aarch64 = [-9.662546, -14.998818, -0.726250, 0.020280] + test_list.append(contadj_naca0012) + + # Inviscid ONERA M6 + contadj_oneram6 = TestCase('contadj_oneram6') + contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" + contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" + contadj_oneram6.test_iter = 10 + contadj_oneram6.test_vals = [-12.085026, -12.651321, -1.086100, 0.007556] + test_list.append(contadj_oneram6) + + # Inviscid WEDGE: tests averaged outflow total pressure adjoint + contadj_wedge = TestCase('contadj_wedge') + contadj_wedge.cfg_dir = "cont_adj_euler/wedge" + contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" + contadj_wedge.test_iter = 10 + contadj_wedge.test_vals = [2.872065, -2.756214, 1010800.000000, 0.000000] + test_list.append(contadj_wedge) + + # Inviscid fixed CL NACA0012 + contadj_fixed_CL_naca0012 = TestCase('contadj_fixedcl_naca0012') + contadj_fixed_CL_naca0012.cfg_dir = "fixed_cl/naca0012" + contadj_fixed_CL_naca0012.cfg_file = "inv_NACA0012_ContAdj.cfg" + contadj_fixed_CL_naca0012.test_iter = 100 + contadj_fixed_CL_naca0012.test_vals = [1.408903, -4.010709, 0.005808, 0.004028] + test_list.append(contadj_fixed_CL_naca0012) + + ################################### + ### Cont. adj. compressible N-S ### + ################################### + + # Adjoint laminar cylinder + contadj_ns_cylinder = TestCase('contadj_ns_cylinder') + contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" + contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" + contadj_ns_cylinder.test_iter = 20 + contadj_ns_cylinder.test_vals = [-3.626865, -9.079504, 2.056700, -0.000000] + test_list.append(contadj_ns_cylinder) + + # Adjoint laminar naca0012 subsonic + contadj_ns_naca0012_sub = TestCase('contadj_ns_naca0012_sub') + contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" + contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" + contadj_ns_naca0012_sub.test_iter = 20 + contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] + test_list.append(contadj_ns_naca0012_sub) + + # Adjoint laminar naca0012 transonic + contadj_ns_naca0012_trans = TestCase('contadj_ns_naca0012_trans') + contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" + contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" + contadj_ns_naca0012_trans.test_iter = 20 + contadj_ns_naca0012_trans.test_vals = [-1.039664, -6.575019, 1.772300, 0.012495] + test_list.append(contadj_ns_naca0012_trans) + + ####################################################### + ### Cont. adj. compressible RANS (frozen viscosity) ### + ####################################################### + + # Adjoint turbulent NACA0012 + contadj_rans_naca0012 = TestCase('contadj_rans_naca0012') + contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" + contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" + contadj_rans_naca0012.test_iter = 20 + contadj_rans_naca0012.test_vals = [-0.794162, -5.761722, 19.214000, -0.000000] + test_list.append(contadj_rans_naca0012) + + # Adjoint turbulent NACA0012 with binary restarts + contadj_rans_naca0012_bin = TestCase('contadj_rans_naca0012_bin') + contadj_rans_naca0012_bin.cfg_dir = "cont_adj_rans/naca0012" + contadj_rans_naca0012_bin.cfg_file = "turb_nasa_binary.cfg" + contadj_rans_naca0012_bin.test_iter = 18 + contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] + test_list.append(contadj_rans_naca0012_bin) + + # Adjoint turbulent RAE2822 + contadj_rans_rae2822 = TestCase('contadj_rans_rae822') + contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" + contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" + contadj_rans_rae2822.test_iter = 20 + contadj_rans_rae2822.test_vals = [-5.399270, -10.904277, -0.212470, 0.005448] + test_list.append(contadj_rans_rae2822) + + ############################# + ### Compressibele RANS UQ ### + ############################# + + # NACA0012 1c + turb_naca0012_1c = TestCase('turb_naca0012_1c') + turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" + turb_naca0012_1c.test_iter = 10 + turb_naca0012_1c.test_vals = [-4.979554, 1.344291, 0.666805, 0.010247] + turb_naca0012_1c.test_vals_aarch64 = [-4.981036, 1.345868, 0.673232, 0.010091] + test_list.append(turb_naca0012_1c) + + # NACA0012 2c + turb_naca0012_2c = TestCase('turb_naca0012_2c') + turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" + turb_naca0012_2c.test_iter = 10 + turb_naca0012_2c.test_vals = [-5.482691, 1.262918, 0.529442, -0.023584] + turb_naca0012_2c.test_vals_aarch64 = [-5.484365, 1.264701, 0.501741, -0.033109] + test_list.append(turb_naca0012_2c) + + # NACA0012 3c + turb_naca0012_3c = TestCase('turb_naca0012_3c') + turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" + turb_naca0012_3c.test_iter = 10 + turb_naca0012_3c.test_vals = [-5.583617, 1.229594, 0.463384, -0.035444] + test_list.append(turb_naca0012_3c) + + # NACA0012 p1c1 + turb_naca0012_p1c1 = TestCase('turb_naca0012_p1c1') + turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" + turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" + turb_naca0012_p1c1.test_iter = 10 + turb_naca0012_p1c1.test_vals = [-5.129555, 1.283892, 0.808074, 0.047784] + turb_naca0012_p1c1.test_vals_aarch64 = [-5.122100, 1.284478, 0.608744, -0.008593] + test_list.append(turb_naca0012_p1c1) + + # NACA0012 p1c2 + turb_naca0012_p1c2 = TestCase('turb_naca0012_p1c2') + turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" + turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" + turb_naca0012_p1c2.test_iter = 10 + turb_naca0012_p1c2.test_vals = [-5.554045, 1.234446, 0.603731, -0.008717] + test_list.append(turb_naca0012_p1c2) + + ###################################### + ### Harmonic Balance ### + ###################################### + + # Description of the regression test + harmonic_balance = TestCase('harmonic_balance') + harmonic_balance.cfg_dir = "harmonic_balance" + harmonic_balance.cfg_file = "HB.cfg" + harmonic_balance.test_iter = 25 + harmonic_balance.test_vals = [-1.556449, 0.840517, 0.943602, 3.957291] + test_list.append(harmonic_balance) + + # Turbulent pitching NACA 64a010 airfoil + hb_rans_preconditioning = TestCase('hb_rans_preconditioning') + hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" + hb_rans_preconditioning.cfg_file = "davis.cfg" + hb_rans_preconditioning.test_iter = 25 + hb_rans_preconditioning.tol = 0.00001 + hb_rans_preconditioning.test_vals = [-1.905509, 0.482119, 0.598486, 3.605120, -5.946067] + test_list.append(hb_rans_preconditioning) + + ###################################### + ### Moving Wall ### + ###################################### + + # Rotating NACA 0012 + rot_naca0012 = TestCase('rot_naca0012') + rot_naca0012.cfg_dir = "rotating/naca0012" + rot_naca0012.cfg_file = "rot_NACA0012.cfg" + rot_naca0012.test_iter = 25 + rot_naca0012.test_vals = [-0.028757, 0.058709, 2.000000, -1.147370] + test_list.append(rot_naca0012) + + # Lid-driven cavity + cavity = TestCase('cavity') + cavity.cfg_dir = "moving_wall/cavity" + cavity.cfg_file = "lam_cavity.cfg" + cavity.test_iter = 25 + cavity.test_vals = [-7.770113, -2.308185, 0.011072, 0.008947] + test_list.append(cavity) + + # Spinning cylinder + spinning_cylinder = TestCase('spinning_cylinder') + spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" + spinning_cylinder.cfg_file = "spinning_cylinder.cfg" + spinning_cylinder.test_iter = 25 + spinning_cylinder.test_vals = [-7.471322, -2.007082, 2.183565, 1.847848] + test_list.append(spinning_cylinder) + + ###################################### + ### Unsteady ### + ###################################### + + # Square cylinder + square_cylinder = TestCase('square_cylinder') + square_cylinder.cfg_dir = "unsteady/square_cylinder" + square_cylinder.cfg_file = "turb_square.cfg" + square_cylinder.test_iter = 3 + square_cylinder.test_vals = [-1.175979, 0.062203, 1.399352, 2.219226, 1.399298, 2.217472, 0.000000] + square_cylinder.unsteady = True + test_list.append(square_cylinder) + + # Aeroacoustics postprocessing of a converged square-cylinder pressure history + aeroacoustics_square_cylinder = TestCase('aeroacoustics_square_cylinder') + aeroacoustics_square_cylinder.cfg_dir = "unsteady/square_cylinder" + aeroacoustics_square_cylinder.cfg_file = "aeroacoustics.cfg" + aeroacoustics_square_cylinder.test_iter = 0 + aeroacoustics_square_cylinder.test_vals = [103.1512634765, 1.9531250000] + aeroacoustics_square_cylinder.command = TestCase.Command( + exec = "python", param = "run_aeroacoustics.py" + ) + aeroacoustics_square_cylinder.timeout = 60 + aeroacoustics_square_cylinder.tol = 1e-6 + test_list.append(aeroacoustics_square_cylinder) + + # Gust + sine_gust = TestCase('sine_gust') + sine_gust.cfg_dir = "gust" + sine_gust.cfg_file = "inv_gust_NACA0012.cfg" + sine_gust.test_iter = 5 + sine_gust.test_vals = [-1.977498, 3.481833, -0.013388, -0.003910] + sine_gust.unsteady = True + test_list.append(sine_gust) + + # Delayed Detached Eddy Simulation + ddes_flatplate = TestCase('ddes_flatplate') + ddes_flatplate.cfg_dir = "ddes/flatplate" + ddes_flatplate.cfg_file = "ddes_flatplate.cfg" + ddes_flatplate.test_iter = 10 + ddes_flatplate.test_vals = [-2.714713, -5.763284, -0.214960, 0.023758, 0.000000] + ddes_flatplate.unsteady = True + test_list.append(ddes_flatplate) + + # Stochastic BackScatter (SBS) model + sbs_backward_step = TestCase('sbs_backward_step') + sbs_backward_step.cfg_dir = "backscatter/backward_step" + sbs_backward_step.cfg_file = "backwardStep.cfg" + sbs_backward_step.test_iter = 3 + sbs_backward_step.test_vals = [-6.352884, -3.465372, -5.507901, -3.906545, -9.506305, -6.365236, -6.331021, -6.331028] + sbs_backward_step.unsteady = True + sbs_backward_step.decompress = True + sbs_backward_step.grid_file = "backward_step.su2" + test_list.append(sbs_backward_step) + + # unsteady pitching NACA0015, SA + unst_inc_turb_naca0015_sa = TestCase('unst_inc_turb_naca0015_sa') + unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" + unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" + unst_inc_turb_naca0015_sa.test_iter = 1 + unst_inc_turb_naca0015_sa.test_vals = [-3.002783, -6.875096, 1.487783, 0.421690] + unst_inc_turb_naca0015_sa.unsteady = True + test_list.append(unst_inc_turb_naca0015_sa) + + # Flat plate + flatplate_unsteady = TestCase('flatplate_unsteady') + flatplate_unsteady.cfg_dir = "navierstokes/flatplate" + flatplate_unsteady.cfg_file = "lam_flatplate_unst.cfg" + flatplate_unsteady.test_iter = 3 + flatplate_unsteady.test_vals = [0.000008, -8.875128, -8.250204, -6.305788, -5.469452, -3.398230, 0.002075, -0.325535] + flatplate_unsteady.unsteady = True + test_list.append(flatplate_unsteady) + + ###################################### + ### NICFD ### + ###################################### + + # Rarefaction shock wave edge_VW + edge_VW = TestCase('edge_VW') + edge_VW.cfg_dir = "nicf/edge" + edge_VW.cfg_file = "edge_VW.cfg" + edge_VW.test_iter = 20 + edge_VW.test_vals = [-4.478306, 1.723006, -0.000009, 0.000000] + test_list.append(edge_VW) + + # Rarefaction shock wave edge_PPR + edge_PPR = TestCase('edge_PPR') + edge_PPR.cfg_dir = "nicf/edge" + edge_PPR.cfg_file = "edge_PPR.cfg" + edge_PPR.test_iter = 20 + edge_PPR.test_vals = [-8.395110, -2.236894, -0.000034, 0.000000] + test_list.append(edge_PPR) + + # Rarefaction Q1D nozzle, include CoolProp fluid model + coolprop_fluidModel = TestCase('coolprop_fluidModel') + coolprop_fluidModel.cfg_dir = "nicf/coolprop" + coolprop_fluidModel.cfg_file = "fluidModel.cfg" + coolprop_fluidModel.test_iter = 5 + coolprop_fluidModel.test_vals = [-4.666146, -0.172864, 4.492817, 0.000000, 0.000000] + coolprop_fluidModel.enabled_on_cpu_arch = ["x86_64"] + test_list.append(coolprop_fluidModel) + + # Rarefaction Q1D nozzle, include CoolProp transport model + coolprop_transportModel = TestCase('coolprop_transportModel') + coolprop_transportModel.cfg_dir = "nicf/coolprop" + coolprop_transportModel.cfg_file = "transportModel.cfg" + coolprop_transportModel.test_iter = 5 + coolprop_transportModel.test_vals = [-4.667122, -0.172865, 4.687652, 0.000000, 0.000000] + coolprop_transportModel.enabled_on_cpu_arch = ["x86_64"] + test_list.append(coolprop_transportModel) + + # Rarefaction Q1D nozzle, include data-driven fluid model + datadriven_fluidModel = TestCase('datadriven_fluidModel') + datadriven_fluidModel.cfg_dir = "nicf/datadriven" + datadriven_fluidModel.cfg_file = "datadriven_nozzle.cfg" + datadriven_fluidModel.test_iter = 50 + datadriven_fluidModel.test_vals = [-6.283594, -3.253961, -4.172935, -0.949415, -2.046039, 1.546933] + test_list.append(datadriven_fluidModel) + + ###################################### + ### Turbomachinery ### + ###################################### + + # Aachen Turbine restart + Aachen_3D_restart = TestCase('aachen_turbine_restart') + Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine" + Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg" + Aachen_3D_restart.test_iter = 5 + Aachen_3D_restart.tol = 0.00001 + Aachen_3D_restart.test_vals = [-7.688483, -8.466346, -6.035067, -6.425967, -5.820125, -4.597817, -5.528297, -5.301466, -3.819862, -5.242356, -5.738805, -3.630202, -2.213240, -2.857919, -0.576864] + test_list.append(Aachen_3D_restart) + + # Jones APU Turbocharger restart + Jones_tc_restart = TestCase('jones_turbocharger_restart') + Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" + Jones_tc_restart.cfg_file = "Jones_restart.cfg" + Jones_tc_restart.test_iter = 5 + Jones_tc_restart.test_vals = [-11.905370, -12.212031, -19.212143, -13.508267, -19.079216, -13.445953, 73286.000000, 73286.000000, 0.020056, 82.286000] + test_list.append(Jones_tc_restart) + + # 2D axial stage + axial_stage2D = TestCase('axial_stage2D') + axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" + axial_stage2D.cfg_file = "Axial_stage2D.cfg" + axial_stage2D.test_iter = 20 + axial_stage2D.test_vals = [1.167500, 1.598546, -2.928573, 2.573647, -2.527331, 3.016254, 106370.000000, 106370.000000, 5.726800, 64.383000] + test_list.append(axial_stage2D) + + # 2D transonic stator restart + transonic_stator_restart = TestCase('transonic_stator_restart') + transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" + transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" + transonic_stator_restart.test_iter = 20 + transonic_stator_restart.test_vals = [-4.365636, -2.482248, -2.081252, 1.729763, -1.467305, 3.231073, -471620.000000, 94.837000, -0.046834] + transonic_stator_restart.test_vals_aarch64 = [-4.437809, -2.553049, -2.164729, 1.657542, -1.356823, 3.178788, -471620.000000, 94.842000, -0.040365] + test_list.append(transonic_stator_restart) + + # Multiple turbomachinery interface restart + multi_interface = TestCase('multi_interface') + multi_interface.cfg_dir = "turbomachinery/multi_interface" + multi_interface.cfg_file = "multi_interface_rst.cfg" + multi_interface.test_iter = 5 + multi_interface.test_vals = [-8.634558, -8.895554, -9.348754] + multi_interface.test_vals_aarch64 = [-8.632227, -8.894736, -9.348706] + test_list.append(multi_interface) + + ###################################### + ### Sliding Mesh ### + ###################################### + + # Uniform flow + uniform_flow = TestCase('uniform_flow') + uniform_flow.cfg_dir = "sliding_interface/uniform_flow" + uniform_flow.cfg_file = "uniform_NN.cfg" + uniform_flow.test_iter = 5 + uniform_flow.test_vals = [5.000000, 0.000000, -0.193989, -10.624451] + uniform_flow.unsteady = True + uniform_flow.multizone = True + test_list.append(uniform_flow) + + # Channel_2D, native SU2 binary mesh format (.su2b) + # channel_2D_WA.cfg loads channel_2D_su2bin.su2b directly, so SU2_DEF must + # first convert channel_2D.su2 (3 zones) into that binary mesh. + channel_2D_su2bin_convert = TestCase('channel_2D_su2bin_convert') + channel_2D_su2bin_convert.cfg_dir = "sliding_interface/channel_2D" + channel_2D_su2bin_convert.cfg_file = "mesh_su2_to_su2bin.cfg" + channel_2D_su2bin_convert.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + test_list.append(channel_2D_su2bin_convert) + + channel_2D = TestCase('channel_2D') + channel_2D.cfg_dir = "sliding_interface/channel_2D" + channel_2D.cfg_file = "channel_2D_WA.cfg" + channel_2D.test_iter = 2 + channel_2D.test_vals = [2.000000, 0.000000, 0.399141, 0.350260, 0.405570] + channel_2D.timeout = 100 + channel_2D.unsteady = True + channel_2D.multizone = True + test_list.append(channel_2D) + + # Channel_3D + channel_3D = TestCase('channel_3D') + channel_3D.cfg_dir = "sliding_interface/channel_3D" + channel_3D.cfg_file = "channel_3D_WA.cfg" + channel_3D.test_iter = 2 + channel_3D.test_vals = [2.000000, 0.000000, 0.632752, 0.522763, 0.423355] + channel_3D.test_vals_aarch64 = [2.000000, 0.000000, 0.629119, 0.524959, 0.422390] + channel_3D.unsteady = True + channel_3D.multizone = True + test_list.append(channel_3D) + + # Pipe + pipe = TestCase('pipe') + pipe.cfg_dir = "sliding_interface/pipe" + pipe.cfg_file = "pipe_NN.cfg" + pipe.test_iter = 2 + pipe.test_vals = [0.024970, 0.452312, 0.562852, 0.974613, 1.031075] + pipe.unsteady = True + pipe.multizone = True + test_list.append(pipe) + + # Rotating cylinders + rotating_cylinders = TestCase('rotating_cylinders') + rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" + rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" + rotating_cylinders.test_iter = 3 + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686417, 1.152593, 1.145900] + rotating_cylinders.unsteady = True + rotating_cylinders.multizone = True + test_list.append(rotating_cylinders) + + # Supersonic vortex shedding + supersonic_vortex_shedding = TestCase('supersonic_vortex_shedding') + supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" + supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" + supersonic_vortex_shedding.test_iter = 5 + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064262] + supersonic_vortex_shedding.unsteady = True + supersonic_vortex_shedding.multizone = True + test_list.append(supersonic_vortex_shedding) + + # Bars_SST_2D + bars_SST_2D = TestCase('bars_SST_2D') + bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" + bars_SST_2D.cfg_file = "bars.cfg" + bars_SST_2D.test_iter = 13 + bars_SST_2D.test_vals = [13.000000, -0.457912, -1.541047] + bars_SST_2D.multizone = True + test_list.append(bars_SST_2D) + + # Sliding mesh with incompressible flows (steady) + slinc_steady = TestCase('slinc_steady') + slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" + slinc_steady.cfg_file = "config.cfg" + slinc_steady.test_iter = 19 + slinc_steady.test_vals = [19.000000, -1.129117, -1.399143] + slinc_steady.timeout = 100 + slinc_steady.tol = 0.00002 + slinc_steady.multizone = True + test_list.append(slinc_steady) + + # Sliding mesh with incompressible flows (unsteady) + # slinc_unsteady = TestCase('slinc_unsteady') + # slinc_unsteady.cfg_dir = "sliding_interface/incompressible_unsteady" + # slinc_unsteady.cfg_file = "config.cfg" + # slinc_unsteady.test_iter = 19 + # slinc_unsteady.test_vals = [-3.513701,1.931626,0.000000,0.000000] #last 4 columns + # slinc_unsteady.command = TestCase.Command(exec = "SU2_CFD") + # slinc_unsteady.timeout = 100 + # slinc_unsteady.unsteady = True + # test_list.append(slinc_unsteady) + + ########################## + ### FEA - FSI ### + ########################## + + # Static beam, 3d + statbeam3d = TestCase('statbeam3d') + statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" + statbeam3d.cfg_file = "configBeam_3d.cfg" + statbeam3d.test_iter = 0 + statbeam3d.test_vals = [-6.020105, -5.749794, -5.931330, 110190.000000] + statbeam3d.test_vals_aarch64 = [-6.062693, -5.769132, -5.891190, 110190] + test_list.append(statbeam3d) + + # Static beam, 3d with coupled temperature + thermal_beam_3d = TestCase('thermal_beam_3d') + thermal_beam_3d.cfg_dir = "fea_fsi/ThermalBeam_3d" + thermal_beam_3d.cfg_file = "configBeam_3d.cfg" + thermal_beam_3d.test_iter = 4 + thermal_beam_3d.test_vals = [-8.101468, -7.745325, -7.818908, -13.978110, 216.000000, -4.008646, 39.000000, -4.072613, 136760.000000, 75.000000] + test_list.append(thermal_beam_3d) + + # Static beam, 3d with coupled temperature, nonlinear elasticity + thermal_beam_nl_3d = TestCase('thermal_beam_nl_3d') + thermal_beam_nl_3d.cfg_dir = "fea_fsi/ThermalBeam_3d" + thermal_beam_nl_3d.cfg_file = "configBeamNonlinear_3d.cfg" + thermal_beam_nl_3d.test_iter = 8 + thermal_beam_nl_3d.test_vals = [-7.564308, -2.992893, -12.242503, -14.068322, 57.000000, -4.017669, 24.000000, -4.204804, 138710.000000, 75.233000] + test_list.append(thermal_beam_nl_3d) + + # Rotating cylinder, 3d + rotating_cylinder_fea = TestCase('rotating_cylinder_fea') + rotating_cylinder_fea.cfg_dir = "fea_fsi/rotating_cylinder" + rotating_cylinder_fea.cfg_file = "config.cfg" + rotating_cylinder_fea.test_iter = 0 + # For a thin disk with the inner and outer radius of this geometry, from + # "Formulas for Stress, Strain, and Structural Matrices", 2nd Edition, figure 19-4, + # the maximum stress is 165.6MPa, we get a von Mises stress very close to that. + rotating_cylinder_fea.test_vals = [-6.760497, -6.689266, -6.739355, 37.000000, -8.178510, 165020000.000000] + rotating_cylinder_fea.test_vals_aarch64 = [-6.861939, -6.835539, -6.895498, 22, -8.313847, 1.6502e+08] + test_list.append(rotating_cylinder_fea) + + # 2D beam in plain strain with thermal expansion. This tests fixes to the 2D Von Mises stress calculation. + linear_plane_strain = TestCase('linear_plane_strain') + linear_plane_strain.cfg_dir = "fea_fsi/VonMissesVerif" + linear_plane_strain.cfg_file = "linear_plane_strain_2d.cfg" + linear_plane_strain.test_iter = 0 + linear_plane_strain.test_vals = [-6.246772, -6.060575, 0.000000, 120140.000000, 148.000000, -8.140997] + test_list.append(linear_plane_strain) + + # 2D beam in plain stress with thermal expansion. This tests fixes to the 2D von Mises stress calculation, + # and to the plane stress formulation with thermal expansion for nonlinear materials. + nonlinear_plane_stress = TestCase('nonlinear_plane_stress') + nonlinear_plane_stress.cfg_dir = "fea_fsi/VonMissesVerif" + nonlinear_plane_stress.cfg_file = "nonlinear_plane_stress_2d.cfg" + nonlinear_plane_stress.test_iter = 16 + nonlinear_plane_stress.test_vals = [-6.235980, -2.229690, -11.701484, 162480.000000, 30.000000, -4.152654] + nonlinear_plane_stress.tol = [2e-4, 2e-4, 2e-4, 1e-5, 1e-5, 4e-4] + test_list.append(nonlinear_plane_stress) + + # Dynamic beam, 2d + dynbeam2d = TestCase('dynbeam2d') + dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" + dynbeam2d.cfg_file = "configBeam_2d.cfg" + dynbeam2d.test_iter = 6 + dynbeam2d.test_vals = [-3.240012, 2.895060, -0.353140, 76220] + dynbeam2d.unsteady = True + test_list.append(dynbeam2d) + + # FSI, 2d + fsi2d = TestCase('fsi2d') + fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" + fsi2d.cfg_file = "configFSI.cfg" + fsi2d.test_iter = 4 + fsi2d.test_vals = [4.000000, 0.000000, -3.725519, -4.278760] + fsi2d.command = TestCase.Command(exec = "parallel_computation_fsi.py", param = "-f") + fsi2d.multizone= True + fsi2d.unsteady = True + test_list.append(fsi2d) + + # FSI, Dynamic, 2D, new mesh solver + dyn_fsi = TestCase('dyn_fsi') + dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" + dyn_fsi.cfg_file = "config.cfg" + dyn_fsi.test_iter = 4 + dyn_fsi.test_vals = [-4.328805, -4.153009, 0.000000, 75.000000] + dyn_fsi.multizone = True + dyn_fsi.unsteady = True + test_list.append(dyn_fsi) + + # ############################### + # ### Radiative Heat Transfer ### + # ############################### + + # Radiative heat transfer + p1rad = TestCase('p1rad') + p1rad.cfg_dir = "radiation/p1model" + p1rad.cfg_file = "configp1.cfg" + p1rad.test_iter = 50 + p1rad.test_vals = [-8.197112, -7.856394, -2.380743, 0.381122, -57.186000] + test_list.append(p1rad) + + + # ############################# + # ### Solid Heat Conduction ### + # ############################# + + # 2D pins, periodically connected + solid_periodic_pins = TestCase('solid_periodic_pins') + solid_periodic_pins.cfg_dir = "solid_heat_conduction/periodic_pins" + solid_periodic_pins.cfg_file = "configSolid.cfg" + solid_periodic_pins.test_iter = 750 + solid_periodic_pins.test_vals = [-15.878960, -14.569206, 300.900000, 425.320000, 5.000000, -1.672601] + solid_periodic_pins.test_vals_aarch64 = [-15.879016, -14.569206, 300.900000, 425.320000, 5.000000, -1.672666] + test_list.append(solid_periodic_pins) + + # ############################### + # ### Conjugate heat transfer ### + # ############################### + + # CHT incompressible + cht_incompressible = TestCase('cht_incompressible') + cht_incompressible.cfg_dir = "coupled_cht/incomp_2d" + cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible.test_iter = 10 + cht_incompressible.test_vals = [-1.376344, -0.591210, -0.591210, -0.591211] + cht_incompressible.multizone = True + test_list.append(cht_incompressible) + + # CHT compressible + cht_compressible = TestCase('cht_compressible') + cht_compressible.cfg_dir = "coupled_cht/comp_2d" + cht_compressible.cfg_file = "cht_2d_3cylinders.cfg" + cht_compressible.test_iter = 10 + cht_compressible.test_vals = [-4.256051, -0.532725, -0.532724, -0.532725] + cht_compressible.multizone = True + test_list.append(cht_compressible) + + # 2D CHT case streamwise periodicity. Also test Multizone PerSurface screen output. + sp_pinArray_cht_2d_dp_hf = TestCase('sp_pinArray_cht_2d_dp_hf') + sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + sp_pinArray_cht_2d_dp_hf.cfg_file = "configMaster.cfg" + sp_pinArray_cht_2d_dp_hf.test_iter = 100 + sp_pinArray_cht_2d_dp_hf.test_vals = [0.691407, 2.834803, -1.205148, -0.677171, 208.023676, 350.080000, -0.000000, -0.677170, 0.677170] + sp_pinArray_cht_2d_dp_hf.multizone = True + test_list.append(sp_pinArray_cht_2d_dp_hf) + + # simple small 3D pin case massflow periodic with heatflux BC + sp_pinArray_3d_cht_mf_hf_tp = TestCase('sp_pinArray_3d_cht_mf_hf_tp') + sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" + sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" + sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [-1.116268, 3.008626, -0.634287, -0.009805, 104.600487, 410.310000, 0.000000] + sp_pinArray_3d_cht_mf_hf_tp.multizone = True + test_list.append(sp_pinArray_3d_cht_mf_hf_tp) + + + ########################## + ### Python wrapper ### + ########################## + + # NACA0012 + pywrapper_naca0012 = TestCase('pywrapper_naca0012') + pywrapper_naca0012.cfg_dir = "euler/naca0012" + pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" + pywrapper_naca0012.test_iter = 80 + pywrapper_naca0012.test_vals = [-5.701280, -5.186480, 0.334856, 0.023342] + pywrapper_naca0012.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") + test_list.append(pywrapper_naca0012) + + # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) + pywrapper_turb_naca0012_sst = TestCase('pywrapper_turb_naca0012_sst') + pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" + pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" + pywrapper_turb_naca0012_sst.test_iter = 10 + pywrapper_turb_naca0012_sst.test_vals = [-12.094736, -15.251092, -5.906365, 1.070413, 0.015775, -2.376001, 0.000000] + pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.075620, -15.246688, -5.861276, 1.070036, 0.015841, -1.991001, 0.000000] + pywrapper_turb_naca0012_sst.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") + pywrapper_turb_naca0012_sst.timeout = 3200 + test_list.append(pywrapper_turb_naca0012_sst) + + # Square cylinder + pywrapper_square_cylinder = TestCase('pywrapper_square_cylinder') + pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" + pywrapper_square_cylinder.cfg_file = "turb_square.cfg" + pywrapper_square_cylinder.test_iter = 10 + pywrapper_square_cylinder.test_vals = [-1.178521, -0.349772, 1.401402, 2.359105, 1.401729, 2.300974, 0.000000] + pywrapper_square_cylinder.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") + pywrapper_square_cylinder.unsteady = True + test_list.append(pywrapper_square_cylinder) + + # Aeroelastic + pywrapper_aeroelastic = TestCase('pywrapper_aeroelastic') + pywrapper_aeroelastic.cfg_dir = "aeroelastic" + pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" + pywrapper_aeroelastic.test_iter = 2 + pywrapper_aeroelastic.test_vals = [-1.876625, 4.021088, 0.083361, 0.026765, -0.001638, -0.000130, -0.947102] + pywrapper_aeroelastic.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") + pywrapper_aeroelastic.unsteady = True + test_list.append(pywrapper_aeroelastic) + + # Custom FEA load + pywrapper_custom_fea_load = TestCase('pywrapper_custom_fea_load') + pywrapper_custom_fea_load.cfg_dir = "py_wrapper/custom_load_fea" + pywrapper_custom_fea_load.cfg_file = "config.cfg" + pywrapper_custom_fea_load.test_iter = 13 + pywrapper_custom_fea_load.test_vals = [-7.262040, -4.945686, -14.163208, 27.000000, -6.285429, 362.230000] + pywrapper_custom_fea_load.command = TestCase.Command("mpirun -np 2", "python", "run.py") + test_list.append(pywrapper_custom_fea_load) + + # FSI, 2d + pywrapper_fsi2d = TestCase('pywrapper_fsi2d') + pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" + pywrapper_fsi2d.cfg_file = "configFSI.cfg" + pywrapper_fsi2d.test_iter = 4 + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.725519, -4.278760] + pywrapper_fsi2d.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--nZone 2 --fsi True --parallel -f") + pywrapper_fsi2d.unsteady = True + pywrapper_fsi2d.multizone = True + test_list.append(pywrapper_fsi2d) + + # Unsteady FSI with custom load + pywrapper_unsteadyFSI = TestCase('pywrapper_unsteadyFSI') + pywrapper_unsteadyFSI.cfg_dir = "py_wrapper/dyn_fsi" + pywrapper_unsteadyFSI.cfg_file = "config.cfg" + pywrapper_unsteadyFSI.test_iter = 4 + pywrapper_unsteadyFSI.test_vals = [0.000000, 30.000000, 5.000000, 48.000000, -1.756676, -2.828284, -7.625018, -6.863923, 0.000156] + pywrapper_unsteadyFSI.command = TestCase.Command("mpirun -np 2", "python", "run.py") + pywrapper_unsteadyFSI.unsteady = True + pywrapper_unsteadyFSI.multizone = True + test_list.append(pywrapper_unsteadyFSI) + + # Unsteady CHT + pywrapper_unsteadyCHT = TestCase('pywrapper_unsteadyCHT') + pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" + pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" + pywrapper_unsteadyCHT.test_iter = 5 + pywrapper_unsteadyCHT.test_vals = [-1.614168, 2.260203, -0.008065, 0.201068] + pywrapper_unsteadyCHT.command = TestCase.Command("mpirun -np 2", "python", "launch_unsteady_CHT_FlatPlate.py --parallel -f") + pywrapper_unsteadyCHT.unsteady = True + test_list.append(pywrapper_unsteadyCHT) + + # Rigid motion + pywrapper_rigidMotion = TestCase('pywrapper_rigidMotion') + pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" + pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" + pywrapper_rigidMotion.test_iter = 5 + pywrapper_rigidMotion.test_vals = [-1.607009, 2.260791, 0.350196, 0.089496] + pywrapper_rigidMotion.command = TestCase.Command("mpirun -np 2", "python", "launch_flatPlate_rigidMotion.py --parallel -f") + pywrapper_rigidMotion.unsteady = True + test_list.append(pywrapper_rigidMotion) + + # Deforming Bump in Channel + pywrapper_deformingBump = TestCase('pywrapper_deformingBump') + pywrapper_deformingBump.cfg_dir = "py_wrapper/deforming_bump_in_channel" + pywrapper_deformingBump.cfg_file = "config.cfg" + pywrapper_deformingBump.test_iter = 1 + pywrapper_deformingBump.test_vals = [0.500000, 0.000000, -2.556310, -1.270836, -2.351316, 2.905858, 9.953163, -0.946408] + pywrapper_deformingBump.command = TestCase.Command("mpirun -np 2", "python", "run.py") + pywrapper_deformingBump.unsteady = True + test_list.append(pywrapper_deformingBump) + + # custom source: buoyancy term + pywrapper_buoyancy = TestCase('pywrapper_buoyancy') + pywrapper_buoyancy.cfg_dir = "py_wrapper/custom_source_buoyancy" + pywrapper_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" + pywrapper_buoyancy.test_iter = 0 + pywrapper_buoyancy.test_vals = [-13.227985, -13.678479, -13.050758, -7.777151] + pywrapper_buoyancy.test_vals_aarch64 = [-13.227985, -13.678478, -13.050758, -7.777151] + pywrapper_buoyancy.command = TestCase.Command("mpirun -np 2", "python", "run.py") + test_list.append(pywrapper_buoyancy) + + # custom source: turbulent flamespeed closure (Zimont model) for PSI testcase + pywrapper_zimont = TestCase('pywrapper_zimont') + pywrapper_zimont.cfg_dir = "py_wrapper/turbulent_premixed_psi" + pywrapper_zimont.cfg_file = "psi.cfg" + pywrapper_zimont.test_iter = 0 + pywrapper_zimont.test_vals = [-3.415653, -2.221781, -3.107330, -2.569248, 0.531838, -3.796447] + pywrapper_zimont.command = TestCase.Command("mpirun -np 2", "python", "run.py") + test_list.append(pywrapper_zimont) + + + # Heat solver unsteady with source + pywrapper_Unst_Heat_Source = TestCase('pywrapper_Unst_Heat_Source') + pywrapper_Unst_Heat_Source.cfg_dir = "py_wrapper/custom_heat_source" + pywrapper_Unst_Heat_Source.cfg_file = "run.py" + pywrapper_Unst_Heat_Source.test_iter = 10 + pywrapper_Unst_Heat_Source.unsteady = True + pywrapper_Unst_Heat_Source.test_vals = [-5.235402, 300.010000, 300.000000] + pywrapper_Unst_Heat_Source.command = TestCase.Command("mpirun -n 2", "python", "run.py") + test_list.append(pywrapper_Unst_Heat_Source) + + ############################################## + ### Method of Manufactured Solutions (MMS) ### + ############################################## + + # FVM, compressible, euler (periodic isentropic vortex) + mms_fvm_vortex = TestCase('mms_fvm_vortex') + mms_fvm_vortex.cfg_dir = "mms/fvm_euler" + mms_fvm_vortex.cfg_file = "inv_mms_vortex.cfg" + mms_fvm_vortex.test_iter = 10 + mms_fvm_vortex.test_vals = [-5.704300, -4.848072, 0.000000, 0.000000] + mms_fvm_vortex.unsteady = True + test_list.append(mms_fvm_vortex) + + # FVM, compressible, laminar N-S + mms_fvm_ns = TestCase('mms_fvm_ns') + mms_fvm_ns.cfg_dir = "mms/fvm_navierstokes" + mms_fvm_ns.cfg_file = "lam_mms_roe.cfg" + mms_fvm_ns.test_iter = 20 + mms_fvm_ns.test_vals = [-2.808514, 2.152654, 0.000000, 0.000000] + mms_fvm_ns.tol = 0.0001 + test_list.append(mms_fvm_ns) + + # FVM, incompressible, euler + mms_fvm_inc_euler = TestCase('mms_fvm_inc_euler') + mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" + mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" + mms_fvm_inc_euler.test_iter = 20 + mms_fvm_inc_euler.test_vals = [-9.128735, -9.441757, 0.000000, 0.000000] + mms_fvm_inc_euler.tol = 0.0001 + test_list.append(mms_fvm_inc_euler) + + # FVM, incompressible, laminar N-S + mms_fvm_inc_ns = TestCase('mms_fvm_inc_ns') + mms_fvm_inc_ns.cfg_dir = "mms/fvm_incomp_navierstokes" + mms_fvm_inc_ns.cfg_file = "lam_mms_fds.cfg" + mms_fvm_inc_ns.test_iter = 20 + mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] + mms_fvm_inc_ns.tol = 0.0001 + test_list.append(mms_fvm_inc_ns) + + # DG, compressible, euler + ringleb_dg_euler = TestCase('ringleb_dg_euler') + ringleb_dg_euler.cfg_dir = "mms/dg_ringleb" + ringleb_dg_euler.cfg_file = "ringleb_dg.cfg" + ringleb_dg_euler.test_iter = 100 + ringleb_dg_euler.test_vals = [-5.136652, -4.724941, 0.000000, 0.000000] + ringleb_dg_euler.tol = 0.0001 + test_list.append(ringleb_dg_euler) + + # DG, compressible, laminar N-S + mms_dg_ns = TestCase('mms_dg_ns') + mms_dg_ns.cfg_dir = "mms/dg_navierstokes" + mms_dg_ns.cfg_file = "lam_mms_dg.cfg" + mms_dg_ns.test_iter = 100 + mms_dg_ns.test_vals = [-1.845393, 3.520699, 0.000000, 0.000000] + mms_dg_ns.tol = 0.0001 + test_list.append(mms_dg_ns) + + # DG, compressible, laminar N-S 3D + mms_dg_ns_3d = TestCase('mms_dg_ns_3d') + mms_dg_ns_3d.cfg_dir = "mms/dg_navierstokes_3d" + mms_dg_ns_3d.cfg_file = "lam_mms_dg_3d.cfg" + mms_dg_ns_3d.test_iter = 100 + mms_dg_ns_3d.test_vals = [-0.146826, 5.356413, 0.000000, 0.000000] + mms_dg_ns_3d.tol = 0.0001 + test_list.append(mms_dg_ns_3d) + + ##################### + ## Species solver ### + ##################### + + # 2 species (1 eq) primitive venturi mixing using mixing model + species2_primitiveVenturi_mixingmodel = TestCase('species2_primitiveVenturi_mixingmodel') + species2_primitiveVenturi_mixingmodel.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_mixingmodel.cfg_file = "species2_primitiveVenturi_mixingmodel.cfg" + species2_primitiveVenturi_mixingmodel.test_iter = 50 + species2_primitiveVenturi_mixingmodel.test_vals = [-5.735589, -4.564867, -4.669647, -5.794093, -0.067124, -5.583396, 5.000000, -1.375324, 5.000000, -4.869799, 5.000000, -1.453419, 0.000381, 0.000366, 0.000016, 0.000000] + test_list.append(species2_primitiveVenturi_mixingmodel) + + # 2 species (1 eq) primitive venturi mixing using mixing model and bounded scalar transport + species2_primitiveVenturi_mixingmodel_boundedscalar = TestCase('species2_primitiveVenturi_mixingmodel_boundedscalar') + species2_primitiveVenturi_mixingmodel_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_mixingmodel_boundedscalar.cfg_file = "species2_primitiveVenturi_mixingmodel_boundedscalar.cfg" + species2_primitiveVenturi_mixingmodel_boundedscalar.test_iter = 50 + species2_primitiveVenturi_mixingmodel_boundedscalar.test_vals = [-5.689670, -4.511504, -4.615493, -5.795205, -0.113336, -5.704986, 5.000000, -1.433752, 5.000000, -4.921374, 5.000000, -1.771015, 0.000318, 0.000318, 0.000000, 0.000000] + test_list.append(species2_primitiveVenturi_mixingmodel_boundedscalar) + + # 2 species (1 eq) primitive venturi mixing using mixing model including viscosity, thermal conductivity and inlet markers for SA turbulence model + species2_primitiveVenturi_mixingmodel_viscosity = TestCase('species2_primitiveVenturi_mixingmodel_viscosity') + species2_primitiveVenturi_mixingmodel_viscosity.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_mixingmodel_viscosity.cfg_file = "species2_primitiveVenturi_mixingmodel_viscosity.cfg" + species2_primitiveVenturi_mixingmodel_viscosity.test_iter = 50 + species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-5.243310, -3.635941, -3.892111, -7.558656, -5.131491, 5.000000, -1.668102, 5.000000, -3.474705, 5.000000, -2.085931, 2.494619, 0.985334, 0.599879, 0.909406] + test_list.append(species2_primitiveVenturi_mixingmodel_viscosity) + + # 2 species (1 eq) primitive venturi mixing using mixing model including heat capacity and mass diffusivity + species2_primitiveVenturi_mixingmodel_heatcapacity_H2 = TestCase('species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg') + species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg_file = "species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg" + species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_iter = 50 + species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_vals = [-5.837690, -4.641815, -4.576060, -6.662811, 2.074231, -5.482861, 30.000000, -7.308120, 12.000000, -8.022273, 8.000000, -8.828506, 2.092336, 1.000000, 0.600000, 0.492336] + test_list.append(species2_primitiveVenturi_mixingmodel_heatcapacity_H2) + + # 2 species (1 eq) primitive venturi mixing using mixing model including heat capacity and mass diffusivity NonDimensional case + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND = TestCase('species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg') + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg_file = "species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg" + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_iter = 50 + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_vals = [-5.706757, -5.216206, -5.142503, -7.926926, 1.492326, -5.366923, 10.000000, -2.738884, 3.000000, -5.208126, 5.000000, -5.742459, 2.092365, 1.000000, 0.600000, 0.492365] + test_list.append(species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND) + + # 2 species (1 eq) primitive venturi mixing using mixing model solving enthalpy equation using preconditioning + JST convective scheme + species2_primitiveVenturi_JST = TestCase('species2_primitiveVenturi_JST.cfg') + species2_primitiveVenturi_JST.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_JST.cfg_file = "species2_primitiveVenturi_JST.cfg" + species2_primitiveVenturi_JST.test_iter = 50 + species2_primitiveVenturi_JST.test_vals = [-6.035464, -7.071918, -7.201080, -1.142940, -8.348316, 10.000000, -3.223791, 10.000000, -4.435519, 0.049048, 0.014468, 0.020068, 0.014512, 25.000000] + test_list.append(species2_primitiveVenturi_JST) + + # 2 species (1 eq) primitive venturi mixing using mixing model solving enthalpy equation using preconditioning + Lax-Friedrich convective scheme + species2_primitiveVenturi_Lax_Friedrich = TestCase('species2_primitiveVenturi_Lax_Friedrich.cfg') + species2_primitiveVenturi_Lax_Friedrich.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_Lax_Friedrich.cfg_file = "species2_primitiveVenturi_Lax_Friedrich.cfg" + species2_primitiveVenturi_Lax_Friedrich.test_iter = 50 + species2_primitiveVenturi_Lax_Friedrich.test_vals = [-6.092441, -6.981653, -6.982959, -1.195023, -8.245626, 10.000000, -3.472515, 8.000000, -5.356121, 0.048943, 0.014468, 0.020007, 0.014468, 12.500000] + test_list.append(species2_primitiveVenturi_Lax_Friedrich) + + # 2 species (1 eq) primitive venturi mixing + species2_primitiveVenturi = TestCase('species2_primitiveVenturi') + species2_primitiveVenturi.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi.cfg_file = "species2_primitiveVenturi.cfg" + species2_primitiveVenturi.test_iter = 50 + species2_primitiveVenturi.test_vals = [-5.470699, -4.435379, -4.486544, -5.327925, -0.866369, -5.623281, 5.000000, -0.557915, 5.000000, -2.599732, 5.000000, -0.536608, 0.000037, 0.000037, 0.000000, 0.000000] + test_list.append(species2_primitiveVenturi) + + # 2 species (1 eq) primitive venturi mixing with bounded scalar transport + species_primitiveVenturi_boundedscalar = TestCase('species2_primitiveVenturi_bounded_scalar') + species_primitiveVenturi_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species" + species_primitiveVenturi_boundedscalar.cfg_file = "species2_primitiveVenturi_boundedscalar.cfg" + species_primitiveVenturi_boundedscalar.test_iter = 50 + species_primitiveVenturi_boundedscalar.test_vals = [-5.537734, -4.375388, -4.475128, -5.597904, -0.870563, -5.633513, 5.000000, -1.461524, 5.000000, -4.142508, 5.000000, -1.727874, 0.000438, 0.000438, 0.000000, 0.000000] + test_list.append(species_primitiveVenturi_boundedscalar) + + # 2 species (1 eq) primitive venturi mixing, unsteady and pressure-based + species2_primitiveVenturi_pb_unsteady = TestCase('species2_primitiveVenturi_pb_unsteady') + species2_primitiveVenturi_pb_unsteady.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_pb_unsteady.cfg_file = "pb_species2_primitiveVenturi_unsteady.cfg" + species2_primitiveVenturi_pb_unsteady.test_iter = 1 + species2_primitiveVenturi_pb_unsteady.test_vals = [-4.109794, -3.353379, -3.837678, -4.013330] + species2_primitiveVenturi_pb_unsteady.unsteady = True + test_list.append(species2_primitiveVenturi_pb_unsteady) + + # 2 species (1 eq) primitive venturi mixing using mixing model including inlet markers for turbulent intensity and viscosity ratios + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS = TestCase('species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg') + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg_file = "species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg" + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_iter = 50 + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_vals = [-4.847325, -1.922154, -1.947527, -0.716546, 1.211740, -3.930346, 21.000000, -5.152522, 9.000000, -5.325373, 4.000000, -5.865914, 2.000000, 1.000000, 0.000000, 1.000000] + test_list.append(species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS) + + # 3 species (2 eq) primitive venturi mixing with inlet files. + # Note that the residuals are exactly the same as for the non-inlet case which should be the case for a fresh inlet file. + species3_primitiveVenturi_inletFile = TestCase('species3_primitiveVenturi_inletFile') + species3_primitiveVenturi_inletFile.cfg_dir = "species_transport/venturi_primitive_3species" + species3_primitiveVenturi_inletFile.cfg_file = "species3_primitiveVenturi_inletFile.cfg" + species3_primitiveVenturi_inletFile.test_iter = 50 + species3_primitiveVenturi_inletFile.test_vals = [-5.541163, -4.505905, -4.557116, -5.398846, -0.938219, -5.817818, -5.944195, 5.000000, -0.555895, 5.000000, -2.598254, 5.000000, -0.597122] + test_list.append(species3_primitiveVenturi_inletFile) + + # 3 species (2 eq) primitive venturi mixing with new flux and value boundary conditions + species3_primitiveVenturi_fluxvalue = TestCase('species3_primitiveVenturi_fluxvalue') + species3_primitiveVenturi_fluxvalue.cfg_dir = "species_transport/venturi_primitive_3species" + species3_primitiveVenturi_fluxvalue.cfg_file = "species3_primitiveVenturi_flux_value.cfg" + species3_primitiveVenturi_fluxvalue.test_iter = 50 + species3_primitiveVenturi_fluxvalue.test_vals = [-4.563242, -5.504658, -0.861266, -5.822957, -6.458367, 1.257912, 0.122219, 0.317705, 0.817988, 0.241494, 0.102507, 0.004981, 0.134006] + test_list.append(species3_primitiveVenturi_fluxvalue) + + # rectangle passive transport validation + species_passive_val = TestCase('species_passive_val') + species_passive_val.cfg_dir = "species_transport/passive_transport_validation" + species_passive_val.cfg_file = "passive_transport.cfg" + species_passive_val.test_iter = 50 + species_passive_val.test_vals = [-16.493002, -16.246291, -16.871574, -4.257599, 10.000000, -4.526973, 8.000000, -5.193350, 0.186610, 0.000000] + species_passive_val.test_vals_aarch64 = [-16.517744, -16.282420, -16.871663, -4.257599, 10.000000, -4.278151, 8.000000, -5.193350, 0.186610, 0.000000] + test_list.append(species_passive_val) + + # rectangle active 2-species transport + species_active_transport_temp_limits = TestCase('species_active_transport_temp_limits') + species_active_transport_temp_limits.cfg_dir = "species_transport/passive_transport_validation" + species_active_transport_temp_limits.cfg_file = "active_species_transport_temp_limits.cfg" + species_active_transport_temp_limits.test_iter = 50 + species_active_transport_temp_limits.test_vals = [-1.785041, -2.565628, 2.460433, -3.188111, 9.000000, -5.551493, 3.000000, -5.826106, 1.456438, 0.998134, 0.001475, 0.456829] + species_active_transport_temp_limits.test_vals_aarch64 = [-1.785041, -2.565628, 2.460433, -3.188111, 9.000000, -5.551493, 3.000000, -5.826106, 1.456438, 0.998134, 0.001475, 0.456829] + test_list.append(species_active_transport_temp_limits) + + # species transport, 3 species with multizone (2 fluid regions) + species3_multizone_restart = TestCase('species3_multizone_restart') + species3_multizone_restart.cfg_dir = "species_transport/multizone" + species3_multizone_restart.cfg_file = "configMaster.cfg" + species3_multizone_restart.test_iter = 5 + species3_multizone_restart.test_vals = [-4.621056, -4.492840] + species3_multizone_restart.multizone = True + test_list.append(species3_multizone_restart) + + ##################### + ## CGNS writer ### + ##################### + + # CGNS writer + cgns_writer = TestCase('cgns_writer') + cgns_writer.cfg_dir = "cgns_writer" + cgns_writer.cfg_file = "config.cfg" + cgns_writer.test_iter = 1 + cgns_writer.test_vals = [-2.974473, 0.640256, 5.371028, -6.732060] + cgns_writer.new_output = True + test_list.append(cgns_writer) + + # The CGNS output of a 2D mesh is read back as mesh, with the restart written by the same run. + # The read-back test must run after the test that writes the files. + cgns_output = TestCase('cgns_output') + cgns_output.cfg_dir = "output_writers" + cgns_output.cfg_file = "cgns_output.cfg" + cgns_output.test_iter = 2 + cgns_output.test_vals = [-1.684071, 0.454658, 3.802834, -2.624573, 6.956844, 0.091480] + test_list.append(cgns_output) + + cgns_mesh_readback = TestCase('cgns_mesh_readback') + cgns_mesh_readback.cfg_dir = "output_writers" + cgns_mesh_readback.cfg_file = "cgns_mesh_readback.cfg" + cgns_mesh_readback.test_iter = 2 + cgns_mesh_readback.test_vals = [-2.480775, 0.352445, 2.998807, -3.103293, 6.892515, 0.085107] + test_list.append(cgns_mesh_readback) + + # Same for a 3D mesh with mixed elements, whose boundaries are written as MIXED sections. + cgns_output_bend = TestCase('cgns_output_bend') + cgns_output_bend.cfg_dir = "output_writers" + cgns_output_bend.cfg_file = "cgns_output_bend.cfg" + cgns_output_bend.test_iter = 2 + cgns_output_bend.test_vals = [-2.413023, -2.210141, -2.545448, -3.057828, 2.475696] + test_list.append(cgns_output_bend) + + cgns_mesh_readback_bend = TestCase('cgns_mesh_readback_bend') + cgns_mesh_readback_bend.cfg_dir = "output_writers" + cgns_mesh_readback_bend.cfg_file = "cgns_mesh_readback_bend.cfg" + cgns_mesh_readback_bend.test_iter = 2 + cgns_mesh_readback_bend.test_vals = [-3.256728, -2.769844, -3.007840, -3.567315, 4.318459] + test_list.append(cgns_mesh_readback_bend) + + ###################################### + ### RUN CHT TEST WITH FILEDIFF ### + ###################################### + + # 2D planar laminar premixed methane flame on isothermal burner with conjugate heat transfer in cooling fin (restart) + cfd_flamelet_ch4_cht = TestCase('cfd_flamelet_ch4_cht') + cfd_flamelet_ch4_cht.cfg_dir = "flamelet/03_laminar_premixed_ch4_flame_cht_cfd" + cfd_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_cfd_master.cfg" + cfd_flamelet_ch4_cht.test_iter = 5 + cfd_flamelet_ch4_cht.test_vals = [-7.223149, -6.338839, -8.334392, -10.410156, -3.171365, -10.884464, -12.615132, -6.614396] + cfd_flamelet_ch4_cht.timeout = 1600 + cfd_flamelet_ch4_cht.multizone = True + test_list.append(cfd_flamelet_ch4_cht) + + ###################################### + ### RUN TESTS ### + ###################################### + + # set suitable defaults unless something else has been specified + # command: "mpirun -n 2 SU2_CFD" + # timeout: 1600 + # tol: 0.00001 + for test in test_list: + if test.command.empty(): + test.command = TestCase.Command("mpirun -n 2", "SU2_CFD") + if test.timeout == 0: + test.timeout = 1600 + if test.tol == 0.0: + test.tol = 0.00001 + + pass_list = [ test.run_test() for test in test_list ] + + ###################################### + ### RUN SU2_SOL TESTS ### + ###################################### + + # parallel STL output using + stl_writer_test = TestCase('stl_writer_test') + stl_writer_test.cfg_dir = "rans/oneram6" + stl_writer_test.cfg_file = "turb_ONERAM6.cfg" + stl_writer_test.test_iter = 1 + stl_writer_test.command = TestCase.Command("mpirun -n 2", "SU2_SOL") + stl_writer_test.timeout = 1600 + stl_writer_test.reference_file = "surface_flow.stl.ref" + stl_writer_test.test_file = "surface_flow.stl" + pass_list.append(stl_writer_test.run_filediff()) + test_list.append(stl_writer_test) + + # The ASCII writers write in parallel, compare their files with those of the previous writers. + # ITER= 0 (test_iter = -1): the restart solution is written without iterating. + ascii_restart_writer = TestCase('ascii_restart_writer') + ascii_restart_writer.cfg_dir = "output_writers" + ascii_restart_writer.cfg_file = "ascii_output.cfg" + ascii_restart_writer.test_iter = -1 + ascii_restart_writer.command = TestCase.Command("mpirun -n 2", "SU2_CFD") + ascii_restart_writer.timeout = 1600 + ascii_restart_writer.reference_file = "restart_flow.csv.ref" + ascii_restart_writer.test_file = "restart_flow.csv" + pass_list.append(ascii_restart_writer.run_filediff()) + test_list.append(ascii_restart_writer) + + for tag, test_file in [("ascii_paraview_writer", "flow.vtk"), ("ascii_tecplot_writer", "flow.dat"), + ("ascii_surface_paraview_writer", "surface_flow.vtk"), + ("ascii_surface_tecplot_writer", "surface_flow.dat")]: + ascii_writer = TestCase(tag) + ascii_writer.cfg_dir = "output_writers" + ascii_writer.cfg_file = "ascii_output.cfg" + ascii_writer.test_iter = -1 + ascii_writer.command = TestCase.Command("mpirun -n 2", "SU2_SOL") + ascii_writer.timeout = 1600 + ascii_writer.reference_file = test_file + ".ref" + ascii_writer.test_file = test_file + pass_list.append(ascii_writer.run_filediff()) + test_list.append(ascii_writer) + + # SU2 mesh file written by SU2_DEF without deformation + ascii_mesh_writer = TestCase('ascii_mesh_writer') + ascii_mesh_writer.cfg_dir = "output_writers" + ascii_mesh_writer.cfg_file = "ascii_output.cfg" + ascii_mesh_writer.test_iter = -1 + ascii_mesh_writer.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + ascii_mesh_writer.timeout = 1600 + ascii_mesh_writer.reference_file = "mesh_out.su2.ref" + ascii_mesh_writer.test_file = "mesh_out.su2" + pass_list.append(ascii_mesh_writer.run_filediff()) + test_list.append(ascii_mesh_writer) + + ###################################### + ### RUN SU2_DEF TESTS ### + ###################################### + + # Inviscid NACA0012 (triangles) + naca0012_def = TestCase('naca0012_def') + naca0012_def.cfg_dir = "deformation/naca0012" + naca0012_def.cfg_file = "def_NACA0012.cfg" + naca0012_def.test_iter = 10 + naca0012_def.test_vals = [0.00352488] #residual + naca0012_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + naca0012_def.timeout = 1600 + naca0012_def.tol = 1e-8 + + pass_list.append(naca0012_def.run_def()) + test_list.append(naca0012_def) + + # Inviscid NACA0012 based on Camberline deformation (triangles) + naca0012_def_file_camber = TestCase('naca0012_def_camber') + naca0012_def_file_camber.cfg_dir = "deformation/naca0012" + naca0012_def_file_camber.cfg_file = "def_NACA0012_camber.cfg" + naca0012_def_file_camber.test_iter = 10 + naca0012_def_file_camber.test_vals = [0.00854844] + naca0012_def_file_camber.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + naca0012_def_file_camber.timeout = 1600 + naca0012_def_file_camber.tol = 1e-8 + + pass_list.append(naca0012_def_file_camber.run_def()) + test_list.append(naca0012_def_file_camber) + + # Inviscid NACA0012 (triangles) RBF + naca0012_rbf_def = TestCase('naca0012_def') + naca0012_rbf_def.cfg_dir = "deformation/naca0012" + naca0012_rbf_def.cfg_file = "def_NACA0012_rbf.cfg" + naca0012_rbf_def.test_iter = 12 + naca0012_rbf_def.test_vals = [0.000782551, 26] # error + naca0012_rbf_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + naca0012_rbf_def.timeout = 1600 + naca0012_rbf_def.tol = 1e-8 + + pass_list.append(naca0012_def.run_def()) + test_list.append(naca0012_def) + + # Inviscid NACA0012 based on SURFACE_FILE input (surface_bump.dat) + naca0012_def_file = TestCase('naca0012_def_file') + naca0012_def_file.cfg_dir = "deformation/naca0012" + naca0012_def_file.cfg_file = "surface_file_NACA0012.cfg" + naca0012_def_file.test_iter = 10 + naca0012_def_file.test_vals = [0.00352488] #residual + naca0012_def_file.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + naca0012_def_file.timeout = 1600 + naca0012_def_file.tol = 1e-8 + + pass_list.append(naca0012_def_file.run_def()) + test_list.append(naca0012_def_file) + + # RAE2822 (mixed tris + quads) + rae2822_def = TestCase('rae2822_def') + rae2822_def.cfg_dir = "deformation/rae2822" + rae2822_def.cfg_file = "def_RAE2822.cfg" + rae2822_def.test_iter = 10 + rae2822_def.test_vals = [8.24002e-09] #residual + rae2822_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + rae2822_def.timeout = 1600 + rae2822_def.tol = 1e-13 + + pass_list.append(rae2822_def.run_def()) + test_list.append(rae2822_def) + + # Turb NACA4412 (quads, wall distance) + naca4412_def = TestCase('naca4412_def') + naca4412_def.cfg_dir = "deformation/naca4412" + naca4412_def.cfg_file = "def_NACA4412.cfg" + naca4412_def.test_iter = 10 + naca4412_def.test_vals = [2.210380e-12] #residual + naca4412_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + naca4412_def.timeout = 1600 + naca4412_def.tol = 1e-12 + + pass_list.append(naca4412_def.run_def()) + test_list.append(naca4412_def) + + # Brick of tets (inverse volume) + brick_tets_def = TestCase('brick_tets_def') + brick_tets_def.cfg_dir = "deformation/brick_tets" + brick_tets_def.cfg_file = "def_brick_tets.cfg" + brick_tets_def.test_iter = 10 + brick_tets_def.test_vals = [0.000955394] #residual + brick_tets_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + brick_tets_def.timeout = 1600 + brick_tets_def.tol = 1e-9 + + pass_list.append(brick_tets_def.run_def()) + test_list.append(brick_tets_def) + + # Brick of isotropic hexas (inverse volume) + brick_hex_def = TestCase('brick_hex_def') + brick_hex_def.cfg_dir = "deformation/brick_hex" + brick_hex_def.cfg_file = "def_brick_hex.cfg" + brick_hex_def.test_iter = 10 + brick_hex_def.test_vals = [0.000166575] #residual + brick_hex_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + brick_hex_def.timeout = 1600 + brick_hex_def.tol = 1e-9 + + pass_list.append(brick_hex_def.run_def()) + test_list.append(brick_hex_def) + + # Brick with a pyramid layer (inverse volume) + brick_pyra_def = TestCase('brick_pyra_def') + brick_pyra_def.cfg_dir = "deformation/brick_pyra" + brick_pyra_def.cfg_file = "def_brick_pyra.cfg" + brick_pyra_def.test_iter = 10 + brick_pyra_def.test_vals = [0.00161454] #residual + brick_pyra_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + brick_pyra_def.timeout = 1600 + brick_pyra_def.tol = 1e-8 + + pass_list.append(brick_pyra_def.run_def()) + test_list.append(brick_pyra_def) + + # Brick of isotropic prisms (inverse volume) + brick_prism_def = TestCase('brick_prism_def') + brick_prism_def.cfg_dir = "deformation/brick_prism" + brick_prism_def.cfg_file = "def_brick_prism.cfg" + brick_prism_def.test_iter = 10 + brick_prism_def.test_vals = [0.00254732] #residual + brick_prism_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + brick_prism_def.timeout = 1600 + brick_prism_def.tol = 1e-8 + + pass_list.append(brick_prism_def.run_def()) + test_list.append(brick_prism_def) + + # Brick of prisms with high aspect ratio cells near the wall (wall distance) + brick_prism_rans_def = TestCase('brick_prism_rans_def') + brick_prism_rans_def.cfg_dir = "deformation/brick_prism_rans" + brick_prism_rans_def.cfg_file = "def_brick_prism_rans.cfg" + brick_prism_rans_def.test_iter = 10 + brick_prism_rans_def.test_vals = [2.99461e-07] #residual + brick_prism_rans_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + brick_prism_rans_def.timeout = 1600 + brick_prism_rans_def.tol = 1e-12 + + pass_list.append(brick_prism_rans_def.run_def()) + test_list.append(brick_prism_rans_def) + + # Brick of hexas with high aspect ratio cells near the wall (inverse volume) + brick_hex_rans_def = TestCase('brick_hex_rans_def') + brick_hex_rans_def.cfg_dir = "deformation/brick_hex_rans" + brick_hex_rans_def.cfg_file = "def_brick_hex_rans.cfg" + brick_hex_rans_def.test_iter = 10 + brick_hex_rans_def.test_vals = [3.54213e-06] #residual + brick_hex_rans_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + brick_hex_rans_def.timeout = 1600 + brick_hex_rans_def.tol = 1e-11 + + pass_list.append(brick_hex_rans_def.run_def()) + test_list.append(brick_hex_rans_def) + + # Cylindrical FFD test + cylinder_ffd_def = TestCase('cylinder_ffd_def') + cylinder_ffd_def.cfg_dir = "deformation/cylindrical_ffd" + cylinder_ffd_def.cfg_file = "def_cylindrical.cfg" + cylinder_ffd_def.test_iter = 10 + cylinder_ffd_def.test_vals = [0.000902348] #residual + cylinder_ffd_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + cylinder_ffd_def.timeout = 1600 + cylinder_ffd_def.tol = 1e-9 + + pass_list.append(cylinder_ffd_def.run_def()) + test_list.append(cylinder_ffd_def) + + # Spherical FFD test + sphere_ffd_def = TestCase('sphere_ffd_def') + sphere_ffd_def.cfg_dir = "deformation/spherical_ffd" + sphere_ffd_def.cfg_file = "def_spherical.cfg" + sphere_ffd_def.test_iter = 10 + sphere_ffd_def.test_vals = [0.00360367] #residual + sphere_ffd_def.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + sphere_ffd_def.timeout = 1600 + sphere_ffd_def.tol = 1e-8 + + pass_list.append(sphere_ffd_def.run_def()) + test_list.append(sphere_ffd_def) + + # Spherical FFD test using BSplines + sphere_ffd_def_bspline = TestCase('sphere_ffd_def_bspline') + sphere_ffd_def_bspline.cfg_dir = "deformation/spherical_ffd" + sphere_ffd_def_bspline.cfg_file = "def_spherical_bspline.cfg" + sphere_ffd_def_bspline.test_iter = 10 + sphere_ffd_def_bspline.test_vals = [0.00208393] #residual + sphere_ffd_def_bspline.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + sphere_ffd_def_bspline.timeout = 1600 + sphere_ffd_def_bspline.tol = 1e-8 + + pass_list.append(sphere_ffd_def_bspline.run_def()) + test_list.append(sphere_ffd_def_bspline) + + # Inviscid NACA0012 (triangles) + naca0012_cst = TestCase('naca0012_cst') + naca0012_cst.cfg_dir = "deformation/cst" + naca0012_cst.cfg_file = "naca0012.cfg" + naca0012_cst.test_iter = 10 + naca0012_cst.test_vals = [0.000385514] #residual + naca0012_cst.command = TestCase.Command("mpirun -n 2", "SU2_DEF") + naca0012_cst.timeout = 1600 + naca0012_cst.tol = 1e-8 + + pass_list.append(naca0012_cst.run_def()) + test_list.append(naca0012_cst) + + # 2D FD streamwise periodic cht, avg temp obj func + fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') + fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + fd_sp_pinArray_cht_2d_dp_hf.cfg_file = "FD_configMaster.cfg" + fd_sp_pinArray_cht_2d_dp_hf.test_iter = 100 + fd_sp_pinArray_cht_2d_dp_hf.command = TestCase.Command(exec = "finite_differences.py", param = "-z 2 -n 2 -f") + fd_sp_pinArray_cht_2d_dp_hf.timeout = 1600 + fd_sp_pinArray_cht_2d_dp_hf.comp_threshold = 1e-6 + fd_sp_pinArray_cht_2d_dp_hf.tol_file_percent = 0.2 + fd_sp_pinArray_cht_2d_dp_hf.reference_file = "of_grad_findiff.csv.ref" + fd_sp_pinArray_cht_2d_dp_hf.reference_file_aarch64 = "of_grad_findiff_aarch64.csv.ref" + fd_sp_pinArray_cht_2d_dp_hf.test_file = "FINDIFF/of_grad_findiff.csv" + fd_sp_pinArray_cht_2d_dp_hf.multizone = True + + pass_list.append(fd_sp_pinArray_cht_2d_dp_hf.run_filediff()) + test_list.append(fd_sp_pinArray_cht_2d_dp_hf) + + + # Tests summary + print('==================================================================') + print('Summary of the parallel tests') + print('python version:', sys.version) + for i, test in enumerate(test_list): + if (pass_list[i]): + print(' passed - %s'%test.tag) + else: + print('* FAILED - %s'%test.tag) + + if all(pass_list): + sys.exit(0) + else: + sys.exit(1) + # done + +if __name__ == '__main__': + main() diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 384fa6dcf268..ebd1193f4b0c 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -151,3 +151,484 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 discadj_axisymmetric_rans_nozzle.test_vals = [9.738854, 5.135195, 7.108430, 2.487299] + discadj_axisymmetric_rans_nozzle.no_restart = True + test_list.append(discadj_axisymmetric_rans_nozzle) + + ####################################################### + ### Unsteady Disc. adj. compressible RANS ### + ####################################################### + + # Turbulent Cylinder + discadj_cylinder = TestCase('unsteady_cylinder') + discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" + discadj_cylinder.cfg_file = "cylinder.cfg" + discadj_cylinder.test_iter = 9 + discadj_cylinder.test_vals = [1.639372, -2.834293, -0.009538, 0.000020] + discadj_cylinder.unsteady = True + test_list.append(discadj_cylinder) + + ############################################################## + ### Unsteady Disc. adj. compressible RANS Windowed Average ### + ############################################################## + + # Turbulent Cylinder + discadj_cylinder = TestCase('unsteady_cylinder_windowed_average_AD') + discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" + discadj_cylinder.cfg_file = "cylinder_Windowing_AD.cfg" + discadj_cylinder.test_iter = 9 + discadj_cylinder.test_vals = [2.183361] + discadj_cylinder.unsteady = True + test_list.append(discadj_cylinder) + + ############################################################## + ### Unsteady Disc. adj. compressible RANS Windowed Average ### + ############################################################## + + # Turbulent Cylinder + discadj_cylinder = TestCase('unsteady_cylinder_windowed_average') + discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" + discadj_cylinder.cfg_file = "cylinder_Windowing.cfg" + discadj_cylinder.test_iter = 6 + discadj_cylinder.test_vals = [0.238134, -0.000245, 1.926672, -0.000097, 1.062800] + discadj_cylinder.tol = 0.0001 + discadj_cylinder.command = TestCase.Command("mpirun -n 2", "SU2_CFD_DIRECTDIFF") + discadj_cylinder.unsteady = True + test_list.append(discadj_cylinder) + + ########################################################################## + ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### + ########################################################################## + + # Turbulent Cylinder + discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') + discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" + discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" + discadj_DT_1ST_cylinder.test_iter = 9 + discadj_DT_1ST_cylinder.test_vals = [1.196414, -3.339029, -0.006212, 0.000020] + discadj_DT_1ST_cylinder.unsteady = True + test_list.append(discadj_DT_1ST_cylinder) + + ###################################################### + ### Unsteady Disc. adj. compressible pitching NACA ### + ###################################################### + + # compressible pitching NACA0012 + discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') + discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" + discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" + discadj_pitchingNACA0012.test_iter = 4 + discadj_pitchingNACA0012.test_vals = [-1.115587, -1.573317, -0.006474, 0.000010] + discadj_pitchingNACA0012.tol = 0.01 + discadj_pitchingNACA0012.unsteady = True + test_list.append(discadj_pitchingNACA0012) + + ####################################################### + ### Disc. adj. multizone interfaces ### + ####################################################### + + # Mixing plane interface + discadj_mixing_plane = TestCase('discadj_mixing_plane') + discadj_mixing_plane.cfg_dir = "disc_adj_ffi/mixing_plane" + discadj_mixing_plane.cfg_file = "circles.cfg" + discadj_mixing_plane.test_iter = 10 + discadj_mixing_plane.test_vals = [10.000000, -4.714607, -4.479606] + test_list.append(discadj_mixing_plane) + + # Sliding interface + discadj_sliding_interface = TestCase('discadj_sliding_interface') + discadj_sliding_interface.cfg_dir = "disc_adj_ffi/sliding_interface" + discadj_sliding_interface.cfg_file = "circles.cfg" + discadj_sliding_interface.test_iter = 10 + discadj_sliding_interface.test_vals = [10.000000, -4.403529, -4.419435] + test_list.append(discadj_sliding_interface) + + ####################################################### + ### Disc. adj. turbomachinery ### + ####################################################### + + # Transonic Stator 2D + discadj_trans_stator = TestCase('transonic_stator') + discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" + discadj_trans_stator.cfg_file = "transonic_stator.cfg" + discadj_trans_stator.test_iter = 79 + discadj_trans_stator.test_vals = [79.000000, -7.555647, -10.335486, -10.356919, -13.629543] + discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.555647, -10.335486, -10.356919, -13.629543] + test_list.append(discadj_trans_stator) + + # Axial stage 2D + discadj_axial_stage = TestCase('axial_stage_2D') + discadj_axial_stage.cfg_dir = "disc_adj_turbomachinery/axial_stage_2D" + discadj_axial_stage.cfg_file = "Axial_stage2D.cfg" + discadj_axial_stage.test_iter = 79 + discadj_axial_stage.test_vals = [79.000000, -6.606356, -7.139726] + discadj_axial_stage.test_vals_aarch64 = [79.000000, -6.606356, -7.139726] + test_list.append(discadj_axial_stage) + + ################################### + ### Structural Adjoint ### + ################################### + + # Structural model + discadj_fea = TestCase('discadj_fea') + discadj_fea.cfg_dir = "disc_adj_fea" + discadj_fea.cfg_file = "configAD_fem.cfg" + discadj_fea.test_iter = 4 + discadj_fea.test_vals = [-2.849664, -3.238571, -0.000364, -8.708700] + discadj_fea.test_vals_aarch64 = [-2.849646, -3.238577, -0.000364, -8.708700] #last 4 columns + test_list.append(discadj_fea) + + # Thermoelastic problem + # Derivative of heat flux wrt Poisson's ratio (due to increase in cross section) verified via finite differences. + discadj_thermoelastic = TestCase('discadj_thermoelastic') + discadj_thermoelastic.cfg_dir = "fea_fsi/ThermalBeam_3d" + discadj_thermoelastic.cfg_file = "configBeamNonlinear_3d_ad.cfg" + discadj_thermoelastic.test_iter = 10 + discadj_thermoelastic.test_vals = [-5.355530, -5.293381, -6.164472, -6.433864, 43, -4.049760, 27, -4.164193, 0, 0.192640, 0] + test_list.append(discadj_thermoelastic) + + ################################### + ### Disc. adj. heat ### + ################################### + + # Discrete adjoint for heated cylinder + discadj_heat = TestCase('discadj_heat') + discadj_heat.cfg_dir = "disc_adj_heat" + discadj_heat.cfg_file = "disc_adj_heat.cfg" + discadj_heat.test_iter = 10 + discadj_heat.test_vals = [-2.344276, 0.759978, 0.000000, -3.967600] + test_list.append(discadj_heat) + + ################################### + ### Coupled FSI Adjoint ### + ################################### + + # Legacy driver + discadj_fsi = TestCase('discadj_fsi') + discadj_fsi.cfg_dir = "disc_adj_fsi" + discadj_fsi.cfg_file = "config.cfg" + discadj_fsi.test_iter = 9 + discadj_fsi.test_vals = [-3.166421, -4.160938, 0.000439, -1.061900] + test_list.append(discadj_fsi) + + # Multi physics framework + discadj_fsi2 = TestCase('discadj_fsi_airfoil') + discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" + discadj_fsi2.cfg_file = "config.cfg" + discadj_fsi2.test_iter = 8 + discadj_fsi2.test_vals = [-3.824591, 1.979595, -3.863368, 0.295450, 3.839800] + discadj_fsi2.test_vals_aarch64 = [-3.824870, 1.979160, -3.863368, 0.295450, 3.839800] + discadj_fsi2.tol = 0.00001 + test_list.append(discadj_fsi2) + + ################################### + ### Coupled CHT Adjoint ### + ################################### + + # Coupled discrete adjoint for heatflux in heated cylinder array + discadj_cht = TestCase('discadj_cht') + discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" + discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" + discadj_cht.test_iter = 10 + discadj_cht.test_vals = [-6.308199, -3.086021, -3.086022, -3.086022] + test_list.append(discadj_cht) + + # 2D DA cht streamwise periodic case, 2 zones, avg temp objective + da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') + da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" + da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 + da_sp_pinArray_cht_2d_dp_hf.tol = 5e-4 + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-11.620815, -6.488915, -13.316583] + da_sp_pinArray_cht_2d_dp_hf.multizone = True + test_list.append(da_sp_pinArray_cht_2d_dp_hf) + + # 2D DA cht streamwise periodic case, 2 zones, PressureDrop objective, additional pressure drop adjoint equation + da_sp_pinArray_cht_2d_mf = TestCase('da_sp_pinArray_cht_2d_mf') + da_sp_pinArray_cht_2d_mf.cfg_dir = "incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d" + da_sp_pinArray_cht_2d_mf.cfg_file = "configMaster.cfg" + da_sp_pinArray_cht_2d_mf.test_iter = 100 + da_sp_pinArray_cht_2d_mf.test_vals = [-4.544489, -1.200740, -1.451677, -0.809551, -5.998322, -15.723654, -49.833480] + da_sp_pinArray_cht_2d_mf.multizone = True + test_list.append(da_sp_pinArray_cht_2d_mf) + + # 2D unsteady CHT vortex shedding at RE=200. TAVG_Temperature OF + da_unsteadyCHT_cylinder = TestCase('da_unsteadyCHT_cylinder') + da_unsteadyCHT_cylinder.cfg_dir = "coupled_cht/disc_adj_unsteadyCHT_cylinder" + da_unsteadyCHT_cylinder.cfg_file = "chtMaster.cfg" + da_unsteadyCHT_cylinder.test_iter = 2 + da_unsteadyCHT_cylinder.tol = 2e-5 + da_unsteadyCHT_cylinder.test_vals = [-8.479629, -9.239920, -9.234868, -15.934511, -13.662008, 0.000000, 10.627000, 0.295190] + da_unsteadyCHT_cylinder.test_vals_aarch64 = [-8.479629, -9.239920, -9.234868, -15.934511, -13.662012, 0.000000, 89.932000, 0.295190] + da_unsteadyCHT_cylinder.unsteady = True + da_unsteadyCHT_cylinder.multizone = True + test_list.append(da_unsteadyCHT_cylinder) + + ################################## + ### Disc. adj. flamelet solver ### + ################################## + + # 2D planar laminar premixed flame on isothermal burner (restart) + discadj_flamelet_ch4_hx = TestCase('discadj_flamelet_ch4_hx') + discadj_flamelet_ch4_hx.cfg_dir = "flamelet/02_laminar_premixed_ch4_flame_hx_ad" + discadj_flamelet_ch4_hx.cfg_file = "lam_prem_ch4_hx_ad.cfg" + discadj_flamelet_ch4_hx.multizone = False + discadj_flamelet_ch4_hx.test_iter = 10 + discadj_flamelet_ch4_hx.test_vals = [-9.083502, -9.033520, -9.529644, -8.442388, -15.399568, -6.170002, -18.881156] + test_list.append(discadj_flamelet_ch4_hx) + + # 2D planar laminar premixed flame on isothermal burner with conjugate heat transfer (restart) + discadj_flamelet_ch4_cht = TestCase('discadj_flamelet_ch4_cht') + discadj_flamelet_ch4_cht.cfg_dir = "flamelet/04_laminar_premixed_ch4_flame_cht_ad" + discadj_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_ad_master.cfg" + discadj_flamelet_ch4_cht.multizone = True + discadj_flamelet_ch4_cht.test_iter = 10 + discadj_flamelet_ch4_cht.test_vals = [-1.545058, 0.628666, -6.533534, -18.651078, -18.648552, -3.794724, -6.572494, 11.000000] + test_list.append(discadj_flamelet_ch4_cht) + + ###################################### + ### RUN TESTS ### + ###################################### + + # set suitable defaults unless something else has been specified + # command: "mpirun -n 2 SU2_CFD_AD" + # timeout: 1600 + # tol: 0.00001 + for test in test_list: + if test.command.empty(): + test.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") + if test.timeout == 0: + test.timeout = 1600 + if test.tol == 0.0: + test.tol = 0.00001 + + pass_list = [ test.run_test() for test in test_list ] + + ################################################ + ### Gradient check (dot) for flamelet solver ### + ################################################ + + # 2D planar laminar premixed flame on isothermal burner (restart) + # This test restarts on the output of test discadj_flamelet_ch4_hx and + # will only pass if test discadj_flamelet_ch4_hx passes. + dot_flamelet_ch4_hx = TestCase('dot_flamelet_ch4_hx') + dot_flamelet_ch4_hx.cfg_dir = "flamelet/02_laminar_premixed_ch4_flame_hx_ad" + dot_flamelet_ch4_hx.cfg_file = "lam_prem_ch4_hx_dot.cfg" + dot_flamelet_ch4_hx.test_iter = 10 + dot_flamelet_ch4_hx.command = TestCase.Command("mpirun -n 2", "SU2_DOT_AD") + dot_flamelet_ch4_hx.timeout = 20000 + dot_flamelet_ch4_hx.reference_file = "of_grad.csv.ref" + dot_flamelet_ch4_hx.test_file = "of_grad.csv" + dot_flamelet_ch4_hx.comp_threshold = 1e-6 + dot_flamelet_ch4_hx.tol_file_percent = 0.1 + pass_list.append(dot_flamelet_ch4_hx.run_filediff()) + test_list.append(dot_flamelet_ch4_hx) + + # 2D planar laminar premixed flame on isothermal burner with conjugate heat transfer (restart) + # This test restarts on the output of test discadj_flamelet_ch4_cht and + # will only pass if test discadj_flamelet_ch4_cht passes. + dot_flamelet_ch4_cht = TestCase('dot_flamelet_ch4_cht') + dot_flamelet_ch4_cht.cfg_dir = "flamelet/04_laminar_premixed_ch4_flame_cht_ad" + dot_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_dot_master.cfg" + dot_flamelet_ch4_cht.multizone = True + dot_flamelet_ch4_cht.test_iter = 10 + dot_flamelet_ch4_cht.command = TestCase.Command("mpirun -n 2", "SU2_DOT_AD") + dot_flamelet_ch4_cht.timeout = 20000 + dot_flamelet_ch4_cht.reference_file = "of_grad.csv.ref" + dot_flamelet_ch4_cht.test_file = "of_grad.csv" + dot_flamelet_ch4_cht.comp_threshold = 1e-6 + dot_flamelet_ch4_cht.tol_file_percent = 0.1 + pass_list.append(dot_flamelet_ch4_cht.run_filediff()) + test_list.append(dot_flamelet_ch4_cht) + + ################################################## + ### Structural Adjoint - Topology Optimization ### + ################################################## + + # test discrete_adjoint.py + discadj_topol_optim = TestCase('discadj_topol_optim') + discadj_topol_optim.cfg_dir = "fea_topology" + discadj_topol_optim.cfg_file = "config.cfg" + discadj_topol_optim.test_iter = 0 + discadj_topol_optim.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") + discadj_topol_optim.timeout = 1600 + discadj_topol_optim.reference_file = "grad_ref_node.dat.ref" + discadj_topol_optim.reference_file_aarch64 = "grad_ref_node_aarch64.dat.ref" + discadj_topol_optim.test_file = "grad_ref_node.dat" + pass_list.append(discadj_topol_optim.run_filediff()) + test_list.append(discadj_topol_optim) + + #################################################################################### + ### Unsteady Disc. adj. compressible RANS Windowed Average with restart solution ### + #################################################################################### + + # NACA0012 Airfoil + unsteady_naca0012 = TestCase('unsteady_NACA0012_restart_adjoint') + unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" + unsteady_naca0012.cfg_file = "naca0012.cfg" + unsteady_naca0012.test_iter = 14 + unsteady_naca0012.command = TestCase.Command(exec = "discrete_adjoint.py", param = "-f") + unsteady_naca0012.timeout = 1600 + unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" + unsteady_naca0012.test_file = "of_grad_cd.csv" + unsteady_naca0012.unsteady = True + pass_list.append(unsteady_naca0012.run_filediff()) + test_list.append(unsteady_naca0012) + + #################################################################################### + ### Unsteady Disc. adj. compressible RANS Windowed Average only adjoint ### + #################################################################################### + + # NACA0012 Airfoil (Test depends on results of "unsteady_NACA0012_restart_adjoint") + unsteady_naca0012 = TestCase('unsteady_NACA0012_adjoint_only') + unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" + unsteady_naca0012.cfg_file = "naca0012.cfg" + unsteady_naca0012.test_iter = 14 + unsteady_naca0012.command = TestCase.Command(exec = "discrete_adjoint.py", param = "-m adj -f") + unsteady_naca0012.timeout = 1600 + unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" + unsteady_naca0012.test_file = "of_grad_cd.csv" + unsteady_naca0012.unsteady = True + pass_list.append(unsteady_naca0012.run_filediff()) + test_list.append(unsteady_naca0012) + + #################################################################### + ### Python Wrapper ### + #################################################################### + + # FEA AD Flow Load Sensitivity + pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_FEA_AD_FlowLoad') + pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_fea/flow_load_sens" + pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_fem.cfg" + pywrapper_FEA_AD_FlowLoad.test_iter = 100 + pywrapper_FEA_AD_FlowLoad.test_vals = [-0.13945587401785386, -0.5859858866132448, -0.00036377840086080694, -0.0031005670174756366] #last 4 columns + pywrapper_FEA_AD_FlowLoad.command = TestCase.Command("mpirun -n 2", "python", "run_adjoint.py --parallel -f") + pywrapper_FEA_AD_FlowLoad.timeout = 1600 + pywrapper_FEA_AD_FlowLoad.tol = 0.000001 + pywrapper_FEA_AD_FlowLoad.new_output = False + test_list.append(pywrapper_FEA_AD_FlowLoad) + pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) + + # FEA unsteady AD Load Sensitivity + pywrapper_Unst_FEA_AD = TestCase('pywrapper_Unst_FEA_AD') + pywrapper_Unst_FEA_AD.cfg_dir = "py_wrapper/custom_load_fea" + pywrapper_Unst_FEA_AD.cfg_file = "config.cfg" + pywrapper_Unst_FEA_AD.test_iter = 100 + pywrapper_Unst_FEA_AD.test_vals = [0.262441, 0.262444, 0.324361, 0.324640, -0.188221, -0.188238] + pywrapper_Unst_FEA_AD.command = TestCase.Command("mpirun -n 2", "python", "run_ad.py") + pywrapper_Unst_FEA_AD.timeout = 1600 + pywrapper_Unst_FEA_AD.tol = 0.00001 + pywrapper_Unst_FEA_AD.new_output = False + test_list.append(pywrapper_Unst_FEA_AD) + pass_list.append(pywrapper_Unst_FEA_AD.run_test()) + + # Heat solver unsteady AD + pywrapper_Unst_Heat_AD = TestCase('pywrapper_Unst_Heat_AD') + pywrapper_Unst_Heat_AD.cfg_dir = "py_wrapper/custom_heat_flux" + pywrapper_Unst_Heat_AD.cfg_file = "run_ad.py" + pywrapper_Unst_Heat_AD.test_iter = 100 + pywrapper_Unst_Heat_AD.test_vals = [0.776365, 0.776430, 1.000003] + pywrapper_Unst_Heat_AD.command = TestCase.Command("mpirun -n 2", "python", "run_ad.py") + pywrapper_Unst_Heat_AD.timeout = 1600 + pywrapper_Unst_Heat_AD.tol = 0.00001 + pywrapper_Unst_Heat_AD.new_output = False + test_list.append(pywrapper_Unst_Heat_AD) + pass_list.append(pywrapper_Unst_Heat_AD.run_test()) + + # Flow AD Mesh Displacement Sensitivity + pywrapper_CFD_AD_MeshDisp = TestCase('pywrapper_CFD_AD_MeshDisp') + pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" + pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" + pywrapper_CFD_AD_MeshDisp.test_iter = 1000 + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.496452, 1.441022, 0.000000] + pywrapper_CFD_AD_MeshDisp.command = TestCase.Command("mpirun -n 2", "python", "run_adjoint.py --parallel -f") + pywrapper_CFD_AD_MeshDisp.timeout = 1600 + pywrapper_CFD_AD_MeshDisp.tol = 0.000001 + pywrapper_CFD_AD_MeshDisp.new_output = False + test_list.append(pywrapper_CFD_AD_MeshDisp) + pass_list.append(pywrapper_CFD_AD_MeshDisp.run_test()) + + # Flow AD Mesh Displacement and Initial Coordinates Sensitivity + pywrapper_wavy_wall_steady = TestCase('pywrapper_wavy_wall_steady') + pywrapper_wavy_wall_steady.cfg_dir = "py_wrapper/wavy_wall" + pywrapper_wavy_wall_steady.cfg_file = "run_steady.py" + pywrapper_wavy_wall_steady.test_iter = 100 + pywrapper_wavy_wall_steady.test_vals = [-1.353007, 2.581051, -2.900574] + pywrapper_wavy_wall_steady.command = TestCase.Command("mpirun -n 2", "python", "run_steady.py") + pywrapper_wavy_wall_steady.timeout = 1600 + pywrapper_wavy_wall_steady.tol = 0.00001 + pywrapper_wavy_wall_steady.new_output = False + test_list.append(pywrapper_wavy_wall_steady) + pass_list.append(pywrapper_wavy_wall_steady.run_test()) + + #################################################################### + ### Unsteady Disc. adj. compressible RANS restart optimization ### + #################################################################### + + # test shape_optimization.py + naca_restart_shape_opt = TestCase('restart_shape_optimization') + naca_restart_shape_opt.cfg_dir = "optimization_rans/naca0012" + naca_restart_shape_opt.cfg_file = "naca0012.cfg" + naca_restart_shape_opt.test_iter = 1 + naca_restart_shape_opt.test_vals = [1.000000, 1.000000, 0.007047, 0.196668] + naca_restart_shape_opt.command = TestCase.Command(exec = "shape_optimization.py", param = "-f") + naca_restart_shape_opt.timeout = 1600 + naca_restart_shape_opt.tol = 0.00001 + pass_list.append(naca_restart_shape_opt.run_opt()) + test_list.append(naca_restart_shape_opt) + + #################################################################### + ### Unsteady Disc. Adj. Coupled FSI ### + #################################################################### + + # Unsteady multi physics framework + dyn_discadj_fsi = TestCase('dyn_discadj_fsi') + dyn_discadj_fsi.cfg_dir = "disc_adj_fsi/dyn_fsi" + dyn_discadj_fsi.cfg_file = "config.cfg" + dyn_discadj_fsi.test_iter = 2 + dyn_discadj_fsi.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") + dyn_discadj_fsi.timeout = 1600 + dyn_discadj_fsi.reference_file = "grad_dv.opt.ref" + dyn_discadj_fsi.reference_file_aarch64 = "grad_dv_aarch64.opt.ref" + dyn_discadj_fsi.test_file = "grad_young.opt" + dyn_discadj_fsi.comp_threshold = 1e-6 + dyn_discadj_fsi.tol_file_percent = 0.1 + dyn_discadj_fsi.unsteady = True + pass_list.append(dyn_discadj_fsi.run_filediff()) + test_list.append(dyn_discadj_fsi) + + #################################################################### + ### Sobolev Gradient Smoothing ### + #################################################################### + + # Sobolev gradient smoothing solver + grad_smooth_oneram6 = TestCase('grad_smooth_sob') + grad_smooth_oneram6.cfg_dir = "grad_smooth/oneram6" + grad_smooth_oneram6.cfg_file = "ONERAM6_gradsmooth.cfg" + grad_smooth_oneram6.test_iter = 2 + grad_smooth_oneram6.command = TestCase.Command("mpirun -n 2", "SU2_DOT_AD") + grad_smooth_oneram6.timeout = 1600 + grad_smooth_oneram6.reference_file = "of_hess.dat.ref" + grad_smooth_oneram6.reference_file_aarch64 = "of_hess_aarch64.dat.ref" + grad_smooth_oneram6.test_file = "of_hess.dat" + pass_list.append(grad_smooth_oneram6.run_filediff()) + test_list.append(grad_smooth_oneram6) + + + # Tests summary + print('==================================================================') + print('Summary of the parallel tests') + print('python version:', sys.version) + for i, test in enumerate(test_list): + if (pass_list[i]): + print(' passed - %s'%test.tag) + else: + print('* FAILED - %s'%test.tag) + + if all(pass_list): + sys.exit(0) + else: + sys.exit(1) + # done + +if __name__ == '__main__': + main() diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 65b40988b844..d1462e455e46 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -376,3 +376,1413 @@ def main(): axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 axi_rans_air_nozzle_restart.test_vals = [-5.121517, 0.452804, -2.910659, 1.662143, 0.000000] + axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143715, -9.170705, -10.848554, -5.776746, 0.000000] + axi_rans_air_nozzle_restart.tol = 0.0001 + test_list.append(axi_rans_air_nozzle_restart) + + # Axisymmetric air nozzle species + axi_rans_air_nozzle_species = TestCase('axi_rans_air_nozzle_species') + axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle_species.cfg_file = "air_nozzle_species.cfg" + axi_rans_air_nozzle_species.test_iter = 10 + axi_rans_air_nozzle_species.test_vals = [-2.148980, 3.342062, -1.939182, 5.883411, -2.443141, 0.000000] + axi_rans_air_nozzle_species.tol = 0.0001 + test_list.append(axi_rans_air_nozzle_species) + + ################################# + ## Compressible RANS Restart ### + ################################# + + # NACA0012 SST Multigrid restart + turb_naca0012_sst_restart_mg = TestCase('turb_naca0012_sst_restart_mg') + turb_naca0012_sst_restart_mg.cfg_dir = "rans/naca0012" + turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" + turb_naca0012_sst_restart_mg.test_iter = 50 + turb_naca0012_sst_restart_mg.ntest_vals = 5 + turb_naca0012_sst_restart_mg.test_vals = [-6.570974, -5.081421, 0.810883, -0.008830, 0.077967] + turb_naca0012_sst_restart_mg.timeout = 3200 + turb_naca0012_sst_restart_mg.tol = 0.000001 + test_list.append(turb_naca0012_sst_restart_mg) + + ############################# + ### Incompressible Euler ### + ############################# + + # Dry run Inc Euler + inc_euler_naca0012_d = TestCase('dry run Inc Euler') + inc_euler_naca0012_d.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012_d.cfg_file = "incomp_NACA0012.cfg" + inc_euler_naca0012_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(inc_euler_naca0012_d) + + # NACA0012 Hydrofoil + inc_euler_naca0012 = TestCase('inc_euler_naca0012') + inc_euler_naca0012.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" + inc_euler_naca0012.test_iter = 20 + inc_euler_naca0012.test_vals = [-6.814482, -6.001232, 0.531760, 0.008476] + test_list.append(inc_euler_naca0012) + + # NACA0012 Hydrofoil, pressure-based + inc_euler_naca0012_pb = TestCase('inc_euler_naca0012_pb') + inc_euler_naca0012_pb.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012_pb.cfg_file = "incomp_pb_NACA0012.cfg" + inc_euler_naca0012_pb.test_iter = 20 + inc_euler_naca0012_pb.test_vals = [-4.454834, -4.784268, 0.427449, 0.012084] + test_list.append(inc_euler_naca0012_pb) + + # C-D nozzle with pressure inlet and mass flow outlet + inc_nozzle = TestCase('inc_nozzle') + inc_nozzle.cfg_dir = "incomp_euler/nozzle" + inc_nozzle.cfg_file = "inv_nozzle.cfg" + inc_nozzle.test_iter = 20 + inc_nozzle.test_vals = [-6.331969, -5.586818, -0.024387, 0.126306] + test_list.append(inc_nozzle) + + ############################# + ### Incompressible N-S ### + ############################# + + # Dry Run Inc. NS + inc_lam_cylinder_d = TestCase('dry run Inc. NS') + inc_lam_cylinder_d.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder_d.cfg_file = "incomp_cylinder.cfg" + inc_lam_cylinder_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(inc_lam_cylinder_d) + + # Laminar cylinder + inc_lam_cylinder = TestCase('inc_lam_cylinder') + inc_lam_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" + inc_lam_cylinder.test_iter = 10 + inc_lam_cylinder.test_vals = [-4.809141, -5.026921, 0.000880, 3.118344] + test_list.append(inc_lam_cylinder) + + # Laminar cylinder, pressure-based + inc_lam_cylinder_pb = TestCase('inc_lam_cylinder_pb') + inc_lam_cylinder_pb.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder_pb.cfg_file = "incomp_pb_cylinder.cfg" + inc_lam_cylinder_pb.test_iter = 10 + inc_lam_cylinder_pb.test_vals = [-3.486587, -3.776864, 0.012396, 6.205509] + test_list.append(inc_lam_cylinder_pb) + + + # Buoyancy-driven cavity + inc_buoyancy = TestCase('inc_buoyancy') + inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity" + inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" + inc_buoyancy.test_iter = 20 + inc_buoyancy.test_vals = [-3.860466, -3.122403, 1.322721, -23.413000] + test_list.append(inc_buoyancy) + + # Laminar heated cylinder with polynomial fluid model + inc_poly_cylinder = TestCase('inc_poly_cylinder') + inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" + inc_poly_cylinder.test_iter = 20 + inc_poly_cylinder.test_vals = [-8.081227, -2.399756, 0.009794, 1.900988, -172.970000] + test_list.append(inc_poly_cylinder) + + # X-coarse laminar bend as a mixed element CGNS test + inc_lam_bend = TestCase('inc_lam_bend') + inc_lam_bend.cfg_dir = "incomp_navierstokes/bend" + inc_lam_bend.cfg_file = "lam_bend.cfg" + inc_lam_bend.test_iter = 10 + inc_lam_bend.test_vals = [-3.639664, -3.218039, -0.016067, 1.090645] + test_list.append(inc_lam_bend) + + + ############################ + ### Incompressible RANS ### + ############################ + + # Dry run Inc. RANS + inc_turb_naca0012_d = TestCase('dry run Inc. RANS') + inc_turb_naca0012_d.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012_d.cfg_file = "naca0012.cfg" + inc_turb_naca0012_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(inc_turb_naca0012_d) + + # NACA0012, SA + inc_turb_naca0012 = TestCase('inc_turb_naca0012') + inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012.cfg_file = "naca0012.cfg" + inc_turb_naca0012.test_iter = 20 + inc_turb_naca0012.test_vals = [-4.758064, -10.974498, -0.000003, -0.028654, 3.000000, -4.499423, 2.000000, -4.951202] + test_list.append(inc_turb_naca0012) + + # NACA0012, SST_SUST + inc_turb_naca0012_sst_sust = TestCase('inc_turb_naca0012_sst_sust') + inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" + inc_turb_naca0012_sst_sust.test_iter = 20 + inc_turb_naca0012_sst_sust.test_vals = [-7.169704, 0.332779, 0.000021, 0.312114] + test_list.append(inc_turb_naca0012_sst_sust) + + # Flat plate, pressure-based + inc_flatplate_pb = TestCase('inc_flatplate_pb') + inc_flatplate_pb.cfg_dir = "incomp_rans/rough_flatplate" + inc_flatplate_pb.cfg_file = "pb_rough_flatplate_incomp.cfg" + inc_flatplate_pb.test_iter = 10 + inc_flatplate_pb.test_vals = [-4.063342, -9.884401, 0.000010, 0.228472] + test_list.append(inc_flatplate_pb) + + # FLAT PLATE, WALL FUNCTIONS, INCOMPRESSIBLE SST + inc_turb_wallfunction_flatplate_sst = TestCase('inc_turb_sst_wallfunction_flatplate') + inc_turb_wallfunction_flatplate_sst.cfg_dir = "wallfunctions/flatplate/incompressible_SST" + inc_turb_wallfunction_flatplate_sst.cfg_file = "turb_SST_flatplate.cfg" + inc_turb_wallfunction_flatplate_sst.test_iter = 10 + inc_turb_wallfunction_flatplate_sst.test_vals = [-6.879863, -5.731934, -6.732450, -4.240641, -7.189679, -2.050873, 10.000000, -4.007590, 0.001161, 0.003172, 0.000000] + test_list.append(inc_turb_wallfunction_flatplate_sst) + + # FLAT PLATE, WALL FUNCTIONS, INCOMPRESSIBLE SA + inc_turb_wallfunction_flatplate_sa = TestCase('inc_turb_sa_wallfunction_flatplate') + inc_turb_wallfunction_flatplate_sa.cfg_dir = "wallfunctions/flatplate/incompressible_SA" + inc_turb_wallfunction_flatplate_sa.cfg_file = "turb_SA_flatplate.cfg" + inc_turb_wallfunction_flatplate_sa.test_iter = 10 + inc_turb_wallfunction_flatplate_sa.test_vals = [-6.892366, -5.716008, -6.750391, -4.240551, -9.549816, 10.000000, -4.008735, 0.001030, 0.003759] + test_list.append(inc_turb_wallfunction_flatplate_sa) + + #################### + ### DG-FEM Euler ### + #################### + + # Dry run DG Euler + fem_euler_naca0012_d = TestCase('dry run DG Euler') + fem_euler_naca0012_d.cfg_dir = "hom_euler/NACA0012_5thOrder" + fem_euler_naca0012_d.cfg_file = "fem_NACA0012_reg.cfg" + fem_euler_naca0012_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(fem_euler_naca0012_d) + + # NACA0012 + fem_euler_naca0012 = TestCase('fem_euler_naca0012') + fem_euler_naca0012.cfg_dir = "hom_euler/NACA0012_5thOrder" + fem_euler_naca0012.cfg_file = "fem_NACA0012_reg.cfg" + fem_euler_naca0012.test_iter = 10 + fem_euler_naca0012.test_vals = [-6.519946, -5.976944, 0.255551, 0.000028] + test_list.append(fem_euler_naca0012) + + ############################ + ### DG-FEM Navier-Stokes ### + ############################ + + # Dry run DG NS + fem_ns_flatplate_d = TestCase('dry run DG NS') + fem_ns_flatplate_d.cfg_dir = "hom_navierstokes/FlatPlate/nPoly4" + fem_ns_flatplate_d.cfg_file = "lam_flatplate_reg.cfg" + fem_ns_flatplate_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(fem_ns_flatplate_d) + + # Flat plate + fem_ns_flatplate = TestCase('fem_ns_flatplate') + fem_ns_flatplate.cfg_dir = "hom_navierstokes/FlatPlate/nPoly4" + fem_ns_flatplate.cfg_file = "lam_flatplate_reg.cfg" + fem_ns_flatplate.test_iter = 25 + fem_ns_flatplate.test_vals = [1.383727, 3.175247, 0.058387, 0.257951] + test_list.append(fem_ns_flatplate) + + # Steady cylinder + fem_ns_cylinder = TestCase('fem_ns_cylinder') + fem_ns_cylinder.cfg_dir = "hom_navierstokes/CylinderViscous/nPoly3" + fem_ns_cylinder.cfg_file = "fem_Cylinder_reg.cfg" + fem_ns_cylinder.test_iter = 10 + fem_ns_cylinder.test_vals = [0.454960, 0.979123, -0.000028, 79.984799] + test_list.append(fem_ns_cylinder) + + # Steady sphere + fem_ns_sphere = TestCase('fem_ns_sphere') + fem_ns_sphere.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" + fem_ns_sphere.cfg_file = "fem_Sphere_reg.cfg" + fem_ns_sphere.test_iter = 10 + fem_ns_sphere.test_vals = [-0.288121, 0.240324, 0.000258, 21.797363] + test_list.append(fem_ns_sphere) + + # Unsteady sphere ADER + fem_ns_sphere_ader = TestCase('fem_ns_sphere_ader') + fem_ns_sphere_ader.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" + fem_ns_sphere_ader.cfg_file = "fem_Sphere_reg_ADER.cfg" + fem_ns_sphere_ader.test_iter = 10 + fem_ns_sphere_ader.test_vals = [-35.000000, -35.000000, 0.000047, 31.110911] + fem_ns_sphere_ader.unsteady = True + test_list.append(fem_ns_sphere_ader) + + # Unsteady cylinder + fem_ns_unsteady_cylinder = TestCase('fem_ns_unsteady_cylinder') + fem_ns_unsteady_cylinder.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" + fem_ns_unsteady_cylinder.cfg_file = "fem_unst_cylinder.cfg" + fem_ns_unsteady_cylinder.test_iter = 11 + fem_ns_unsteady_cylinder.test_vals = [-3.558582, -3.014464, -0.038927, 1.383983] + fem_ns_unsteady_cylinder.unsteady = True + test_list.append(fem_ns_unsteady_cylinder) + + # Unsteady cylinder ADER + fem_ns_unsteady_cylinder_ader = TestCase('fem_ns_unsteady_cylinder_ader') + fem_ns_unsteady_cylinder_ader.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" + fem_ns_unsteady_cylinder_ader.cfg_file = "fem_unst_cylinder_ADER.cfg" + fem_ns_unsteady_cylinder_ader.test_iter = 11 + fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000, -35.000000, -0.041003, 1.391339] + fem_ns_unsteady_cylinder_ader.unsteady = True + test_list.append(fem_ns_unsteady_cylinder_ader) + + ######################### + ### Transition ### + ######################### + + # Schubauer-Klebanoff Natural Transition + schubauer_klebanoff_transition = TestCase('Schubauer_Klebanoff') + schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff" + schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" + schubauer_klebanoff_transition.test_iter = 10 + schubauer_klebanoff_transition.test_vals = [-8.284308, -13.239421, 0.000057, 0.007982] + test_list.append(schubauer_klebanoff_transition) + + ##################################### + ### Cont. adj. compressible Euler ### + ##################################### + + # Dry run Cont. Adj. Euler + contadj_naca0012_d = TestCase('dry run Cont. Adj. Euler') + contadj_naca0012_d.cfg_dir = "cont_adj_euler/naca0012" + contadj_naca0012_d.cfg_file = "inv_NACA0012.cfg" + contadj_naca0012_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(contadj_naca0012_d) + + # Inviscid NACA0012 + contadj_naca0012 = TestCase('contadj_naca0012') + contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" + contadj_naca0012.cfg_file = "inv_NACA0012.cfg" + contadj_naca0012.test_iter = 5 + contadj_naca0012.test_vals = [-9.552105, -15.069398, -0.726250, 0.020280] + contadj_naca0012.tol = 0.001 + test_list.append(contadj_naca0012) + + # Inviscid ONERA M6 + contadj_oneram6 = TestCase('contadj_oneram6') + contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" + contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" + contadj_oneram6.test_iter = 10 + contadj_oneram6.test_vals = [-12.083324, -12.644564, -1.086100, 0.007556] + test_list.append(contadj_oneram6) + + # Inviscid WEDGE: tests averaged outflow total pressure adjoint + contadj_wedge = TestCase('contadj_wedge') + contadj_wedge.cfg_dir = "cont_adj_euler/wedge" + contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" + contadj_wedge.test_iter = 10 + contadj_wedge.test_vals = [2.872066, -2.756215, 1010800.000000, -0.000000] + test_list.append(contadj_wedge) + + # Inviscid fixed CL NACA0012 + contadj_fixedCL_naca0012 = TestCase('contadj_fixedcl_naca0012') + contadj_fixedCL_naca0012.cfg_dir = "fixed_cl/naca0012" + contadj_fixedCL_naca0012.cfg_file = "inv_NACA0012_ContAdj.cfg" + contadj_fixedCL_naca0012.test_iter = 100 + contadj_fixedCL_naca0012.test_vals = [1.409148, -4.006889, -0.025392, 0.004170] + test_list.append(contadj_fixedCL_naca0012) + + ################################### + ### Cont. adj. compressible N-S ### + ################################### + + # Dry run Cont. Adj. NS + contadj_ns_cylinder_d = TestCase('dry run Cont. Adj. NS') + contadj_ns_cylinder_d.cfg_dir = "cont_adj_navierstokes/cylinder" + contadj_ns_cylinder_d.cfg_file = "lam_cylinder.cfg" + contadj_ns_cylinder_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(contadj_ns_cylinder_d) + + # Adjoint laminar cylinder + contadj_ns_cylinder = TestCase('contadj_ns_cylinder') + contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" + contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" + contadj_ns_cylinder.test_iter = 20 + contadj_ns_cylinder.test_vals = [-3.634026, -9.089553, 2.056700, -0.000000] + test_list.append(contadj_ns_cylinder) + + # Adjoint laminar naca0012 subsonic + contadj_ns_naca0012_sub = TestCase('contadj_ns_naca0012_sub') + contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" + contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" + contadj_ns_naca0012_sub.test_iter = 20 + contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] + test_list.append(contadj_ns_naca0012_sub) + + # Adjoint laminar naca0012 transonic + contadj_ns_naca0012_trans = TestCase('contadj_ns_naca0012_trans') + contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" + contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" + contadj_ns_naca0012_trans.test_iter = 20 + contadj_ns_naca0012_trans.test_vals = [-1.039664, -6.575019, 1.772300, 0.012495] + test_list.append(contadj_ns_naca0012_trans) + + ####################################################### + ### Cont. adj. compressible RANS (frozen viscosity) ### + ####################################################### + + # Adjoint turbulent NACA0012 + contadj_rans_naca0012 = TestCase('contadj_rans_naca0012') + contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" + contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" + contadj_rans_naca0012.test_iter = 20 + contadj_rans_naca0012.test_vals = [-0.794162, -5.761722, 19.214000, -0.000000] + test_list.append(contadj_rans_naca0012) + + # Adjoint turbulent NACA0012 with binary restarts + contadj_rans_naca0012_bin = TestCase('contadj_rans_naca0012_bin') + contadj_rans_naca0012_bin.cfg_dir = "cont_adj_rans/naca0012" + contadj_rans_naca0012_bin.cfg_file = "turb_nasa_binary.cfg" + contadj_rans_naca0012_bin.test_iter = 18 + contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] + test_list.append(contadj_rans_naca0012_bin) + + # Adjoint turbulent RAE2822 + contadj_rans_rae2822 = TestCase('contadj_rans_rae2822') + contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" + contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" + contadj_rans_rae2822.test_iter = 20 + contadj_rans_rae2822.test_vals = [-5.399078, -10.904106, -0.212470, 0.005448] + test_list.append(contadj_rans_rae2822) + + ############################# + ### Compressibele RANS UQ ### + ############################# + + # NACA0012 1c + turb_naca0012_1c = TestCase('turb_naca0012_1c') + turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" + turb_naca0012_1c.test_iter = 10 + turb_naca0012_1c.test_vals = [-4.981181, 1.343583, 0.597111, 0.017244] + turb_naca0012_1c.test_vals_aarch64 = [-4.992791, 1.342873, 0.557941, 0.003269] + test_list.append(turb_naca0012_1c) + + # NACA0012 2c + turb_naca0012_2c = TestCase('turb_naca0012_2c') + turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" + turb_naca0012_2c.test_iter = 10 + turb_naca0012_2c.test_vals = [-5.482907, 1.262063, 0.459671, -0.026410] + test_list.append(turb_naca0012_2c) + + # NACA0012 3c + turb_naca0012_3c = TestCase('turb_naca0012_3c') + turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" + turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" + turb_naca0012_3c.test_iter = 10 + turb_naca0012_3c.test_vals = [-5.583768, 1.229824, 0.426258, -0.033150] + test_list.append(turb_naca0012_3c) + + # NACA0012 p1c1 + turb_naca0012_p1c1 = TestCase('turb_naca0012_p1c1') + turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" + turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" + turb_naca0012_p1c1.test_iter = 10 + turb_naca0012_p1c1.test_vals = [-5.127701, 1.284875, 0.779301, 0.086111] + turb_naca0012_p1c1.test_vals_aarch64 = [-5.119942, 1.283920, 0.486264, -0.021518] + test_list.append(turb_naca0012_p1c1) + + # NACA0012 p1c2 + turb_naca0012_p1c2 = TestCase('turb_naca0012_p1c2') + turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" + turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" + turb_naca0012_p1c2.test_iter = 10 + turb_naca0012_p1c2.test_vals = [-5.553987, 1.235071, 0.521197, -0.004487] + test_list.append(turb_naca0012_p1c2) + + ###################################### + ### Harmonic Balance ### + ###################################### + + # Description of the regression test + harmonic_balance = TestCase('harmonic_balance') + harmonic_balance.cfg_dir = "harmonic_balance" + harmonic_balance.cfg_file = "HB.cfg" + harmonic_balance.test_iter = 25 + harmonic_balance.test_vals = [-1.556449, 0.840517, 0.943602, 3.957291] + test_list.append(harmonic_balance) + + # Turbulent pitching NACA 64a010 airfoil + hb_rans_preconditioning = TestCase('hb_rans_preconditioning') + hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" + hb_rans_preconditioning.cfg_file = "davis.cfg" + hb_rans_preconditioning.test_iter = 25 + hb_rans_preconditioning.test_vals = [-1.905509, 0.482119, 0.598486, 3.605121, -5.946067] + test_list.append(hb_rans_preconditioning) + + ###################################### + ### Moving Wall ### + ###################################### + + # Rotating NACA 0012 + rot_naca0012 = TestCase('rot_naca0012') + rot_naca0012.cfg_dir = "rotating/naca0012" + rot_naca0012.cfg_file = "rot_NACA0012.cfg" + rot_naca0012.test_iter = 25 + rot_naca0012.test_vals = [-1.281757, 4.222928, -0.027656, 0.059256, 2.000000, -1.218300] + test_list.append(rot_naca0012) + + # Lid-driven cavity + cavity = TestCase('cavity') + cavity.cfg_dir = "moving_wall/cavity" + cavity.cfg_file = "lam_cavity.cfg" + cavity.test_iter = 25 + cavity.test_vals = [-8.032742, -2.589249, 0.015257, 0.007688] + test_list.append(cavity) + + # Spinning cylinder + spinning_cylinder = TestCase('spinning_cylinder') + spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" + spinning_cylinder.cfg_file = "spinning_cylinder.cfg" + spinning_cylinder.test_iter = 25 + spinning_cylinder.test_vals = [-7.634797, -2.176937, 1.860210, 1.939647] + test_list.append(spinning_cylinder) + + ###################################### + ### Unsteady ### + ###################################### + + # Square cylinder + square_cylinder = TestCase('square_cylinder') + square_cylinder.cfg_dir = "unsteady/square_cylinder" + square_cylinder.cfg_file = "turb_square.cfg" + square_cylinder.test_iter = 3 + square_cylinder.test_vals = [-2.560678, -1.175979, 0.062202, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] + square_cylinder.unsteady = True + test_list.append(square_cylinder) + + # Gust + sine_gust = TestCase('sine_gust') + sine_gust.cfg_dir = "gust" + sine_gust.cfg_file = "inv_gust_NACA0012.cfg" + sine_gust.test_iter = 5 + sine_gust.test_vals = [-1.977498, 3.481833, -0.012952, -0.003623] + sine_gust.unsteady = True + test_list.append(sine_gust) + + # Aeroelastic + aeroelastic = TestCase('aeroelastic') + aeroelastic.cfg_dir = "aeroelastic" + aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" + aeroelastic.test_iter = 2 + aeroelastic.test_vals = [-1.876630, 4.021083, 0.082484, 0.026820, -0.001638, -0.000129, -1.081133] + aeroelastic.unsteady = True + test_list.append(aeroelastic) + + # Delayed Detached Eddy Simulation + ddes_flatplate = TestCase('ddes_flatplate') + ddes_flatplate.cfg_dir = "ddes/flatplate" + ddes_flatplate.cfg_file = "ddes_flatplate.cfg" + ddes_flatplate.test_iter = 10 + ddes_flatplate.test_vals = [-2.714713, -5.763293, -0.214960, 0.023758, 0.000000] + ddes_flatplate.unsteady = True + test_list.append(ddes_flatplate) + + # unsteady pitching NACA0015, SA + unst_inc_turb_naca0015_sa = TestCase('unst_inc_turb_naca0015_sa') + unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" + unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" + unst_inc_turb_naca0015_sa.test_iter = 1 + unst_inc_turb_naca0015_sa.test_vals = [-3.005435, -6.878657, 1.445291, 0.420526] + unst_inc_turb_naca0015_sa.unsteady = True + test_list.append(unst_inc_turb_naca0015_sa) + # unsteady pitching NACA64A010, RANS, SA + unst_pitching_naca64a010_rans = TestCase('unst_pitching_naca64a010_rans') + unst_pitching_naca64a010_rans.cfg_dir = "unsteady/pitching_naca64a010_rans" + unst_pitching_naca64a010_rans.cfg_file = "turb_NACA64A010.cfg" + unst_pitching_naca64a010_rans.test_iter = 2 + unst_pitching_naca64a010_rans.test_vals = [-1.299045, -3.951331, 0.011098, 0.008241] + unst_pitching_naca64a010_rans.unsteady = True + test_list.append(unst_pitching_naca64a010_rans) + # unsteady pitching NACA64A010, Euler + unst_pitching_naca64a010_euler = TestCase('unst_pitching_naca64a010_euler') + unst_pitching_naca64a010_euler.cfg_dir = "unsteady/pitching_naca64a010_euler" + unst_pitching_naca64a010_euler.cfg_file = "pitching_NACA64A010.cfg" + unst_pitching_naca64a010_euler.test_iter = 2 + unst_pitching_naca64a010_euler.test_vals = [-1.186839, 4.280671, -0.026619, 0.000937] + unst_pitching_naca64a010_euler.unsteady = True + test_list.append(unst_pitching_naca64a010_euler) + # unsteady plunging NACA0012, Laminar NS + unst_plunging_naca0012 = TestCase('unst_plunging_naca0012') + unst_plunging_naca0012.cfg_dir = "unsteady/plunging_naca0012" + unst_plunging_naca0012.cfg_file = "plunging_NACA0012.cfg" + unst_plunging_naca0012.test_iter = 2 + unst_plunging_naca0012.test_vals = [-4.083462, 1.366757, -3.455802, -0.097062] + unst_plunging_naca0012.unsteady = True + test_list.append(unst_plunging_naca0012) + + # unsteady pitching NACA0012, Euler, Deforming + unst_deforming_naca0012 = TestCase('unst_deforming_naca0012') + unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" + unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" + unst_deforming_naca0012.test_iter = 5 + unst_deforming_naca0012.test_vals = [-3.666074, -3.794974, -3.717659, -3.149285] + unst_deforming_naca0012.unsteady = True + test_list.append(unst_deforming_naca0012) + + ###################################### + ### NICFD ### + ###################################### + + # ls89_sa + ls89_sa = TestCase('ls89_sa') + ls89_sa.cfg_dir = "nicf/LS89" + ls89_sa.cfg_file = "turb_SA_PR.cfg" + ls89_sa.test_iter = 20 + ls89_sa.test_vals = [-5.041500, -13.379523, 0.179019, 0.420831] + test_list.append(ls89_sa) + + # Rarefaction shock wave edge_VW + edge_VW = TestCase('edge_VW') + edge_VW.cfg_dir = "nicf/edge" + edge_VW.cfg_file = "edge_VW.cfg" + edge_VW.test_iter = 20 + edge_VW.test_vals = [-8.901513, -2.707051, -0.000009, 0.000000] + test_list.append(edge_VW) + + # Rarefaction shock wave edge_PPR + edge_PPR = TestCase('edge_PPR') + edge_PPR.cfg_dir = "nicf/edge" + edge_PPR.cfg_file = "edge_PPR.cfg" + edge_PPR.test_iter = 20 + edge_PPR.test_vals = [-12.051551, -5.877885, -0.000034, 0.000000] + test_list.append(edge_PPR) + + + ###################################### + ### Turbomachinery ### + ###################################### + + # Aachen Turbine restart + Aachen_3D_restart = TestCase('aachen_turbine_restart') + Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine" + Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg" + Aachen_3D_restart.test_iter = 5 + Aachen_3D_restart.test_vals = [-7.689117, -8.476204, -6.036107, -6.427402, -5.831576, -4.599024, -5.530512, -5.305687, -3.821789, -5.243255, -5.754831, -3.631603, -2.213934, -2.895728, -0.578545] + Aachen_3D_restart.enabled_with_asan = False + test_list.append(Aachen_3D_restart) + + # Jones APU Turbocharger restart + Jones_tc_restart = TestCase('jones_turbocharger_restart') + Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" + Jones_tc_restart.cfg_file = "Jones_restart.cfg" + Jones_tc_restart.test_iter = 5 + Jones_tc_restart.test_vals = [-11.905621, -12.212078, -19.212558, -13.508063, -19.069990, -13.439493, 73286.000000, 73286.000000, 0.020056, 82.286000] + test_list.append(Jones_tc_restart) + + # 2D axial stage + axial_stage2D = TestCase('axial_stage2D') + axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" + axial_stage2D.cfg_file = "Axial_stage2D.cfg" + axial_stage2D.test_iter = 20 + axial_stage2D.test_vals = [1.167521, 1.598536, -2.928575, 2.573646, -2.527330, 3.016253, 106370.000000, 106370.000000, 5.726800, 64.383000] + test_list.append(axial_stage2D) + + # 2D transonic stator restart + transonic_stator_restart = TestCase('transonic_stator_restart') + transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" + transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" + transonic_stator_restart.test_iter = 20 + transonic_stator_restart.test_vals = [-4.367784, -2.492912, -2.082414, 1.727491, -1.466974, 3.224730, -471620.000000, 94.839000, -0.052082] + transonic_stator_restart.test_vals_aarch64 = [-4.367784, -2.492912, -2.082414, 1.727491, -1.466974, 3.224730, -471620.000000, 94.839000, -0.052082] + test_list.append(transonic_stator_restart) + + # Multiple turbomachinery interface restart + multi_interface = TestCase('multi_interface') + multi_interface.cfg_dir = "turbomachinery/multi_interface" + multi_interface.cfg_file = "multi_interface_rst.cfg" + multi_interface.test_iter = 5 + multi_interface.test_vals = [-8.634558, -8.895554, -9.348754] + multi_interface.test_vals_aarch64 = [-8.632227, -8.894736, -9.348706] + test_list.append(multi_interface) + + + ###################################### + ### Sliding Mesh ### + ###################################### + + # Dry run Multizone + uniform_flow_d = TestCase('dry run Multizone') + uniform_flow_d.cfg_dir = "sliding_interface/uniform_flow" + uniform_flow_d.cfg_file = "uniform_NN.cfg" + uniform_flow_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(uniform_flow_d) + + # Uniform flow + uniform_flow = TestCase('uniform_flow') + uniform_flow.cfg_dir = "sliding_interface/uniform_flow" + uniform_flow.cfg_file = "uniform_NN.cfg" + uniform_flow.test_iter = 2 + uniform_flow.test_vals = [2.000000, 0.000000, -0.230680, -13.251592] + uniform_flow.test_vals_aarch64 = [2.000000, 0.000000, -0.230641, -13.249000] + uniform_flow.tol = 0.000001 + uniform_flow.unsteady = True + uniform_flow.multizone = True + test_list.append(uniform_flow) + + # Channel_2D, native SU2 binary mesh format (.su2b) + # channel_2D_WA.cfg loads channel_2D_su2bin.su2b directly, so SU2_DEF must + # first convert channel_2D.su2 (3 zones) into that binary mesh. + channel_2D_su2bin_convert = TestCase('channel_2D_su2bin_convert') + channel_2D_su2bin_convert.cfg_dir = "sliding_interface/channel_2D" + channel_2D_su2bin_convert.cfg_file = "mesh_su2_to_su2bin.cfg" + channel_2D_su2bin_convert.command = TestCase.Command(exec = "SU2_DEF") + test_list.append(channel_2D_su2bin_convert) + + # Channel_2D + channel_2D = TestCase('channel_2D') + channel_2D.cfg_dir = "sliding_interface/channel_2D" + channel_2D.cfg_file = "channel_2D_WA.cfg" + channel_2D.test_iter = 2 + channel_2D.test_vals = [2.000000, 0.000000, 0.399122, 0.350309, 0.405616] + channel_2D.timeout = 100 + channel_2D.unsteady = True + channel_2D.multizone = True + test_list.append(channel_2D) + + # Channel_3D + channel_3D = TestCase('channel_3D') + channel_3D.cfg_dir = "sliding_interface/channel_3D" + channel_3D.cfg_file = "channel_3D_WA.cfg" + channel_3D.test_iter = 1 + channel_3D.test_vals = [1.000000, 0.000000, 0.620573, 0.810294, 0.718984] + channel_3D.test_vals_aarch64 = [1.000000, 0.000000, 0.611996, 0.798988, 0.702357] + channel_3D.unsteady = True + channel_3D.multizone = True + channel_3D.enabled_with_asan = False + test_list.append(channel_3D) + + # Pipe + pipe = TestCase('pipe') + pipe.cfg_dir = "sliding_interface/pipe" + pipe.cfg_file = "pipe_NN.cfg" + pipe.test_iter = 2 + pipe.test_vals = [0.452310, 0.562852, 0.974610, 1.031075] + pipe.unsteady = True + pipe.multizone = True + test_list.append(pipe) + + # Rotating cylinders + rotating_cylinders = TestCase('rotating_cylinders') + rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" + rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" + rotating_cylinders.test_iter = 3 + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.686419, 1.152594, 1.145895] + rotating_cylinders.unsteady = True + rotating_cylinders.multizone = True + test_list.append(rotating_cylinders) + + # Supersonic vortex shedding + supersonic_vortex_shedding = TestCase('supersonic_vortex_shedding') + supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" + supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" + supersonic_vortex_shedding.test_iter = 5 + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.128138, 1.064261] + supersonic_vortex_shedding.unsteady = True + supersonic_vortex_shedding.multizone = True + test_list.append(supersonic_vortex_shedding) + + # Bars_SST_2D + bars_SST_2D = TestCase('bars_SST_2D') + bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" + bars_SST_2D.cfg_file = "bars.cfg" + bars_SST_2D.test_iter = 13 + bars_SST_2D.test_vals = [13.000000, -0.456143, -1.541051] + bars_SST_2D.multizone = True + test_list.append(bars_SST_2D) + + # Sliding mesh with incompressible flows (steady) + slinc_steady = TestCase('slinc_steady') + slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" + slinc_steady.cfg_file = "config.cfg" + slinc_steady.test_iter = 19 + slinc_steady.test_vals = [19.000000, -1.141747, -1.450721] + slinc_steady.timeout = 100 + slinc_steady.multizone = True + test_list.append(slinc_steady) + + # Sliding mesh with incompressible flows (unsteady) + # slinc_unsteady = TestCase('slinc_unsteady') + # slinc_unsteady.cfg_dir = "sliding_interface/incompressible_unsteady" + # slinc_unsteady.cfg_file = "config.cfg" + # slinc_unsteady.test_iter = 19 + # slinc_unsteady.test_vals = [-3.515218,1.930028,0.000000,0.000000] #last 4 columns + # slinc_unsteady.timeout = 100 + # slinc_unsteady.unsteady = True + # test_list.append(slinc_unsteady) + + ########################## + ### FEA - FSI ### + ########################## + + # Dry run FEA + statbeam3d_d = TestCase('dry run FEA') + statbeam3d_d.cfg_dir = "fea_fsi/StatBeam_3d" + statbeam3d_d.cfg_file = "configBeam_3d.cfg" + statbeam3d_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(statbeam3d_d) + + # Static beam, 3d + statbeam3d = TestCase('statbeam3d') + statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" + statbeam3d.cfg_file = "configBeam_3d.cfg" + statbeam3d.test_iter = 0 + statbeam3d.test_vals = [-6.192310, -5.950395, -6.079363, 110190.000000] + statbeam3d.test_vals_aarch64 = [-6.166287, -5.938291, -6.069768, 110190] #last 4 columns + test_list.append(statbeam3d) + + # Mix elem, 3d beam, Knowles + knowlesbeam = TestCase('mixelemknowles') + knowlesbeam.cfg_dir = "fea_fsi/MixElemsKnowles" + knowlesbeam.cfg_file = "config.cfg" + knowlesbeam.test_iter = 0 + knowlesbeam.test_vals = [-14.472698, -13.540078, -28.049079, 0.445030, 9.730600] + knowlesbeam.test_vals_aarch64 = [-14.475326, -13.54641, -28.057487, 0.44503, 9.7306] #last 5 columns + knowlesbeam.tol = 0.0001 + test_list.append(knowlesbeam) + + # Dynamic beam, 2d + dynbeam2d = TestCase('dynbeam2d') + dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" + dynbeam2d.cfg_file = "configBeam_2d.cfg" + dynbeam2d.unsteady = True + dynbeam2d.test_iter = 6 + dynbeam2d.test_vals = [-3.240012, 2.895060, -0.353140, 76220] + test_list.append(dynbeam2d) + + # FSI, 2d + fsi2d = TestCase('fsi2d') + fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" + fsi2d.cfg_file = "configFSI.cfg" + fsi2d.test_iter = 4 + fsi2d.test_vals = [4.000000, 0.000000, -3.725521, -4.278759] + fsi2d.multizone = True + fsi2d.unsteady = True + test_list.append(fsi2d) + + # FSI+CHT, Static, 2D, new mesh solver + fsi_cht = TestCase('fsi_cht') + fsi_cht.cfg_dir = "fea_fsi/stat_fsi" + fsi_cht.cfg_file = "config.cfg" + fsi_cht.test_iter = 20 + fsi_cht.test_vals = [5.000000, -5.077002, -5.379450, -9.247804, -9.320014, -9.185034, 608.350000, -0.012973, 0.000000, 30.000000] + fsi_cht.multizone = True + test_list.append(fsi_cht) + + # FSI, Dynamic, 2D, new mesh solver + dyn_fsi = TestCase('dyn_fsi') + dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" + dyn_fsi.cfg_file = "config.cfg" + dyn_fsi.test_iter = 4 + dyn_fsi.test_vals = [-4.328792, -4.153004, 0.000000, 86.000000] + dyn_fsi.multizone = True + dyn_fsi.unsteady = True + test_list.append(dyn_fsi) + + # FSI, 2D airfoil with RBF interpolation + airfoilRBF = TestCase('airfoil_fsi_rbf') + airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" + airfoilRBF.cfg_file = "config.cfg" + airfoilRBF.test_iter = 1 + airfoilRBF.test_vals = [1.000000, 0.030557, -3.531052] + airfoilRBF.tol = 0.0001 + airfoilRBF.multizone = True + test_list.append(airfoilRBF) + + # ############################### + # ### Radiative Heat Transfer ### + # ###############################] + + # Radiative heat transfer + p1rad = TestCase('p1rad') + p1rad.cfg_dir = "radiation/p1model" + p1rad.cfg_file = "configp1.cfg" + p1rad.test_iter = 50 + p1rad.test_vals = [-8.284673, -8.008659, -2.424204, 0.389030, -56.560000] + test_list.append(p1rad) + + # ############################### + # ### Conjugate heat transfer ### + # ############################### + + # Dry run CHT + cht_incompressible_d = TestCase('dry run CHT') + cht_incompressible_d.cfg_dir = "coupled_cht/incomp_2d" + cht_incompressible_d.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible_d.command = TestCase.Command(exec = "SU2_CFD", param = "-d") + test_list.append(cht_incompressible_d) + + # CHT incompressible + cht_incompressible = TestCase('cht_incompressible') + cht_incompressible.cfg_dir = "coupled_cht/incomp_2d" + cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible.test_iter = 10 + cht_incompressible.test_vals = [-1.376345, -0.591212, -0.591212, -0.591212] + cht_incompressible.multizone = True + test_list.append(cht_incompressible) + + # CHT compressible + cht_incompressible = TestCase('cht_compressible') + cht_incompressible.cfg_dir = "coupled_cht/comp_2d" + cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible.test_iter = 10 + cht_incompressible.test_vals = [-4.256032, -0.532728, -0.532728, -0.532728] + cht_incompressible.multizone = True + test_list.append(cht_incompressible) + + ############################################## + ### Method of Manufactured Solutions (MMS) ### + ############################################## + + # FVM, compressible, euler (periodic isentropic vortex) + mms_fvm_vortex = TestCase('mms_fvm_vortex') + mms_fvm_vortex.cfg_dir = "mms/fvm_euler" + mms_fvm_vortex.cfg_file = "inv_mms_vortex.cfg" + mms_fvm_vortex.test_iter = 10 + mms_fvm_vortex.test_vals = [-5.704300, -4.848072, 0.000000, 0.000000] + mms_fvm_vortex.unsteady = True + test_list.append(mms_fvm_vortex) + + # FVM, compressible, laminar N-S + mms_fvm_ns = TestCase('mms_fvm_ns') + mms_fvm_ns.cfg_dir = "mms/fvm_navierstokes" + mms_fvm_ns.cfg_file = "lam_mms_roe.cfg" + mms_fvm_ns.test_iter = 20 + mms_fvm_ns.test_vals = [-2.808514, 2.152654, 0.000000, 0.000000] + mms_fvm_ns.tol = 0.0001 + test_list.append(mms_fvm_ns) + + # FVM, incompressible, euler + mms_fvm_inc_euler = TestCase('mms_fvm_inc_euler') + mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" + mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" + mms_fvm_inc_euler.test_iter = 20 + mms_fvm_inc_euler.test_vals = [-9.128345, -9.441741, 0.000000, 0.000000] + mms_fvm_inc_euler.tol = 0.0001 + test_list.append(mms_fvm_inc_euler) + + # FVM, incompressible, laminar N-S + mms_fvm_inc_ns = TestCase('mms_fvm_inc_ns') + mms_fvm_inc_ns.cfg_dir = "mms/fvm_incomp_navierstokes" + mms_fvm_inc_ns.cfg_file = "lam_mms_fds.cfg" + mms_fvm_inc_ns.test_iter = 20 + mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] + mms_fvm_inc_ns.tol = 0.0001 + test_list.append(mms_fvm_inc_ns) + + # DG, compressible, euler + ringleb_dg_euler = TestCase('ringleb_dg_euler') + ringleb_dg_euler.cfg_dir = "mms/dg_ringleb" + ringleb_dg_euler.cfg_file = "ringleb_dg.cfg" + ringleb_dg_euler.test_iter = 100 + ringleb_dg_euler.test_vals = [-5.136652, -4.724941, 0.000000, 0.000000] + ringleb_dg_euler.tol = 0.0001 + test_list.append(ringleb_dg_euler) + + # DG, compressible, laminar N-S + mms_dg_ns = TestCase('mms_dg_ns') + mms_dg_ns.cfg_dir = "mms/dg_navierstokes" + mms_dg_ns.cfg_file = "lam_mms_dg.cfg" + mms_dg_ns.test_iter = 100 + mms_dg_ns.test_vals = [-1.845393, 3.520699, 0.000000, 0.000000] + mms_dg_ns.tol = 0.0001 + test_list.append(mms_dg_ns) + + # DG, compressible, laminar N-S 3D + mms_dg_ns_3d = TestCase('mms_dg_ns_3d') + mms_dg_ns_3d.cfg_dir = "mms/dg_navierstokes_3d" + mms_dg_ns_3d.cfg_file = "lam_mms_dg_3d.cfg" + mms_dg_ns_3d.test_iter = 100 + mms_dg_ns_3d.test_vals = [-0.146826, 5.356413, 0.000000, 0.000000] + mms_dg_ns_3d.tol = 0.0001 + test_list.append(mms_dg_ns_3d) + + ###################################### + ### CGNS writer ### + ###################################### + + # The CGNS output of a 2D mesh is read back as mesh, with the restart written by the same run. + # The read-back test must run after the test that writes the files. + cgns_output = TestCase('cgns_output') + cgns_output.cfg_dir = "output_writers" + cgns_output.cfg_file = "cgns_output.cfg" + cgns_output.test_iter = 2 + cgns_output.test_vals = [-1.684071, 0.454658, 3.802835, -2.624573, 6.956844, 0.091480] + test_list.append(cgns_output) + + cgns_mesh_readback = TestCase('cgns_mesh_readback') + cgns_mesh_readback.cfg_dir = "output_writers" + cgns_mesh_readback.cfg_file = "cgns_mesh_readback.cfg" + cgns_mesh_readback.test_iter = 2 + cgns_mesh_readback.test_vals = [-2.480775, 0.352445, 2.998807, -3.103293, 6.892515, 0.085107] + test_list.append(cgns_mesh_readback) + + # Same for a 3D mesh with mixed elements, whose boundaries are written as MIXED sections. + cgns_output_bend = TestCase('cgns_output_bend') + cgns_output_bend.cfg_dir = "output_writers" + cgns_output_bend.cfg_file = "cgns_output_bend.cfg" + cgns_output_bend.test_iter = 2 + cgns_output_bend.test_vals = [-2.420818, -2.225454, -2.551501, -3.067128, 2.673612] + test_list.append(cgns_output_bend) + + cgns_mesh_readback_bend = TestCase('cgns_mesh_readback_bend') + cgns_mesh_readback_bend.cfg_dir = "output_writers" + cgns_mesh_readback_bend.cfg_file = "cgns_mesh_readback_bend.cfg" + cgns_mesh_readback_bend.test_iter = 2 + cgns_mesh_readback_bend.test_vals = [-3.254168, -2.756564, -3.006605, -3.572686, 4.308287] + test_list.append(cgns_mesh_readback_bend) + + ###################################### + ### RUN TESTS ### + ###################################### + + # set suitable defaults unless something else has been specified + # command: "SU2_CFD" + # timeout: 1600 + # tol: 0.00001 + for test in test_list: + if test.command.empty(): + test.command = TestCase.Command(exec = "SU2_CFD") + if test.timeout == 0: + test.timeout = 1600 + if test.tol == 0.0: + test.tol = 0.00001 + + pass_list = [ test.run_test(args.tsan, args.asan) for test in test_list ] + + # Nastran bulk data parser unit tests + nastran_parser = TestCase('pysu2_nastran') + # The CI container runs this script from a copied tests/TestCases tree, so + # the repo-relative path does not exist there; use the installed copy that + # SU2_RUN points to and fall back to the source tree for local runs. + nastran_test = os.path.join( + os.environ.get('SU2_RUN', ''), + 'SU2_Nastran', + 'test_pysu2_nastran.py', + ) + if not os.path.isfile(nastran_test): + nastran_test = os.path.join( + os.path.dirname(os.path.dirname(os.path.abspath(__file__))), + 'SU2_PY', + 'SU2_Nastran', + 'test_pysu2_nastran.py', + ) + pass_list.append(subprocess.call([sys.executable, nastran_test]) == 0) + test_list.append(nastran_parser) + + + ###################################### + ### RUN SU2_GEO TESTS ### + ###################################### + + # NACA0012 + naca0012_geo = TestCase('naca0012_geo') + naca0012_geo.cfg_dir = "optimization_euler/steady_naca0012" + naca0012_geo.cfg_file = "inv_NACA0012_adv.cfg" + naca0012_geo.test_vals = [1.000000, 62.045500, 0.120011, 0.000000] + naca0012_geo.command = TestCase.Command(exec = "SU2_GEO") + naca0012_geo.timeout = 1600 + naca0012_geo.tol = 0.00001 + pass_list.append(naca0012_geo.run_geo(args.tsan, args.asan)) + test_list.append(naca0012_geo) + + ###################################### + ### RUN SU2_DEF TESTS ### + ###################################### + + # intersection prevention + intersect_def = TestCase('intersectionprevention') + intersect_def.cfg_dir = "deformation/intersection_prevention" + intersect_def.cfg_file = "def_intersect.cfg" + intersect_def.test_iter = 10 + intersect_def.test_vals = [0.000112] + intersect_def.command = TestCase.Command(exec = "SU2_DEF") + intersect_def.timeout = 1600 + intersect_def.tol = 1e-04 + + pass_list.append(intersect_def.run_def(args.tsan, args.asan)) + test_list.append(intersect_def) + + # Inviscid NACA0012 (triangles) + naca0012_def = TestCase('naca0012_def') + naca0012_def.cfg_dir = "deformation/naca0012" + naca0012_def.cfg_file = "def_NACA0012.cfg" + naca0012_def.test_iter = 10 + naca0012_def.test_vals = [0.0034470] + naca0012_def.command = TestCase.Command(exec = "SU2_DEF") + naca0012_def.timeout = 1600 + naca0012_def.tol = 1e-06 + + pass_list.append(naca0012_def.run_def(args.tsan, args.asan)) + test_list.append(naca0012_def) + + # Inviscid NACA0012 based on SURFACE_FILE input (surface_bump.dat) + naca0012_def_file = TestCase('naca0012_def_file') + naca0012_def_file.cfg_dir = "deformation/naca0012" + naca0012_def_file.cfg_file = "surface_file_NACA0012.cfg" + naca0012_def_file.test_iter = 10 + naca0012_def_file.test_vals = [0.0034470] + naca0012_def_file.command = TestCase.Command(exec = "SU2_DEF") + naca0012_def_file.timeout = 1600 + naca0012_def_file.tol = 1e-6 + + pass_list.append(naca0012_def_file.run_def(args.tsan, args.asan)) + test_list.append(naca0012_def_file) + + # RAE2822 (mixed tris + quads) + rae2822_def = TestCase('rae2822_def') + rae2822_def.cfg_dir = "deformation/rae2822" + rae2822_def.cfg_file = "def_RAE2822.cfg" + rae2822_def.test_iter = 10 + rae2822_def.test_vals = [0.0000000] + rae2822_def.command = TestCase.Command(exec = "SU2_DEF") + rae2822_def.timeout = 1600 + rae2822_def.tol = 1e-06 + + pass_list.append(rae2822_def.run_def(args.tsan, args.asan)) + test_list.append(rae2822_def) + + # Turb NACA4412 (quads, wall distance) + naca4412_def = TestCase('naca4412_def') + naca4412_def.cfg_dir = "deformation/naca4412" + naca4412_def.cfg_file = "def_NACA4412.cfg" + naca4412_def.test_iter = 10 + naca4412_def.test_vals = [0.0000000] + naca4412_def.command = TestCase.Command(exec = "SU2_DEF") + naca4412_def.timeout = 1600 + naca4412_def.tol = 1e-06 + + pass_list.append(naca4412_def.run_def(args.tsan, args.asan)) + test_list.append(naca4412_def) + + # Brick of tets (inverse volume) + brick_tets_def = TestCase('brick_tets_def') + brick_tets_def.cfg_dir = "deformation/brick_tets" + brick_tets_def.cfg_file = "def_brick_tets.cfg" + brick_tets_def.test_iter = 10 + brick_tets_def.test_vals = [0.0008970] + brick_tets_def.command = TestCase.Command(exec = "SU2_DEF") + brick_tets_def.timeout = 1600 + brick_tets_def.tol = 1e-06 + + pass_list.append(brick_tets_def.run_def(args.tsan, args.asan)) + test_list.append(brick_tets_def) + + # Brick of isotropic hexas (inverse volume) + brick_hex_def = TestCase('brick_hex_def') + brick_hex_def.cfg_dir = "deformation/brick_hex" + brick_hex_def.cfg_file = "def_brick_hex.cfg" + brick_hex_def.test_iter = 10 + brick_hex_def.test_vals = [0.0002080] + brick_hex_def.command = TestCase.Command(exec = "SU2_DEF") + brick_hex_def.timeout = 1600 + brick_hex_def.tol = 1e-06 + + pass_list.append(brick_hex_def.run_def(args.tsan, args.asan)) + test_list.append(brick_hex_def) + + # Brick with a pyramid layer (inverse volume) + brick_pyra_def = TestCase('brick_pyra_def') + brick_pyra_def.cfg_dir = "deformation/brick_pyra" + brick_pyra_def.cfg_file = "def_brick_pyra.cfg" + brick_pyra_def.test_iter = 10 + brick_pyra_def.test_vals = [0.0015010] + brick_pyra_def.command = TestCase.Command(exec = "SU2_DEF") + brick_pyra_def.timeout = 1600 + brick_pyra_def.tol = 1e-06 + + pass_list.append(brick_pyra_def.run_def(args.tsan, args.asan)) + test_list.append(brick_pyra_def) + + # Brick of isotropic prisms (inverse volume) + brick_prism_def = TestCase('brick_prism_def') + brick_prism_def.cfg_dir = "deformation/brick_prism" + brick_prism_def.cfg_file = "def_brick_prism.cfg" + brick_prism_def.test_iter = 10 + brick_prism_def.test_vals = [0.0021210] + brick_prism_def.command = TestCase.Command(exec = "SU2_DEF") + brick_prism_def.timeout = 1600 + brick_prism_def.tol = 1e-06 + + pass_list.append(brick_prism_def.run_def(args.tsan, args.asan)) + test_list.append(brick_prism_def) + + # Brick of prisms with high aspect ratio cells near the wall (wall distance) + brick_prism_rans_def = TestCase('brick_prism_rans_def') + brick_prism_rans_def.cfg_dir = "deformation/brick_prism_rans" + brick_prism_rans_def.cfg_file = "def_brick_prism_rans.cfg" + brick_prism_rans_def.test_iter = 10 + brick_prism_rans_def.test_vals = [0.0000000] + brick_prism_rans_def.command = TestCase.Command(exec = "SU2_DEF") + brick_prism_rans_def.timeout = 1600 + brick_prism_rans_def.tol = 1e-06 + + pass_list.append(brick_prism_rans_def.run_def(args.tsan, args.asan)) + test_list.append(brick_prism_rans_def) + + # Brick of hexas with high aspect ratio cells near the wall (inverse volume) + brick_hex_rans_def = TestCase('brick_hex_rans_def') + brick_hex_rans_def.cfg_dir = "deformation/brick_hex_rans" + brick_hex_rans_def.cfg_file = "def_brick_hex_rans.cfg" + brick_hex_rans_def.test_iter = 10 + brick_hex_rans_def.test_vals = [0.0000000] + brick_hex_rans_def.command = TestCase.Command(exec = "SU2_DEF") + brick_hex_rans_def.timeout = 1600 + brick_hex_rans_def.tol = 1e-06 + + pass_list.append(brick_hex_rans_def.run_def(args.tsan, args.asan)) + test_list.append(brick_hex_rans_def) + + # Cylindrical FFD test + cylinder_ffd_def = TestCase('cylinder_ffd_def') + cylinder_ffd_def.cfg_dir = "deformation/cylindrical_ffd" + cylinder_ffd_def.cfg_file = "def_cylindrical.cfg" + cylinder_ffd_def.test_iter = 10 + cylinder_ffd_def.test_vals = [0.0004700] + cylinder_ffd_def.command = TestCase.Command(exec = "SU2_DEF") + cylinder_ffd_def.timeout = 1600 + cylinder_ffd_def.tol = 1e-06 + + pass_list.append(cylinder_ffd_def.run_def(args.tsan, args.asan)) + test_list.append(cylinder_ffd_def) + + # Spherical FFD test + sphere_ffd_def = TestCase('sphere_ffd_def') + sphere_ffd_def.cfg_dir = "deformation/spherical_ffd" + sphere_ffd_def.cfg_file = "def_spherical.cfg" + sphere_ffd_def.test_iter = 10 + sphere_ffd_def.test_vals = [0.0035670] + sphere_ffd_def.command = TestCase.Command(exec = "SU2_DEF") + sphere_ffd_def.timeout = 1600 + sphere_ffd_def.tol = 1e-06 + + pass_list.append(sphere_ffd_def.run_def(args.tsan, args.asan)) + test_list.append(sphere_ffd_def) + + # Spherical FFD test using BSplines + sphere_ffd_def_bspline = TestCase('sphere_ffd_def_bspline') + sphere_ffd_def_bspline.cfg_dir = "deformation/spherical_ffd" + sphere_ffd_def_bspline.cfg_file = "def_spherical_bspline.cfg" + sphere_ffd_def_bspline.test_iter = 10 + sphere_ffd_def_bspline.test_vals = [0.0020680] + sphere_ffd_def_bspline.command = TestCase.Command(exec = "SU2_DEF") + sphere_ffd_def_bspline.timeout = 1600 + sphere_ffd_def_bspline.tol = 1e-06 + + pass_list.append(sphere_ffd_def_bspline.run_def(args.tsan, args.asan)) + test_list.append(sphere_ffd_def_bspline) + + ###################################### + ### RUN PYTHON TESTS ### + ###################################### + + # test continuous_adjoint.py + contadj_euler_py = TestCase('contadj_euler_py') + contadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" + contadj_euler_py.cfg_file = "inv_NACA0012.cfg" + contadj_euler_py.test_iter = 10 + contadj_euler_py.command = TestCase.Command(exec = "continuous_adjoint.py", param = "-f") + contadj_euler_py.timeout = 1600 + contadj_euler_py.reference_file = "of_grad_cd.dat.ref" + contadj_euler_py.test_file = "of_grad_cd.dat" + contadj_euler_py.enabled_with_asan = False + pass_list.append(contadj_euler_py.run_filediff(args.tsan, args.asan)) + test_list.append(contadj_euler_py) + + # test shape_optimization.py + shape_opt_euler_py = TestCase('shape_opt_euler_py') + shape_opt_euler_py.cfg_dir = "optimization_euler/steady_naca0012" + shape_opt_euler_py.cfg_file = "inv_NACA0012_adv.cfg" + shape_opt_euler_py.test_iter = 1 + shape_opt_euler_py.test_vals = [1.000000, 1.000000, 0.000021, 0.003642] + shape_opt_euler_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") + shape_opt_euler_py.timeout = 1600 + shape_opt_euler_py.tol = 0.00001 + shape_opt_euler_py.enabled_with_asan = False + pass_list.append(shape_opt_euler_py.run_opt(args.tsan, args.asan)) + test_list.append(shape_opt_euler_py) + + # Multiple functionals with the continuous adjoint + contadj_multi_py = TestCase('contadj_multi_py') + contadj_multi_py.cfg_dir = "cont_adj_euler/wedge" + contadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" + contadj_multi_py.test_iter = 10 + contadj_multi_py.command = TestCase.Command(exec = "continuous_adjoint.py", param = "-f") + contadj_multi_py.timeout = 1600 + contadj_multi_py.reference_file = "of_grad_combo.dat.ref" + contadj_multi_py.test_file = "of_grad_combo.dat" + contadj_multi_py.enabled_with_asan = False + pass_list.append(contadj_multi_py.run_filediff(args.tsan, args.asan)) + test_list.append(contadj_multi_py) + + # Optimization with multiple objectives, with gradients evaluated individually + # the difference in gradient value relative to combined case + # is due to lack of solution file for the adjoint and small number of iterations +# opt_multiobj_py = TestCase('opt_multiobj_py') +# opt_multiobj_py.cfg_dir = "optimization_euler/multiobjective_wedge" +# opt_multiobj_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" +# opt_multiobj_py.test_iter = 1 +# opt_multiobj_py.test_vals = [1, 1, 1.084701E+02, 3.799222E+00] #last 4 columns +# opt_multiobj_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") +# opt_multiobj_py.timeout = 1600 +# opt_multiobj_py.tol = 0.00001 +# pass_list.append(opt_multiobj_py.run_opt()) +# test_list.append(opt_multiobj_py) +# +# # test optimization, with multiple objectives and gradient evaluated as 'combo' +# opt_multiobjcombo_py = TestCase('opt_multiobjcombo_py') +# opt_multiobjcombo_py.cfg_dir = "optimization_euler/multiobjective_wedge" +# opt_multiobjcombo_py.cfg_file = "inv_wedge_ROE_multiobj_combo.cfg" +# opt_multiobjcombo_py.test_iter = 1 +# opt_multiobjcombo_py.test_vals = [1, 1, 1.084701E+02, 3.789322E+00] #last 4 columns +# opt_multiobjcombo_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") +# opt_multiobjcombo_py.timeout = 1600 +# opt_multiobjcombo_py.tol = 0.00001 +# pass_list.append(opt_multiobjcombo_py.run_opt()) +# test_list.append(opt_multiobjcombo_py) + + # test optimization, with multiple objectives evaluated on a single surface + opt_multiobj1surf_py = TestCase('opt_multiobj1surf_py') + opt_multiobj1surf_py.cfg_dir = "optimization_euler/multiobjective_wedge" + opt_multiobj1surf_py.cfg_file = "inv_wedge_ROE_multiobj_1surf.cfg" + opt_multiobj1surf_py.test_iter = 1 + opt_multiobj1surf_py.test_vals = [1.000000, 1.000000, 36.586730, 5.593636] + opt_multiobj1surf_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") + opt_multiobj1surf_py.timeout = 1600 + opt_multiobj1surf_py.tol = 0.00001 + opt_multiobj1surf_py.enabled_with_asan = False + pass_list.append(opt_multiobj1surf_py.run_opt(args.tsan, args.asan)) + test_list.append(opt_multiobj1surf_py) + + # test optimization, with a single objective evaluated on multiple surfaces + opt_2surf1obj_py = TestCase('opt_2surf1obj_py') + opt_2surf1obj_py.cfg_dir = "optimization_euler/multiobjective_wedge" + opt_2surf1obj_py.cfg_file = "inv_wedge_ROE_2surf_1obj.cfg" + opt_2surf1obj_py.test_iter = 1 + opt_2surf1obj_py.test_vals = [1.000000, 1.000000, 2.005039, 0.000462] + opt_2surf1obj_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") + opt_2surf1obj_py.timeout = 1600 + opt_2surf1obj_py.tol = 0.00001 + opt_2surf1obj_py.enabled_with_asan = False + pass_list.append(opt_2surf1obj_py.run_opt(args.tsan, args.asan)) + test_list.append(opt_2surf1obj_py) + + ########################## + ### Python wrapper ### + ########################## + + # NACA0012 + pywrapper_naca0012 = TestCase('pywrapper_naca0012') + pywrapper_naca0012.cfg_dir = "euler/naca0012" + pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" + pywrapper_naca0012.test_iter = 20 + pywrapper_naca0012.test_vals = [-4.031446, -3.524530, 0.273056, 0.009703] + pywrapper_naca0012.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") + pywrapper_naca0012.timeout = 1600 + pywrapper_naca0012.tol = 0.00001 + pywrapper_naca0012.enabled_with_asan = False + test_list.append(pywrapper_naca0012) + pass_list.append(pywrapper_naca0012.run_test(args.tsan, args.asan)) + + # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) + pywrapper_turb_naca0012_sst = TestCase('pywrapper_turb_naca0012_sst') + pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" + pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" + pywrapper_turb_naca0012_sst.test_iter = 10 + pywrapper_turb_naca0012_sst.test_vals = [-12.094366, -15.251082, -5.906366, 1.070413, 0.015775, -3.178304, 0.000000] + pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.076068, -15.246740, -5.861280, 1.070036, 0.015841, -3.297854, 0.000000] + pywrapper_turb_naca0012_sst.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") + pywrapper_turb_naca0012_sst.timeout = 3200 + pywrapper_turb_naca0012_sst.tol = 0.00001 + pywrapper_turb_naca0012_sst.enabled_with_asan = False + test_list.append(pywrapper_turb_naca0012_sst) + pass_list.append(pywrapper_turb_naca0012_sst.run_test(args.tsan, args.asan)) + + # Square cylinder + pywrapper_square_cylinder = TestCase('pywrapper_square_cylinder') + pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" + pywrapper_square_cylinder.cfg_file = "turb_square.cfg" + pywrapper_square_cylinder.test_iter = 3 + pywrapper_square_cylinder.test_vals = [-2.560678, -1.175979, 0.062202, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] + pywrapper_square_cylinder.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") + pywrapper_square_cylinder.timeout = 1600 + pywrapper_square_cylinder.tol = 0.00001 + pywrapper_square_cylinder.unsteady = True + pywrapper_square_cylinder.enabled_with_asan = False + test_list.append(pywrapper_square_cylinder) + pass_list.append(pywrapper_square_cylinder.run_test(args.tsan, args.asan)) + + # FSI, 2d + pywrapper_fsi2d = TestCase('pywrapper_fsi2d') + pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" + pywrapper_fsi2d.cfg_file = "configFSI.cfg" + pywrapper_fsi2d.test_iter = 4 + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.725521, -4.278759] + pywrapper_fsi2d.command = TestCase.Command(exec = "SU2_CFD.py", param = "--nZone 2 --fsi True -f") + pywrapper_fsi2d.unsteady = True + pywrapper_fsi2d.multizone = True + pywrapper_fsi2d.timeout = 1600 + pywrapper_fsi2d.tol = 0.00001 + pywrapper_fsi2d.enabled_with_asan = False + test_list.append(pywrapper_fsi2d) + pass_list.append(pywrapper_fsi2d.run_test(args.tsan, args.asan)) + + # Unsteady CHT + pywrapper_unsteadyCHT = TestCase('pywrapper_unsteadyCHT') + pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" + pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" + pywrapper_unsteadyCHT.test_iter = 5 + pywrapper_unsteadyCHT.test_vals = [-1.614168, 2.259817, -0.009951, 0.169563] + pywrapper_unsteadyCHT.command = TestCase.Command(exec = "python", param = "launch_unsteady_CHT_FlatPlate.py -f") + pywrapper_unsteadyCHT.timeout = 1600 + pywrapper_unsteadyCHT.tol = 0.00001 + pywrapper_unsteadyCHT.unsteady = True + pywrapper_unsteadyCHT.enabled_with_asan = False + test_list.append(pywrapper_unsteadyCHT) + pass_list.append(pywrapper_unsteadyCHT.run_test(args.tsan, args.asan)) + + # Rigid motion + pywrapper_rigidMotion = TestCase('pywrapper_rigidMotion') + pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" + pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" + pywrapper_rigidMotion.test_iter = 5 + pywrapper_rigidMotion.test_vals = [-1.607008, 2.260791, 0.350208, 0.089496] + pywrapper_rigidMotion.command = TestCase.Command(exec = "python", param = "launch_flatPlate_rigidMotion.py -f") + pywrapper_rigidMotion.timeout = 1600 + pywrapper_rigidMotion.tol = 0.00001 + pywrapper_rigidMotion.unsteady = True + pywrapper_rigidMotion.enabled_with_asan = False + test_list.append(pywrapper_rigidMotion) + pass_list.append(pywrapper_rigidMotion.run_test(args.tsan, args.asan)) + + # Custom inlet + pywrapper_custom_inlet = TestCase('pywrapper_custom_inlet') + pywrapper_custom_inlet.cfg_dir = "py_wrapper/custom_inlet" + pywrapper_custom_inlet.cfg_file = "lam_flatplate.cfg" + pywrapper_custom_inlet.test_iter = 20 + pywrapper_custom_inlet.test_vals = [-4.123921, -1.544230, -3.886906, 1.338713, -0.688132, 0.160844, -0.009845, 0.520880, -0.530730] + pywrapper_custom_inlet.command = TestCase.Command(exec = "python", param = "run.py") + pywrapper_custom_inlet.timeout = 1600 + pywrapper_custom_inlet.tol = 0.0001 + pywrapper_custom_inlet.unsteady = True + pywrapper_custom_inlet.enabled_with_asan = False + test_list.append(pywrapper_custom_inlet) + pass_list.append(pywrapper_custom_inlet.run_test(args.tsan, args.asan)) + + # Tests summary + print('==================================================================') + print('Summary of the serial tests') + print('python version:', sys.version) + for i, test in enumerate(test_list): + if (pass_list[i]): + print(' passed - %s'%test.tag) + else: + print('* FAILED - %s'%test.tag) + + if all(pass_list): + sys.exit(0) + else: + sys.exit(1) + # done + +if __name__ == '__main__': + main() From 1aa4951c26f92e52f8a20465145144a693d1b03d Mon Sep 17 00:00:00 2001 From: rois1995 Date: Sat, 31 Oct 2026 19:20:43 +0100 Subject: [PATCH 36/43] Clarify HLLC Jacobian naming and tests --- .../include/numerics/flow/convection/hllc.hpp | 6 +- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 21 ++-- .../SU2_CFD/numerics/hllc_jacobian_tests.cpp | 103 +++++++----------- 3 files changed, 51 insertions(+), 79 deletions(-) diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index 0755473ae70e..e5ba58030940 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -40,7 +40,7 @@ class CUpwHLLC_Flow final : public CNumerics { private: friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ + bool useExactJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -82,6 +82,7 @@ class CUpwHLLC_Flow final : public CNumerics { * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ ResidualType<> ComputeResidual(const CConfig* config) override; + }; /*! @@ -95,7 +96,7 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { private: friend struct HLLCJacobianTestAccess; bool implicit, dynamic_grid; - bool useAccurateJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ + bool useExactJacobian; /*!< \brief Jacobians computed exactly for fixed wave speeds (USE_EXACT_HLLC_JACOBIANS). */ unsigned short iDim, jDim, iVar, jVar; su2double *IntermediateState; @@ -139,7 +140,6 @@ class CUpwGeneralHLLC_Flow final : public CNumerics { */ ResidualType<> ComputeResidual(const CConfig* config) override; - /*! * \brief Compute the Average quantities for a general fluid flux between two nodes i and j. * Using the approach of Vinokur and Montagne' diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 488db46f5299..b6ff0eef2d16 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -80,7 +80,7 @@ CUpwHLLC_Flow::CUpwHLLC_Flow(unsigned short val_nDim, unsigned short val_nVar, c /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); + useExactJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -291,11 +291,11 @@ CNumerics::ResidualType<> CUpwHLLC_Flow::ComputeResidual(const CConfig* config) /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). - By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ + By default the derivative of p* uses the density of the opposite state (approximate). + USE_EXACT_HLLC_JACOBIANS= YES gives the derivative for fixed wave speeds. ---*/ - const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; - const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; + const su2double rhoPStar_R = useExactJacobian ? Density_j : Density_i; + const su2double rhoPStar_L = useExactJacobian ? Density_i : Density_j; if (sM > 0.0) { @@ -595,7 +595,7 @@ CUpwGeneralHLLC_Flow::CUpwGeneralHLLC_Flow(unsigned short val_nDim, unsigned sho /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); - useAccurateJacobian = config->GetUse_Exact_HLLC_Jacobians(); + useExactJacobian = config->GetUse_Exact_HLLC_Jacobians(); Gamma = config->GetGamma(); @@ -684,7 +684,6 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c ShiftToFaceFrame(nDim, ProjInterfaceVel, UnitNormal, Velocity_j, Enthalpy_j); } - sq_vel_i = 0.0; sq_vel_j = 0.0; @@ -834,11 +833,11 @@ CNumerics::ResidualType<> CUpwGeneralHLLC_Flow::ComputeResidual(const CConfig* c /*--- Jacobians for the wave speeds held fixed (in the frame of the face). p* = rho_j (u_j - sR)(u_j - sM) + p_j = rho_i (u_i - sL)(u_i - sM) + p_i, so its derivative contains rho_j (sR - u_j) dsM/dU (or rho_i (sL - u_i) dsM/dU). - By default the density of the other state is kept, as in the previous implementation (an inexact transcription - of the reference, see #2198). USE_EXACT_HLLC_JACOBIANS= YES gives the exact derivative. ---*/ + By default the derivative of p* uses the density of the opposite state (approximate). + USE_EXACT_HLLC_JACOBIANS= YES gives the derivative for fixed wave speeds. ---*/ - const su2double rhoPStar_R = useAccurateJacobian ? Density_j : Density_i; - const su2double rhoPStar_L = useAccurateJacobian ? Density_i : Density_j; + const su2double rhoPStar_R = useExactJacobian ? Density_j : Density_i; + const su2double rhoPStar_L = useExactJacobian ? Density_i : Density_j; if (sM > 0.0) { diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index fc36c6cc9eba..1e63621c5bc6 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -43,7 +43,7 @@ struct HLLCJacobianTestAccess { namespace { -constexpr su2double gamma = 1.4; +constexpr su2double Gamma = 1.4; constexpr unsigned short maxVar = 5; using State = std::array; // conservative variables (rho, rho u, rho v, [rho w], rho E) @@ -58,14 +58,14 @@ void Primitives(unsigned short nDim, const State& U, su2double k, su2double* V, q2 += V[iDim + 1] * V[iDim + 1]; } const su2double e = U[nDim + 1] / rho - 0.5 * q2 - k; - const su2double p = (gamma - 1) * rho * e; + const su2double p = (Gamma - 1) * rho * e; V[0] = p / (rho * 287.058); V[nDim + 1] = p; V[nDim + 2] = rho; V[nDim + 3] = (U[nDim + 1] + p) / rho; - V[nDim + 4] = sqrt(gamma * p / rho); - S[0] = (gamma - 1) * e; - S[1] = (gamma - 1) * rho; + V[nDim + 4] = sqrt(Gamma * p / rho); + S[0] = (Gamma - 1) * e; + S[1] = (Gamma - 1) * rho; } /*--- Conservative state from density, velocity, pressure and k. ---*/ @@ -77,7 +77,7 @@ State Conservative(unsigned short nDim, su2double rho, const su2double* vel, su2 U[iDim + 1] = rho * vel[iDim]; q2 += vel[iDim] * vel[iDim]; } - U[nDim + 1] = p / (gamma - 1) + rho * (0.5 * q2 + k); + U[nDim + 1] = p / (Gamma - 1) + rho * (0.5 * q2 + k); return U; } @@ -87,10 +87,15 @@ struct Result { }; Result Evaluate(unsigned short nDim, CNumerics& numerics, const CConfig* config, const State& Ui, const State& Uj, - su2double k_i, su2double k_j) { + su2double k_i, su2double k_j, su2double pressureOffset = 0.0) { su2double Vi[20] = {0.0}, Vj[20] = {0.0}, Si[2], Sj[2]; Primitives(nDim, Ui, k_i, Vi, Si); Primitives(nDim, Uj, k_j, Vj, Sj); + // A fixed offset models independently reconstructed face pressure and enthalpy. + Vi[nDim + 1] += pressureOffset; + Vj[nDim + 1] += pressureOffset; + Vi[nDim + 3] += pressureOffset / Ui[0]; + Vj[nDim + 3] += pressureOffset / Uj[0]; numerics.SetPrimitive(Vi, Vj); numerics.SetSecondary(Si, Sj); numerics.SetTurbKineticEnergy(k_i, k_j); @@ -106,22 +111,24 @@ Result Evaluate(unsigned short nDim, CNumerics& numerics, const CConfig* config, return r; } -/*--- Largest difference between the Jacobians and central differences of the flux, relative to the largest entry. ---*/ +/*--- Compare the Jacobians with central differences; use absolute error for a selected side. ---*/ su2double JacobianError(unsigned short nDim, CNumerics& numerics, const CConfig* config, const State& Ui, - const State& Uj, su2double k_i, su2double k_j) { + const State& Uj, su2double k_i, su2double k_j, + su2double pressureOffset = 0.0, int sideFilter = -1) { const unsigned short nVar = nDim + 2; - const auto ref = Evaluate(nDim, numerics, config, Ui, Uj, k_i, k_j); + const auto ref = Evaluate(nDim, numerics, config, Ui, Uj, k_i, k_j, pressureOffset); su2double maxErr = 0.0, maxJac = 0.0; for (int side = 0; side < 2; side++) { + if (sideFilter >= 0 && side != sideFilter) continue; for (unsigned short jVar = 0; jVar < nVar; jVar++) { State Up = side ? Uj : Ui, Um = Up; - const su2double h = 1e-6 * std::max(std::abs(Up[jVar]), su2double(1.0)); + const su2double h = 1e-6 * (sideFilter < 0 ? std::max(std::abs(Up[jVar]), su2double(1.0)) : 1.0); Up[jVar] += h; Um[jVar] -= h; - const auto fp = side ? Evaluate(nDim, numerics, config, Ui, Up, k_i, k_j) - : Evaluate(nDim, numerics, config, Up, Uj, k_i, k_j); - const auto fm = side ? Evaluate(nDim, numerics, config, Ui, Um, k_i, k_j) - : Evaluate(nDim, numerics, config, Um, Uj, k_i, k_j); + const auto fp = side ? Evaluate(nDim, numerics, config, Ui, Up, k_i, k_j, pressureOffset) + : Evaluate(nDim, numerics, config, Up, Uj, k_i, k_j, pressureOffset); + const auto fm = side ? Evaluate(nDim, numerics, config, Ui, Um, k_i, k_j, pressureOffset) + : Evaluate(nDim, numerics, config, Um, Uj, k_i, k_j, pressureOffset); for (unsigned short iVar = 0; iVar < nVar; iVar++) { const su2double fd = (fp.flux[iVar] - fm.flux[iVar]) / (2 * h); const su2double jac = side ? ref.jac_j[iVar][jVar] : ref.jac_i[iVar][jVar]; @@ -130,7 +137,7 @@ su2double JacobianError(unsigned short nDim, CNumerics& numerics, const CConfig* } } } - return maxErr / maxJac; + return sideFilter < 0 ? maxErr / maxJac : maxErr; } /*--- Contact speed sM of the scheme, in the frame of the face (w = grid velocity along the unit normal n). ---*/ @@ -148,10 +155,10 @@ su2double ContactSpeed(unsigned short nDim, const State& Ui, const State& Uj, su return (p_i - p_j - rho_i * u_i * (sL - u_i) + rho_j * u_j * (sR - u_j)) / (rho_j * (sR - u_j) - rho_i * (sL - u_i)); } -std::unique_ptr MakeConfig(bool moving, bool accurate) { +std::unique_ptr MakeConfig(bool moving, bool exact) { std::stringstream options; options << "SOLVER= EULER\nCONV_NUM_METHOD_FLOW= HLLC\nTIME_DISCRE_FLOW= EULER_IMPLICIT\n"; - options << "USE_EXACT_HLLC_JACOBIANS= " << (accurate ? "YES" : "NO") << "\n"; + options << "USE_EXACT_HLLC_JACOBIANS= " << (exact ? "YES" : "NO") << "\n"; if (moving) options << "GRID_MOVEMENT= STEADY_TRANSLATION\nTRANSLATION_RATE= 0.0 0.0 0.0\n"; return std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); } @@ -159,8 +166,8 @@ std::unique_ptr MakeConfig(bool moving, bool accurate) { /*--- With USE_EXACT_HLLC_JACOBIANS= YES the Jacobians are exact for fixed wave speeds in all branches. By default the derivative of p* is approximated (star states), the supersonic branches remain exact. ---*/ template -void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accurate) { - auto config = MakeConfig(moving, accurate); +void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool exact) { + auto config = MakeConfig(moving, exact); HLLC numerics(nDim, nDim + 2, config.get()); /*--- Oblique unit normal (face area 1.3) and, on moving faces, a grid velocity with a normal component. ---*/ @@ -198,7 +205,7 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, s[0], s[1]); const bool supersonic = (s[0] > 0.0) || (s[1] < 0.0); const su2double sM = ContactSpeed(nDim, Ui, Uj, k, 0.8 * k, n, w, s[0], s[1]); - CAPTURE(nDim, moving, k, accurate, dir, s[0], s[1], sM); + CAPTURE(nDim, moving, k, exact, dir, s[0], s[1], sM); /*--- Make sure the intended branch is the one selected. ---*/ if (supersonic) @@ -207,10 +214,10 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura REQUIRE(sM * dir > 0.0); const su2double error = JacobianError(nDim, numerics, config.get(), Ui, Uj, k, 0.8 * k); - if (accurate || supersonic) + if (exact || supersonic) CHECK(error < 1e-6); else - CHECK(error > 1e-3); // the approximation is active + CHECK(error > 1e-3); // Confirms the default approximate Jacobian is selected. } } } @@ -220,9 +227,9 @@ void CheckAllBranches(unsigned short nDim, bool moving, su2double k, bool accura TEST_CASE("HLLC Jacobians match finite differences", "[HLLC]") { for (const unsigned short nDim : {2, 3}) { for (const bool moving : {false, true}) { - for (const bool accurate : {false, true}) { - CheckAllBranches(nDim, moving, 0.0, accurate); - CheckAllBranches(nDim, moving, 0.0, accurate); + for (const bool exact : {false, true}) { + CheckAllBranches(nDim, moving, 0.0, exact); + CheckAllBranches(nDim, moving, 0.0, exact); } } } @@ -231,9 +238,9 @@ TEST_CASE("HLLC Jacobians match finite differences", "[HLLC]") { TEST_CASE("HLLC supersonic Jacobian uses reconstructed face enthalpy", "[HLLC-face]") { for (unsigned short nDim : {2, 3}) { for (bool moving : {false, true}) { - for (const bool accurate : {false, true}) { + for (const bool exact : {false, true}) { for (su2double direction : {-1.0, 1.0}) { - auto config = MakeConfig(moving, accurate); + auto config = MakeConfig(moving, exact); CUpwHLLC_Flow numerics(nDim, nDim + 2, config.get()); const su2double n2[3] = {0.8, 0.6, 0.0}, n3[3] = {2.0 / 7, 3.0 / 7, 6.0 / 7}; const auto* normal = nDim == 2 ? n2 : n3; @@ -247,43 +254,9 @@ TEST_CASE("HLLC supersonic Jacobian uses reconstructed face enthalpy", "[HLLC-fa HLLCJacobianTestAccess::SetFixedWaveSpeeds(numerics, direction > 0 ? 2.0 : -4.0, direction > 0 ? 4.0 : -2.0); const State state = Conservative(nDim, 1.2, velocity, 1.1, 0.0); for (su2double pressureOffset : {0.0, 0.1}) { - auto evaluate = [&](const State& Ui, const State& Uj) { - su2double Vi[20] = {}, Vj[20] = {}, Si[2], Sj[2]; - Primitives(nDim, Ui, 0.0, Vi, Si); - Primitives(nDim, Uj, 0.0, Vj, Sj); - // A fixed pressure offset models independently reconstructed p and h. - Vi[nDim + 1] += pressureOffset; - Vj[nDim + 1] += pressureOffset; - Vi[nDim + 3] += pressureOffset / Ui[0]; - Vj[nDim + 3] += pressureOffset / Uj[0]; - numerics.SetPrimitive(Vi, Vj); - numerics.SetTurbKineticEnergy(0.0, 0.0); - const auto residual = numerics.ComputeResidual(config.get()); - Result result{}; - for (auto i = 0u; i < nDim + 2; ++i) { - result.flux[i] = residual.residual[i]; - for (auto j = 0u; j < nDim + 2; ++j) { - result.jac_i[i][j] = residual.jacobian_i[i][j]; - result.jac_j[i][j] = residual.jacobian_j[i][j]; - } - } - return result; - }; - CAPTURE(nDim, moving, accurate, direction, pressureOffset); - const auto reference = evaluate(state, state); - for (auto column = 0u; column < nDim + 2; ++column) { - State plus = state, minus = state; - const su2double step = 1e-6; - plus[column] += step; - minus[column] -= step; - const auto fp = direction > 0 ? evaluate(plus, state) : evaluate(state, plus); - const auto fm = direction > 0 ? evaluate(minus, state) : evaluate(state, minus); - for (auto row = 0u; row < nDim + 2; ++row) { - const su2double fd = (fp.flux[row] - fm.flux[row]) / (2 * step); - const su2double jac = direction > 0 ? reference.jac_i[row][column] : reference.jac_j[row][column]; - CHECK(jac == Approx(fd).margin(1e-6)); - } - } + CAPTURE(nDim, moving, exact, direction, pressureOffset); + const int side = direction > 0 ? 0 : 1; + CHECK(JacobianError(nDim, numerics, config.get(), state, state, 0.0, 0.0, pressureOffset, side) < 1e-6); } } } From e94eaff1dfb1f6b57c66d164a2b1fd600be62051 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 6 Nov 2026 10:58:53 +0100 Subject: [PATCH 37/43] Fix HLLC test formatting --- UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp index 1e63621c5bc6..a047452fb084 100644 --- a/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/hllc_jacobian_tests.cpp @@ -113,8 +113,8 @@ Result Evaluate(unsigned short nDim, CNumerics& numerics, const CConfig* config, /*--- Compare the Jacobians with central differences; use absolute error for a selected side. ---*/ su2double JacobianError(unsigned short nDim, CNumerics& numerics, const CConfig* config, const State& Ui, - const State& Uj, su2double k_i, su2double k_j, - su2double pressureOffset = 0.0, int sideFilter = -1) { + const State& Uj, su2double k_i, su2double k_j, su2double pressureOffset = 0.0, + int sideFilter = -1) { const unsigned short nVar = nDim + 2; const auto ref = Evaluate(nDim, numerics, config, Ui, Uj, k_i, k_j, pressureOffset); su2double maxErr = 0.0, maxJac = 0.0; From 51b2494253b86c6fe6875645a24a380acf6722d8 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Sat, 7 Nov 2026 08:54:38 +0100 Subject: [PATCH 38/43] Fix remaining SST k inconsistencies in flow numerics Keep cell k consistent in MUSCL and sliding states, transport k jumps without acoustic MSW/Turkel/JST dissipation, and limit thermal energy in flow relaxation. Include fixed-k derivatives in dissipation, heat-flux and low-Mach Jacobians. Carry the JST rho-k Laplacian through periodic and MPI exchange. Add manufactured contact, Jacobian, relaxation and fourth-order dissipation tests. Document the separate SSTm production and energy-transport approximations. --- Docs/SSTEnergy.md | 32 ++++++ .../flow/convection/centered.hpp | 65 ++++++----- .../numerics_simd/flow/convection/common.hpp | 27 ++--- .../numerics_simd/flow/convection/upwind.hpp | 7 +- .../flow/diffusion/viscous_fluxes.hpp | 51 ++++----- SU2_CFD/include/solvers/CEulerSolver.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.inl | 9 +- SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 2 +- SU2_CFD/include/variables/CEulerVariable.hpp | 20 +++- SU2_CFD/include/variables/CVariable.hpp | 4 +- SU2_CFD/src/numerics/flow/convection/fvs.cpp | 12 +- SU2_CFD/src/numerics/flow/convection/roe.cpp | 9 +- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 6 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 46 ++++---- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 57 +++++----- SU2_CFD/src/variables/CEulerVariable.cpp | 14 ++- UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp | 57 +++++++++- .../SU2_CFD/solvers/sst_energy_tests.cpp | 103 ++++++++++++++++++ .../solvers/under_relaxation_ad_tests.cpp | 2 +- UnitTests/meson.build | 1 + 22 files changed, 383 insertions(+), 147 deletions(-) create mode 100644 Docs/SSTEnergy.md create mode 100644 UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp diff --git a/Docs/SSTEnergy.md b/Docs/SSTEnergy.md new file mode 100644 index 000000000000..bef1b970a5dd --- /dev/null +++ b/Docs/SSTEnergy.md @@ -0,0 +1,32 @@ +# SST turbulent kinetic energy in the compressible solver + +The compressible SST solver stores total energy per unit mass as +`E = e + |u|²/2 + k`. Thermodynamic pressure and temperature use `e`; +total enthalpy and its convective flux include `k`. Flow Jacobians hold `k` +fixed because it is advanced by the separate turbulence solver. + +This energy convention does not imply that every term of the full +Favre-averaged energy equation is modeled. The current SSTm formulation: + +- omits the isotropic `-2 rho k I/3` term from turbulent stress; +- uses approximate strain-based production `P = mu_t 2S:S` before applying + the production limiter (other production options modify this expression); +- omits molecular diffusion and turbulent transport of `k` from the total + energy flux. Temperature heat conduction is still present. + +These are modeling approximations, distinct from interpreting `k` as +thermal energy inside a numerical flux or its Jacobian. The +[Turbulence Modeling Resource SST definitions](https://tmbwg.github.io/turbmodels/sst.html) +explicitly describe the SSTm production approximation, and its +[compressible RANS implementation notes](https://tmbwg.github.io/turbmodels/implementrans.html) +allow omission of the energy transport term involving the gradient of `k`. + +For unmodified strain production, its difference from the contraction of +SU2's deviatoric turbulent stress with the velocity gradient is +`2 mu_t (div u)²/3`, before limiting. At fixed total energy, additional +production of `k` reduces thermal energy. This difference vanishes for +incompressible flow and can matter in shocks and strong expansions. The +production limiter, sustaining terms, transition coupling, and production +modifiers prevent interpreting this expression as the actual production +excess in every configuration. Changing these approximations requires +choosing and validating a different SST formulation. diff --git a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp index 626c90ac9d3c..2198e3ce2a28 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp @@ -57,12 +57,16 @@ class CCenteredBase : public Base { /*! * \brief Constructor, store some constants and forward args to base. */ - template - CCenteredBase(const CConfig& config, Ts&... args) : Base(config, args...), - gamma(config.GetGamma()), - fixFactor(config.GetCent_Jac_Fix_Factor()), - dynamicGrid(config.GetDynamic_Grid()), - tkeVars(config.GetKind_Turb_Model() == TURB_MODEL::SST ? findTurbVars(args...) : nullptr) { + template + CCenteredBase(const CConfig& config, Ts&... args) + : Base(config, args...), + gamma(config.GetGamma()), + fixFactor(config.GetCent_Jac_Fix_Factor()), + dynamicGrid(config.GetDynamic_Grid()), + tkeVars(config.GetKind_Turb_Model() == TURB_MODEL::SST ? findTurbVars(args...) : nullptr) {} + + FORCEINLINE Double getTke(const Int& point) const { + return tkeVars ? gatherVariables(point, tkeVars->GetSolution()) : Double(0.0); } /*! @@ -270,10 +274,10 @@ class CJSTScheme : public CCenteredBase,Decorator> { } if (implicit) { - const Double dissip_i = fixFactor * (eps2 + eps4*(ni+1)) * lambda; - const Double dissip_j = -fixFactor * (eps2 + eps4*(nj+1)) * lambda; - scalarDissipationJacobian(V.i, gamma, dissip_i, jac_i); - scalarDissipationJacobian(V.j, gamma, dissip_j, jac_j); + const Double dissip_i = fixFactor * (eps2 + eps4 * (ni + 1)) * lambda; + const Double dissip_j = -fixFactor * (eps2 + eps4 * (nj + 1)) * lambda; + scalarDissipationJacobian(V.i, gamma, dissip_i, jac_i, Base::getTke(iPoint)); + scalarDissipationJacobian(V.j, gamma, dissip_j, jac_j, Base::getTke(jPoint)); } } }; @@ -345,35 +349,36 @@ class CJSTmatScheme : public CCenteredBase,Decorator> { VectorDbl scalarDissip; for (size_t iVar = 0; iVar < nVar; ++iVar) { - scalarDissip(iVar) = eps2*diffU(iVar) - eps4*(lapl_i(iVar)-lapl_j(iVar)); + scalarDissip(iVar) = eps2 * diffU(iVar) - eps4 * (lapl_i(iVar) - lapl_j(iVar)); } + Double tke_i = 0.0, tke_j = 0.0; + if (tkeVars) { + tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); + tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + } + const Double avgTke = 0.5 * (tke_i + tke_j); + MatrixDbl scalarJac; if (implicit) { scalarJac = Double(0.0); - Double factor = fixFactor * (eps2 + 0.5*eps4*(ni+nj+2)); - scalarDissipationJacobian(avgV, gamma, factor, scalarJac); + Double factor = fixFactor * (eps2 + 0.5 * eps4 * (ni + nj + 2)); + scalarDissipationJacobian(avgV, gamma, factor, scalarJac, avgTke); } /*--- Compute matrix dissipation terms. ---*/ const auto unitProjVel = dot(avgV.velocity(), unitNormal); - /*--- With SST the total energy contains k, averaged between the cells. ---*/ - Double tke_i = 0.0, tke_j = 0.0; + // Remove changes in k before acoustic projection, including the fourth-order term. + Double rhoDeltaTke = eps2 * avgV.density() * (tke_i - tke_j); if (tkeVars) { - tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); - tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + const auto lapK_i = gatherVariables(iPoint, solution.GetUndivided_Laplacian(), nVar); + const auto lapK_j = gatherVariables(jPoint, solution.GetUndivided_Laplacian(), nVar); + rhoDeltaTke -= eps4 * (lapK_i - lapK_j - avgTke * (lapl_i(0) - lapl_j(0))); } - const Double avgTke = 0.5 * (tke_i + tke_j); - - /*--- Delta(rho k) = avg(rho) Delta k + avg(k) Delta rho. The part with Delta k is not a pressure jump: remove it - from the 2nd order dissipation before the projection and advect it with the contact wave. The 4th order term - keeps it (the Laplacian of k is not available). ---*/ - const Double rhoDeltaTke = eps2 * avgV.density() * (tke_i - tke_j); - scalarDissip(nVar-1) -= rhoDeltaTke; - auto pMat = pMatrix(gamma, avgV.density(), avgV.velocity(), - unitProjVel, avgV.speedSound(), unitNormal, avgTke); + scalarDissip(nVar - 1) -= rhoDeltaTke; + auto pMat = pMatrix(gamma, avgV.density(), avgV.velocity(), unitProjVel, avgV.speedSound(), unitNormal, avgTke); auto pMatInv = pMatrixInv(gamma, avgV.density(), avgV.velocity(), unitProjVel, avgV.speedSound(), unitNormal, avgTke); @@ -485,8 +490,8 @@ class CJSTkeScheme : public CCenteredBase,Decorator> { } if (implicit) { - scalarDissipationJacobian(V.i, gamma, fixFactor*dissip, jac_i); - scalarDissipationJacobian(V.j, gamma, -fixFactor*dissip, jac_j); + scalarDissipationJacobian(V.i, gamma, fixFactor * dissip, jac_i, Base::getTke(iPoint)); + scalarDissipationJacobian(V.j, gamma, -fixFactor * dissip, jac_j, Base::getTke(jPoint)); } } }; @@ -552,8 +557,8 @@ class CLaxScheme : public CCenteredBase,Decorator> { } if (implicit) { - scalarDissipationJacobian(V.i, gamma, fixFactor*dissip, jac_i); - scalarDissipationJacobian(V.j, gamma, -fixFactor*dissip, jac_j); + scalarDissipationJacobian(V.i, gamma, fixFactor * dissip, jac_i, Base::getTke(iPoint)); + scalarDissipationJacobian(V.j, gamma, -fixFactor * dissip, jac_j, Base::getTke(jPoint)); } } }; diff --git a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp index ab6d0a98d523..13fcd5fc13de 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp @@ -60,7 +60,9 @@ FORCEINLINE CPair reconstructPrimitives(const Int& iEdge, const CPair& V1st, const VectorDbl& vector_ij, const VariableType& solution, - Double& nonPhysical) { + Double& nonPhysical, + const Double& tke_i = Double(0.0), + const Double& tke_j = Double(0.0)) { static_assert(ReconVarType::nVar <= PrimVarType::nVar); const auto& gradients = solution.GetGradient_Reconstruction(); @@ -101,7 +103,7 @@ FORCEINLINE CPair reconstructPrimitives(const Int& iEdge, /*--- Test the sign of the Roe-averaged speed of sound. ---*/ const Double R = sqrt(abs(V.j.density() / V.i.density())); /*--- Delay dividing by R+1 until comparing enthalpy and velocity magnitude. ---*/ - const Double enthalpy = R*V.j.enthalpy() + V.i.enthalpy(); + const Double enthalpy = R*(V.j.enthalpy() - tke_j) + V.i.enthalpy() - tke_i; Double v_squared = 0.0; for (size_t iDim = 0; iDim < nDim; ++iDim) { v_squared += pow(R*V.j.velocity(iDim) + V.i.velocity(iDim), 2); @@ -400,21 +402,20 @@ FORCEINLINE Double correctedSpectralRadius(const Int& iPoint, /*! * \brief Update of a flux Jacobian due to a scalar dissipation term. */ -template -FORCEINLINE void scalarDissipationJacobian(const VariableType& V, - const Double& gamma, - Double dissipConst, - MatrixDbl& jac) { +template +FORCEINLINE void scalarDissipationJacobian(const VariableType& V, const Double& gamma, Double dissipConst, + MatrixDbl& jac, const Double& tke = Double(0.0)) { /*--- Diagonal entries. ---*/ - for (size_t iVar = 0; iVar < nVar-1; ++iVar) { - jac(iVar,iVar) += dissipConst; + for (size_t iVar = 0; iVar < nVar - 1; ++iVar) { + jac(iVar, iVar) += dissipConst; } - jac(nVar-1,nVar-1) += dissipConst * gamma; + jac(nVar - 1, nVar - 1) += dissipConst * gamma; + jac(nVar - 1, 0) -= dissipConst * (gamma - 1.0) * tke; /*--- N-1 columns of last row. ---*/ - dissipConst *= gamma-1.0; + dissipConst *= gamma - 1.0; for (size_t iDim = 0; iDim < VariableType::nDim; ++iDim) { - jac(nVar-1,iDim+1) -= dissipConst * V.velocity(iDim); - jac(nVar-1,0) += dissipConst * pow(V.velocity(iDim), 2); + jac(nVar - 1, iDim + 1) -= dissipConst * V.velocity(iDim); + jac(nVar - 1, 0) += 0.5 * dissipConst * pow(V.velocity(iDim), 2); } } diff --git a/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp b/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp index 0e93a158ce98..65227e35bc3e 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/upwind.hpp @@ -121,10 +121,15 @@ class CUpwindBase : public Base { V1st.j.all = gatherVariables(jPoint, solution.GetPrimitive()); /*--- Recompute density and enthalpy instead of reconstructing. ---*/ + Double tke_i = 0.0, tke_j = 0.0; + if (tkeVars) { + tke_i = gatherVariables(iPoint, tkeVars->GetSolution()); + tke_j = gatherVariables(jPoint, tkeVars->GetSolution()); + } Double nonPhysical; auto V = reconstructPrimitives >( iEdge, iPoint, jPoint, gamma, gasConst, muscl, umusclKappa, umusclRamp, - typeLimiter, V1st, vector_ij, solution, nonPhysical); + typeLimiter, V1st, vector_ij, solution, nonPhysical, tke_i, tke_j); /*--- Compute conservative variables. ---*/ diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index fa2b90d3d592..6e5d73bb9e1d 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -80,6 +80,7 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { const bool useSA_QCR; const bool wallFun; const bool uq; + const bool tkeInEnergy; const bool uq_permute; const size_t uq_eigval_comp; const su2double uq_delta_b; @@ -90,22 +91,21 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { /*! * \brief Constructor, initialize constants and booleans. */ - template - CCompressibleViscousFluxBase(const CConfig& config, int iMesh, - const CVariable* turbVars_, Ts&...) : - gamma(config.GetGamma()), - gasConst(config.GetGas_ConstantND()), - prandtlTurb(config.GetPrandtl_Turb()), - correct(iMesh == MESH_0), - useSA_QCR(config.GetSAParsedOptions().qcr2000), - wallFun(config.GetWall_Functions()), - uq(config.GetSSTParsedOptions().uq), - uq_permute(config.GetUQ_Permute()), - uq_eigval_comp(config.GetEig_Val_Comp()), - uq_delta_b(config.GetUQ_Delta_B()), - uq_urlx(config.GetUQ_URLX()), - turbVars(turbVars_) { - } + template + CCompressibleViscousFluxBase(const CConfig& config, int iMesh, const CVariable* turbVars_, Ts&...) + : gamma(config.GetGamma()), + gasConst(config.GetGas_ConstantND()), + prandtlTurb(config.GetPrandtl_Turb()), + correct(iMesh == MESH_0), + useSA_QCR(config.GetSAParsedOptions().qcr2000), + wallFun(config.GetWall_Functions()), + uq(config.GetSSTParsedOptions().uq), + tkeInEnergy(config.GetKind_Turb_Model() == TURB_MODEL::SST), + uq_permute(config.GetUQ_Permute()), + uq_eigval_comp(config.GetEig_Val_Comp()), + uq_delta_b(config.GetUQ_Delta_B()), + uq_urlx(config.GetUQ_URLX()), + turbVars(turbVars_) {} /*! * \brief Add viscous contributions to flux and jacobians. @@ -276,16 +276,17 @@ class CCompressibleViscousFlux : public CCompressibleViscousFluxBase - FORCEINLINE VectorDbl energyJacobian(const PrimitiveType& V, - const MatrixDbl& dtau, - const Double& thermalCond, - const Double& area, - const Double& dist_ij, - Ts&... args) const { + template + FORCEINLINE VectorDbl energyJacobian(const PrimitiveType& V, const MatrixDbl& dtau, + const Double& thermalCond, const Double& area, const Double& dist_ij, + const Int& iPoint, const Int& jPoint, const VariableType&) const { Double vel2 = 0.5 * squaredNorm(V.velocity()); - Double phi = (gamma-1) / V.density(); - Double RdTdrho = phi*vel2 - V.pressure() / pow(V.density(),2); + Double phi = (gamma - 1) / V.density(); + Double tke = 0.0; + if (this->tkeInEnergy) + tke = 0.5 * (gatherVariables(iPoint, this->turbVars->GetSolution()) + + gatherVariables(jPoint, this->turbVars->GetSolution())); + Double RdTdrho = phi * (vel2 - tke) - V.pressure() / pow(V.density(), 2); Double condOnRd = thermalCond / (gasConst * dist_ij); Double contraction = 0.0; for (size_t iDim = 0; iDim < nDim; ++iDim) { diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 402b8901194f..f958c3759588 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -837,7 +837,7 @@ class CEulerSolver : public CFVMFlowSolverBase::ComputeVerificationError(CGeometry* geometry, CCo } template -void CFVMFlowSolverBase::CompleteImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { +void CFVMFlowSolverBase::CompleteImplicitIteration(CGeometry *geometry, CSolver** solver_container, CConfig *config) { SU2_ZONE_SCOPED - if constexpr (R == ENUM_REGIME::COMPRESSIBLE) ComputeUnderRelaxationFactor(config); + if constexpr (R == ENUM_REGIME::COMPRESSIBLE) ComputeUnderRelaxationFactor(config, solver_container); /*--- Update solution with under-relaxation and communicate it. ---*/ @@ -1409,6 +1409,11 @@ void CFVMFlowSolverBase::BC_Fluid_Interface(CGeometry* geometry, /*--- Set primitive variables ---*/ conv_numerics->SetPrimitive(PrimVar_i, PrimVar_j); + if (FlowRegime == ENUM_REGIME::COMPRESSIBLE && config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const auto* turb = solver_container[TURB_SOL]; + conv_numerics->SetTurbKineticEnergy(turb->GetNodes()->GetSolution(iPoint, 0), + turb->GetSlidingState(iMarker, iVertex, 0, jVertex)); + } if (FlowRegime == ENUM_REGIME::COMPRESSIBLE && !ideal_gas) { P_static = PrimVar_j[nDim + 1]; diff --git a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp index 99b58553de1b..88387a267d6e 100644 --- a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp @@ -197,7 +197,7 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase OutlierMitigation; - }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 377a0c818881..4e9484a7933a 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -990,7 +990,9 @@ class CVariable { * \param[in] iPoint - Point index. * \return Pointer to the undivided laplacian vector. */ - inline su2double *GetUndivided_Laplacian(unsigned long iPoint) { return Undivided_Laplacian[iPoint]; } + virtual su2double GetRhoTke(unsigned long iPoint) const { return 0.0; } + + inline su2double* GetUndivided_Laplacian(unsigned long iPoint) { return Undivided_Laplacian[iPoint]; } /*! * \brief Get the undivided laplacian of the solution. diff --git a/SU2_CFD/src/numerics/flow/convection/fvs.cpp b/SU2_CFD/src/numerics/flow/convection/fvs.cpp index 2799122b25cf..fdf6ab74a5ef 100644 --- a/SU2_CFD/src/numerics/flow/convection/fvs.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fvs.cpp @@ -145,7 +145,8 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { for (auto iVar = 0u; iVar < MAXNVAR; ++iVar) { Fc[iVar] = 0; } - auto UpdateFlux = [&](const auto* U, auto* Jacobian) { + auto UpdateFlux = [&](auto* U, auto* Jacobian, su2double deltaTke) { + U[nVar - 1] -= U[0] * deltaTke; for (auto iVar = 0u; iVar < nVar; ++iVar) { for (auto jVar = 0u; jVar < nVar; ++jVar) { su2double Proj_ModJac_Tensor_i = 0.0; @@ -158,9 +159,14 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { Fc[iVar] += Proj_ModJac_Tensor_i * Area * U[jVar]; Jacobian[iVar][jVar] = Proj_ModJac_Tensor_i * Area; } + Jacobian[iVar][0] -= Jacobian[iVar][nVar - 1] * deltaTke; + if (iVar + 1 == nVar) { + Fc[iVar] += Lambda[0] * Area * U[0] * deltaTke; + Jacobian[iVar][0] += Lambda[0] * Area * deltaTke; + } } }; - UpdateFlux(U_i, Jacobian_i); + UpdateFlux(U_i, Jacobian_i, turb_ke_i - tkest_i); /*--- Flow eigenvalues at j (Lambda-) ---*/ @@ -177,7 +183,7 @@ CNumerics::ResidualType<> CUpwMSW_Flow::ComputeResidual(const CConfig* config) { /*--- Projected flux (f-) ---*/ - UpdateFlux(U_j, Jacobian_j); + UpdateFlux(U_j, Jacobian_j, turb_ke_j - tkest_j); AD::SetPreaccOut(Fc, nVar); AD::EndPreacc(); diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 5fdf14f9c92c..ec73bae349fc 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -643,10 +643,15 @@ CNumerics::ResidualType<> CUpwTurkel_Flow::ComputeResidual(const CConfig* config GetPrecondJacobian(Beta2, r_hat, s_hat, t_hat, rhoB2a2, Lambda, UnitNormal, absPeJac); /*--- Compute the matrix from entropic variables to conserved variables ---*/ - GetinvRinvPe(Beta2, RoeEnthalpy, RoeSoundSpeed, RoeDensity, RoeVelocity, invRinvPe); + const su2double roeTke = (R * turb_ke_j + turb_ke_i) / (R + 1); + GetinvRinvPe(Beta2, RoeEnthalpy - roeTke, RoeSoundSpeed, RoeDensity, RoeVelocity, invRinvPe); + for (iVar = 0; iVar < nVar; ++iVar) invRinvPe[nVar - 1][iVar] += roeTke * invRinvPe[0][iVar]; /*--- Compute the matrix from entropic variables to conserved variables ---*/ GetRMatrix(RoePressure, RoeSoundSpeed, RoeDensity, RoeVelocity, R_Tensor); + for (iVar = 0; iVar < nVar; ++iVar) R_Tensor[iVar][0] -= roeTke * R_Tensor[iVar][nVar - 1]; + const su2double rhoDeltaTke = RoeDensity * (turb_ke_j - turb_ke_i); + Diff_U[nVar - 1] -= rhoDeltaTke; if (implicit) { /*--- Jacobians of the inviscid flux, scaled by @@ -683,6 +688,8 @@ CNumerics::ResidualType<> CUpwTurkel_Flow::ComputeResidual(const CConfig* config } } + Flux[nVar - 1] -= 0.5 * fabs(ProjVelocity) * Area * rhoDeltaTke; + /*--- Contributions due to mesh motion---*/ if (dynamic_grid) { ProjVelocity = 0.0; diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index eca315d00373..276663b1306f 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -539,9 +539,9 @@ void CAvgGrad_Flow::SetHeatFluxJacobian(const su2double *val_Mean_PrimVar, /*--- R times partial derivatives of temp. ---*/ - const su2double R_dTdu0 = -Pressure/(Density*Density) + 0.5*sqvel*phi; - const su2double R_dTdu1 = -phi*val_Mean_PrimVar[1]; - const su2double R_dTdu2 = -phi*val_Mean_PrimVar[2]; + const su2double R_dTdu0 = -Pressure / (Density * Density) + (0.5 * sqvel - Mean_turb_ke) * phi; + const su2double R_dTdu1 = -phi * val_Mean_PrimVar[1]; + const su2double R_dTdu2 = -phi * val_Mean_PrimVar[2]; const su2double heat_flux_factor = val_thermal_conductivity/val_heat_capacity_cp + val_eddy_viscosity/Prandtl_Turb; const su2double cpoR = Gamma/Gamma_Minus_One; // cp over R diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index c3a14090633a..9fea6c1ecef5 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1970,11 +1970,10 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain bool neg_pres_or_rho_j = nonPositive(Primitive_j[prim_idx.Pressure()]) || nonPositive(Primitive_j[prim_idx.Density()]); if (!neg_pres_or_rho_i && !neg_pres_or_rho_j) { - /*--- Recompute the reconstructed quantities in a thermodynamically consistent way. With SST the total enthalpy contains k, taken from the cells (as the vectorized reconstruction does). ---*/ - if (!ideal_gas || low_mach_corr) { + if (!ideal_gas || low_mach_corr || tkeInEnergy) { ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_i, Secondary_i, tke_i); ComputeConsistentExtrapolation(GetFluidModel(), nDim, Primitive_j, Secondary_j, tke_j); } @@ -2427,12 +2426,11 @@ void CEulerSolver::SetUndivided_Laplacian(CGeometry *geometry, const CConfig *co const su2double Pressure_i = nodes->GetPressure(iPoint); /*--- Initialize. ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) - nodes->SetUnd_Lapl(iPoint, iVar, 0.0); + for (unsigned short iVar = 0; iVar < nVar; iVar++) nodes->SetUnd_Lapl(iPoint, iVar, 0.0); + if (nodes->GetUndivided_Laplacian().cols() > nVar) nodes->SetUnd_Lapl(iPoint, nVar, 0.0); /*--- Loop over the neighbors of point i. ---*/ for (auto jPoint : geometry->nodes->GetPoints(iPoint)) { - bool boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); /*--- If iPoint is boundary it only takes contributions from other boundary points. ---*/ @@ -2444,7 +2442,9 @@ void CEulerSolver::SetUndivided_Laplacian(CGeometry *geometry, const CConfig *co nodes->AddUnd_Lapl(iPoint, iVar, nodes->GetSolution(jPoint,iVar)-nodes->GetSolution(iPoint,iVar)); su2double Pressure_j = nodes->GetPressure(jPoint); - nodes->AddUnd_Lapl(iPoint, nVar-1, Pressure_j-Pressure_i); + nodes->AddUnd_Lapl(iPoint, nVar - 1, Pressure_j - Pressure_i); + if (nodes->GetUndivided_Laplacian().cols() > nVar) + nodes->AddUnd_Lapl(iPoint, nVar, nodes->GetRhoTke(jPoint) - nodes->GetRhoTke(iPoint)); } } END_SU2_OMP_FOR @@ -2571,7 +2571,7 @@ void CEulerSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver**, CCon PrepareImplicitIteration_impl(precond, geometry, config); } -void CEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config) { +void CEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config, CSolver** solver_container) { SU2_ZONE_SCOPED /*--- Loop over the solution update given by relaxing the linear system for this @@ -2593,6 +2593,11 @@ void CEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config) { e_old -= 0.5 * pow(nodes->GetSolution(iPoint, jVar), 2) / rho_old; e_new -= 0.5 * pow(nodes->GetSolution(iPoint, jVar) + LinSysSol(iPoint, jVar), 2) / rho_new; } + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) { + const su2double tke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0); + e_old -= rho_old * tke; + e_new -= rho_new * tke; + } ratio = fmax(ratio, fabs(e_new - e_old) / max(e_old, EPS)); su2double localUnderRelaxation = fmin(allowableRatio / fmax(ratio, EPS), 1); @@ -2761,25 +2766,24 @@ void CEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint soundspeed = nodes->GetSoundSpeed(iPoint); sq_vel = nodes->GetVelocity2(iPoint); + const su2double tke = config->GetKind_Turb_Model() == TURB_MODEL::SST ? nodes->GetRhoTke(iPoint) / rho : 0.0; + /*---Calculating the inverse of the preconditioning matrix that multiplies the time derivative */ - preconditioner[0][0] = 0.5*sq_vel; - preconditioner[0][nVar-1] = 1.0; - for (iDim = 0; iDim < nDim; iDim ++) - preconditioner[0][1+iDim] = -1.0*U_i[iDim+1]/rho; + preconditioner[0][0] = 0.5 * sq_vel - tke; + preconditioner[0][nVar - 1] = 1.0; + for (iDim = 0; iDim < nDim; iDim++) preconditioner[0][1 + iDim] = -1.0 * U_i[iDim + 1] / rho; - for (iDim = 0; iDim < nDim; iDim ++) { - preconditioner[iDim+1][0] = 0.5*sq_vel*U_i[iDim+1]/rho; - preconditioner[iDim+1][nVar-1] = U_i[iDim+1]/rho; - for (jDim = 0; jDim < nDim; jDim ++) { - preconditioner[iDim+1][1+jDim] = -1.0*U_i[jDim+1]/rho*U_i[iDim+1]/rho; + for (iDim = 0; iDim < nDim; iDim++) { + preconditioner[iDim + 1][0] = (0.5 * sq_vel - tke) * U_i[iDim + 1] / rho; + preconditioner[iDim + 1][nVar - 1] = U_i[iDim + 1] / rho; + for (jDim = 0; jDim < nDim; jDim++) { + preconditioner[iDim + 1][1 + jDim] = -1.0 * U_i[jDim + 1] / rho * U_i[iDim + 1] / rho; } } - preconditioner[nVar-1][0] = 0.5*sq_vel*enthalpy; - preconditioner[nVar-1][nVar-1] = enthalpy; - for (iDim = 0; iDim < nDim; iDim ++) - preconditioner[nVar-1][1+iDim] = -1.0*U_i[iDim+1]/rho*enthalpy; - + preconditioner[nVar - 1][0] = (0.5 * sq_vel - tke) * enthalpy; + preconditioner[nVar - 1][nVar - 1] = enthalpy; + for (iDim = 0; iDim < nDim; iDim++) preconditioner[nVar - 1][1 + iDim] = -1.0 * U_i[iDim + 1] / rho * enthalpy; for (iVar = 0; iVar < nVar; iVar ++ ) { for (jVar = 0; jVar < nVar; jVar ++ ) { diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 2a3ab7ac3c2a..d53d7cd17fad 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -971,7 +971,7 @@ su2double CNEMOEulerSolver::ComputeUnderRelaxationFactor(unsigned short nSpecies return localUnderRelaxation; } -void CNEMOEulerSolver::ComputeUnderRelaxationFactor(const CConfig *config) { +void CNEMOEulerSolver::ComputeUnderRelaxationFactor(const CConfig* config, CSolver**) { SU2_ZONE_SCOPED const su2double allowableRatio = config->GetMaxUpdateFractionFlow(); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 19f07df2e598..76c5c45f779f 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -215,11 +215,11 @@ void CSolver::GetPeriodicCommCountAndType(const CConfig* config, break; case PERIODIC_IMPLICIT: COUNT_PER_POINT = nVar; - MPI_TYPE = COMM_TYPE::DOUBLE; + MPI_TYPE = COMM_TYPE::DOUBLE; break; case PERIODIC_LAPLACIAN: - COUNT_PER_POINT = nVar; - MPI_TYPE = COMM_TYPE::DOUBLE; + COUNT_PER_POINT = base_nodes->GetUndivided_Laplacian().cols(); + MPI_TYPE = COMM_TYPE::DOUBLE; break; case PERIODIC_MAX_EIG: COUNT_PER_POINT = 1; @@ -395,11 +395,11 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, unsigned long iPoint, msg_offset, buf_offset, iPeriodic; - auto *Diff = new su2double[nVar]; - auto *Und_Lapl = new su2double[nVar]; - auto *Sol_Min = new su2double[std::max(nVar, nPrimVarGrad)]; - auto *Sol_Max = new su2double[std::max(nVar, nPrimVarGrad)]; - auto *rotPrim_i = new su2double[std::max(nVar, nPrimVar)]; + auto* Diff = new su2double[nVar + 1]; + auto* Und_Lapl = new su2double[nVar + 1]; + auto* Sol_Min = new su2double[std::max(nVar, nPrimVarGrad)]; + auto* Sol_Max = new su2double[std::max(nVar, nPrimVarGrad)]; + auto* rotPrim_i = new su2double[std::max(nVar, nPrimVar)]; auto *rotPrim_j = new su2double[std::max(nVar, nPrimVar)]; su2double Sensor_i = 0.0, Sensor_j = 0.0, Pressure_i, Pressure_j; @@ -687,11 +687,9 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, consistently by using the complete control volume info from both sides of the periodic face. ---*/ - for (iVar = 0; iVar < nVar; iVar++) - Und_Lapl[iVar] = 0.0; + for (iVar = 0; iVar < COUNT_PER_POINT; iVar++) Und_Lapl[iVar] = 0.0; for (auto jPoint : geometry->nodes->GetPoints(iPoint)) { - /*--- Avoid periodic boundary points so that we do not duplicate edges on both sides of the periodic BC. ---*/ @@ -708,10 +706,12 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, if (!(config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE)) { Pressure_i = base_nodes->GetPressure(iPoint); Pressure_j = base_nodes->GetPressure(jPoint); - Diff[nVar-1] = ((base_nodes->GetSolution(iPoint,nVar-1) + Pressure_i) - - (base_nodes->GetSolution(jPoint,nVar-1) + Pressure_j)); + Diff[nVar - 1] = ((base_nodes->GetSolution(iPoint, nVar - 1) + Pressure_i) - + (base_nodes->GetSolution(jPoint, nVar - 1) + Pressure_j)); } + if (COUNT_PER_POINT > nVar) Diff[nVar] = base_nodes->GetRhoTke(iPoint) - base_nodes->GetRhoTke(jPoint); + boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); @@ -719,9 +719,8 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- iPoint inside the domain, jPoint on the boundary ---*/ if (!boundary_i || boundary_j) { - if (geometry->nodes->GetDomain(iPoint)){ - for (iVar = 0; iVar< nVar; iVar++) - Und_Lapl[iVar] -= Diff[iVar]; + if (geometry->nodes->GetDomain(iPoint)) { + for (iVar = 0; iVar < COUNT_PER_POINT; iVar++) Und_Lapl[iVar] -= Diff[iVar]; } } } @@ -729,8 +728,7 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- Store the components to be communicated in the buffer. ---*/ - for (iVar = 0; iVar < nVar; iVar++) - bufDSend[buf_offset+iVar] = Und_Lapl[iVar]; + for (iVar = 0; iVar < COUNT_PER_POINT; iVar++) bufDSend[buf_offset + iVar] = Und_Lapl[iVar]; /*--- Rotate the momentum components of the Laplacian. ---*/ @@ -1314,8 +1312,8 @@ void CSolver::CompletePeriodicComms(CGeometry *geometry, /*--- Adjust the undivided Laplacian. The accumulation was with a subtraction before communicating, so now just add. ---*/ - for (iVar = 0; iVar < nVar; iVar++) - base_nodes->AddUnd_Lapl(iPoint, iVar, bufDRecv[buf_offset+iVar]); + for (iVar = 0; iVar < COUNT_PER_POINT; iVar++) + base_nodes->AddUnd_Lapl(iPoint, iVar, bufDRecv[buf_offset + iVar]); break; @@ -1465,14 +1463,17 @@ void CSolver::GetCommCountAndType(const CConfig* config, switch (commType) { case MPI_QUANTITIES::SOLUTION: case MPI_QUANTITIES::SOLUTION_OLD: - case MPI_QUANTITIES::UNDIVIDED_LAPLACIAN: case MPI_QUANTITIES::SOLUTION_LIMITER: - COUNT_PER_POINT = nVar; - MPI_TYPE = COMM_TYPE::DOUBLE; + COUNT_PER_POINT = nVar; + MPI_TYPE = COMM_TYPE::DOUBLE; + break; + case MPI_QUANTITIES::UNDIVIDED_LAPLACIAN: + COUNT_PER_POINT = base_nodes->GetUndivided_Laplacian().cols(); + MPI_TYPE = COMM_TYPE::DOUBLE; break; case MPI_QUANTITIES::MAX_EIGENVALUE: case MPI_QUANTITIES::SENSOR: - COUNT_PER_POINT = 1; + COUNT_PER_POINT = 1; MPI_TYPE = COMM_TYPE::DOUBLE; break; case MPI_QUANTITIES::SOLUTION_GRADIENT: @@ -1649,8 +1650,8 @@ void CSolver::InitiateComms(CGeometry *geometry, bufDSend[buf_offset] = base_nodes->GetDES_LengthScale(iPoint); break; case MPI_QUANTITIES::UNDIVIDED_LAPLACIAN: - for (iVar = 0; iVar < nVar; iVar++) - bufDSend[buf_offset+iVar] = base_nodes->GetUndivided_Laplacian(iPoint, iVar); + for (iVar = 0; iVar < COUNT_PER_POINT; iVar++) + bufDSend[buf_offset + iVar] = base_nodes->GetUndivided_Laplacian(iPoint, iVar); break; case MPI_QUANTITIES::SOLUTION_LIMITER: case MPI_QUANTITIES::PRIMITIVE_LIMITER: @@ -1816,8 +1817,8 @@ void CSolver::CompleteComms(CGeometry *geometry, base_nodes->SetDES_LengthScale(iPoint, bufDRecv[buf_offset]); break; case MPI_QUANTITIES::UNDIVIDED_LAPLACIAN: - for (iVar = 0; iVar < nVar; iVar++) - base_nodes->SetUnd_Lapl(iPoint, iVar, bufDRecv[buf_offset+iVar]); + for (iVar = 0; iVar < COUNT_PER_POINT; iVar++) + base_nodes->SetUnd_Lapl(iPoint, iVar, bufDRecv[buf_offset + iVar]); break; case MPI_QUANTITIES::SOLUTION_LIMITER: case MPI_QUANTITIES::PRIMITIVE_LIMITER: diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index 7bc13eb675c0..71e929c10618 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -50,16 +50,20 @@ unsigned long EulerNSecVar(const CConfig *config) { return config->GetViscous() ? 8 : 2; } -CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2double energy, unsigned long npoint, - unsigned long ndim, unsigned long nvar, const CConfig *config) - : CFlowVariable(npoint, ndim, nvar, ndim + 9, EulerNPrimVarGrad(config, ndim), config), - indices(ndim, 0) { - +CEulerVariable::CEulerVariable(su2double density, const su2double* velocity, su2double energy, unsigned long npoint, + unsigned long ndim, unsigned long nvar, const CConfig* config) + : CFlowVariable(npoint, ndim, nvar, ndim + 9, EulerNPrimVarGrad(config, ndim), config), + Gamma(config->GetGamma()), + indices(ndim, 0) { const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool classical_rk4 = (config->GetKind_TimeIntScheme_Flow() == CLASSICAL_RK4_EXPLICIT); nSecondaryVar = EulerNSecVar(config); + // Carry rho*k separately through the matrix JST projection and periodic/MPI exchange. + if (Undivided_Laplacian.size() && config->GetKind_Turb_Model() == TURB_MODEL::SST && + config->GetKind_Centered_Flow() == CENTERED::JST_MAT) + Undivided_Laplacian.resize(nPoint, nVar + 1); /*--- Solution initialization ---*/ diff --git a/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp b/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp index c33e4ae38735..928afd9062c2 100644 --- a/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/roe_tke_tests.cpp @@ -25,14 +25,16 @@ */ #include "catch.hpp" +#include "../../../SU2_CFD/include/numerics_simd/flow/convection/common.hpp" #include #include #include #include "../../../SU2_CFD/include/numerics/flow/convection/roe.hpp" +#include "../../../SU2_CFD/include/numerics/flow/convection/fvs.hpp" namespace { -constexpr su2double gamma = 1.4; +constexpr su2double gammaSST = 1.4; std::unique_ptr MakeConfig(bool implicit = true) { std::stringstream options; @@ -51,14 +53,14 @@ void Primitives(unsigned short nDim, su2double rho, const su2double* vel, su2dou V[0] = p / (rho * 287.058); V[nDim + 1] = p; V[nDim + 2] = rho; - V[nDim + 3] = gamma / (gamma - 1) * p / rho + 0.5 * q2 + k; - V[nDim + 4] = sqrt(gamma * p / rho); + V[nDim + 3] = gammaSST / (gammaSST - 1) * p / rho + 0.5 * q2 + k; + V[nDim + 4] = sqrt(gammaSST * p / rho); } /*--- Secondary variables (dp/drho_e, dp/de_rho) of the ideal gas, for the general-gas schemes. ---*/ void Secondary(su2double rho, su2double p, su2double* S) { S[0] = p / rho; - S[1] = (gamma - 1) * rho; + S[1] = (gammaSST - 1) * rho; } /*--- Common constructor for the schemes of the family. ---*/ @@ -174,3 +176,50 @@ TEST_CASE("Roe does not dissipate a stationary contact with k in the total energ CHECK(res.residual[2] == Approx(p * normal[1]).epsilon(1e-12)); CHECK(res.residual[3] == Approx(0.0).margin(1e-12)); } + +TEST_CASE("Turkel preserves contacts with SST energy", "[Roe][SST][Turkel]") { + CheckContactsWithTkeJump("Turkel", true, false); +} + +TEST_CASE("Scalar MSW advects a pure k jump without acoustic flux", "[MSW][SST]") { + auto config = MakeConfig(); + for (const unsigned short dim : {2, 3}) { + for (const su2double speed : {-0.2, 0.0, 0.2}) { + CUpwMSW_Flow numerics(dim, dim + 2, config.get()); + su2double Vi[10] = {}, Vj[10] = {}, vel[3] = {speed, 0.0, 0.0}, normal[3] = {1.0, 0.0, 0.0}; + const su2double rho = 1.4, p = 1.0, ki = 0.1, kj = 3.0; + Primitives(dim, rho, vel, p, ki, Vi); + Primitives(dim, rho, vel, p, kj, Vj); + numerics.SetPrimitive(Vi, Vj); + numerics.SetTurbKineticEnergy(ki, kj); + numerics.SetSensor(0.0, 0.0); + numerics.SetNormal(normal); + const auto res = numerics.ComputeResidual(config.get()); + CAPTURE(dim, speed); + CHECK(res[0] == Approx(rho * speed).margin(1e-12)); + CHECK(res[1] == Approx(rho * speed * speed + p).margin(1e-12)); + for (unsigned short d = 1; d < dim; ++d) CHECK(res[d + 1] == Approx(0.0).margin(1e-12)); + const su2double h = gammaSST / (gammaSST - 1) * p / rho + 0.5 * speed * speed + (speed > 0 ? ki : kj); + CHECK(res[dim + 1] == Approx(rho * speed * h).margin(1e-12)); + } + } +} + +TEST_CASE("JST enthalpy dissipation Jacobian holds k fixed", "[JST][SST]") { + CCompressiblePrimitives<2, 6> V; + V.all = Double(0.0); + V.velocity(0) = 0.4; + V.velocity(1) = -0.3; + V.pressure() = 1.0; + V.density() = 1.4; + for (const su2double k : {0.0, 0.3, 10.0}) { + V.enthalpy() = gammaSST / (gammaSST - 1) / 1.4 + 0.125 + k; + MatrixDbl<4> jac; + jac = Double(0.0); + scalarDissipationJacobian(V, Double(gammaSST), Double(1.0), jac, Double(k)); + // Finite difference of rho*H = gammaSST*rhoE - (gammaSST-1)*(|rho*u|^2/(2*rho)+rho*k). + const auto rhoH = [&](su2double rho) { return gammaSST * 7.0 - (gammaSST - 1) * (0.245 / rho + rho * k); }; + const su2double fd = (rhoH(1.4 + 1e-5) - rhoH(1.4 - 1e-5)) / 2e-5; + for (size_t lane = 0; lane < Double::Size; ++lane) CHECK(jac(3, 0)[lane] == Approx(fd).margin(1e-9)); + } +} diff --git a/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp b/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp new file mode 100644 index 000000000000..e8a5556b5092 --- /dev/null +++ b/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp @@ -0,0 +1,103 @@ +/*! + * \file sst_energy_tests.cpp + * \brief SST thermal-energy relaxation and matrix dissipation regressions. + * \version 8.5.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "catch.hpp" +#include "../../UnitQuadTestCase.hpp" + +TEST_CASE("SST relaxation limits thermal energy when k dominates", "[SST][UnderRelaxation]") { + UnitQuadTestCase test; + test.config_options = + "SOLVER= RANS\nMACH_NUMBER= 0.5\nREYNOLDS_NUMBER= 1e6\nKIND_TURB_MODEL= SST\nMESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" + "MARKER_HEATFLUX= (x_minus,0,x_plus,0,y_minus,0,y_plus,0)\n" + "TIME_DISCRE_FLOW= EULER_IMPLICIT\nMAX_UPDATE_FLOW= 0.2\n"; + std::stringstream options(test.config_options); + test.config = std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); + test.InitGeometry(); + test.solver = CSolverFactory::CreateSolverContainer(test.config->GetKind_Solver(), test.config.get(), + test.geometry.get(), 0); + auto* flow = static_cast(test.solver[FLOW_SOL]); + auto* nodes = flow->GetNodes(); + auto* turb = test.solver[TURB_SOL]->GetNodes(); + for (auto p = 0ul; p < test.geometry->GetnPoint(); ++p) { + nodes->SetSolution(p, 0, 2.0); + nodes->SetSolution(p, 1, 0.0); + nodes->SetSolution(p, 2, 0.0); + nodes->SetSolution(p, 3, 201.0); + turb->SetSolution(p, 0, 100.0); + for (auto v = 0u; v < 4; ++v) flow->LinSysSol(p, v) = 0.0; + flow->LinSysSol(p, 3) = -10.0; + } + flow->ComputeUnderRelaxationFactor(test.config.get(), test.solver); + CHECK(nodes->GetUnderRelaxation(0) == Approx(0.02)); + CHECK(201.0 - 10.0 * nodes->GetUnderRelaxation(0) - 200.0 > 0.0); + delete test.solver[TURB_SOL]; +} + +#include "../../../SU2_CFD/include/variables/CNSVariable.hpp" +#include "../../../SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp" +#include "../../../SU2_CFD/include/numerics_simd/flow/convection/centered.hpp" + +TEST_CASE("JST matrix fourth-order k dissipation does not create pressure waves", "[SST][JST]") { + UnitQuadTestCase test; + test.config_options = + "SOLVER= RANS\nMACH_NUMBER= 0.5\nREYNOLDS_NUMBER= 1e6\nKIND_TURB_MODEL= SST\nMESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" + "MARKER_HEATFLUX= (x_minus,0,x_plus,0,y_minus,0,y_plus,0)\n" + "CONV_NUM_METHOD_FLOW= JST_MAT\nENTROPY_FIX_COEFF= 0\n"; + std::stringstream options(test.config_options); + test.config = std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); + test.InitGeometry(); + test.solver = CSolverFactory::CreateSolverContainer(test.config->GetKind_Solver(), test.config.get(), + test.geometry.get(), 0); + auto* flow = static_cast(test.solver[FLOW_SOL]); + auto& nodes = *static_cast(flow->GetNodes()); + const CVariable* turb = test.solver[TURB_SOL]->GetNodes(); + for (auto p = 0ul; p < test.geometry->GetnPoint(); ++p) { + nodes.SetSensor(p, 0.0); + for (auto v = 0u; v < 5; ++v) nodes.SetUnd_Lapl(p, v, 0.0); + } + nodes.SetUnd_Lapl(0, 3, 2.0); + nodes.SetUnd_Lapl(0, 4, 2.0); // the energy Laplacian comes entirely from rho*k + CJSTmatScheme> scheme(*test.config, turb); + CPair> V; + V.i.all = Double(0.0); + V.i.density() = 1.0; + V.i.pressure() = 1.0; + V.i.speedSound() = sqrt(1.4); + V.i.enthalpy() = 3.5; + V.j = V.i; + VectorDbl<4> flux, diff; + flux = Double(0.0); + diff = Double(0.0); + VectorDbl<2> normal; + normal(0) = 1.0; + normal(1) = 0.0; + MatrixDbl<4> ji, jj; + scheme.finalizeFlux(flux, ji, jj, false, Double(1.0), Double(0.0), V.i, V, diff, Int(0ul), Int(1ul), *test.geometry, + nodes, normal); + for (size_t lane = 0; lane < Double::Size; ++lane) + for (size_t v = 0; v < 4; ++v) CHECK(flux(v)[lane] == Approx(0.0).margin(1e-12)); + delete test.solver[TURB_SOL]; +} diff --git a/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp b/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp index 431bee249cdc..fcad6cb1e551 100644 --- a/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp +++ b/UnitTests/SU2_CFD/solvers/under_relaxation_ad_tests.cpp @@ -57,7 +57,7 @@ TEST_CASE("Compressible under-relaxation owns its AD density values", "[UnderRel solver->LinSysSol(0, 0) = densityLimited ? 0.1 : 0.0; solver->LinSysSol(0, 1) = densityLimited ? 0.2 : 0.0; solver->LinSysSol(0, 3) = densityLimited ? 0.4 : 4.0; - solver->ComputeUnderRelaxationFactor(test.config.get()); + solver->ComputeUnderRelaxationFactor(test.config.get(), test.solver); su2double factor = nodes->GetUnderRelaxation(0); #ifdef CODI_REVERSE_TYPE AD::RegisterOutput(factor); diff --git a/UnitTests/meson.build b/UnitTests/meson.build index d0b43aa71423..3b3dfd6d3ec5 100644 --- a/UnitTests/meson.build +++ b/UnitTests/meson.build @@ -28,6 +28,7 @@ su2_cfd_tests = files(['Common/CConfig_tests.cpp', 'SU2_CFD/scalar_muscl.cpp', 'SU2_CFD/solvers/CNEMOEulerSolver_tests.cpp', 'SU2_CFD/solvers/moving_wall_tests.cpp', + 'SU2_CFD/solvers/sst_energy_tests.cpp', 'SU2_CFD/nemo_viscous_assembly.cpp', 'SU2_CFD/windowing.cpp', 'Common/toolboxes/random_toolbox_tests.cpp', From ee92156f825cd664041f53b9ff39113bcf07f775 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Sat, 7 Nov 2026 14:32:47 +0100 Subject: [PATCH 39/43] Forward solver container through implicit Euler completion The SST thermal-energy relaxation reads the turbulence solver. The ordinary implicit-Euler wrapper still passed nullptr to completion, causing the cluster CFD runs to crash. Forward the supplied container through preparation and completion, and test the actual implicit iteration with k-dominated total energy. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 6 +++--- UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 02a520cb5408..d9668ec1ba65 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -615,10 +615,10 @@ void CFVMFlowSolverBase::CompleteImplicitIteration(CGeometry *geometry, CS } template -void CFVMFlowSolverBase::ImplicitEuler_Iteration(CGeometry *geometry, CSolver**, CConfig *config) { +void CFVMFlowSolverBase::ImplicitEuler_Iteration(CGeometry *geometry, CSolver** solver_container, CConfig *config) { SU2_ZONE_SCOPED - PrepareImplicitIteration(geometry, nullptr, config); + PrepareImplicitIteration(geometry, solver_container, config); /*--- Solve or smooth the linear system. ---*/ @@ -637,7 +637,7 @@ void CFVMFlowSolverBase::ImplicitEuler_Iteration(CGeometry *geometry, CSol } END_SU2_OMP_SAFE_GLOBAL_ACCESS - CompleteImplicitIteration(geometry, nullptr, config); + CompleteImplicitIteration(geometry, solver_container, config); } template diff --git a/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp b/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp index e8a5556b5092..fbf7ee3b2786 100644 --- a/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp +++ b/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp @@ -53,6 +53,18 @@ TEST_CASE("SST relaxation limits thermal energy when k dominates", "[SST][UnderR flow->ComputeUnderRelaxationFactor(test.config.get(), test.solver); CHECK(nodes->GetUnderRelaxation(0) == Approx(0.02)); CHECK(201.0 - 10.0 * nodes->GetUnderRelaxation(0) - 200.0 > 0.0); + // Exercise the production implicit-Euler caller, not only the relaxation helper. + nodes->Set_OldSolution(); + flow->Jacobian.SetValZero(); + for (auto p = 0ul; p < test.geometry->GetnPoint(); ++p) { + nodes->SetDelta_Time(p, test.geometry->nodes->GetVolume(p)); + nodes->SetRes_TruncErrorZero(p); + for (auto v = 0u; v < 4; ++v) flow->LinSysRes(p, v) = 0.0; + flow->LinSysRes(p, 3) = 10.0; + } + flow->ImplicitEuler_Iteration(test.geometry.get(), test.solver, test.config.get()); + CHECK(nodes->GetUnderRelaxation(0) == Approx(0.02)); + CHECK(nodes->GetSolution(0, 3) == Approx(200.8)); delete test.solver[TURB_SOL]; } From 1127f91e057b206d354aabcd5304a2442fd12278 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 16 Nov 2026 14:42:37 +0100 Subject: [PATCH 40/43] Fix the AD build of the preconditioner k term and format the SST energy tests --- SU2_CFD/src/solvers/CEulerSolver.cpp | 3 ++- UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 03ca0382da21..978d74a2dfcf 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2766,7 +2766,8 @@ void CEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint soundspeed = nodes->GetSoundSpeed(iPoint); sq_vel = nodes->GetVelocity2(iPoint); - const su2double tke = config->GetKind_Turb_Model() == TURB_MODEL::SST ? nodes->GetRhoTke(iPoint) / rho : 0.0; + const su2double tke = + config->GetKind_Turb_Model() == TURB_MODEL::SST ? su2double(nodes->GetRhoTke(iPoint) / rho) : su2double(0.0); /*---Calculating the inverse of the preconditioning matrix that multiplies the time derivative */ preconditioner[0][0] = 0.5 * sq_vel - tke; diff --git a/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp b/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp index fbf7ee3b2786..809511e8036b 100644 --- a/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp +++ b/UnitTests/SU2_CFD/solvers/sst_energy_tests.cpp @@ -30,14 +30,15 @@ TEST_CASE("SST relaxation limits thermal energy when k dominates", "[SST][UnderRelaxation]") { UnitQuadTestCase test; test.config_options = - "SOLVER= RANS\nMACH_NUMBER= 0.5\nREYNOLDS_NUMBER= 1e6\nKIND_TURB_MODEL= SST\nMESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" + "SOLVER= RANS\nMACH_NUMBER= 0.5\nREYNOLDS_NUMBER= 1e6\nKIND_TURB_MODEL= SST\n" + "MESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" "MARKER_HEATFLUX= (x_minus,0,x_plus,0,y_minus,0,y_plus,0)\n" "TIME_DISCRE_FLOW= EULER_IMPLICIT\nMAX_UPDATE_FLOW= 0.2\n"; std::stringstream options(test.config_options); test.config = std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); test.InitGeometry(); - test.solver = CSolverFactory::CreateSolverContainer(test.config->GetKind_Solver(), test.config.get(), - test.geometry.get(), 0); + test.solver = + CSolverFactory::CreateSolverContainer(test.config->GetKind_Solver(), test.config.get(), test.geometry.get(), 0); auto* flow = static_cast(test.solver[FLOW_SOL]); auto* nodes = flow->GetNodes(); auto* turb = test.solver[TURB_SOL]->GetNodes(); @@ -75,14 +76,15 @@ TEST_CASE("SST relaxation limits thermal energy when k dominates", "[SST][UnderR TEST_CASE("JST matrix fourth-order k dissipation does not create pressure waves", "[SST][JST]") { UnitQuadTestCase test; test.config_options = - "SOLVER= RANS\nMACH_NUMBER= 0.5\nREYNOLDS_NUMBER= 1e6\nKIND_TURB_MODEL= SST\nMESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" + "SOLVER= RANS\nMACH_NUMBER= 0.5\nREYNOLDS_NUMBER= 1e6\nKIND_TURB_MODEL= SST\n" + "MESH_FORMAT= RECTANGLE\nMESH_BOX_SIZE= 5,5,5\n" "MARKER_HEATFLUX= (x_minus,0,x_plus,0,y_minus,0,y_plus,0)\n" "CONV_NUM_METHOD_FLOW= JST_MAT\nENTROPY_FIX_COEFF= 0\n"; std::stringstream options(test.config_options); test.config = std::make_unique(options, SU2_COMPONENT::SU2_CFD, false); test.InitGeometry(); - test.solver = CSolverFactory::CreateSolverContainer(test.config->GetKind_Solver(), test.config.get(), - test.geometry.get(), 0); + test.solver = + CSolverFactory::CreateSolverContainer(test.config->GetKind_Solver(), test.config.get(), test.geometry.get(), 0); auto* flow = static_cast(test.solver[FLOW_SOL]); auto& nodes = *static_cast(flow->GetNodes()); const CVariable* turb = test.solver[TURB_SOL]->GetNodes(); From 9c2b5b09ce7d59dbbbdf1879b6a332b7f9a4796c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 16 Nov 2026 14:44:59 +0100 Subject: [PATCH 41/43] Update the axisymmetric RANS reference values from the CI --- TestCases/hybrid_regression.py | 2 +- TestCases/parallel_regression.py | 2 +- TestCases/parallel_regression_AD.py | 2 +- TestCases/serial_regression.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 315607d42344..4edd502a1afe 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -265,7 +265,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.069624, 0.505288, -2.816368, 1.728267, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.069700, 0.505207, -2.812109, 1.730245, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.140441, -9.154674, -10.886121, -5.806594, 0.000000] test_list.append(axi_rans_air_nozzle_restart) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 71325c8fa5e4..27e33d84ba0a 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -719,7 +719,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.130654, 0.443770, -2.934019, 1.603840, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.130750, 0.443668, -2.927522, 1.604842, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143310, -9.163287, -10.858232, -5.787715, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index fd7c7a62efef..879d3e7463ab 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.738854, 5.135195, 7.108430, 2.487299] + discadj_axisymmetric_rans_nozzle.test_vals = [9.738855, 5.135194, 7.107157, 2.487121] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 8f09e193d4d8..66c42bc6ef65 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -383,7 +383,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-5.121517, 0.452804, -2.910659, 1.662143, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-5.121608, 0.452705, -2.905427, 1.662997, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143715, -9.170705, -10.848554, -5.776746, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -393,7 +393,7 @@ def main(): axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_species.cfg_file = "air_nozzle_species.cfg" axi_rans_air_nozzle_species.test_iter = 10 - axi_rans_air_nozzle_species.test_vals = [-2.148980, 3.342062, -1.939182, 5.883411, -2.443141, 0.000000] + axi_rans_air_nozzle_species.test_vals = [-2.148886, 3.342139, -1.929466, 5.883406, -2.443125, 0.000000] axi_rans_air_nozzle_species.tol = 0.0001 test_list.append(axi_rans_air_nozzle_species) From 27ac2a90df837345282d520dfcae992c7d0ae218 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 17 Nov 2026 17:06:19 +0100 Subject: [PATCH 42/43] Update moving-frame reference files for the compressible slip-wall projection The new projection makes a translating frame match the still airfoil (Galilean invariance), so the stored forces and FSI adjoint gradient change. Co-Authored-By: Claude Opus 5.5 --- .../disc_adj_fsi/dyn_fsi/grad_dv.opt.ref | 16 +- .../translating_NACA0012/forces_0.csv.ref | 400 +++++++++--------- .../forces_0.csv.ref | 400 +++++++++--------- 3 files changed, 408 insertions(+), 408 deletions(-) diff --git a/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref b/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref index 1f0241b9e2fa..87ba683b8149 100644 --- a/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref +++ b/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref @@ -1,9 +1,9 @@ INDEX GRAD -0 -2.998512907701271e-03 -1 -1.584866997023666e-03 -2 -6.647075933794050e-04 -3 -2.112197065714601e-04 -4 -2.145348429280959e-04 -5 -6.735292498556252e-04 -6 -1.595607953604883e-03 -7 -3.004453684429480e-03 +0 -4.588838559391948e-04 +1 -2.411684253396962e-04 +2 -9.185692562532188e-05 +3 -1.653284043205054e-05 +4 -1.765443853566316e-05 +5 -9.511026937287119e-05 +6 -2.462259547955249e-04 +7 -4.652824150064567e-04 diff --git a/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref b/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref index 0c9091d233ae..d6ec7617edf2 100644 --- a/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref +++ b/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref @@ -1,200 +1,200 @@ -199, -0.94, -0.00, 0.00 -0, -2.79, 19.21, 0.00 -1, -4.07, 28.05, 0.00 -2, -5.12, 35.35, 0.00 -3, -6.07, 41.99, 0.00 -4, -6.89, 47.80, 0.00 -5, -7.57, 52.73, 0.00 -6, -8.16, 57.03, 0.00 -7, -8.63, 60.64, 0.00 -8, -8.99, 63.49, 0.00 -9, -9.25, 65.69, 0.00 -10, -9.40, 67.22, 0.00 -11, -9.47, 68.21, 0.00 -12, -9.44, 68.52, 0.00 -13, -9.32, 68.22, 0.00 -14, -9.13, 67.36, 0.00 -15, -8.84, 65.83, 0.00 -16, -8.50, 63.93, 0.00 -17, -8.06, 61.28, 0.00 -18, -7.60, 58.37, 0.00 -19, -7.04, 54.67, 0.00 -20, -6.48, 50.91, 0.00 -21, -5.83, 46.37, 0.00 -22, -5.21, 41.95, 0.00 -23, -4.50, 36.73, 0.00 -24, -3.85, 31.89, 0.00 -25, -3.13, 26.30, 0.00 -26, -2.48, 21.12, 0.00 -27, -1.81, 15.63, 0.00 -28, -1.16, 10.19, 0.00 -29, -0.56, 5.01, 0.00 -30, -0.01, 0.07, 0.00 -31, 0.30, -2.76, 0.00 -32, 0.83, -7.82, 0.00 -33, 0.85, -8.14, 0.00 -34, 1.47, -14.33, 0.00 -35, 1.50, -14.91, 0.00 -36, 2.34, -23.79, 0.00 -37, 2.58, -26.78, 0.00 -38, 3.60, -38.33, 0.00 -39, 4.15, -45.32, 0.00 -40, 5.35, -59.93, 0.00 -41, 6.34, -73.02, 0.00 -42, 7.53, -89.47, 0.00 -43, 8.62, -105.75, 0.00 -44, 9.52, -120.93, 0.00 -45, 10.46, -137.99, 0.00 -46, 10.89, -149.59, 0.00 -47, 11.06, -158.86, 0.00 -48, 10.91, -164.51, 0.00 -49, 10.20, -162.29, 0.00 -50, 10.41, -175.95, 0.00 -51, 10.69, -193.01, 0.00 -52, 11.35, -220.88, 0.00 -53, 12.09, -256.22, 0.00 -54, 11.70, -273.60, 0.00 -55, 11.18, -293.17, 0.00 -56, 9.73, -292.14, 0.00 -57, 8.95, -317.19, 0.00 -58, 8.19, -357.93, 0.00 -59, 7.34, -424.98, 0.00 -60, 5.17, -454.05, 0.00 -61, 2.26, -432.87, 0.00 -62, -0.52, -418.79, 0.00 -63, -3.27, -407.56, 0.00 -64, -5.99, -395.49, 0.00 -65, -8.62, -381.54, 0.00 -66, -11.16, -366.54, 0.00 -67, -13.55, -350.35, 0.00 -68, -15.82, -334.23, 0.00 -69, -17.87, -316.57, 0.00 -70, -19.66, -297.72, 0.00 -71, -21.14, -277.56, 0.00 -72, -22.40, -258.00, 0.00 -73, -23.24, -236.77, 0.00 -74, -23.93, -217.26, 0.00 -75, -23.95, -194.85, 0.00 -76, -23.92, -175.24, 0.00 -77, -23.06, -152.62, 0.00 -78, -22.31, -133.79, 0.00 -79, -20.38, -110.93, 0.00 -80, -18.51, -91.56, 0.00 -81, -14.90, -67.05, 0.00 -82, -11.41, -46.70, 0.00 -83, -4.97, -18.48, 0.00 -84, -0.30, -1.01, 0.00 -85, 9.93, 30.30, 0.00 -86, 16.77, 46.17, 0.00 -87, 32.33, 79.93, 0.00 -88, 43.53, 96.08, 0.00 -89, 60.42, 118.16, 0.00 -90, 71.17, 122.11, 0.00 -91, 98.75, 146.81, 0.00 -92, 112.94, 143.03, 0.00 -93, 162.93, 171.80, 0.00 -94, 168.48, 143.12, 0.00 -95, 162.93, 106.12, 0.00 -96, 161.49, 74.02, 0.00 -97, 226.14, 61.20, 0.00 -98, 173.55, 23.29, 0.00 -99, 81.85, -0.00, 0.00 -100, 101.93, -13.68, 0.00 -101, 111.85, -30.27, 0.00 -102, 83.84, -38.43, 0.00 -103, 59.18, -38.55, 0.00 -104, 39.46, -33.52, 0.00 -105, 20.52, -21.64, 0.00 -106, 9.26, -11.73, 0.00 -107, -5.26, 7.82, 0.00 -108, -14.72, 25.25, 0.00 -109, -24.47, 47.86, 0.00 -110, -30.46, 67.22, 0.00 -111, -36.98, 91.44, 0.00 -112, -40.61, 111.80, 0.00 -113, -44.24, 135.04, 0.00 -114, -47.23, 159.29, 0.00 -115, -50.25, 186.80, 0.00 -116, -52.01, 212.78, 0.00 -117, -49.79, 224.02, 0.00 -118, -49.93, 247.03, 0.00 -119, -50.10, 272.69, 0.00 -120, -49.50, 296.79, 0.00 -121, -48.43, 320.54, 0.00 -122, -46.68, 341.98, 0.00 -123, -45.16, 367.44, 0.00 -124, -43.12, 391.55, 0.00 -125, -41.04, 418.22, 0.00 -126, -38.38, 441.96, 0.00 -127, -35.65, 468.10, 0.00 -128, -32.39, 490.58, 0.00 -129, -29.12, 515.86, 0.00 -130, -25.43, 537.19, 0.00 -131, -21.72, 561.44, 0.00 -132, -17.69, 581.14, 0.00 -133, -13.62, 602.77, 0.00 -134, -9.39, 620.72, 0.00 -135, -5.13, 639.76, 0.00 -136, -0.81, 656.52, 0.00 -137, 3.52, 673.60, 0.00 -138, 7.84, 688.01, 0.00 -139, 12.15, 703.61, 0.00 -140, 16.38, 716.38, 0.00 -141, 20.56, 728.93, 0.00 -142, 24.62, 739.26, 0.00 -143, 28.61, 749.93, 0.00 -144, 32.43, 758.20, 0.00 -145, 36.13, 765.81, 0.00 -146, 39.66, 772.00, 0.00 -147, 43.08, 777.93, 0.00 -148, 46.29, 782.12, 0.00 -149, 49.44, 786.83, 0.00 -150, 52.29, 788.58, 0.00 -151, 54.86, 787.96, 0.00 -152, 57.31, 787.22, 0.00 -153, 59.58, 785.72, 0.00 -154, 62.23, 790.29, 0.00 -155, 62.41, 765.50, 0.00 -156, 64.45, 765.33, 0.00 -157, 54.69, 630.25, 0.00 -158, 48.23, 540.32, 0.00 -159, -12.34, -134.66, 0.00 -160, -29.22, -310.97, 0.00 -161, -7.18, -74.61, 0.00 -162, -3.54, -35.94, 0.00 -163, -3.39, -33.73, 0.00 -164, -3.11, -30.30, 0.00 -165, -2.96, -28.33, 0.00 -166, -2.85, -26.76, 0.00 -167, -2.79, -25.71, 0.00 -168, -2.88, -26.13, 0.00 -169, -3.27, -29.13, 0.00 -170, -3.57, -31.34, 0.00 -171, -3.86, -33.32, 0.00 -172, -4.21, -35.80, 0.00 -173, -4.70, -39.42, 0.00 -174, -5.09, -42.12, 0.00 -175, -5.57, -45.47, 0.00 -176, -6.00, -48.33, 0.00 -177, -6.47, -51.51, 0.00 -178, -6.92, -54.40, 0.00 -179, -7.37, -57.26, 0.00 -180, -7.77, -59.72, 0.00 -181, -8.16, -62.01, 0.00 -182, -8.49, -63.90, 0.00 -183, -8.78, -65.39, 0.00 -184, -9.01, -66.52, 0.00 -185, -9.18, -67.19, 0.00 -186, -9.30, -67.46, 0.00 -187, -9.30, -67.00, 0.00 -188, -9.21, -65.84, 0.00 -189, -9.06, -64.37, 0.00 -190, -8.81, -62.23, 0.00 -191, -8.46, -59.42, 0.00 -192, -8.00, -55.90, 0.00 -193, -7.42, -51.65, 0.00 -194, -6.74, -46.78, 0.00 -195, -5.94, -41.07, 0.00 -196, -5.00, -34.54, 0.00 -197, -3.98, -27.42, 0.00 -198, -2.72, -18.72, 0.00 +199, -1.17, -0.00, 0.00 +0, -2.95, 20.29, 0.00 +1, -4.18, 28.84, 0.00 +2, -5.23, 36.10, 0.00 +3, -6.15, 42.53, 0.00 +4, -6.93, 48.08, 0.00 +5, -7.56, 52.66, 0.00 +6, -8.10, 56.60, 0.00 +7, -8.50, 59.71, 0.00 +8, -8.79, 62.08, 0.00 +9, -8.97, 63.72, 0.00 +10, -9.05, 64.69, 0.00 +11, -9.03, 65.05, 0.00 +12, -8.92, 64.73, 0.00 +13, -8.72, 63.82, 0.00 +14, -8.44, 62.29, 0.00 +15, -8.08, 60.19, 0.00 +16, -7.66, 57.63, 0.00 +17, -7.17, 54.52, 0.00 +18, -6.63, 50.92, 0.00 +19, -6.03, 46.87, 0.00 +20, -5.39, 42.34, 0.00 +21, -4.70, 37.42, 0.00 +22, -3.98, 32.07, 0.00 +23, -3.22, 26.31, 0.00 +24, -2.44, 20.21, 0.00 +25, -1.64, 13.74, 0.00 +26, -0.81, 6.92, 0.00 +27, 0.02, -0.21, 0.00 +28, 0.87, -7.67, 0.00 +29, 1.73, -15.42, 0.00 +30, 2.59, -23.45, 0.00 +31, 3.44, -31.75, 0.00 +32, 4.30, -40.35, 0.00 +33, 5.14, -49.19, 0.00 +34, 5.98, -58.26, 0.00 +35, 6.79, -67.59, 0.00 +36, 7.59, -77.17, 0.00 +37, 8.36, -86.92, 0.00 +38, 9.11, -96.91, 0.00 +39, 9.82, -107.11, 0.00 +40, 10.48, -117.46, 0.00 +41, 11.11, -127.97, 0.00 +42, 11.68, -138.70, 0.00 +43, 12.19, -149.57, 0.00 +44, 12.64, -160.59, 0.00 +45, 13.02, -171.67, 0.00 +46, 13.31, -182.81, 0.00 +47, 13.51, -194.00, 0.00 +48, 13.60, -205.19, 0.00 +49, 13.60, -216.39, 0.00 +50, 13.46, -227.38, 0.00 +51, 13.18, -237.98, 0.00 +52, 12.75, -248.20, 0.00 +53, 12.23, -259.17, 0.00 +54, 11.52, -269.25, 0.00 +55, 10.25, -268.75, 0.00 +56, 8.38, -251.63, 0.00 +57, 7.07, -250.64, 0.00 +58, 7.56, -330.47, 0.00 +59, 7.32, -423.80, 0.00 +60, 5.04, -442.56, 0.00 +61, 2.27, -433.32, 0.00 +62, -0.52, -423.85, 0.00 +63, -3.32, -414.18, 0.00 +64, -6.10, -403.22, 0.00 +65, -8.83, -390.82, 0.00 +66, -11.48, -377.12, 0.00 +67, -14.02, -362.49, 0.00 +68, -16.42, -346.83, 0.00 +69, -18.65, -330.39, 0.00 +70, -20.69, -313.30, 0.00 +71, -22.51, -295.58, 0.00 +72, -24.09, -277.38, 0.00 +73, -25.39, -258.74, 0.00 +74, -26.41, -239.83, 0.00 +75, -27.12, -220.65, 0.00 +76, -27.44, -201.00, 0.00 +77, -27.37, -181.18, 0.00 +78, -26.91, -161.37, 0.00 +79, -25.99, -141.45, 0.00 +80, -24.59, -121.63, 0.00 +81, -22.65, -101.90, 0.00 +82, -20.12, -82.33, 0.00 +83, -16.96, -63.03, 0.00 +84, -13.07, -44.08, 0.00 +85, -8.38, -25.59, 0.00 +86, -2.78, -7.65, 0.00 +87, 3.88, 9.59, 0.00 +88, 11.75, 25.94, 0.00 +89, 21.02, 41.10, 0.00 +90, 31.85, 54.64, 0.00 +91, 44.54, 66.22, 0.00 +92, 59.13, 74.88, 0.00 +93, 75.73, 79.85, 0.00 +94, 94.12, 79.95, 0.00 +95, 112.89, 73.53, 0.00 +96, 130.10, 59.63, 0.00 +97, 143.14, 38.74, 0.00 +98, 108.79, 14.60, 0.00 +99, 70.11, -0.00, 0.00 +100, 103.89, -13.94, 0.00 +101, 125.30, -33.91, 0.00 +102, 101.33, -46.45, 0.00 +103, 76.47, -49.81, 0.00 +104, 52.78, -44.83, 0.00 +105, 31.65, -33.37, 0.00 +106, 13.81, -17.49, 0.00 +107, -0.91, 1.35, 0.00 +108, -12.99, 22.28, 0.00 +109, -22.79, 44.57, 0.00 +110, -30.71, 67.77, 0.00 +111, -36.99, 91.47, 0.00 +112, -42.00, 115.63, 0.00 +113, -45.85, 139.97, 0.00 +114, -48.79, 164.55, 0.00 +115, -50.93, 189.35, 0.00 +116, -52.37, 214.25, 0.00 +117, -53.17, 239.25, 0.00 +118, -53.40, 264.16, 0.00 +119, -53.08, 288.91, 0.00 +120, -52.31, 313.64, 0.00 +121, -51.08, 338.04, 0.00 +122, -49.48, 362.46, 0.00 +123, -47.52, 386.68, 0.00 +124, -45.18, 410.24, 0.00 +125, -42.56, 433.63, 0.00 +126, -39.68, 456.92, 0.00 +127, -36.53, 479.69, 0.00 +128, -33.14, 501.84, 0.00 +129, -29.54, 523.29, 0.00 +130, -25.76, 544.22, 0.00 +131, -21.84, 564.63, 0.00 +132, -17.79, 584.27, 0.00 +133, -13.64, 603.37, 0.00 +134, -9.41, 621.47, 0.00 +135, -5.12, 638.73, 0.00 +136, -0.81, 655.59, 0.00 +137, 3.51, 671.32, 0.00 +138, 7.82, 685.90, 0.00 +139, 12.09, 699.98, 0.00 +140, 16.31, 713.08, 0.00 +141, 20.44, 724.72, 0.00 +142, 24.49, 735.59, 0.00 +143, 28.45, 745.67, 0.00 +144, 32.27, 754.47, 0.00 +145, 35.94, 761.95, 0.00 +146, 39.49, 768.62, 0.00 +147, 42.87, 774.27, 0.00 +148, 46.09, 778.66, 0.00 +149, 49.15, 782.31, 0.00 +150, 52.03, 784.73, 0.00 +151, 54.74, 786.18, 0.00 +152, 57.27, 786.69, 0.00 +153, 59.64, 786.42, 0.00 +154, 61.80, 784.85, 0.00 +155, 63.44, 778.18, 0.00 +156, 66.99, 795.52, 0.00 +157, 59.24, 682.66, 0.00 +158, 2.29, 25.63, 0.00 +159, -2.39, -26.12, 0.00 +160, 0.48, 5.10, 0.00 +161, 0.29, 2.98, 0.00 +162, 0.29, 2.94, 0.00 +163, 0.26, 2.60, 0.00 +164, 0.10, 0.99, 0.00 +165, -0.15, -1.43, 0.00 +166, -0.48, -4.49, 0.00 +167, -0.87, -8.02, 0.00 +168, -1.31, -11.91, 0.00 +169, -1.80, -16.06, 0.00 +170, -2.32, -20.39, 0.00 +171, -2.87, -24.79, 0.00 +172, -3.43, -29.21, 0.00 +173, -4.01, -33.63, 0.00 +174, -4.58, -37.92, 0.00 +175, -5.15, -42.07, 0.00 +176, -5.72, -46.09, 0.00 +177, -6.26, -49.84, 0.00 +178, -6.78, -53.32, 0.00 +179, -7.28, -56.54, 0.00 +180, -7.73, -59.39, 0.00 +181, -8.14, -61.90, 0.00 +182, -8.51, -64.01, 0.00 +183, -8.81, -65.66, 0.00 +184, -9.07, -66.93, 0.00 +185, -9.25, -67.69, 0.00 +186, -9.36, -67.91, 0.00 +187, -9.38, -67.59, 0.00 +188, -9.32, -66.65, 0.00 +189, -9.17, -65.15, 0.00 +190, -8.93, -63.04, 0.00 +191, -8.58, -60.25, 0.00 +192, -8.12, -56.77, 0.00 +193, -7.54, -52.51, 0.00 +194, -6.87, -47.65, 0.00 +195, -6.05, -41.87, 0.00 +196, -5.11, -35.27, 0.00 +197, -4.05, -27.89, 0.00 +198, -2.79, -19.21, 0.00 diff --git a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref index 5168d86660a2..8fd11a1b9b78 100644 --- a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref +++ b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref @@ -1,200 +1,200 @@ -199, -0.99, -0.00, 0.00 -0, -2.91, 20.03, 0.00 -1, -4.14, 28.50, 0.00 -2, -5.20, 35.86, 0.00 -3, -6.14, 42.47, 0.00 -4, -6.97, 48.37, 0.00 -5, -7.67, 53.42, 0.00 -6, -8.25, 57.65, 0.00 -7, -8.70, 61.14, 0.00 -8, -9.00, 63.59, 0.00 -9, -9.19, 65.26, 0.00 -10, -9.25, 66.17, 0.00 -11, -9.21, 66.36, 0.00 -12, -9.11, 66.11, 0.00 -13, -8.91, 65.21, 0.00 -14, -8.68, 64.05, 0.00 -15, -8.38, 62.39, 0.00 -16, -8.03, 60.38, 0.00 -17, -7.63, 58.02, 0.00 -18, -7.15, 54.94, 0.00 -19, -6.64, 51.57, 0.00 -20, -6.03, 47.40, 0.00 -21, -5.39, 42.89, 0.00 -22, -4.70, 37.86, 0.00 -23, -3.97, 32.41, 0.00 -24, -3.25, 26.89, 0.00 -25, -2.49, 20.93, 0.00 -26, -1.80, 15.28, 0.00 -27, -1.07, 9.26, 0.00 -28, -0.43, 3.74, 0.00 -29, 0.22, -2.00, 0.00 -30, 0.74, -6.72, 0.00 -31, 1.23, -11.32, 0.00 -32, 1.61, -15.15, 0.00 -33, 1.99, -19.02, 0.00 -34, 2.29, -22.32, 0.00 -35, 2.64, -26.26, 0.00 -36, 2.79, -28.35, 0.00 -37, 2.88, -29.98, 0.00 -38, 2.58, -27.41, 0.00 -39, 2.40, -26.23, 0.00 -40, 2.14, -23.97, 0.00 -41, 2.88, -33.18, 0.00 -42, 0.07, -0.88, 0.00 -43, -7.69, 94.38, 0.00 -44, -15.57, 197.73, 0.00 -45, -17.94, 236.64, 0.00 -46, 4.70, -64.62, 0.00 -47, 28.52, -409.61, 0.00 -48, 30.19, -455.33, 0.00 -49, 29.54, -470.12, 0.00 -50, 27.35, -462.05, 0.00 -51, 25.31, -457.07, 0.00 -52, 23.08, -449.24, 0.00 -53, 21.94, -465.13, 0.00 -54, 21.48, -502.18, 0.00 -55, 22.02, -577.36, 0.00 -56, 20.47, -614.69, 0.00 -57, 16.29, -577.49, 0.00 -58, 12.59, -550.58, 0.00 -59, 9.32, -539.47, 0.00 -60, 6.05, -531.03, 0.00 -61, 2.73, -521.29, 0.00 -62, -0.63, -508.34, 0.00 -63, -3.96, -493.40, 0.00 -64, -7.24, -478.67, 0.00 -65, -10.46, -462.56, 0.00 -66, -13.57, -445.82, 0.00 -67, -16.54, -427.72, 0.00 -68, -19.38, -409.38, 0.00 -69, -22.00, -389.70, 0.00 -70, -24.45, -370.21, 0.00 -71, -26.59, -349.18, 0.00 -72, -28.53, -328.51, 0.00 -73, -30.06, -306.33, 0.00 -74, -31.33, -284.50, 0.00 -75, -32.15, -261.58, 0.00 -76, -32.58, -238.65, 0.00 -77, -32.48, -214.97, 0.00 -78, -32.01, -191.95, 0.00 -79, -31.12, -169.41, 0.00 -80, -29.76, -147.23, 0.00 -81, -28.42, -127.89, 0.00 -82, -26.46, -108.25, 0.00 -83, -25.23, -93.79, 0.00 -84, -23.18, -78.17, 0.00 -85, -22.06, -67.33, 0.00 -86, -20.11, -55.36, 0.00 -87, -17.52, -43.33, 0.00 -88, -14.90, -32.88, 0.00 -89, -7.49, -14.65, 0.00 -90, -1.78, -3.05, 0.00 -91, 11.94, 17.75, 0.00 -92, 21.51, 27.24, 0.00 -93, 37.02, 39.03, 0.00 -94, 47.69, 40.51, 0.00 -95, 60.96, 39.71, 0.00 -96, 70.98, 32.53, 0.00 -97, 78.52, 21.25, 0.00 -98, 83.66, 11.23, 0.00 -99, 49.17, -0.00, 0.00 -100, 124.12, -16.66, 0.00 -101, 184.07, -49.82, 0.00 -102, 164.48, -75.39, 0.00 -103, 133.69, -87.08, 0.00 -104, 109.43, -92.96, 0.00 -105, 76.86, -81.04, 0.00 -106, 57.12, -72.34, 0.00 -107, 33.93, -50.44, 0.00 -108, 19.70, -33.80, 0.00 -109, 3.84, -7.50, 0.00 -110, -6.08, 13.41, 0.00 -111, -17.27, 42.71, 0.00 -112, -24.34, 67.01, 0.00 -113, -32.29, 98.57, 0.00 -114, -37.23, 125.57, 0.00 -115, -42.27, 157.13, 0.00 -116, -45.00, 184.10, 0.00 -117, -47.22, 212.46, 0.00 -118, -48.02, 237.54, 0.00 -119, -48.54, 264.19, 0.00 -120, -48.03, 288.01, 0.00 -121, -47.18, 312.25, 0.00 -122, -45.73, 334.99, 0.00 -123, -43.96, 357.74, 0.00 -124, -41.77, 379.29, 0.00 -125, -39.34, 400.82, 0.00 -126, -36.68, 422.40, 0.00 -127, -33.75, 443.26, 0.00 -128, -30.64, 464.03, 0.00 -129, -27.30, 483.59, 0.00 -130, -23.83, 503.39, 0.00 -131, -20.19, 522.07, 0.00 -132, -16.46, 540.78, 0.00 -133, -12.62, 558.35, 0.00 -134, -8.71, 575.65, 0.00 -135, -4.74, 591.58, 0.00 -136, -0.75, 607.73, 0.00 -137, 3.26, 622.30, 0.00 -138, 7.25, 636.34, 0.00 -139, 11.22, 649.44, 0.00 -140, 15.14, 662.10, 0.00 -141, 18.99, 673.05, 0.00 -142, 22.76, 683.64, 0.00 -143, 26.45, 693.25, 0.00 -144, 30.01, 701.79, 0.00 -145, 33.44, 708.94, 0.00 -146, 36.75, 715.33, 0.00 -147, 39.92, 720.85, 0.00 -148, 42.91, 725.05, 0.00 -149, 45.76, 728.29, 0.00 -150, 48.36, 729.34, 0.00 -151, 50.65, 727.41, 0.00 -152, 53.13, 729.86, 0.00 -153, 53.65, 707.51, 0.00 -154, 41.35, 525.16, 0.00 -155, -10.50, -128.78, 0.00 -156, -10.40, -123.56, 0.00 -157, -0.38, -4.42, 0.00 -158, 0.07, 0.74, 0.00 -159, -0.56, -6.11, 0.00 -160, -0.06, -0.63, 0.00 -161, 0.35, 3.66, 0.00 -162, 0.54, 5.47, 0.00 -163, 0.57, 5.63, 0.00 -164, 0.50, 4.88, 0.00 -165, 0.34, 3.29, 0.00 -166, 0.13, 1.18, 0.00 -167, -0.18, -1.65, 0.00 -168, -0.56, -5.04, 0.00 -169, -1.04, -9.24, 0.00 -170, -1.56, -13.68, 0.00 -171, -2.17, -18.73, 0.00 -172, -2.78, -23.65, 0.00 -173, -3.45, -28.94, 0.00 -174, -4.09, -33.84, 0.00 -175, -4.78, -39.02, 0.00 -176, -5.44, -43.83, 0.00 -177, -6.12, -48.67, 0.00 -178, -6.74, -52.99, 0.00 -179, -7.38, -57.30, 0.00 -180, -7.94, -61.00, 0.00 -181, -8.47, -64.36, 0.00 -182, -8.92, -67.13, 0.00 -183, -9.27, -69.09, 0.00 -184, -9.56, -70.59, 0.00 -185, -9.71, -71.08, 0.00 -186, -9.80, -71.10, 0.00 -187, -9.76, -70.26, 0.00 -188, -9.64, -68.96, 0.00 -189, -9.45, -67.16, 0.00 -190, -9.17, -64.76, 0.00 -191, -8.82, -61.96, 0.00 -192, -8.34, -58.34, 0.00 -193, -7.78, -54.14, 0.00 -194, -7.08, -49.13, 0.00 -195, -6.24, -43.17, 0.00 -196, -5.26, -36.30, 0.00 -197, -4.14, -28.53, 0.00 -198, -2.87, -19.79, 0.00 +199, -1.20, -0.00, 0.00 +0, -2.91, 20.05, 0.00 +1, -4.09, 28.16, 0.00 +2, -5.15, 35.52, 0.00 +3, -6.05, 41.87, 0.00 +4, -6.83, 47.39, 0.00 +5, -7.46, 51.93, 0.00 +6, -7.98, 55.81, 0.00 +7, -8.38, 58.87, 0.00 +8, -8.66, 61.18, 0.00 +9, -8.83, 62.77, 0.00 +10, -8.90, 63.67, 0.00 +11, -8.88, 63.96, 0.00 +12, -8.76, 63.56, 0.00 +13, -8.55, 62.54, 0.00 +14, -8.25, 60.89, 0.00 +15, -7.87, 58.62, 0.00 +16, -7.43, 55.87, 0.00 +17, -6.91, 52.55, 0.00 +18, -6.34, 48.72, 0.00 +19, -5.72, 44.40, 0.00 +20, -5.03, 39.56, 0.00 +21, -4.31, 34.26, 0.00 +22, -3.53, 28.48, 0.00 +23, -2.72, 22.22, 0.00 +24, -1.88, 15.59, 0.00 +25, -1.01, 8.51, 0.00 +26, -0.13, 1.09, 0.00 +27, 0.77, -6.63, 0.00 +28, 1.68, -14.70, 0.00 +29, 2.59, -23.11, 0.00 +30, 3.50, -31.76, 0.00 +31, 4.42, -40.71, 0.00 +32, 5.31, -49.80, 0.00 +33, 6.18, -59.12, 0.00 +34, 7.01, -68.35, 0.00 +35, 7.81, -77.72, 0.00 +36, 8.54, -86.83, 0.00 +37, 9.21, -95.73, 0.00 +38, 9.85, -104.77, 0.00 +39, 10.46, -114.13, 0.00 +40, 11.15, -124.95, 0.00 +41, 11.87, -136.79, 0.00 +42, 12.52, -148.72, 0.00 +43, 13.07, -160.31, 0.00 +44, 13.44, -170.75, 0.00 +45, 13.71, -180.79, 0.00 +46, 13.51, -185.52, 0.00 +47, 12.80, -183.80, 0.00 +48, 11.79, -177.78, 0.00 +49, 11.16, -177.63, 0.00 +50, 11.17, -188.79, 0.00 +51, 9.75, -176.01, 0.00 +52, 4.86, -94.68, 0.00 +53, 4.39, -93.06, 0.00 +54, 19.50, -455.89, 0.00 +55, 22.62, -592.88, 0.00 +56, 18.86, -566.30, 0.00 +57, 15.60, -553.07, 0.00 +58, 12.49, -545.93, 0.00 +59, 9.27, -536.99, 0.00 +60, 6.00, -526.52, 0.00 +61, 2.70, -515.25, 0.00 +62, -0.62, -502.68, 0.00 +63, -3.92, -488.92, 0.00 +64, -7.18, -474.50, 0.00 +65, -10.38, -459.17, 0.00 +66, -13.48, -442.77, 0.00 +67, -16.47, -425.71, 0.00 +68, -19.30, -407.83, 0.00 +69, -21.98, -389.40, 0.00 +70, -24.47, -370.52, 0.00 +71, -26.74, -351.11, 0.00 +72, -28.76, -331.24, 0.00 +73, -30.51, -310.87, 0.00 +74, -31.96, -290.23, 0.00 +75, -33.11, -269.39, 0.00 +76, -33.87, -248.12, 0.00 +77, -34.26, -226.71, 0.00 +78, -34.25, -205.36, 0.00 +79, -33.78, -183.86, 0.00 +80, -32.84, -162.46, 0.00 +81, -31.37, -141.12, 0.00 +82, -29.30, -119.89, 0.00 +83, -26.60, -98.88, 0.00 +84, -23.17, -78.16, 0.00 +85, -18.94, -57.81, 0.00 +86, -13.77, -37.92, 0.00 +87, -7.52, -18.60, 0.00 +88, -0.02, -0.05, 0.00 +89, 8.93, 17.47, 0.00 +90, 19.56, 33.56, 0.00 +91, 32.17, 47.83, 0.00 +92, 46.93, 59.43, 0.00 +93, 64.05, 67.53, 0.00 +94, 83.40, 70.84, 0.00 +95, 103.82, 67.62, 0.00 +96, 123.49, 56.60, 0.00 +97, 140.08, 37.91, 0.00 +98, 109.25, 14.66, 0.00 +99, 71.57, -0.00, 0.00 +100, 106.90, -14.35, 0.00 +101, 132.12, -35.76, 0.00 +102, 110.67, -50.73, 0.00 +103, 87.56, -57.03, 0.00 +104, 64.93, -55.16, 0.00 +105, 44.35, -46.77, 0.00 +106, 26.67, -33.77, 0.00 +107, 11.84, -17.59, 0.00 +108, -0.51, 0.88, 0.00 +109, -10.69, 20.91, 0.00 +110, -19.06, 42.06, 0.00 +111, -25.85, 63.92, 0.00 +112, -31.37, 86.38, 0.00 +113, -35.77, 109.20, 0.00 +114, -39.24, 132.34, 0.00 +115, -41.89, 155.73, 0.00 +116, -43.81, 179.26, 0.00 +117, -45.11, 202.97, 0.00 +118, -45.82, 226.70, 0.00 +119, -46.00, 250.40, 0.00 +120, -45.73, 274.18, 0.00 +121, -44.98, 297.71, 0.00 +122, -43.85, 321.24, 0.00 +123, -42.34, 344.56, 0.00 +124, -40.45, 367.28, 0.00 +125, -38.27, 389.93, 0.00 +126, -35.82, 412.54, 0.00 +127, -33.10, 434.67, 0.00 +128, -30.13, 456.22, 0.00 +129, -26.93, 477.11, 0.00 +130, -23.55, 497.51, 0.00 +131, -20.01, 517.39, 0.00 +132, -16.33, 536.54, 0.00 +133, -12.55, 555.14, 0.00 +134, -8.67, 572.75, 0.00 +135, -4.73, 589.53, 0.00 +136, -0.75, 605.87, 0.00 +137, 3.25, 621.10, 0.00 +138, 7.24, 635.19, 0.00 +139, 11.20, 648.73, 0.00 +140, 15.12, 661.30, 0.00 +141, 18.97, 672.43, 0.00 +142, 22.74, 682.79, 0.00 +143, 26.41, 692.34, 0.00 +144, 29.96, 700.62, 0.00 +145, 33.38, 707.63, 0.00 +146, 36.67, 713.81, 0.00 +147, 39.81, 718.97, 0.00 +148, 42.78, 722.78, 0.00 +149, 45.57, 725.30, 0.00 +150, 47.98, 723.61, 0.00 +151, 51.05, 733.27, 0.00 +152, 54.58, 749.71, 0.00 +153, 24.36, 321.17, 0.00 +154, 0.10, 1.31, 0.00 +155, 3.44, 42.16, 0.00 +156, 4.87, 57.79, 0.00 +157, 5.10, 58.72, 0.00 +158, 5.46, 61.20, 0.00 +159, 5.65, 61.66, 0.00 +160, 5.66, 60.25, 0.00 +161, 5.52, 57.36, 0.00 +162, 5.26, 53.42, 0.00 +163, 4.86, 48.35, 0.00 +164, 4.38, 42.69, 0.00 +165, 3.80, 36.36, 0.00 +166, 3.17, 29.74, 0.00 +167, 2.46, 22.72, 0.00 +168, 1.73, 15.66, 0.00 +169, 0.95, 8.48, 0.00 +170, 0.16, 1.42, 0.00 +171, -0.64, -5.53, 0.00 +172, -1.44, -12.22, 0.00 +173, -2.22, -18.64, 0.00 +174, -3.00, -24.78, 0.00 +175, -3.74, -30.51, 0.00 +176, -4.46, -35.96, 0.00 +177, -5.15, -40.95, 0.00 +178, -5.80, -45.55, 0.00 +179, -6.40, -49.70, 0.00 +180, -6.95, -53.39, 0.00 +181, -7.45, -56.60, 0.00 +182, -7.89, -59.34, 0.00 +183, -8.26, -61.54, 0.00 +184, -8.58, -63.31, 0.00 +185, -8.82, -64.52, 0.00 +186, -8.98, -65.15, 0.00 +187, -9.05, -65.21, 0.00 +188, -9.04, -64.63, 0.00 +189, -8.94, -63.48, 0.00 +190, -8.73, -61.68, 0.00 +191, -8.42, -59.18, 0.00 +192, -8.00, -55.95, 0.00 +193, -7.46, -51.92, 0.00 +194, -6.81, -47.25, 0.00 +195, -6.01, -41.60, 0.00 +196, -5.09, -35.15, 0.00 +197, -4.02, -27.73, 0.00 +198, -2.84, -19.54, 0.00 From a0a0f392b007c389150760e18b4c080be9d4c852 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 18 Nov 2026 09:47:28 +0100 Subject: [PATCH 43/43] Use the CI value for one sensitive force entry in updated_moving_frame_NACA12 Co-Authored-By: Claude Opus 5.5 --- .../py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref index 8fd11a1b9b78..017384b3f498 100644 --- a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref +++ b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref @@ -22,7 +22,7 @@ 20, -5.03, 39.56, 0.00 21, -4.31, 34.26, 0.00 22, -3.53, 28.48, 0.00 -23, -2.72, 22.22, 0.00 +23, -2.58, 22.22, 0.00 24, -1.88, 15.59, 0.00 25, -1.01, 8.51, 0.00 26, -0.13, 1.09, 0.00