diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index ed33589b31d2..dfc32dc93a26 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -227,8 +227,7 @@ struct CBlockView { /*! * \brief Write the block from callable \p f(i,j). * \p Overwrite=true overwrites (or quantizes for Q_LU_SGS off-diagonal blocks); - * \p Overwrite=false accumulates into non-quantized storage only — accumulating into - * quantized storage would require decode-accumulate-encode and is a silent no-op. + * \p Overwrite=false accumulates (quantized storage is decoded, added and re-encoded). * Only enabled for mutable (non-const ScalarType) views. */ template > = 0> @@ -241,8 +240,20 @@ struct CBlockView { else ptr[i * nVar + j] += f(i, j); } - } else if constexpr (Overwrite) { - if (qs) EncodeQuantBlock(f, qs, qv, nVar); + } else if (qs) { + if constexpr (Overwrite) { + EncodeQuantBlock(f, qs, qv, nVar); + } else { + using T = std::remove_const_t; + for (auto r = 0ul; r < nVar; ++r) { + /*--- The old scale is kept because EncodeQuantRow overwrites qs[r] before re-reading the row. ---*/ + const auto scale = DecodeQuantScale(qs[r]); + const auto sum = [&](unsigned long i, unsigned long j) -> T { + return static_cast(qv[i * nVar + j] * scale) + f(i, j); + }; + EncodeQuantRow(sum, qs[r], qv + r * nVar, nVar, r); + } + } } } }; diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index f88fdce5b106..4c300def3f61 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -478,6 +478,9 @@ class CFVMFlowSolverBase : public CSolver { { auto jPoint = geometry->nodes->GetPoint(iPoint,iNeigh); + /*--- The edge to a periodic image is left out, the states of both points are tied. ---*/ + if (implicit_periodic && IsPeriodicImage(geometry, config, iPoint, jPoint)) continue; + auto iEdge = geometry->nodes->GetEdge(iPoint,iNeigh); auto Normal = geometry->edges->GetNormal(iEdge); auto Area2 = GeometryToolbox::SquaredNorm(nDim, Normal); diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 1f773a73503c..ca95edde3f47 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -254,9 +254,8 @@ void CFVMFlowSolverBase::CommunicateInitialState(CGeometry* geometry, cons /*--- Communicate and store volume and the number of neighbors for any dual CVs that lie on on periodic markers. ---*/ + CommunicatePeriodicVolume(geometry, config); for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic() / 2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_VOLUME); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_VOLUME); InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_NEIGHBORS); CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_NEIGHBORS); } @@ -1451,6 +1450,8 @@ void CFVMFlowSolverBase::BC_Periodic(CGeometry* geometry, CSolver** solver accumulated correctly during the communications. For implicit calculations, the Jacobians and linear system are also correctly adjusted here. ---*/ + CouplePeriodicJacobian(geometry, config); + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic() / 2; iPeriodic++) { InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_RESIDUAL); CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_RESIDUAL); diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index 941d68928493..041730ba8029 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -412,6 +412,8 @@ void CScalarSolver::BC_Periodic(CGeometry* geometry, CSolver** sol accumulated corectly during the communications. For implicit calculations the Jacobians and linear system are also correctly adjusted here. ---*/ + CouplePeriodicJacobian(geometry, config); + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic() / 2; iPeriodic++) { InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_RESIDUAL); CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_RESIDUAL); diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 1e5c0376f267..9446db1e7351 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -151,6 +151,10 @@ class CSolver { bool implicit_periodic; /*!< \brief Flag that controls whether the implicit system should be treated by the periodic BC comms. */ su2activematrix PeriodicProj; /*!< \brief Min/max reconstruction increments at periodic receive points (for limiters). */ std::unordered_map PeriodicProjIndex; /*!< \brief Local point to compact projection row. */ + vector PeriodicMaster; /*!< \brief Local master point of each coupled passive periodic point, or -1. */ + vector PeriodicMasterMarker; /*!< \brief Periodic marker of each passive point, gives its rotation. */ + vector PeriodicPassive; /*!< \brief Coupled passive periodic points. */ + vector PeriodicRotation; /*!< \brief Rotation of each periodic marker to its match, empty if none. */ bool dynamic_grid; /*!< \brief Flag that determines whether the grid is dynamic (moving or deforming + grid velocities). */ @@ -339,6 +343,41 @@ class CSolver { unsigned short val_periodic_index, unsigned short commType); + /*! + * \brief Set the periodic volume of each periodic point, the volume of its matches on the other periodic faces. + * \note Called again when the mesh coordinates are recorded, so the periodic volume depends on them. + */ + void CommunicatePeriodicVolume(CGeometry *geometry, const CConfig *config); + + /*! + * \brief Move the off-diagonal Jacobian blocks of passive periodic points to their masters, rotated. + * \note Call before the PERIODIC_RESIDUAL comms. A passive point is coupled if its master is on the same rank and + * all its blocks fit in the sparsity pattern. + */ + void CouplePeriodicJacobian(CGeometry *geometry, const CConfig *config); + + /*! + * \brief Map each coupled passive periodic point to its master on the same rank, and set the marker rotations. + */ + void SetPeriodicMaster(CGeometry *geometry, const CConfig *config); + + /*! + * \brief Whether jPoint is the periodic donor of iPoint on this rank. + * \note Only happens on meshes one cell thick in the periodic direction. + */ + inline bool IsPeriodicImage(const CGeometry *geometry, const CConfig *config, unsigned long iPoint, + unsigned long jPoint) const { + if (!geometry->nodes->GetPeriodicBoundary(iPoint) || !geometry->nodes->GetPeriodicBoundary(jPoint)) return false; + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) continue; + const auto iVertex = geometry->nodes->GetVertex(iPoint, iMarker); + if (iVertex < 0) continue; + const auto* vertex = geometry->vertex[iMarker][iVertex]; + if (vertex->GetDonorProcessor() == rank && vertex->GetDonorPoint() == static_cast(jPoint)) return true; + } + return false; + } + /*! * \brief Set number of linear solver iterations. * \param[in] val_iterlinsolver - Number of linear iterations. diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 7c33451e6095..5fe40729f533 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -478,6 +478,8 @@ void CDiscAdjFluidIteration::SetDependencies(CSolver***** solver, CGeometry**** CGeometry::UpdateGeometry(geometry[iZone][iInst], config[iZone]); END_SU2_OMP_PARALLEL + solvers0[FLOW_SOL]->CommunicatePeriodicVolume(geometry0, config[iZone]); + CGeometry::ComputeWallDistance(config, geometry, iZone); } diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 4c42081491dc..278e737ff339 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -215,7 +215,7 @@ void CSolver::GetPeriodicCommCountAndType(const CConfig* config, MPI_TYPE = COMM_TYPE::DOUBLE; break; case PERIODIC_IMPLICIT: - COUNT_PER_POINT = nVar; + COUNT_PER_POINT = 2*nVar; MPI_TYPE = COMM_TYPE::DOUBLE; break; case PERIODIC_LAPLACIAN: @@ -303,6 +303,27 @@ void CSolver::GetPeriodicCommCountAndType(const CConfig* config, } namespace PeriodicCommHelpers { + /*--- B = Ql*B*Qr^T on the momentum rows and columns of B, a null matrix leaves that side alone. ---*/ + template + void RotateMomentumBlock(const Matrix* Ql, const Matrix* Qr, unsigned short nDim, unsigned short nVar, + su2matrix& B) { + auto rotate = [nDim](const Matrix& Q, auto&& component) { + Scalar vec[3]; + for (auto iDim = 0u; iDim < nDim; iDim++) vec[iDim] = component(iDim); + for (auto iDim = 0u; iDim < nDim; iDim++) { + Scalar sum = 0.0; + for (auto jDim = 0u; jDim < nDim; jDim++) sum += Q[iDim][jDim] * vec[jDim]; + component(iDim) = sum; + } + }; + if (Ql) + for (auto jVar = 0u; jVar < nVar; jVar++) + rotate(*Ql, [&](unsigned iDim) -> Scalar& { return B(1 + iDim, jVar); }); + if (Qr) + for (auto iVar = 0u; iVar < nVar; iVar++) + rotate(*Qr, [&](unsigned iDim) -> Scalar& { return B(iVar, 1 + iDim); }); + } + CVectorOfMatrix& selectGradient(CVariable* nodes, unsigned short commType) { switch(commType) { case PERIODIC_PRIM_GG: @@ -688,31 +709,11 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, } } - /*--- Rotate the momentum rows and columns of the Jacobian, the residual of the - periodic match is Q*R(Q^T*U), so its Jacobian is Q*J*Q^T. First the rows. ---*/ + /*--- The residual of the periodic match is Q*R(Q^T*U), so its Jacobian is Q*J*Q^T. ---*/ if (rotate_periodic) { - for (iVar = 0; iVar < nVar; iVar++) { - if (nDim == 2) { - jacBlock[1][iVar] = rotMatrix2D[0][0]*block(1, iVar) + rotMatrix2D[0][1]*block(2, iVar); - jacBlock[2][iVar] = rotMatrix2D[1][0]*block(1, iVar) + rotMatrix2D[1][1]*block(2, iVar); - } else { - jacBlock[1][iVar] = rotMatrix3D[0][0]*block(1, iVar) + rotMatrix3D[0][1]*block(2, iVar) + - rotMatrix3D[0][2]*block(3, iVar); - jacBlock[2][iVar] = rotMatrix3D[1][0]*block(1, iVar) + rotMatrix3D[1][1]*block(2, iVar) + - rotMatrix3D[1][2]*block(3, iVar); - jacBlock[3][iVar] = rotMatrix3D[2][0]*block(1, iVar) + rotMatrix3D[2][1]*block(2, iVar) + - rotMatrix3D[2][2]*block(3, iVar); - } - } - - /*--- Then the columns, i.e. the momentum part of each row. ---*/ - - for (auto iRow = 0u; iRow < nVar; iRow++) { - su2double rotated[3] = {0.0}; - Rotate(zeros, &jacBlock[iRow][1], rotated); - for (auto jDim = 0u; jDim < nDim; jDim++) jacBlock[iRow][1+jDim] = rotated[jDim]; - } + if (nDim == 2) PeriodicCommHelpers::RotateMomentumBlock(&rotMatrix2D, &rotMatrix2D, nDim, nVar, jacBlock); + else PeriodicCommHelpers::RotateMomentumBlock(&rotMatrix3D, &rotMatrix3D, nDim, nVar, jacBlock); } /*--- Load the Jacobian terms into the buffer for sending. ---*/ @@ -737,12 +738,14 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, for (iVar = 0; iVar < nVar; iVar++) { bufDSend[buf_offset+iVar] = base_nodes->GetSolution(iPoint, iVar); + bufDSend[buf_offset+nVar+iVar] = LinSysRes(iPoint, iVar); } - /*--- Rotate the momentum components of the solution array. ---*/ + /*--- Rotate the momentum components of the solution and of the residual. ---*/ if (rotate_periodic) { Rotate(zeros, &base_nodes->GetSolution(iPoint)[1], &bufDSend[buf_offset+1]); + Rotate(zeros, &LinSysRes(iPoint, 1), &bufDSend[buf_offset+nVar+1]); } break; @@ -1329,7 +1332,7 @@ void CSolver::CompletePeriodicComms(CGeometry *geometry, base_nodes->SetDelta_Time(iPoint,bufDRecv[buf_offset]); buf_offset++; - /*--- For implicit integration, we choose the first + /*--- For implicit integration, we choose the second periodic face of each pair to be the master/owner of the solution for the linear system while fixing the solution at the matching face during the solve. Here, @@ -1373,7 +1376,7 @@ void CSolver::CompletePeriodicComms(CGeometry *geometry, case PERIODIC_IMPLICIT: - /*--- For implicit integration, we choose the first + /*--- For implicit integration, we choose the second periodic face of each pair to be the master/owner of the solution for the linear system while fixing the solution at the matching face during the solve. Here, @@ -1392,6 +1395,13 @@ void CSolver::CompletePeriodicComms(CGeometry *geometry, buf_offset++; } + /*--- The passive point shows the residual of the combined control volume of its master. ---*/ + + for (iVar = 0; iVar < nVar; iVar++) { + LinSysRes(iPoint, iVar) = bufDRecv[buf_offset]; + buf_offset++; + } + } /*--- A point on a rotation axis takes the average over all the copies of its control @@ -4816,6 +4826,141 @@ void CSolver::SavelibROM(CGeometry *geometry, CConfig *config, bool converged) { } +void CSolver::CommunicatePeriodicVolume(CGeometry *geometry, const CConfig *config) { + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); iPoint++) geometry->nodes->SetPeriodicVolume(iPoint, 0.0); + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic() / 2; iPeriodic++) { + InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_VOLUME); + CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_VOLUME); + } +} + +void CSolver::SetPeriodicMaster(CGeometry *geometry, const CConfig *config) { + const auto nPeriodic = config->GetnMarker_Periodic(); + + PeriodicMaster.assign(nPoint, -1); + PeriodicMasterMarker.assign(nPoint, 0); + vector nPeriodicMarker(nPoint, 0); + vector passive(nPoint, false); + + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) continue; + /*--- Points receiving from the second marker of a pair have their rows removed (CompletePeriodicComms). ---*/ + const bool isPassive = config->GetMarker_All_PerBound(iMarker) <= nPeriodic / 2; + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { + const auto* vertex = geometry->vertex[iMarker][iVertex]; + const auto iPoint = vertex->GetNode(); + nPeriodicMarker[iPoint]++; + if (!isPassive) continue; + passive[iPoint] = true; + if (vertex->GetDonorProcessor() == rank && vertex->GetDonorPoint() >= 0) { + PeriodicMaster[iPoint] = vertex->GetDonorPoint(); + PeriodicMasterMarker[iPoint] = iMarker; + } + } + } + + /*--- Points on several periodic markers keep the treatment of the comms only. ---*/ + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { + const auto master = PeriodicMaster[iPoint]; + if (master < 0) continue; + if (nPeriodicMarker[iPoint] != 1 || nPeriodicMarker[master] != 1 || passive[master]) PeriodicMaster[iPoint] = -1; + } + + /*--- A point is coupled only if all its blocks fit in the sparsity pattern of its master. Columns of passive + * points without a master are ignored, their increment is zero in the linear system. ---*/ + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { + const auto master = PeriodicMaster[iPoint]; + if (master < 0) continue; + const bool ownRow = iPoint < nPointDomain; + bool fits = true; + for (const auto kPoint : geometry->nodes->GetPoints(iPoint)) { + const bool kCoupled = PeriodicMaster[kPoint] >= 0; + if (ownRow && (!passive[kPoint] || kCoupled)) { + const unsigned long col = kCoupled ? PeriodicMaster[kPoint] : kPoint; + fits = fits && Jacobian.GetBlockView(master, col); + } + if (kPoint < nPointDomain && !passive[kPoint]) fits = fits && Jacobian.GetBlockView(kPoint, master); + } + if (!fits) PeriodicMaster[iPoint] = -1; + } + + PeriodicPassive.clear(); + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) + if (PeriodicMaster[iPoint] >= 0) PeriodicPassive.push_back(iPoint); + + /*--- Rotation from the frame of each periodic marker to the frame of its match, empty if none. ---*/ + PeriodicRotation.assign(config->GetnMarker_All(), su2passivematrix()); + for (auto iMarker = 0u; iMarker < config->GetnMarker_All() && rotate_periodic; iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) continue; + const auto* angles = config->GetPeriodicRotAngles(config->GetMarker_All_TagBound(iMarker)); + if (!GeometryToolbox::HasRotation(angles)) continue; + auto& rotation = PeriodicRotation[iMarker]; + rotation.resize(3, 3) = passivedouble(0.0); + const auto theta = SU2_TYPE::GetValue(angles[0]); + const auto phi = SU2_TYPE::GetValue(angles[1]); + const auto psi = SU2_TYPE::GetValue(angles[2]); + if (nDim == 2) GeometryToolbox::RotationMatrix(psi, rotation); + else GeometryToolbox::RotationMatrix(theta, phi, psi, rotation); + } +} + +void CSolver::CouplePeriodicJacobian(CGeometry *geometry, const CConfig *config) { + SU2_ZONE_SCOPED + if (!implicit_periodic || config->GetnMarker_Periodic() == 0) return; + + /*--- The table is built on the first call, the sparsity pattern of the Jacobian is fixed by then. ---*/ + const bool built = PeriodicMaster.size() == nPoint; + if (built && PeriodicPassive.empty()) return; + + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + + if (!built) SetPeriodicMaster(geometry, config); + + auto Rotation = [&](unsigned long iPoint) -> const su2passivematrix* { + if (PeriodicMaster[iPoint] < 0) return nullptr; + const auto& rotation = PeriodicRotation[PeriodicMasterMarker[iPoint]]; + return rotation.size() ? &rotation : nullptr; + }; + + /*--- Blocks are passive, except in forward AD where the Jacobian itself is active. ---*/ + using BlockScalar = std::conditional_t::value, su2double, passivedouble>; + su2matrix block(nVar, nVar), zero(nVar, nVar); + zero = BlockScalar(0.0); + auto ReadBlock = [&](unsigned long iRow, unsigned long iCol) { + const auto view = Jacobian.GetBlockView(iRow, iCol); + for (auto iVar = 0u; iVar < nVar; iVar++) + for (auto jVar = 0u; jVar < nVar; jVar++) block(iVar, jVar) = view(iVar, jVar); + }; + + /*--- Rows of passive points go to the rows of their masters. ---*/ + for (const auto iPoint : PeriodicPassive) { + if (iPoint >= nPointDomain) continue; + const auto master = PeriodicMaster[iPoint]; + for (const auto kPoint : geometry->nodes->GetPoints(iPoint)) { + const unsigned long col = PeriodicMaster[kPoint] >= 0 ? PeriodicMaster[kPoint] : kPoint; + if (!Jacobian.GetBlockView(master, col)) continue; + ReadBlock(iPoint, kPoint); + PeriodicCommHelpers::RotateMomentumBlock(Rotation(iPoint), Rotation(kPoint), nDim, nVar, block); + Jacobian.AddBlock(master, col, block); + } + } + + /*--- Columns of passive points go to the columns of their masters. ---*/ + for (const auto iPoint : PeriodicPassive) { + const auto master = PeriodicMaster[iPoint]; + for (const auto jPoint : geometry->nodes->GetPoints(iPoint)) { + if (jPoint >= nPointDomain || PeriodicMaster[jPoint] >= 0) continue; + if (!Jacobian.GetBlockView(jPoint, master)) continue; + ReadBlock(jPoint, iPoint); + PeriodicCommHelpers::RotateMomentumBlock(nullptr, Rotation(iPoint), nDim, nVar, block); + Jacobian.AddBlock(jPoint, master, block); + Jacobian.SetBlock(jPoint, iPoint, zero); + } + } + + } + END_SU2_OMP_SAFE_GLOBAL_ACCESS +} void CSolver::ComputeAdaptiveMetric(CGeometry *geometry, const CConfig *config, bool restartMetric) { /*--- TODO: - goal-oriented metric ---*/ diff --git a/TestCases/incomp_rans/morse_swirl_jet/inlet_jet.dat b/TestCases/incomp_rans/morse_swirl_jet/inlet_jet.dat new file mode 100644 index 000000000000..19f935ed891f --- /dev/null +++ b/TestCases/incomp_rans/morse_swirl_jet/inlet_jet.dat @@ -0,0 +1,65 @@ +NMARK= 1 +MARKER_TAG= inlet_jet +NROW=60 +NCOL=9 +# COORD-X COORD-Y COORD-Z TEMPERATURE VELOCITY NORMAL-X NORMAL-Y NORMAL-Z NU_TILDE +1.230000000000000e-02 4.915317250182741e-04 -2.146073858374531e-05 2.881500000000000e+02 3.404952035805443e+01 9.964500863218230e-01 3.977264224582153e-03 8.409165736575443e-02 2.108527391098338e-03 +1.230000000000000e-02 9.750124993671942e-04 -4.256996506995672e-05 2.881500000000000e+02 3.430313843595425e+01 9.880697227692148e-01 7.215987429835292e-03 1.538380722453961e-01 2.108527391098338e-03 +1.230000000000000e-02 9.750124993671942e-04 4.256996506995671e-05 2.881500000000000e+02 3.430313843595425e+01 9.880697227692148e-01 -6.219343030316790e-03 1.538815866796235e-01 2.108527391098338e-03 +1.230000000000000e-02 4.915317250182741e-04 2.146073858374531e-05 2.881500000000000e+02 3.404952035805443e+01 9.964500863218230e-01 -3.366941323155189e-03 8.411830463910938e-02 2.108527391098338e-03 +1.230000000000000e-02 1.458493273716226e-03 -6.367919155617299e-05 2.881500000000000e+02 3.454279085009219e+01 9.762877688261749e-01 1.014212659517094e-02 2.162390568526813e-01 2.108527391098338e-03 +1.230000000000000e-02 1.458493273716226e-03 6.367919155617298e-05 2.881500000000000e+02 3.454279085009220e+01 9.762877688261747e-01 -8.742942869563935e-03 2.163001465334435e-01 2.108527391098338e-03 +1.230000000000000e-02 1.941974048065509e-03 -8.478841804240026e-05 2.881500000000000e+02 3.473691736740481e+01 9.688679027627434e-01 1.201797138126057e-02 2.472863832886933e-01 2.108527391098338e-03 +1.230000000000000e-02 1.941974048065509e-03 8.478841804240026e-05 2.881500000000000e+02 3.473691736740481e+01 9.688679027627434e-01 -9.580189035078044e-03 2.473928191645333e-01 2.108527391098338e-03 +1.230000000000000e-02 2.425454822414266e-03 -1.058976445286045e-04 2.881500000000000e+02 3.491004480099832e+01 9.570479293413384e-01 1.437979231487217e-02 2.895729312564240e-01 2.108527391098338e-03 +1.230000000000000e-02 2.425454822414266e-03 1.058976445286045e-04 2.881500000000000e+02 3.491004480099832e+01 9.570479293413384e-01 -1.091287103953410e-02 2.897243003082949e-01 2.108527391098338e-03 +1.230000000000000e-02 2.908935596762439e-03 -1.270068710147833e-04 2.881500000000000e+02 3.511796986204671e+01 9.397713273854733e-01 1.714460373522862e-02 3.413735707211489e-01 2.108527391098338e-03 +1.230000000000000e-02 2.908935596762439e-03 1.270068710147833e-04 2.881500000000000e+02 3.511796986204671e+01 9.397713273854733e-01 -1.267330376870326e-02 3.415687918937142e-01 2.108527391098338e-03 +1.230000000000000e-02 3.392416371111116e-03 -1.481160975009841e-04 2.881500000000000e+02 3.528982116296100e+01 9.260512716016078e-01 1.892666174263513e-02 3.769228353925044e-01 2.108527391098338e-03 +1.230000000000000e-02 3.392416371111116e-03 1.481160975009841e-04 2.881500000000000e+02 3.528982116296100e+01 9.260512716016078e-01 -1.399634959659803e-02 3.771380974696337e-01 2.108527391098338e-03 +1.230000000000000e-02 3.875897145460034e-03 -1.692253239871954e-04 2.881500000000000e+02 3.551215523720097e+01 9.112425122050197e-01 2.065526075006717e-02 4.113519711313309e-01 2.108527391098338e-03 +1.230000000000000e-02 3.875897145460034e-03 1.692253239871954e-04 2.881500000000000e+02 3.551215523720097e+01 9.112425122050197e-01 -1.527502532774494e-02 4.115868772829392e-01 2.108527391098338e-03 +1.230000000000000e-02 4.359377919809123e-03 -1.903345504734142e-04 2.881500000000000e+02 3.573358919956365e+01 9.036946523831382e-01 2.172966451482030e-02 4.276257673880193e-01 2.108527391098338e-03 +1.230000000000000e-02 4.359377919809123e-03 1.903345504734141e-04 2.881500000000000e+02 3.573358919956365e+01 9.036946523831382e-01 -1.562306479376379e-02 4.278923872898056e-01 2.108527391098338e-03 +1.230000000000000e-02 4.842858694158044e-03 -2.114437769596256e-04 2.881500000000000e+02 3.596582688777886e+01 8.959717351739295e-01 2.278227706937255e-02 4.435263437733462e-01 2.108527391098338e-03 +1.230000000000000e-02 4.842858694158044e-03 2.114437769596256e-04 2.881500000000000e+02 3.596582688777886e+01 8.959717351739295e-01 -1.596028429275307e-02 4.438241984104884e-01 2.108527391098338e-03 +1.230000000000000e-02 5.326339468506962e-03 -2.325530034458370e-04 2.881500000000000e+02 3.597906269642409e+01 8.942078992003367e-01 2.331743914955868e-02 4.470442148593665e-01 2.108527391098338e-03 +1.230000000000000e-02 5.326339468506963e-03 2.325530034458369e-04 2.881500000000000e+02 3.597906269642409e+01 8.942078992003365e-01 -1.573376133324451e-02 4.473753253835411e-01 2.108527391098338e-03 +1.230000000000000e-02 5.809820242855882e-03 -2.536622299320483e-04 2.881500000000000e+02 3.598980701325640e+01 8.924123870269365e-01 2.385467051978150e-02 4.505897093535071e-01 2.108527391098338e-03 +1.230000000000000e-02 5.809820242855882e-03 2.536622299320483e-04 2.881500000000000e+02 3.598980701325640e+01 8.924123870269365e-01 -1.550758449662454e-02 4.509541509998167e-01 2.108527391098338e-03 +1.230000000000000e-02 6.293301017204801e-03 -2.747714564182597e-04 2.881500000000000e+02 3.585282925447235e+01 8.896639674444857e-01 2.453168460400286e-02 4.559563811171272e-01 2.108527391098338e-03 +1.230000000000000e-02 6.293301017204801e-03 2.747714564182596e-04 2.881500000000000e+02 3.585282925447235e+01 8.896639674444857e-01 -1.530088291903097e-02 4.563594066224945e-01 2.108527391098338e-03 +1.230000000000000e-02 6.776781791553593e-03 -2.958806829044656e-04 2.881500000000000e+02 3.571601787886337e+01 8.868903347339346e-01 2.521594161932737e-02 4.612913292527621e-01 2.108527391098338e-03 +1.230000000000000e-02 6.776781791553593e-03 2.958806829044654e-04 2.881500000000000e+02 3.571601787886337e+01 8.868903347339346e-01 -1.508420107551411e-02 4.617336905982094e-01 2.108527391098338e-03 +1.230000000000000e-02 7.260262565901019e-03 -3.169899093906116e-04 2.881500000000000e+02 3.548623354001720e+01 8.864116770742088e-01 2.614893873877201e-02 4.621586002113610e-01 2.108527391098338e-03 +1.230000000000000e-02 7.260262565901019e-03 3.169899093906116e-04 2.881500000000000e+02 3.548623354001720e+01 8.864116770742088e-01 -1.423034193634863e-02 4.626789773859011e-01 2.108527391098338e-03 +1.230000000000000e-02 7.743743340249600e-03 -3.380991358768083e-04 2.881500000000000e+02 3.525668118861410e+01 8.859251724448826e-01 2.709464097744716e-02 4.630361424973307e-01 2.108527391098338e-03 +1.230000000000000e-02 7.743743340249600e-03 3.380991358768082e-04 2.881500000000000e+02 3.525668118861410e+01 8.859251724448826e-01 -1.336472122993312e-02 4.636356037395652e-01 2.108527391098338e-03 +1.230000000000000e-02 8.227224114600015e-03 -3.592083623630850e-04 2.881500000000000e+02 3.506478345062848e+01 8.854458827588981e-01 2.818749458180924e-02 4.638868976965356e-01 2.108527391098338e-03 +1.230000000000000e-02 8.227224114600015e-03 3.592083623630849e-04 2.881500000000000e+02 3.506478345062848e+01 8.854458827588981e-01 -1.235017446476032e-02 4.645783700259899e-01 2.108527391098338e-03 +1.230000000000000e-02 8.710704888951459e-03 -3.803175888494065e-04 2.881500000000000e+02 3.487296185468804e+01 8.849593859884991e-01 2.929231168974371e-02 4.647460011949857e-01 2.108527391098338e-03 +1.230000000000000e-02 8.710704888951459e-03 3.803175888494064e-04 2.881500000000000e+02 3.487296185468804e+01 8.849593859884991e-01 -1.132443732297945e-02 4.655304955319002e-01 2.108527391098338e-03 +1.230000000000000e-02 9.194185663303368e-03 -4.014268153357484e-04 2.881500000000000e+02 3.409955958208356e+01 8.854079871950582e-01 3.041559804813040e-02 4.638184856240317e-01 2.108527391098338e-03 +1.230000000000000e-02 9.194185663303369e-03 4.014268153357484e-04 2.881500000000000e+02 3.409955958208356e+01 8.854079871950582e-01 -1.012458709981934e-02 4.647044102946019e-01 2.108527391098338e-03 +1.230000000000000e-02 9.677666437654643e-03 -4.225360418220627e-04 2.881500000000000e+02 3.331699155975138e+01 8.859007846674354e-01 3.159905365039384e-02 4.627972553224809e-01 2.109105393500574e-03 +1.230000000000000e-02 9.677666437654643e-03 4.225360418220626e-04 2.881500000000000e+02 3.331699155975138e+01 8.859007846674354e-01 -8.856628817969465e-03 4.637902110346906e-01 2.109105393500574e-03 +1.230000000000000e-02 1.016114721200506e-02 -4.436452683083394e-04 2.881500000000000e+02 3.202843334758530e+01 8.880303872600582e-01 3.344505778443284e-02 4.585667447739173e-01 2.150324507557260e-03 +1.230000000000000e-02 1.016114721200506e-02 4.436452683083392e-04 2.881500000000000e+02 3.202843334758530e+01 8.880303872600582e-01 -6.648935997922503e-03 4.597366887174077e-01 2.150324507557260e-03 +1.230000000000000e-02 1.064462798635547e-02 -4.647544947946160e-04 2.881500000000000e+02 2.931124680838526e+01 8.867853340771026e-01 3.559994489771646e-02 4.608084365428229e-01 1.769861196946197e-03 +1.230000000000000e-02 1.064462798635547e-02 4.647544947946160e-04 2.881500000000000e+02 2.931124680838526e+01 8.867853340771027e-01 -4.697625191813431e-03 4.621576609592430e-01 1.769861196946197e-03 +1.230000000000000e-02 1.112810876070589e-02 -4.858637212808926e-04 2.881500000000000e+02 2.511433201771983e+01 8.693698105783823e-01 3.824167144025443e-02 4.926801264718960e-01 1.630487557935555e-03 +1.230000000000000e-02 1.112810876070589e-02 4.858637212808926e-04 2.881500000000000e+02 2.511433201771983e+01 8.693698105783823e-01 -4.843752024720255e-03 4.941383111247607e-01 1.630487557935555e-03 +1.230000000000000e-02 1.161158953505630e-02 -5.069729477671694e-04 2.881500000000000e+02 2.068271201250798e+01 8.609729305189665e-01 3.996702674728404e-02 5.070781494864128e-01 1.435649787184269e-03 +1.230000000000000e-02 1.161158953505630e-02 5.069729477671693e-04 2.881500000000000e+02 2.068271201250798e+01 8.609729305189665e-01 -4.379832605461022e-03 5.086319199381131e-01 1.435649787184269e-03 +1.230000000000000e-02 1.209507030940672e-02 -5.280821742534461e-04 2.881500000000000e+02 1.425021780494439e+01 8.068188357102061e-01 3.404111642689164e-02 5.898174028762109e-01 1.164465134572247e-03 +1.230000000000000e-02 1.209507030940672e-02 5.280821742534461e-04 2.881500000000000e+02 1.425021780494439e+01 8.068188357102061e-01 -1.749439413157761e-02 5.905398483736696e-01 1.164465134572247e-03 +1.230000000000000e-02 1.257855108375714e-02 -5.491914007397227e-04 2.881500000000000e+02 9.891554779527372e+00 7.520381756169899e-01 2.135771076565043e-02 6.587734288854707e-01 1.158624905448327e-03 +1.230000000000000e-02 1.257855108375714e-02 5.491914007397226e-04 2.881500000000000e+02 9.891554779527372e+00 7.520381756169899e-01 -3.613944926881677e-02 6.581280442445954e-01 1.158624905448327e-03 +1.230000000000000e-02 1.306203185810882e-02 -5.703006272260550e-04 2.881500000000000e+02 6.393699027877189e+00 7.203924215589249e-01 -1.774214892046960e-02 6.933397256123091e-01 8.989716122905569e-04 +1.230000000000000e-02 1.306203185810882e-02 5.703006272260548e-04 2.881500000000000e+02 6.393699027877188e+00 7.203924215589250e-01 -7.810317344952432e-02 6.891550284642648e-01 8.989716122905569e-04 +1.230000000000000e-02 1.354551263246073e-02 -5.914098537123968e-04 2.881500000000000e+02 4.159475074460833e+00 6.958121544564141e-01 -1.056173699727177e-01 7.104156648545761e-01 8.550258250599377e-04 +1.230000000000000e-02 1.354551263246073e-02 5.914098537123966e-04 2.881500000000000e+02 4.159475074460833e+00 6.958121544564141e-01 -1.671322689231877e-01 6.985071584424246e-01 8.550258250599377e-04 +1.230000000000000e-02 1.402899340681264e-02 -6.125190801987386e-04 2.881500000000000e+02 3.466774653766527e+00 6.780817593465893e-01 -1.962656943156323e-01 7.082971868334907e-01 7.807626782637281e-04 +1.230000000000000e-02 1.402899340681264e-02 6.125190801987387e-04 2.881500000000000e+02 3.466774653766527e+00 6.780817593465893e-01 -2.572510114990779e-01 6.884962198328582e-01 7.807626782637281e-04 +1.230000000000000e-02 1.451247418116454e-02 -6.336283066850803e-04 2.881500000000000e+02 2.818095933870955e+00 6.413195442631660e-01 -3.269956285048218e-01 6.941059725177575e-01 7.066101318319812e-04 +1.230000000000000e-02 1.451247418116454e-02 6.336283066850801e-04 2.881500000000000e+02 2.818095933870956e+00 6.413195442631658e-01 -3.862466329960522e-01 6.629651428584297e-01 7.066101318319812e-04 diff --git a/TestCases/incomp_rans/morse_swirl_jet/morse_sa.cfg b/TestCases/incomp_rans/morse_swirl_jet/morse_sa.cfg new file mode 100644 index 000000000000..45a3bf2c8fed --- /dev/null +++ b/TestCases/incomp_rans/morse_swirl_jet/morse_sa.cfg @@ -0,0 +1,99 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Swirling jet in still air, S = 0.36, Re = 56,000 % +% (Morse 1980, ERCOFTAC Classic case 026), SA, 5 deg wedge % +% Author: Nijso Beishuizen % +% Institution: Bosch Thermotechnology % +% Date: Nov 15th, 2026 % +% File Version 8.6.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_RANS +KIND_TURB_MODEL= SA +MATH_PROBLEM= DIRECT +RESTART_SOL= YES + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Air; the far field carries a co-flow of 1% of the jet exit velocity (34.46 m/s). +FLUID_MODEL= CONSTANT_DENSITY +INC_DENSITY_INIT= 1.2 +INC_VELOCITY_INIT= ( 0.345, 0.0, 0.0 ) +INC_NONDIM= DIMENSIONAL + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Re = U_exit D / nu = 56,000 with D = 0.0246 m. +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 1.82e-05 +FREESTREAM_NU_FACTOR= 3.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% The jet enters at x/D = 0.5 with the profiles measured there (inlet_jet.dat). The far field supplies the +% entrained air through the inlet plane; at r = 30 D it suffices up to x/D = 100. +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET= ( inlet_jet, 288.15, 34.10, 1.0, 0.0, 0.0 ) +SPECIFIED_INLET_PROFILE= YES +INLET_FILENAME= inlet_jet.dat +% The outlet is a far field too: a pressure outlet lets a reversed flow enter along the axis. +MARKER_FAR= ( farfield, outlet ) +MARKER_EULER= ( axis ) +MARKER_PERIODIC= ( periodic_1, periodic_2, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) +MARKER_PLOTTING= ( axis ) +MARKER_MONITORING= ( axis ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +NUM_METHOD_GRAD_RECON= LEAST_SQUARES +CFL_NUMBER= 25 +CFL_ADAPT= YES +CFL_ADAPT_PARAM= ( 0.5, 1.1, 25, 2500, 0.001 ) +ITER= 1000 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-4 +LINEAR_SOLVER_ITER= 50 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +VENKAT_LIMITER_COEFF= 0.05 +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= RMS_PRESSURE +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= morse_wedge.su2 +MESH_FORMAT= SU2 +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= restart_flow +CONV_FILENAME= history +VOLUME_FILENAME= flow +SCREEN_OUTPUT= INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_NU_TILDE, LINSOL_ITER, LINSOL_RESIDUAL, AVG_CFL +HISTORY_OUTPUT= ITER, RMS_RES, CFL_NUMBER +VOLUME_OUTPUT= COORDINATES, SOLUTION, PRIMITIVE, RESIDUAL +OUTPUT_FILES= RESTART, RESTART_ASCII, PARAVIEW +WRT_RESTART_COMPACT= NO +OUTPUT_WRT_FREQ= 100 diff --git a/TestCases/incomp_rans/morse_swirl_jet/morse_sa_adjoint.cfg b/TestCases/incomp_rans/morse_swirl_jet/morse_sa_adjoint.cfg new file mode 100644 index 000000000000..58174f661dc1 --- /dev/null +++ b/TestCases/incomp_rans/morse_swirl_jet/morse_sa_adjoint.cfg @@ -0,0 +1,103 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Swirling jet in still air, S = 0.36, Re = 56,000 % +% (Morse 1980, ERCOFTAC Classic case 026), SA, 5 deg wedge % +% Author: Nijso Beishuizen % +% Institution: Bosch Thermotechnology % +% Date: Nov 15th, 2026 % +% File Version 8.6.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_RANS +KIND_TURB_MODEL= SA +MATH_PROBLEM= DISCRETE_ADJOINT +RESTART_SOL= NO + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Air; the far field carries a co-flow of 1% of the jet exit velocity (34.46 m/s). +FLUID_MODEL= CONSTANT_DENSITY +INC_DENSITY_INIT= 1.2 +INC_VELOCITY_INIT= ( 0.345, 0.0, 0.0 ) +INC_NONDIM= DIMENSIONAL + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Re = U_exit D / nu = 56,000 with D = 0.0246 m. +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 1.82e-05 +FREESTREAM_NU_FACTOR= 3.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% The jet enters at x/D = 0.5 with the profiles measured there (inlet_jet.dat). The far field supplies the +% entrained air through the inlet plane; at r = 30 D it suffices up to x/D = 100. +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET= ( inlet_jet, 288.15, 34.10, 1.0, 0.0, 0.0 ) +SPECIFIED_INLET_PROFILE= YES +INLET_FILENAME= inlet_jet.dat +% The outlet is a far field too: a pressure outlet lets a reversed flow enter along the axis. +MARKER_FAR= ( farfield, outlet ) +MARKER_EULER= ( axis ) +MARKER_PERIODIC= ( periodic_1, periodic_2, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) +MARKER_PLOTTING= ( axis ) +MARKER_MONITORING= ( axis ) +OBJECTIVE_FUNCTION= SURFACE_STATIC_PRESSURE +MARKER_ANALYZE= ( inlet_jet ) +MARKER_ANALYZE_AVERAGE= AREA + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +NUM_METHOD_GRAD_RECON= LEAST_SQUARES +CFL_NUMBER= 500 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 0.5, 1.1, 25, 2500, 0.001 ) +ITER= 10 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-4 +LINEAR_SOLVER_ITER= 50 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +VENKAT_LIMITER_COEFF= 0.05 +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= ADJOINT_PRESSURE +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= morse_wedge.su2 +MESH_FORMAT= SU2 +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= restart_flow +RESTART_ADJ_FILENAME= restart_adj +CONV_FILENAME= history +VOLUME_FILENAME= flow +SCREEN_OUTPUT= INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_VELOCITY-X, RMS_ADJ_NU_TILDE +HISTORY_OUTPUT= ITER, RMS_RES +VOLUME_OUTPUT= COORDINATES, SOLUTION, PRIMITIVE, RESIDUAL +OUTPUT_FILES= RESTART +WRT_RESTART_COMPACT= NO +OUTPUT_WRT_FREQ= 100 diff --git a/TestCases/incomp_rans/morse_swirl_jet/morse_wedge.geo b/TestCases/incomp_rans/morse_swirl_jet/morse_wedge.geo new file mode 100644 index 000000000000..8e0323d752c5 --- /dev/null +++ b/TestCases/incomp_rans/morse_swirl_jet/morse_wedge.geo @@ -0,0 +1,100 @@ +// Structured wedge mesh for the Morse swirling jet (ERCOFTAC C26). +// The x-r plane is meshed at theta = -angle/2 and rotated about the jet axis (x) by the wedge angle, one cell thick. +// A slip wall at r = rmin replaces the axis, so all cells are hexahedra. Lengths are in nozzle diameters times D. +// +// gmsh morse_wedge.geo -3 -format su2 -o morse_wedge.su2 +// +// The mesh must be 3D (-3); a 2D mesh gives a file without volume elements. + +D = 0.0246; // nozzle diameter [m] +angle = 5; // wedge angle [deg] +x0 = 0.5; // inlet plane, x/D +xmax = 50; // outlet plane, x/D +rmin = 0.02; // slip wall replacing the axis, r/D +rjet = 0.5905; // outer radius of the measured inlet profile, r/D +rfine = 4; // end of the uniform radial spacing, r/D +rmax = 30; // far-field radius, r/D +dr = 0.02; // uniform radial spacing, r/D +dx0 = 0.02; // axial spacing at the inlet, x/D +dxmax = 0.25; // largest axial spacing, x/D +g = 1.03; // growth ratio of stretched spacings + +// Cells per segment: axial spacing grows from dx0 to dxmax, then stays uniform. +nx1 = Ceil(Log(dxmax / dx0) / Log(g)); +xg = x0 + dx0 * (g^nx1 - 1) / (g - 1); +nx2 = Round((xmax - xg) / dxmax); +nr1 = Round((rjet - rmin) / dr); +nr2 = Round((rfine - rjet) / dr); +nr3 = Round(Log(1 + (rmax - rfine) * (g - 1) / dr) / Log(g)); + +xs[] = {x0, xg, xmax}; +rs[] = {rmin, rjet, rfine, rmax}; +nxs[] = {nx1, nx2}; +gxs[] = {g, 1}; +nrs[] = {nr1, nr2, nr3}; +grs[] = {1, 1, g}; +a = -0.5 * angle * Pi / 180; + +For i In {0:2} + For j In {0:3} + p = newp; + Point(p) = {xs[i] * D, rs[j] * D * Cos(a), rs[j] * D * Sin(a)}; + P[i * 4 + j] = p; + EndFor +EndFor + +// Lines of constant r (H) and of constant x (V), all oriented towards larger x or r. +For i In {0:1} + For j In {0:3} + l = newl; + Line(l) = {P[i * 4 + j], P[(i + 1) * 4 + j]}; + Transfinite Curve{l} = nxs[i] + 1 Using Progression gxs[i]; + H[i * 4 + j] = l; + EndFor +EndFor +For i In {0:2} + For j In {0:2} + l = newl; + Line(l) = {P[i * 4 + j], P[i * 4 + j + 1]}; + Transfinite Curve{l} = nrs[j] + 1 Using Progression grs[j]; + V[i * 3 + j] = l; + EndFor +EndFor + +For i In {0:1} + For j In {0:2} + cl = newcl; + Curve Loop(cl) = {H[i * 4 + j], V[(i + 1) * 3 + j], -H[i * 4 + j + 1], -V[i * 3 + j]}; + s = news; + Plane Surface(s) = {cl}; + Transfinite Surface{s}; + Recombine Surface{s}; + S[i * 3 + j] = s; + EndFor +EndFor + +ext[] = Extrude {{1, 0, 0}, {0, 0, 0}, angle * Pi / 180} { Surface{S[]}; Layers{1}; Recombine; }; + +// Extrude returns, per source surface, the rotated copy, the volume and the four side surfaces. +For k In {0:5} + top[k] = ext[6 * k]; + vol[k] = ext[6 * k + 1]; +EndFor + +e = 1e-4 * D; +big = 2 * rmax * D; +inlet[] = Surface In BoundingBox{x0 * D - e, -big, -big, x0 * D + e, big, big}; +jet[] = Surface In BoundingBox{x0 * D - e, -big, -big, x0 * D + e, rjet * D + e, big}; +outlet[] = Surface In BoundingBox{xmax * D - e, -big, -big, xmax * D + e, big, big}; +axis[] = Surface In BoundingBox{x0 * D - e, -big, -big, xmax * D + e, rmin * D + e, big}; +side[] = Surface In BoundingBox{x0 * D - e, rmax * D * Cos(a) - e, -big, xmax * D + e, rmax * D + e, big}; +open[] = inlet[]; +open[] -= jet[]; + +Physical Surface("inlet_jet") = {jet[]}; +Physical Surface("farfield") = {open[], side[]}; +Physical Surface("outlet") = {outlet[]}; +Physical Surface("axis") = {axis[]}; +Physical Surface("periodic_1") = {S[]}; +Physical Surface("periodic_2") = {top[]}; +Physical Volume("fluid") = {vol[]}; diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index b58c4d7e2199..e2f767f8831a 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -507,7 +507,7 @@ def main(): periodic3d_axis.cfg_dir = "navierstokes/periodic3D_axis" periodic3d_axis.cfg_file = "config.cfg" periodic3d_axis.test_iter = 100 - periodic3d_axis.test_vals = [-3.353165, 0.157501, 2.051458, -9.594400, -9.594400] + periodic3d_axis.test_vals = [-3.271569, -0.284345, 2.163829, -7.848400, -7.848400] test_list.append(periodic3d_axis) ########################## @@ -926,7 +926,7 @@ def main(): 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] + sp_pipeSlice_3d_dp_hf_tp.test_vals = [-13.241752, -13.260502, -10.953562, -0.000025] test_list.append(sp_pipeSlice_3d_dp_hf_tp) # Same with the energy equation, periodic temperature and an integrated wall heat @@ -934,7 +934,7 @@ def main(): sp_pipeSlice_3d_dp_ihf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipeSlice_3d" sp_pipeSlice_3d_dp_ihf_tp.cfg_file = "sp_pipeSlice_3d_dp_ihf_tp.cfg" sp_pipeSlice_3d_dp_ihf_tp.test_iter = 10 - sp_pipeSlice_3d_dp_ihf_tp.test_vals = [-11.120123, -5.196299, -0.000023, -0.015700] + sp_pipeSlice_3d_dp_ihf_tp.test_vals = [-12.253831, -5.369585, -0.000025, -0.015700] test_list.append(sp_pipeSlice_3d_dp_ihf_tp) # 2D pin array with heat transfer BC on pin surfaces @@ -957,6 +957,14 @@ def main(): 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) + # Swirling jet on a one-cell wedge, rotational periodicity (Morse 1980) + inc_turb_morse_swirl_jet = TestCase('inc_turb_morse_swirl_jet') + inc_turb_morse_swirl_jet.cfg_dir = "incomp_rans/morse_swirl_jet" + inc_turb_morse_swirl_jet.cfg_file = "morse_sa.cfg" + inc_turb_morse_swirl_jet.test_iter = 10 + inc_turb_morse_swirl_jet.test_vals = [-10.569500, -8.370534, -9.323232, 12.000000, -4.041427, 71.328000] + test_list.append(inc_turb_morse_swirl_jet) + # NACA0012, SST_SUST inc_turb_naca0012_sst_sust = TestCase('inc_turb_naca0012_sst_sust') inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index f8ada04c5818..19288e429169 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -141,6 +141,14 @@ def main(): discadj_incomp_turb_NACA0012_sst.test_vals_aarch64 = [-4.294502, -3.069650, -7.086569, 0.000000, -1.151213] test_list.append(discadj_incomp_turb_NACA0012_sst) + # Adjoint Incompressible Turbulent Morse swirling jet, SA, one-cell periodic wedge + discadj_incomp_turb_morse_swirl_jet = TestCase('discadj_incomp_turb_morse_swirl_jet') + discadj_incomp_turb_morse_swirl_jet.cfg_dir = "incomp_rans/morse_swirl_jet" + discadj_incomp_turb_morse_swirl_jet.cfg_file = "morse_sa_adjoint.cfg" + discadj_incomp_turb_morse_swirl_jet.test_iter = 10 + discadj_incomp_turb_morse_swirl_jet.test_vals = [10.000000, -5.548813, -3.649165, -1.128723] + test_list.append(discadj_incomp_turb_morse_swirl_jet) + #################################################################### ### Disc. Adj. Axisymmetric RANS ### #################################################################### diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 05d44805e201..8fe4642b02dc 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -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.308175, -9.891136, -10.038680, -13.368508] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.308167, -9.891117, -10.038669, -13.368501] test_list.append(discadj_trans_stator)