From 72d8f3053dae5d0b2ae897d76811b4432456782d Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 13 Jan 2025 15:05:47 +0100 Subject: [PATCH 01/17] - fixed unsteady names --- SU2_CFD/src/output/COutput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 016b5d35ec0..3733f40ed8e 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -389,6 +389,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form /*--- File writer that will later be used to write the file to disk. Created below in the "switch" ---*/ CFileWriter *fileWriter = nullptr; + /*--- Set current time iter even if history file is not written ---*/ + curTimeIter = config->GetTimeIter(); + /*--- If it is still present, strip the extension (suffix) from the filename ---*/ const auto lastindex = fileName.find_last_of('.'); fileName = fileName.substr(0, lastindex); @@ -476,7 +479,7 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form extension = CSU2MeshFileWriter::fileExt; if (fileName.empty()) - fileName = volumeFilename; + fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); From e58cb56a8e826943ace8cd8bf31bf49799f1125b Mon Sep 17 00:00:00 2001 From: vikram Date: Thu, 16 Jan 2025 23:33:14 +0000 Subject: [PATCH 02/17] CTurbSASolver.cpp changed as mentioned --- SU2_CFD/src/solvers/CTurbSASolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 6b465e802fd..08eb5ccc83d 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -500,7 +500,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta Res_Wall = coeff*RoughWallBC*Area; LinSysRes.SubtractBlock(iPoint, &Res_Wall); - su2double Jacobian_i = (laminar_viscosity*Area)/(0.03*Roughness_Height*sigma); + su2double Jacobian_i = Jacobian_i = (laminar_viscosity /density *Area)/(0.03*Roughness_Height*sigma); Jacobian_i += 2.0*RoughWallBC*Area/sigma; if (implicit) Jacobian.AddVal2Diag(iPoint, -Jacobian_i); } From c675d737a79f798f0f13f6167c4034393cdf3508 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:30:07 -0800 Subject: [PATCH 03/17] Update SU2_CFD/src/solvers/CTurbSASolver.cpp --- SU2_CFD/src/solvers/CTurbSASolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 08eb5ccc83d..7d9999d965f 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -500,7 +500,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta Res_Wall = coeff*RoughWallBC*Area; LinSysRes.SubtractBlock(iPoint, &Res_Wall); - su2double Jacobian_i = Jacobian_i = (laminar_viscosity /density *Area)/(0.03*Roughness_Height*sigma); + su2double Jacobian_i = (laminar_viscosity /density *Area)/(0.03*Roughness_Height*sigma); Jacobian_i += 2.0*RoughWallBC*Area/sigma; if (implicit) Jacobian.AddVal2Diag(iPoint, -Jacobian_i); } From b88ed078f337a31e769c82266701157547c9fb75 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 17 Jan 2025 10:08:43 +0100 Subject: [PATCH 04/17] - Added output function to set curTimeIter --- SU2_CFD/include/output/COutput.hpp | 6 ++++++ SU2_CFD/src/iteration/CFluidIteration.cpp | 2 ++ SU2_CFD/src/output/COutput.cpp | 5 ----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 14b0bbec9b6..8300f1a568d 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -418,6 +418,12 @@ class COutput { */ void SetMultizoneHistoryOutput(COutput** output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter); + + /*! + * \brief Sets the current time iteration + * \param[in] timeIter - the current time iteration + */ + inline void SetCurTimeIter(unsigned long val_curTimeIter) {curTimeIter = val_curTimeIter;} /*! * \brief Sets the volume output filename diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 4ca6c45a172..77a058c39df 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -376,6 +376,8 @@ void CFluidIteration::Solve(COutput* output, CIntegration**** integration, CGeom /*--- Boolean to determine if we are running a static or dynamic case ---*/ bool steady = !config[val_iZone]->GetTime_Domain(); + if (!steady) output->SetCurTimeIter(config[val_iZone]->GetTimeIter()); + unsigned long Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter(); bool StopCalc = false; diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 3733f40ed8e..36c743cebe3 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -207,7 +207,6 @@ void COutput::SetHistoryOutput(CGeometry *geometry, unsigned long OuterIter, unsigned long InnerIter) { - curTimeIter = TimeIter; curAbsTimeIter = max(TimeIter, config->GetStartWindowIteration()) - config->GetStartWindowIteration(); curOuterIter = OuterIter; curInnerIter = InnerIter; @@ -273,7 +272,6 @@ void COutput::SetHistoryOutput(CGeometry ****geometry, CSolver *****solver, CCon void COutput::SetMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){ - curTimeIter = TimeIter; curAbsTimeIter = max(TimeIter, driver_config->GetStartWindowIteration()) - driver_config->GetStartWindowIteration(); curOuterIter = OuterIter; @@ -389,9 +387,6 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form /*--- File writer that will later be used to write the file to disk. Created below in the "switch" ---*/ CFileWriter *fileWriter = nullptr; - /*--- Set current time iter even if history file is not written ---*/ - curTimeIter = config->GetTimeIter(); - /*--- If it is still present, strip the extension (suffix) from the filename ---*/ const auto lastindex = fileName.find_last_of('.'); fileName = fileName.substr(0, lastindex); From 6e0d7a1465e63f36ee9f1a139ede9abfe0feb543 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 21 Jan 2025 18:00:02 +0100 Subject: [PATCH 05/17] - Fixed multizone history output --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index d5e2fbbafbb..4a726812e7b 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -397,6 +397,10 @@ void CMultizoneDriver::Corrector(unsigned short val_iZone) { bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { + // Set the current time iter for the multizone problem + bool unsteady = config_container[ZONE_0]->GetTime_Domain(); + if (unsteady) driver_output->SetCurTimeIter(config_container[ZONE_0]->GetTimeIter()); + /*--- Update the residual for the all the zones. ---*/ for (iZone = 0; iZone < nZone; iZone++) { From 181af084f5734e89cb3998b2011dc64c7dbb1727 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 22 Jan 2025 23:01:52 +0100 Subject: [PATCH 06/17] Remove unused option SMOOTH_GEOMETRY (#2427) * remove implicit smoothing remains --- Common/include/CConfig.hpp | 7 -- Common/include/geometry/CGeometry.hpp | 8 --- Common/include/geometry/CPhysicalGeometry.hpp | 8 --- Common/include/geometry/dual_grid/CPoint.hpp | 25 +------- Common/src/CConfig.cpp | 5 -- Common/src/geometry/CPhysicalGeometry.cpp | 64 ------------------- Common/src/geometry/dual_grid/CPoint.cpp | 8 --- 7 files changed, 2 insertions(+), 123 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 0afaff13ddc..58918bfdc2c 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -108,7 +108,6 @@ class CConfig { su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */ su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */ su2double StartTime; - unsigned short SmoothNumGrid; /*!< \brief Smooth the numerical grid. */ bool ContinuousAdjoint, /*!< \brief Flag to know if the code is solving an adjoint problem. */ Viscous, /*!< \brief Flag to know if the code is solving a viscous problem. */ EquivArea, /*!< \brief Flag to know if the code is going to compute and plot the equivalent area. */ @@ -6338,12 +6337,6 @@ class CConfig { */ bool GetAxisymmetric(void) const { return Axisymmetric; } - /*! - * \brief Get information about there is a smoothing of the grid coordinates. - * \return TRUE if there is smoothing of the grid coordinates; otherwise FALSE. - */ - unsigned short GetSmoothNumGrid(void) const { return SmoothNumGrid; } - /*! * \brief Subtract one to the index of the finest grid (full multigrid strategy). * \return Change the index of the finest grid. diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index 738618ba2cd..dd79546f56b 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -913,14 +913,6 @@ class CGeometry { */ inline virtual void SetMultiGridWallTemperature(const CGeometry* fine_grid, unsigned short val_marker) {} - /*! - * \brief A virtual member. - * \param[in] val_nSmooth - Number of smoothing iterations. - * \param[in] val_smooth_coeff - Relaxation factor. - * \param[in] config - Definition of the particular problem. - */ - inline virtual void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) {} - /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the child grid (for multigrid). diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 8214e4ea7f0..5671ceae247 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -545,14 +545,6 @@ class CPhysicalGeometry final : public CGeometry { void DetermineTimeLevelElements(CConfig* config, const vector& localFaces, map& mapExternalElemIDToTimeLevel); - /*! - * \brief Do an implicit smoothing of the grid coordinates. - * \param[in] val_nSmooth - Number of smoothing iterations. - * \param[in] val_smooth_coeff - Relaxation factor. - * \param[in] config - Definition of the particular problem. - */ - void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) override; - /*! * \brief Compute 3 grid quality metrics: orthogonality angle, dual cell aspect ratio, and dual cell volume ratio. * \param[in] config - Definition of the particular problem. diff --git a/Common/include/geometry/dual_grid/CPoint.hpp b/Common/include/geometry/dual_grid/CPoint.hpp index 17d540a2a7b..e497df35307 100644 --- a/Common/include/geometry/dual_grid/CPoint.hpp +++ b/Common/include/geometry/dual_grid/CPoint.hpp @@ -771,14 +771,14 @@ class CPoint { } /*! - * \brief Get the value of the old coordinates for implicit smoothing. + * \brief Get the value of the old coordinates. * \param[in] iPoint - Index of the point. * \return Old coordinates at a point. */ inline su2double* GetCoord_Old(unsigned long iPoint) { return Coord_Old[iPoint]; } /*! - * \brief Set the value of the vector Coord_Old for implicit smoothing. + * \brief Set the value of the vector Coord_Old. * \param[in] iPoint - Index of the point. * \param[in] coord_old - Value of the coordinates. */ @@ -791,27 +791,6 @@ class CPoint { */ void SetCoord_Old(); - /*! - * \brief Get the value of the summed coordinates for implicit smoothing. - * \param[in] iPoint - Index of the point. - * \return Sum of coordinates at a point. - */ - inline su2double* GetCoord_Sum(unsigned long iPoint) { return Coord_Sum[iPoint]; } - - /*! - * \brief Add the value of the coordinates to the Coord_Sum vector for implicit smoothing. - * \param[in] iPoint - Index of the point. - * \param[in] coord_sum - Value of the coordinates to add. - */ - inline void AddCoord_Sum(unsigned long iPoint, const su2double* coord_sum) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_Sum(iPoint, iDim) += coord_sum[iDim]; - } - - /*! - * \brief Initialize the vector Coord_Sum. - */ - void SetCoord_SumZero(); - /*! * \brief Get the value of the grid velocity at the point. * \param[in] iPoint - Index of the point. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 1ec938832e2..cc5bd3faca6 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2264,9 +2264,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Value to move motion origins (1 or 0) */ addUShortListOption("MOVE_MOTION_ORIGIN", nMoveMotion_Origin, MoveMotion_Origin); - /* DESCRIPTION: Before each computation, implicitly smooth the nodal coordinates */ - addUnsignedShortOption("SMOOTH_GEOMETRY", SmoothNumGrid, 0); - /*!\par CONFIG_CATEGORY: Aeroelastic Simulation (Typical Section Model) \ingroup Config*/ /*--- Options related to aeroelastic simulations using the Typical Section Model) ---*/ /* DESCRIPTION: The flutter speed index (modifies the freestream condition) */ @@ -6877,8 +6874,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << endl <<"--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; - if (SmoothNumGrid) cout << "There are some smoothing iterations on the grid coordinates." << endl; - if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_EULER) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 6e34e715be5..6bbbaa38e3d 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7417,70 +7417,6 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig* config) const { } } -void CPhysicalGeometry::SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) { - unsigned short iSmooth, nneigh, iMarker; - su2double *Coord_Old, *Coord_Sum, *Coord, *Coord_i, *Coord_j, Position_Plane = 0.0; - unsigned long iEdge, iPoint, jPoint, iVertex; - su2double eps = 1E-6; - bool NearField = false; - - Coord = new su2double[nDim]; - - nodes->SetCoord_Old(); - - /*--- Jacobi iterations ---*/ - for (iSmooth = 0; iSmooth < val_nSmooth; iSmooth++) { - nodes->SetCoord_SumZero(); - - /*--- Loop over Interior edges ---*/ - for (iEdge = 0; iEdge < nEdge; iEdge++) { - iPoint = edges->GetNode(iEdge, 0); - Coord_i = nodes->GetCoord(iPoint); - - jPoint = edges->GetNode(iEdge, 1); - Coord_j = nodes->GetCoord(jPoint); - - /*--- Accumulate nearest neighbor Coord to Res_sum for each variable ---*/ - nodes->AddCoord_Sum(iPoint, Coord_j); - nodes->AddCoord_Sum(jPoint, Coord_i); - } - - /*--- Loop over all mesh points (Update Coords with averaged sum) ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++) { - nneigh = nodes->GetnPoint(iPoint); - Coord_Sum = nodes->GetCoord_Sum(iPoint); - Coord_Old = nodes->GetCoord_Old(iPoint); - - if (nDim == 2) { - Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh)); - Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh)); - if ((NearField) && ((Coord_Old[1] > Position_Plane - eps) && (Coord_Old[1] < Position_Plane + eps))) - Coord[1] = Coord_Old[1]; - } - - if (nDim == 3) { - Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh)); - Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh)); - Coord[2] = (Coord_Old[2] + val_smooth_coeff * Coord_Sum[2]) / (1.0 + val_smooth_coeff * su2double(nneigh)); - if ((NearField) && ((Coord_Old[2] > Position_Plane - eps) && (Coord_Old[2] < Position_Plane + eps))) - Coord[2] = Coord_Old[2]; - } - - nodes->SetCoord(iPoint, Coord); - } - - /*--- Copy boundary values ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++) - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); - Coord_Old = nodes->GetCoord_Old(iPoint); - nodes->SetCoord(iPoint, Coord_Old); - } - } - - delete[] Coord; -} - bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short& face_first_elem, unsigned short& face_second_elem) { if (first_elem == second_elem) return false; diff --git a/Common/src/geometry/dual_grid/CPoint.cpp b/Common/src/geometry/dual_grid/CPoint.cpp index 35c45a826b4..7096dfa6443 100644 --- a/Common/src/geometry/dual_grid/CPoint.cpp +++ b/Common/src/geometry/dual_grid/CPoint.cpp @@ -94,12 +94,6 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig* config) { Vertex.resize(npoint); - /*--- For smoothing the numerical grid coordinates ---*/ - if (config->GetSmoothNumGrid()) { - Coord_Old.resize(npoint, nDim) = su2double(0.0); - Coord_Sum.resize(npoint, nDim) = su2double(0.0); - } - /*--- Storage of grid velocities for dynamic meshes. ---*/ if (config->GetDynamic_Grid()) { @@ -190,5 +184,3 @@ void CPoint::SetCoord_Old() { assert(Coord_Old.size() == Coord.size()); parallelCopy(Coord.size(), Coord.data(), Coord_Old.data()); } - -void CPoint::SetCoord_SumZero() { parallelSet(Coord_Sum.size(), 0.0, Coord_Sum.data()); } From f5d0c8258d7f7c4f45c690a505effb5640c0aa0c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 23 Jan 2025 16:00:21 +0100 Subject: [PATCH 07/17] - Simplified implementation --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 4 ++-- SU2_CFD/src/iteration/CFluidIteration.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 4a726812e7b..91885f0c731 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -398,13 +398,13 @@ void CMultizoneDriver::Corrector(unsigned short val_iZone) { bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { // Set the current time iter for the multizone problem - bool unsteady = config_container[ZONE_0]->GetTime_Domain(); - if (unsteady) driver_output->SetCurTimeIter(config_container[ZONE_0]->GetTimeIter()); /*--- Update the residual for the all the zones. ---*/ for (iZone = 0; iZone < nZone; iZone++) { + output_container[iZone]->SetCurTimeIter(config_container[iZone]->GetTimeIter()); + /*--- Account for all the solvers in this zone. ---*/ auto solvers = solver_container[iZone][INST_0][MESH_0]; diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 77a058c39df..84c70c2b64e 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -375,8 +375,7 @@ void CFluidIteration::Solve(COutput* output, CIntegration**** integration, CGeom unsigned short val_iInst) { /*--- Boolean to determine if we are running a static or dynamic case ---*/ bool steady = !config[val_iZone]->GetTime_Domain(); - - if (!steady) output->SetCurTimeIter(config[val_iZone]->GetTimeIter()); + output->SetCurTimeIter(config[val_iZone]->GetTimeIter()); unsigned long Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter(); bool StopCalc = false; From 2c3e3c75bbc9fbe655bdb44c88cbcc2f656f0e94 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 23 Jan 2025 17:42:38 +0100 Subject: [PATCH 08/17] - Revert to previous commit --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 -- SU2_CFD/src/iteration/CFluidIteration.cpp | 1 - SU2_CFD/src/output/COutput.cpp | 7 ++++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 91885f0c731..8c6e3cd2194 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -403,8 +403,6 @@ bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { for (iZone = 0; iZone < nZone; iZone++) { - output_container[iZone]->SetCurTimeIter(config_container[iZone]->GetTimeIter()); - /*--- Account for all the solvers in this zone. ---*/ auto solvers = solver_container[iZone][INST_0][MESH_0]; diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 84c70c2b64e..4ca6c45a172 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -375,7 +375,6 @@ void CFluidIteration::Solve(COutput* output, CIntegration**** integration, CGeom unsigned short val_iInst) { /*--- Boolean to determine if we are running a static or dynamic case ---*/ bool steady = !config[val_iZone]->GetTime_Domain(); - output->SetCurTimeIter(config[val_iZone]->GetTimeIter()); unsigned long Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter(); bool StopCalc = false; diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 36c743cebe3..58f01d7f742 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -206,7 +206,8 @@ void COutput::SetHistoryOutput(CGeometry *geometry, unsigned long TimeIter, unsigned long OuterIter, unsigned long InnerIter) { - + + curTimeIter = TimeIter; curAbsTimeIter = max(TimeIter, config->GetStartWindowIteration()) - config->GetStartWindowIteration(); curOuterIter = OuterIter; curInnerIter = InnerIter; @@ -272,6 +273,7 @@ void COutput::SetHistoryOutput(CGeometry ****geometry, CSolver *****solver, CCon void COutput::SetMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){ + curTimeIter = TimeIter; curAbsTimeIter = max(TimeIter, driver_config->GetStartWindowIteration()) - driver_config->GetStartWindowIteration(); curOuterIter = OuterIter; @@ -387,6 +389,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form /*--- File writer that will later be used to write the file to disk. Created below in the "switch" ---*/ CFileWriter *fileWriter = nullptr; + /*--- Set current time iter even if history file is not written ---*/ + curTimeIter = config->GetTimeIter(); + /*--- If it is still present, strip the extension (suffix) from the filename ---*/ const auto lastindex = fileName.find_last_of('.'); fileName = fileName.substr(0, lastindex); From 8fc042cf82e74f2685e4b6e277d0c359646300fe Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:47:13 -0800 Subject: [PATCH 09/17] Apply suggestions from code review --- SU2_CFD/include/output/COutput.hpp | 6 ------ SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 -- SU2_CFD/src/output/COutput.cpp | 1 - 3 files changed, 9 deletions(-) diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 8300f1a568d..14b0bbec9b6 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -418,12 +418,6 @@ class COutput { */ void SetMultizoneHistoryOutput(COutput** output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter); - - /*! - * \brief Sets the current time iteration - * \param[in] timeIter - the current time iteration - */ - inline void SetCurTimeIter(unsigned long val_curTimeIter) {curTimeIter = val_curTimeIter;} /*! * \brief Sets the volume output filename diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 8c6e3cd2194..d5e2fbbafbb 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -397,8 +397,6 @@ void CMultizoneDriver::Corrector(unsigned short val_iZone) { bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { - // Set the current time iter for the multizone problem - /*--- Update the residual for the all the zones. ---*/ for (iZone = 0; iZone < nZone; iZone++) { diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 58f01d7f742..631a4ba6bde 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -206,7 +206,6 @@ void COutput::SetHistoryOutput(CGeometry *geometry, unsigned long TimeIter, unsigned long OuterIter, unsigned long InnerIter) { - curTimeIter = TimeIter; curAbsTimeIter = max(TimeIter, config->GetStartWindowIteration()) - config->GetStartWindowIteration(); curOuterIter = OuterIter; From 1a30b5821b75e9d1cc6c81a7a0ba66c42327207b Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 24 Jan 2025 16:22:21 -0800 Subject: [PATCH 10/17] add submodule --- .gitmodules | 3 +++ externals/FADO | 1 + 2 files changed, 4 insertions(+) create mode 160000 externals/FADO diff --git a/.gitmodules b/.gitmodules index 2c655cb36da..4c6d8a819f8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -27,3 +27,6 @@ [submodule "subprojects/MLPCpp"] path = subprojects/MLPCpp url = https://github.com/EvertBunschoten/MLPCpp.git +[submodule "externals/FADO"] + path = externals/FADO + url = https://github.com/pcarruscag/FADO.git diff --git a/externals/FADO b/externals/FADO new file mode 160000 index 00000000000..ee0eb0ba08e --- /dev/null +++ b/externals/FADO @@ -0,0 +1 @@ +Subproject commit ee0eb0ba08e04c83051d805ee64de6d97d9fda38 From bd72165069e39834a2ee77abc34cb70831a2d4d9 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 24 Jan 2025 16:39:13 -0800 Subject: [PATCH 11/17] install --- SU2_PY/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index 85ae325f3f0..5c00ac9b1ad 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -70,3 +70,5 @@ install_data(['FSI_tools/__init__.py', install_data(['SU2_Nastran/__init__.py', 'SU2_Nastran/pysu2_nastran.py'], install_dir: join_paths(get_option('bindir'), 'SU2_Nastran')) + +install_subdir(['../externals/FADO'], install_dir: join_paths(get_option('bindir'), 'FADO')) From 9697a85c98e67bd13a596ff3fa00489bcd48edbe Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 24 Jan 2025 17:37:08 -0800 Subject: [PATCH 12/17] fixes for importing easily --- SU2_PY/meson.build | 2 +- TestCases/serial_regression.py | 4 ++++ externals/FADO | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index 5c00ac9b1ad..ced81290346 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -71,4 +71,4 @@ install_data(['SU2_Nastran/__init__.py', 'SU2_Nastran/pysu2_nastran.py'], install_dir: join_paths(get_option('bindir'), 'SU2_Nastran')) -install_subdir(['../externals/FADO'], install_dir: join_paths(get_option('bindir'), 'FADO')) +install_subdir(['../externals/FADO'], install_dir: get_option('bindir')) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index b4b9cd473a9..7f8baec7e9a 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -30,6 +30,10 @@ from TestCase import TestCase from TestCase import parse_args +import FADO +FADO.printDocumentation() + + def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github diff --git a/externals/FADO b/externals/FADO index ee0eb0ba08e..de318644e81 160000 --- a/externals/FADO +++ b/externals/FADO @@ -1 +1 @@ -Subproject commit ee0eb0ba08e04c83051d805ee64de6d97d9fda38 +Subproject commit de318644e81037cfd20af3e12c51bf14dcdf77ba From 4d9a0d9aab2f4e86d1f651f30a4645d5a46f7fcb Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:40:31 -0800 Subject: [PATCH 13/17] Update TestCases/serial_regression.py --- TestCases/serial_regression.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 7f8baec7e9a..b4b9cd473a9 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -30,10 +30,6 @@ from TestCase import TestCase from TestCase import parse_args -import FADO -FADO.printDocumentation() - - def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github From b1c3a15e89a7ae6fb7ed39795576a6b0bd2dd93a Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 24 Jan 2025 19:45:26 -0800 Subject: [PATCH 14/17] update authors --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 511ebcf4b33..48b2140480a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -136,6 +136,7 @@ Thomas D. Economon Tim Albring TobiKattmann Trent Lukaczyk +Vikram Bharadwaj Vinzenz Götz VivaanKhatri Wally Maier From 9cfe08d9c061e6e39caab9dc3a591deefa60737d Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 25 Jan 2025 16:25:18 -0800 Subject: [PATCH 15/17] add FADO to init script --- externals/FADO | 2 +- meson_scripts/init.py | 9 +++++++++ preconfigure.py | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/externals/FADO b/externals/FADO index de318644e81..ce7ee018e4e 160000 --- a/externals/FADO +++ b/externals/FADO @@ -1 +1 @@ -Subproject commit de318644e81037cfd20af3e12c51bf14dcdf77ba +Subproject commit ce7ee018e4e699af5028d69baa1939fea290e18a diff --git a/meson_scripts/init.py b/meson_scripts/init.py index e3df3e023ba..56114ebad35 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -48,6 +48,7 @@ def init_submodules( own_mpp=True, own_cool=True, own_mel=True, + own_fado=True, own_mlpcpp=True, ): @@ -71,6 +72,8 @@ def init_submodules( github_repo_coolprop = "https://github.com/CoolProp/CoolProp" sha_version_mel = "46205ab019e5224559091375a6d71aabae6bc5b9" github_repo_mel = "https://github.com/pcarruscag/MEL" + sha_version_fado = "ce7ee018e4e699af5028d69baa1939fea290e18a" + github_repo_fado = "https://github.com/pcarruscag/FADO" sha_version_mlpcpp = "6865a58b22f21a92977839d9c93eae9522402f55" github_repo_mlpcpp = "https://github.com/EvertBunschoten/MLPCpp" @@ -82,6 +85,7 @@ def init_submodules( mpp_name = "Mutationpp" coolprop_name = "CoolProp" mel_name = "MEL" + fado_name = "FADO" mlpcpp_name = "MLPCpp" base_path = cur_dir + os.path.sep + "externals" + os.path.sep @@ -91,6 +95,7 @@ def init_submodules( alt_name_meson = base_path + "meson" alt_name_ninja = base_path + "ninja" alt_name_mel = base_path + "mel" + alt_name_mel = base_path + "fado" alt_name_mpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "Mutationpp" alt_name_coolprop = cur_dir + os.path.sep + "subprojects" + os.path.sep + "CoolProp" alt_name_mlpcpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "MLPCpp" @@ -123,6 +128,8 @@ def init_submodules( submodule_status(alt_name_coolprop, sha_version_coolprop) if own_mel: submodule_status(alt_name_mel, sha_version_mel) + if own_fado: + submodule_status(alt_name_fado, sha_version_fado) if own_mlpcpp: submodule_status(alt_name_mlpcpp, sha_version_mlpcpp) # Otherwise download the zip file from git @@ -157,6 +164,8 @@ def init_submodules( ) if own_mel: download_module(mel_name, alt_name_mel, github_repo_mel, sha_version_mel) + if own_fado: + download_module(fado_name, alt_name_fado, github_repo_fado, sha_version_fado) if own_mlpcpp: download_module( mlpcpp_name, alt_name_mlpcpp, github_repo_mlpcpp, sha_version_mlpcpp diff --git a/preconfigure.py b/preconfigure.py index 51cb0599e6e..5dfe8acd8a9 100755 --- a/preconfigure.py +++ b/preconfigure.py @@ -81,6 +81,7 @@ def run( own_mpp=True, own_cool=True, own_mel=True, + own_fado=True, own_mlpcpp=True, ): @@ -94,6 +95,7 @@ def run( own_mpp=own_mpp, own_cool=own_cool, own_mel=own_mel, + own_fado=own_fado, own_mlpcpp=own_mlpcpp, ) @@ -137,6 +139,9 @@ def run( parser.add_argument( "--no-mel", help="do not download own copy of MEL", action="store_false" ) + parser.add_argument( + "--no-fado", help="do not download own copy of FADO", action="store_false" + ) parser.add_argument( "--no-mlpcpp", help="do not download copy of MLpCpp", @@ -152,5 +157,6 @@ def run( own_mpp=args.no_mpp, own_cool=args.no_coolprop, own_mel=args.no_mel, + own_fado=args.no_fado, own_mlpcpp=args.no_mlpcpp, ) From 423e3a33caf014daed21bd32c1b53e85ef0aed8d Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 25 Jan 2025 16:55:35 -0800 Subject: [PATCH 16/17] fix --- meson_scripts/init.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson_scripts/init.py b/meson_scripts/init.py index 56114ebad35..109c0232271 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -95,7 +95,7 @@ def init_submodules( alt_name_meson = base_path + "meson" alt_name_ninja = base_path + "ninja" alt_name_mel = base_path + "mel" - alt_name_mel = base_path + "fado" + alt_name_mel = base_path + "FADO" alt_name_mpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "Mutationpp" alt_name_coolprop = cur_dir + os.path.sep + "subprojects" + os.path.sep + "CoolProp" alt_name_mlpcpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "MLPCpp" @@ -165,7 +165,9 @@ def init_submodules( if own_mel: download_module(mel_name, alt_name_mel, github_repo_mel, sha_version_mel) if own_fado: - download_module(fado_name, alt_name_fado, github_repo_fado, sha_version_fado) + download_module( + fado_name, alt_name_fado, github_repo_fado, sha_version_fado + ) if own_mlpcpp: download_module( mlpcpp_name, alt_name_mlpcpp, github_repo_mlpcpp, sha_version_mlpcpp From 4a0b4cea87678a87cc861389dfc2f4f5f395569a Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 25 Jan 2025 17:00:34 -0800 Subject: [PATCH 17/17] fix --- meson_scripts/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_scripts/init.py b/meson_scripts/init.py index 109c0232271..67a2e41a2ec 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -95,7 +95,7 @@ def init_submodules( alt_name_meson = base_path + "meson" alt_name_ninja = base_path + "ninja" alt_name_mel = base_path + "mel" - alt_name_mel = base_path + "FADO" + alt_name_fado = base_path + "FADO" alt_name_mpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "Mutationpp" alt_name_coolprop = cur_dir + os.path.sep + "subprojects" + os.path.sep + "CoolProp" alt_name_mlpcpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "MLPCpp"