diff --git a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp index 3f61be0904b7..dee86ad3f191 100644 --- a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp @@ -141,8 +141,6 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { */ void StartSolver() override; -protected: - /*! * \brief Preprocess the multizone iteration */ @@ -153,6 +151,8 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { */ void Run() override; +protected: + /*! * \brief Run one inner iteration for a given zone. * \return The result of "monitor". @@ -272,7 +272,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { * \brief gets Convergence on physical time scale, (deactivated in adjoint case) * \return false */ - inline bool GetTimeConvergence() const override {return false;} + inline bool GetTimeConvergence() const override { return false; } /*! * \brief Get the external of all adjoint solvers in a zone. diff --git a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp index 206f245e400f..105eecc3abe8 100644 --- a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp @@ -57,40 +57,6 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { COutputLegacy* output_legacy; -public: - - /*! - * \brief Constructor of the class. - * \param[in] confFile - Configuration file name. - * \param[in] val_nZone - Total number of zones. - * \param[in] val_nDim - Total number of dimensions. - * \param[in] MPICommunicator - MPI communicator for SU2. - */ - CDiscAdjSinglezoneDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); - - /*! - * \brief Destructor of the class. - */ - ~CDiscAdjSinglezoneDriver(void) override; - - /*! - * \brief Preprocess the single-zone iteration - * \param[in] TimeIter - index of the current time-step. - */ - void Preprocess(unsigned long TimeIter) override; - - /*! - * \brief Run a single iteration of the discrete adjoint solver with a single zone. - */ - void Run(void) override; - - /*! - * \brief Postprocess the adjoint iteration for ZONE_0. - */ - void Postprocess(void) override; - /*! * \brief Record one iteration of a flow iteration in within multiple zones. * \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp) @@ -127,6 +93,39 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { * \brief gets Convergence on physical time scale, (deactivated in adjoint case) * \return false */ - inline bool GetTimeConvergence() const override {return false;}; + inline bool GetTimeConvergence() const override { return false; } +public: + + /*! + * \brief Constructor of the class. + * \param[in] confFile - Configuration file name. + * \param[in] val_nZone - Total number of zones. + * \param[in] val_nDim - Total number of dimensions. + * \param[in] MPICommunicator - MPI communicator for SU2. + */ + CDiscAdjSinglezoneDriver(char* confFile, + unsigned short val_nZone, + SU2_Comm MPICommunicator); + + /*! + * \brief Destructor of the class. + */ + ~CDiscAdjSinglezoneDriver(void) override; + + /*! + * \brief Preprocess the single-zone iteration + * \param[in] TimeIter - index of the current time-step. + */ + void Preprocess(unsigned long TimeIter) override; + + /*! + * \brief Run a single iteration of the discrete adjoint solver with a single zone. + */ + void Run(void) override; + + /*! + * \brief Postprocess the adjoint iteration for ZONE_0. + */ + void Postprocess(void) override; }; diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index d0772a6b5d3e..2cf991bb0b7b 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -106,7 +106,7 @@ class CDriver : public CDriverBase { protected: /*! - * \brief Initialize containers. + * \brief Initialize containers. */ void InitializeContainers(); @@ -154,6 +154,14 @@ class CDriver : public CDriverBase { */ void InitializeSolver(CConfig* config, CGeometry** geometry, CSolver***& solver); + /*! + * \brief Preprocess the inlets via file input for all solvers. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + */ + void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const; + /*! * \brief Restart of the solvers from the restart files. * \param[in] solver - Container vector with all the solutions. @@ -335,21 +343,6 @@ class CDriver : public CDriverBase { */ virtual void RelaxationTractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} - /*! - * \brief A virtual member to run a Block Gauss-Seidel iteration in multi-zone problems. - */ - virtual void RunGaussSeidel() {} - - /*! - * \brief A virtual member to run a Block-Jacobi iteration in multi-zone problems. - */ - virtual void RunJacobi() {} - - /*! - * \brief A virtual member. - */ - void Update() override {} - /*! * \brief Print out the direct residuals. * \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp) @@ -408,6 +401,21 @@ class CDriver : public CDriverBase { } } + /*! + * \brief Sum the number of primal or adjoint variables for all solvers in a given zone. + * \param[in] iZone - Index of the zone. + * \param[in] adjoint - True to consider adjoint solvers instead of primal. + * \return Total number of solution variables. + */ + unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const { + unsigned short nVar = 0; + for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) { + auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; + if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar(); + } + return nVar; + } + public: /*! * \brief Launch the computation for all zones and all physics. @@ -419,11 +427,6 @@ class CDriver : public CDriverBase { */ void Finalize() override; - /*! - * \brief A virtual member. - */ - virtual void ResetConvergence(); - /*! * \brief Perform some pre-processing before an iteration of the physics. */ @@ -446,10 +449,9 @@ class CDriver : public CDriverBase { virtual void DynamicMeshUpdate(unsigned long TimeIter) {} /*! - * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multi-grid - * structure. + * \brief Update the dual-time solution. */ - virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) {} + virtual void Update() {} /*! * \brief Perform a mesh deformation as initial condition. @@ -488,14 +490,6 @@ class CDriver : public CDriverBase { */ string GetSurfaceFileName() const; - /*! - * \brief Preprocess the inlets via file input for all solvers. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const; - /*! * \brief Set the position of the heat source. * \param[in] alpha - Angle of rotation respect to Z axis. @@ -513,21 +507,6 @@ class CDriver : public CDriverBase { void SetInletAngle(unsigned short iMarker, passivedouble alpha); /// \} - - /*! - * \brief Sum the number of primal or adjoint variables for all solvers in a given zone. - * \param[in] iZone - Index of the zone. - * \param[in] adjoint - True to consider adjoint solvers instead of primal. - * \return Total number of solution variables. - */ - unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const { - unsigned short nVar = 0; - for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) { - auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; - if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar(); - } - return nVar; - } }; /*! @@ -540,7 +519,6 @@ class CFluidDriver : public CDriver { protected: unsigned long Max_Iter; - protected: /*! * \brief Constructor of the class. * \param[in] confFile - Configuration file name. @@ -549,6 +527,11 @@ class CFluidDriver : public CDriver { */ CFluidDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); + /*! + * \brief Transfer data among different zones (multiple zone). + */ + void TransferData(unsigned short donorZone, unsigned short targetZone); + public: /*! * \brief Destructor of the class. @@ -590,11 +573,6 @@ class CFluidDriver : public CDriver { * structure (multiple zone). */ void DynamicMeshUpdate(unsigned long TimeIter) override; - - /*! - * \brief Transfer data among different zones (multiple zone). - */ - void TransferData(unsigned short donorZone, unsigned short targetZone); }; /*! @@ -607,6 +585,16 @@ class CTurbomachineryDriver : public CFluidDriver { private: COutputLegacy* output_legacy; + /*! + * \brief Set Mixing Plane interface within multiple zones. + */ + void SetMixingPlane(unsigned short iZone); + + /*! + * \brief Set Mixing Plane interface within multiple zones. + */ + void SetTurboPerformance(unsigned short targetZone); + public: /*! * \brief Constructor of the class. @@ -627,16 +615,6 @@ class CTurbomachineryDriver : public CFluidDriver { void Run() override; - /*! - * \brief Set Mixing Plane interface within multiple zones. - */ - void SetMixingPlane(unsigned short iZone); - - /*! - * \brief Set Mixing Plane interface within multiple zones. - */ - void SetTurboPerformance(unsigned short targetZone); - /*! * \brief Monitor the computation. */ @@ -655,25 +633,6 @@ class CHBDriver : public CFluidDriver { unsigned short nInstHB; su2double** D; /*!< \brief Harmonic Balance operator. */ - public: - /*! - * \brief Constructor of the class. - * \param[in] confFile - Configuration file name. - * \param[in] val_nZone - Total number of zones. - * \param[in] MPICommunicator - MPI communicator for SU2. - */ - CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); - - /*! - * \brief Destructor of the class. - */ - ~CHBDriver(void) override; - - /*! - * \brief Run a single iteration of a Harmonic Balance problem. - */ - void Run() override; - /*! * \brief Computation and storage of the Harmonic Balance method source terms. * \author T. Economon, K. Naik @@ -693,13 +652,27 @@ class CHBDriver : public CFluidDriver { */ void ComputeHBOperator(); + public: /*! - * \brief Update the solution for the Harmonic Balance. + * \brief Constructor of the class. + * \param[in] confFile - Configuration file name. + * \param[in] val_nZone - Total number of zones. + * \param[in] MPICommunicator - MPI communicator for SU2. */ - void Update() override; + CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); + + /*! + * \brief Destructor of the class. + */ + ~CHBDriver(void) override; + + /*! + * \brief Run a single iteration of a Harmonic Balance problem. + */ + void Run() override; /*! - * \brief Reset the convergence flag (set to false) of the solver for the Harmonic Balance. + * \brief Update the solution for the Harmonic Balance. */ - void ResetConvergence() override; + void Update() override; }; diff --git a/SU2_CFD/include/drivers/CDriverBase.hpp b/SU2_CFD/include/drivers/CDriverBase.hpp index 96595b365f59..4e79537a8298 100644 --- a/SU2_CFD/include/drivers/CDriverBase.hpp +++ b/SU2_CFD/include/drivers/CDriverBase.hpp @@ -92,26 +92,11 @@ class CDriverBase { */ virtual ~CDriverBase(void); - /*! - * \brief A virtual member. - */ - virtual void Preprocessing(){} - /*! * \brief A virtual member. */ virtual void Run(){} - /*! - * \brief A virtual member. - */ - virtual void Update(){} - - /*! - * \brief A virtual member. - */ - virtual void Output(){} - /*! * \brief A virtual member. */ diff --git a/SU2_CFD/include/drivers/CMultizoneDriver.hpp b/SU2_CFD/include/drivers/CMultizoneDriver.hpp index e1f9d05dd9a9..8106db28174a 100644 --- a/SU2_CFD/include/drivers/CMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CMultizoneDriver.hpp @@ -57,6 +57,43 @@ class CMultizoneDriver : public CDriver { bool *prefixed_motion; /*!< \brief Determines if a fixed motion is imposed in the config file. */ + /*! + * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. + */ + void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter); + + /*! + * \brief Use a corrector step to prevent convergence issues. + */ + void Corrector(unsigned short val_iZone); + + /*! + * \brief Run a Block Gauss-Seidel iteration in all physical zones. + */ + void RunGaussSeidel(); + + /*! + * \brief Run a Block-Jacobi iteration in all physical zones. + */ + void RunJacobi(); + + /*! + * \brief Routine to provide all the desired physical transfers between the different zones during one iteration. + * \return Boolean that determines whether the mesh needs to be updated for this particular transfer + */ + bool TransferData(unsigned short donorZone, unsigned short targetZone); + + /*! + * \brief Check the convergence at the outer level. + */ + bool OuterConvergence(unsigned long OuterIter); + + /*! + * \brief Returns whether all specified windowed-time-averaged ouputs have been converged + * \return Boolean indicating whether the problem is converged. + */ + virtual bool GetTimeConvergence() const; + public: /*! @@ -84,19 +121,6 @@ class CMultizoneDriver : public CDriver { */ void Preprocess(unsigned long TimeIter) override; - /*! - * \brief Use a corrector step to prevent convergence issues. - */ - void Corrector(unsigned short val_iZone); - - /*! - * \brief Run a Block Gauss-Seidel iteration in all physical zones. - */ - void RunGaussSeidel() override; - /*! - * \brief Run a Block-Jacobi iteration in all physical zones. - */ - void RunJacobi() override; /*! * \brief Update the dual-time solution within multiple zones. */ @@ -107,37 +131,15 @@ class CMultizoneDriver : public CDriver { */ void Output(unsigned long TimeIter) override; - /*! - * \brief Check the convergence at the outer level. - */ - bool OuterConvergence(unsigned long OuterIter); - /*! * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure (multiple zone). */ void DynamicMeshUpdate(unsigned long TimeIter) override; - /*! - * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. - */ - void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) override; - - /*! - * \brief Routine to provide all the desired physical transfers between the different zones during one iteration. - * \return Boolean that determines whether the mesh needs to be updated for this particular transfer - */ - bool TransferData(unsigned short donorZone, unsigned short targetZone); - /*! * \brief Check if simulation converged and return appropriate boolean. * \param[in] TimeIter - Current time iteration. * \return Boolean that indicates to stop the iteration loop. */ bool Monitor(unsigned long TimeIter) override; - - /*! - * \brief Returns whether all specified windowed-time-averaged ouputs have been converged - * \return Boolean indicating whether the problem is converged. - */ - virtual bool GetTimeConvergence() const; }; diff --git a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp index 8f7a11f9ba4d..07cc41c2d519 100644 --- a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp @@ -41,6 +41,12 @@ class CSinglezoneDriver : public CDriver { unsigned long TimeIter; + /*! + * \brief Returns whether all specified windowed-time-averaged ouputs have been converged + * \return Boolean indicating whether the problem is converged. + */ + virtual bool GetTimeConvergence() const; + public: /*! @@ -104,15 +110,4 @@ class CSinglezoneDriver : public CDriver { */ bool Monitor(unsigned long TimeIter) override; - /*! - * \brief Returns whether all specified windowed-time-averaged ouputs have been converged - * \return Boolean indicating whether the problem is converged. - */ - virtual bool GetTimeConvergence() const; - - /*! - * \brief Runtime_Parsing - */ - virtual void RuntimeOptions(); - }; diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index a8908178aafa..577d908c8d05 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -48,9 +48,6 @@ class CIntegration { protected: int rank, /*!< \brief MPI Rank. */ size; /*!< \brief MPI Size. */ - bool Convergence, /*!< \brief To indicate if the flow solver (direct, adjoint, or linearized) has converged or not. */ - Convergence_FSI, /*!< \brief To indicate if the FSI problem has converged or not. */ - Convergence_FullMG; /*!< \brief To indicate if the full multigrid has converged or not. */ /*! * \brief Do the space integration of the numerical system. @@ -88,41 +85,6 @@ class CIntegration { */ virtual ~CIntegration(void) = default; - /*! - * \brief Get the indicator of the convergence for the direct, adjoint and linearized problem. - * \return TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline bool GetConvergence(void) const { return Convergence; } - - /*! - * \brief Get the indicator of the convergence for the Fluid-Structure Interaction problem. - * \return TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline bool GetConvergence_FSI(void) const { return Convergence_FSI; } - - /*! - * \brief Set the indicator of the convergence. - * \param[in] value - TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline void SetConvergence(bool value) { Convergence = value; } - - /*! - * \brief Set the indicator of the convergence for FSI. - * \param[in] valueFSI - TRUE means that the convergence criteria for FSI is satisfied; - * otherwise FALSE. - */ - inline void SetConvergence_FSI(bool valueFSI) { Convergence_FSI = valueFSI; } - - /*! - * \brief Get the indicator of the convergence for the full multigrid problem. - * \return TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline bool GetConvergence_FullMG(void) const { return Convergence_FullMG; } - /*! * \brief Save the geometry at different time steps. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp index 65c37ad3c9b2..6bf38d45af0e 100644 --- a/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp @@ -94,25 +94,6 @@ class CDiscAdjFluidIteration final : public CIteration { void IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override; - /*! - * \brief Updates the containers for the discrete adjoint fluid system. - * \param[in] output - Pointer to the COutput class. - * \param[in] integration - Container vector with all the integration methods. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). - * \param[in] config - Definition of the particular problem. - * \param[in] surface_movement - Surface movement classes of the problem. - * \param[in] grid_movement - Volume grid movement classes of the problem. - * \param[in] FFDBox - FFD FFDBoxes of the problem. - * \param[in] val_iZone - Index of the zone. - * \param[in] val_iInst - Index of the instance - */ - void Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, - CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, - CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, - unsigned short val_iInst) override; - /*! * \brief Monitors the convergence and other metrics for the discrete adjoint fluid system. * \param[in] output - Pointer to the COutput class. diff --git a/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp index c5d0c0c2b02e..390c5ba6a54f 100644 --- a/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp @@ -88,25 +88,6 @@ class CDiscAdjHeatIteration final : public CIteration { void IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override; - /*! - * \brief Perform a single iteration of the adjoint heat problem. - * \param[in] output - Pointer to the COutput class. - * \param[in] integration - Container vector with all the integration methods. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). - * \param[in] config - Definition of the particular problem. - * \param[in] surface_movement - Surface movement classes of the problem. - * \param[in] grid_movement - Volume grid movement classes of the problem. - * \param[in] FFDBox - FFD FFDBoxes of the problem. - * \param[in] val_iZone - Index of the zone. - * \param[in] val_iInst - Index of the instance layer. - */ - void Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, - CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, - CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, - unsigned short val_iInst) override; - /*! * \brief Monitors the convergence and other metrics for the discrete adjoint heat problem. */ diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index fb788d47eb50..457162bf12ba 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1044,8 +1044,7 @@ void CDriver::InitializeSolver(CConfig* config, CGeometry** geometry, CSolver ** } -void CDriver::PreprocessInlet(CSolver ***solver, CGeometry **geometry, - CConfig *config) const { +void CDriver::PreprocessInlet(CSolver ***solver, CGeometry **geometry, CConfig *config) const { /*--- Adjust iteration number for unsteady restarts. ---*/ @@ -3018,7 +3017,7 @@ void CFluidDriver::Preprocess(unsigned long Iter) { void CFluidDriver::Run() { - unsigned short iZone, jZone, checkConvergence; + unsigned short iZone, jZone; unsigned long IntIter, nIntIter; bool unsteady; @@ -3070,15 +3069,7 @@ void CFluidDriver::Run() { config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } - /*--- Check convergence in each zone --*/ - - checkConvergence = 0; - for (iZone = 0; iZone < nZone; iZone++) - checkConvergence += (int) integration_container[iZone][INST_0][FLOW_SOL]->GetConvergence(); - - /*--- If convergence was reached in every zone --*/ - - if (checkConvergence == nZone) break; + /// TODO: Check convergence in each zone. } } @@ -3143,22 +3134,7 @@ bool CFluidDriver::Monitor(unsigned long ExtIter) { /*--- Check whether the current simulation has reached the specified convergence criteria, and set StopCalc to true, if so. ---*/ - switch (config_container[ZONE_0]->GetKind_Solver()) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::NEMO_EULER: case MAIN_SOLVER::NEMO_NAVIER_STOKES: - StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break; - case MAIN_SOLVER::HEAT_EQUATION: - StopCalc = integration_container[ZONE_0][INST_0][HEAT_SOL]->GetConvergence(); break; - case MAIN_SOLVER::FEM_ELASTICITY: - StopCalc = integration_container[ZONE_0][INST_0][FEA_SOL]->GetConvergence(); break; - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - case MAIN_SOLVER::DISC_ADJ_FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: - StopCalc = integration_container[ZONE_0][INST_0][ADJFLOW_SOL]->GetConvergence(); break; - default: - break; - } + /// TODO: Get convergence from the output class /*--- Set StopCalc to true if max. number of iterations has been reached ---*/ @@ -3401,25 +3377,10 @@ bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) { } } - /*--- Check whether the current simulation has reached the specified convergence criteria, and set StopCalc to true, if so. ---*/ - switch (config_container[ZONE_0]->GetKind_Solver()) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::NEMO_EULER: case MAIN_SOLVER::NEMO_NAVIER_STOKES: - StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); - break; - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - case MAIN_SOLVER::DISC_ADJ_FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: - StopCalc = integration_container[ZONE_0][INST_0][ADJFLOW_SOL]->GetConvergence(); - break; - default: - break; - - } + /// TODO: Get convergence from the output class /*--- Set StopCalc to true if max. number of iterations has been reached ---*/ @@ -3531,34 +3492,6 @@ void CHBDriver::Update() { } -void CHBDriver::ResetConvergence() { - - for(iInst = 0; iInst < nZone; iInst++) { - switch (config_container[ZONE_0]->GetKind_Solver()) { - - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - integration_container[ZONE_0][iInst][FLOW_SOL]->SetConvergence(false); - if (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::RANS) integration_container[ZONE_0][iInst][TURB_SOL]->SetConvergence(false); - if(config_container[ZONE_0]->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM) integration_container[ZONE_0][iInst][TRANS_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - integration_container[ZONE_0][iInst][FEA_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - integration_container[ZONE_0][iInst][ADJFLOW_SOL]->SetConvergence(false); - if( (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS) ) - integration_container[ZONE_0][iInst][ADJTURB_SOL]->SetConvergence(false); - break; - - default: - SU2_MPI::Error("Harmonic Balance has not been set up for this solver.", CURRENT_FUNCTION); - } - } - -} - void CHBDriver::SetHarmonicBalance(unsigned short iInst) { unsigned short iVar, jInst, iMGlevel; diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index a1de120c8a8e..4bd72f6752fd 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -443,13 +443,6 @@ void CMultizoneDriver::Update() { iteration_container[iZone][INST_0]->Update(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); - - /*--- Set the Convergence_FSI boolean to false for the next time step ---*/ - for (unsigned short iSol = 0; iSol < MAX_SOLS-1; iSol++){ - if (integration_container[iZone][INST_0][iSol] != nullptr){ - integration_container[iZone][INST_0][iSol]->SetConvergence_FSI(false); - } - } } } @@ -611,9 +604,9 @@ bool CMultizoneDriver::Monitor(unsigned long TimeIter){ const bool MaxIterationsReached = (OuterIter+1 >= nOuterIter); if ((MaxIterationsReached || InnerConvergence) && (rank == MASTER_NODE)) { - cout << endl << "----------------------------- Solver Exit -------------------------------" << endl; + cout << "\n----------------------------- Solver Exit -------------------------------" << endl; if (InnerConvergence) cout << "All convergence criteria satisfied." << endl; - else cout << endl << "Maximum number of iterations reached (OUTER_ITER = " << OuterIter+1 << ") before convergence." << endl; + else cout << "\nMaximum number of iterations reached (OUTER_ITER = " << OuterIter+1 << ") before convergence." << endl; driver_output->PrintConvergenceSummary(); cout << "-------------------------------------------------------------------------" << endl; } @@ -633,10 +626,10 @@ bool CMultizoneDriver::Monitor(unsigned long TimeIter){ const bool MaxIterationsReached = (TimeIter+1 >= nTimeIter); if ((TimeConvergence || FinalTimeReached || MaxIterationsReached) && (rank == MASTER_NODE)){ - cout << endl << "----------------------------- Solver Exit -------------------------------"; - if (TimeConvergence) cout << endl << "All windowed time-averaged convergence criteria are fullfilled." << endl; - if (FinalTimeReached) cout << endl << "Maximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; - else cout << endl << "Maximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; + cout << "\n----------------------------- Solver Exit -------------------------------"; + if (TimeConvergence) cout << "\nAll windowed time-averaged convergence criteria are fullfilled." << endl; + if (FinalTimeReached) cout << "\nMaximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; + else cout << "\nMaximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; cout << "-------------------------------------------------------------------------" << endl; } @@ -646,5 +639,5 @@ bool CMultizoneDriver::Monitor(unsigned long TimeIter){ } bool CMultizoneDriver::GetTimeConvergence() const{ - return output_container[ZONE_0]->GetCauchyCorrectedTimeConvergence(config_container[ZONE_0]); + return output_container[ZONE_0]->GetCauchyCorrectedTimeConvergence(config_container[ZONE_0]); } diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index 8289409a44f0..73668884259f 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -112,10 +112,6 @@ void CSinglezoneDriver::StartSolver() { void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { - /*--- Set runtime option ---*/ - - RuntimeOptions(); - /*--- Set the current time iteration in the config ---*/ config_container[ZONE_0]->SetTimeIter(TimeIter); @@ -262,13 +258,13 @@ bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ if (TimeDomain == NO){ - InnerConvergence = output_container[ZONE_0]->GetConvergence(); + InnerConvergence = output_container[ZONE_0]->GetConvergence(); MaxIterationsReached = InnerIter+1 >= nInnerIter; if ((MaxIterationsReached || InnerConvergence) && (rank == MASTER_NODE)) { - cout << endl << "----------------------------- Solver Exit -------------------------------" << endl; + cout << "\n----------------------------- Solver Exit -------------------------------" << endl; if (InnerConvergence) cout << "All convergence criteria satisfied." << endl; - else cout << endl << "Maximum number of iterations reached (ITER = " << nInnerIter << ") before convergence." << endl; + else cout << "\nMaximum number of iterations reached (ITER = " << nInnerIter << ") before convergence." << endl; output_container[ZONE_0]->PrintConvergenceSummary(); cout << "-------------------------------------------------------------------------" << endl; } @@ -276,25 +272,23 @@ bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ StopCalc = MaxIterationsReached || InnerConvergence; } - - if (TimeDomain == YES) { /*--- Check whether the outer time integration has reached the final time ---*/ TimeConvergence = GetTimeConvergence(); - FinalTimeReached = CurTime >= MaxTime; + FinalTimeReached = CurTime >= MaxTime; MaxIterationsReached = TimeIter+1 >= nTimeIter; if ((FinalTimeReached || MaxIterationsReached || TimeConvergence) && (rank == MASTER_NODE)){ - cout << endl << "----------------------------- Solver Exit -------------------------------"; - if (TimeConvergence) cout << endl << "All windowed time-averaged convergence criteria are fullfilled." << endl; - if (FinalTimeReached) cout << endl << "Maximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; - if (MaxIterationsReached) cout << endl << "Maximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; + cout << "\n----------------------------- Solver Exit -------------------------------"; + if (TimeConvergence) cout << "\nAll windowed time-averaged convergence criteria are fullfilled." << endl; + if (FinalTimeReached) cout << "\nMaximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; + if (MaxIterationsReached) cout << "\nMaximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; cout << "-------------------------------------------------------------------------" << endl; } - StopCalc = FinalTimeReached || MaxIterationsReached|| TimeConvergence; + StopCalc = FinalTimeReached || MaxIterationsReached || TimeConvergence; } /*--- Reset the inner convergence --- */ @@ -308,23 +302,6 @@ bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ return StopCalc; } -void CSinglezoneDriver::RuntimeOptions(){ - - ifstream runtime_configfile; - - /*--- Try to open the runtime config file ---*/ - - runtime_configfile.open(runtime_file_name, ios::in); - - /*--- If succeeded create a temporary config object ---*/ - - if (runtime_configfile.good()){ - CConfig *runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); - delete runtime; - } - -} - bool CSinglezoneDriver::GetTimeConvergence() const{ return output_container[ZONE_0]->GetCauchyCorrectedTimeConvergence(config_container[ZONE_0]); } diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 347e5b4a4b33..1da64f36a322 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -32,9 +32,6 @@ CIntegration::CIntegration() { rank = SU2_MPI::GetRank(); size = SU2_MPI::GetSize(); - Convergence = false; - Convergence_FSI = false; - Convergence_FullMG = false; } void CIntegration::Space_Integration(CGeometry *geometry, diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 36c75cb525f8..c3b8df8401be 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -83,6 +83,9 @@ void CMultiGridIntegration::MultiGrid_Iteration(CGeometry ****geometry, unsigned short FinestMesh = config[iZone]->GetFinestMesh(); + /// TODO: This was always false. + const bool Convergence_FullMG = false; + if (!config[iZone]->GetRestart() && FullMG && direct && ( Convergence_FullMG && (FinestMesh != MESH_0 ))) { SetProlongated_Solution(RunTime_EqSystem, diff --git a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp index 282223b46adf..c3c0cce8a02e 100644 --- a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp @@ -162,17 +162,13 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - su2double Physical_dt, Physical_t; - unsigned short iMesh; - unsigned long TimeIter = config[ZONE_0]->GetTimeIter(); - /*--- Dual time stepping strategy ---*/ if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { /*--- Update dual time solver ---*/ - for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { + for (unsigned short iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetDualTime_Solver( geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][ADJFLOW_SOL], config[val_iZone], iMesh); @@ -180,13 +176,6 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetDualTime_Geometry( geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], iMesh); - - integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(false); } - - Physical_dt = config[val_iZone]->GetDelta_UnstTime(); - Physical_t = (TimeIter + 1) * Physical_dt; - if (Physical_t >= config[val_iZone]->GetTotal_UnstTime()) - integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(true); } } diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 34cc6a94e7c4..6e10e9df4fca 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -609,20 +609,6 @@ void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** g END_SU2_OMP_PARALLEL } -void CDiscAdjFluidIteration::Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, - CSolver***** solver, CNumerics****** numerics, CConfig** config, - CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, - CFreeFormDefBox*** FFDBox, unsigned short iZone, unsigned short iInst) { - /*--- Dual time stepping strategy ---*/ - - if ((config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { - for (unsigned short iMesh = 0; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - integration[iZone][iInst][ADJFLOW_SOL]->SetConvergence(false); - } - } -} - bool CDiscAdjFluidIteration::Monitor(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, diff --git a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp index 572ea54c49e2..a12cb43bdc07 100644 --- a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp @@ -232,21 +232,6 @@ void CDiscAdjHeatIteration::RegisterOutput(CSolver***** solver, CGeometry**** ge solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); } -void CDiscAdjHeatIteration::Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, - CSolver***** solver, CNumerics****** numerics, CConfig** config, - CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, - CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - - /*--- Dual time stepping strategy ---*/ - - if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { - integration[val_iZone][val_iInst][ADJHEAT_SOL]->SetConvergence(false); - } - } -} - bool CDiscAdjHeatIteration::Monitor(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, diff --git a/SU2_CFD/src/iteration/CFEAIteration.cpp b/SU2_CFD/src/iteration/CFEAIteration.cpp index 45ded06c7eed..c827f28467e2 100644 --- a/SU2_CFD/src/iteration/CFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CFEAIteration.cpp @@ -48,9 +48,6 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom CIntegration* feaIntegration = integration[val_iZone][val_iInst][FEA_SOL]; CSolver* feaSolver = solver[val_iZone][val_iInst][MESH_0][FEA_SOL]; - /*--- Set the convergence monitor to false, to prevent the solver to stop in intermediate FSI subiterations ---*/ - feaIntegration->SetConvergence(false); - /*--- FEA equations ---*/ config[val_iZone]->SetGlobalParam(MAIN_SOLVER::FEM_ELASTICITY, RUNTIME_FEA_SYS); @@ -187,7 +184,6 @@ void CFEAIteration::Update(COutput* output, CIntegration**** integration, CGeome CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - const auto TimeIter = config[val_iZone]->GetTimeIter(); const bool dynamic = (config[val_iZone]->GetTime_Domain()); const bool fsi = config[val_iZone]->GetFSI_Simulation(); @@ -199,14 +195,6 @@ void CFEAIteration::Update(COutput* output, CIntegration**** integration, CGeome integration[val_iZone][val_iInst][FEA_SOL]->SetDualTime_Solver( geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); - - /*--- Verify convergence criteria (based on total time) ---*/ - - const su2double Physical_dt = config[val_iZone]->GetDelta_DynTime(); - const su2double Physical_t = (TimeIter + 1) * Physical_dt; - if (Physical_t >= config[val_iZone]->GetTotal_DynTime()) - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(true); } else if (fsi) { /*--- For FSI problems, output the relaxed result, which is the one transferred into the fluid domain (for restart @@ -272,7 +260,4 @@ void CFEAIteration::Solve(COutput* output, CIntegration**** integration, CGeomet if (multizone && !config[val_iZone]->GetTime_Domain()) { Output(output, geometry, solver, config, config[val_iZone]->GetOuterIter(), false, val_iZone, val_iInst); } - - /*--- Set the structural convergence to false (to make sure outer subiterations converge) ---*/ - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); } diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index db2192f64422..7d2fa63b74fe 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -171,8 +171,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][FLOW_SOL]->SetDualTime_Geometry(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], iMesh); - - integration[val_iZone][val_iInst][FLOW_SOL]->SetConvergence(false); } SetDualTime_Aeroelastic(config[val_iZone]); @@ -185,7 +183,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][TURB_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][TURB_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][TURB_SOL]->SetConvergence(false); } /*--- Update dual time solver for the transition model ---*/ @@ -194,7 +191,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][TRANS_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][TRANS_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][TRANS_SOL]->SetConvergence(false); } /*--- Update dual time solver for the weakly coupled energy equation ---*/ @@ -203,7 +199,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][HEAT_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(false); } } } @@ -296,15 +291,6 @@ void CFluidIteration::Solve(COutput* output, CIntegration**** integration, CGeom if (multizone && steady) { Output(output, geometry, solver, config, config[val_iZone]->GetOuterIter(), StopCalc, val_iZone, val_iInst); - - /*--- Set the convergence to false (to make sure outer subiterations converge) ---*/ - - if (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::HEAT_EQUATION) { - integration[val_iZone][INST_0][HEAT_SOL]->SetConvergence(false); - } - else { - integration[val_iZone][INST_0][FLOW_SOL]->SetConvergence(false); - } } } diff --git a/SU2_CFD/src/iteration/CHeatIteration.cpp b/SU2_CFD/src/iteration/CHeatIteration.cpp index e90bcde5144f..45c8d6f8e68d 100644 --- a/SU2_CFD/src/iteration/CHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CHeatIteration.cpp @@ -58,8 +58,6 @@ void CHeatIteration::Update(COutput* output, CIntegration**** integration, CGeom integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Geometry(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], iMesh); - - integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(false); } } } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 1d7bfb5bb673..3626baaae5a3 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -101,49 +101,6 @@ void CDriver::SetInletAngle(unsigned short iMarker, passivedouble alpha) { /* Functions related to simulation control, high level functions (reset convergence, set initial mesh, etc.) */ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CDriver::ResetConvergence() { - for (auto iZone = 0u; iZone < nZone; iZone++) { - switch (main_config->GetKind_Solver()) { - case MAIN_SOLVER::EULER: - case MAIN_SOLVER::NAVIER_STOKES: - case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: - case MAIN_SOLVER::INC_NAVIER_STOKES: - case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::NEMO_EULER: - case MAIN_SOLVER::NEMO_NAVIER_STOKES: - integration_container[iZone][INST_0][FLOW_SOL]->SetConvergence(false); - if (config_container[iZone]->GetKind_Solver() == MAIN_SOLVER::RANS) - integration_container[iZone][INST_0][TURB_SOL]->SetConvergence(false); - if (config_container[iZone]->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM) - integration_container[iZone][INST_0][TRANS_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - integration_container[iZone][INST_0][FEA_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::ADJ_EULER: - case MAIN_SOLVER::ADJ_NAVIER_STOKES: - case MAIN_SOLVER::ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_EULER: - case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: - case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_INC_RANS: - integration_container[iZone][INST_0][ADJFLOW_SOL]->SetConvergence(false); - if ((config_container[iZone]->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || - (config_container[iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS)) - integration_container[iZone][INST_0][ADJTURB_SOL]->SetConvergence(false); - break; - - default: - break; - } - } -} - void CSinglezoneDriver::SetInitialMesh() { DynamicMeshUpdate(0); diff --git a/SU2_DEF/include/drivers/CDeformationDriver.hpp b/SU2_DEF/include/drivers/CDeformationDriver.hpp index 24d640e30fb5..cfdd8830d88d 100644 --- a/SU2_DEF/include/drivers/CDeformationDriver.hpp +++ b/SU2_DEF/include/drivers/CDeformationDriver.hpp @@ -48,30 +48,15 @@ class CDeformationDriver : public CDriverBase { */ CDeformationDriver(char* confFile, SU2_Comm MPICommunicator); - /*! - * \brief Preprocess the driver data. - */ - void Preprocess(); - /*! * \brief Launch the driver computation. */ - void Run(); - - /*! - * \brief Output the mesh. - */ - void Output(); + void Run() override; /*! * \brief Deallocation routine. */ - void Finalize(); - - /*! - * \brief Communicate boundary mesh displacements. - */ - void CommunicateMeshDisplacements(void); + void Finalize() override; protected: /*! @@ -99,13 +84,18 @@ class CDeformationDriver : public CDriverBase { */ void InitializeNumerics(); + /*! + * \brief Output the mesh. + */ + void OutputFiles(); + /*! * \brief Mesh deformation based on linear elasticity solver (CMeshSolver). */ - void Update(); + void DeformMesh(); /*! * \brief Mesh deformation based on legacy implementation. */ - void Update_Legacy(); + void DeformLegacy(); }; diff --git a/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp b/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp index 55c3140348cc..93bf81a55c56 100644 --- a/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp +++ b/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp @@ -52,12 +52,12 @@ class CDiscAdjDeformationDriver : public CDriverBase { /*! * \brief Launch the driver computation. */ - void Run(); + void Run() override; /*! * \brief Deallocation routine. */ - void Finalize(); + void Finalize() override; protected: /*! diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index 504e80d9a87b..ccf25daf49e5 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -53,10 +53,6 @@ int main(int argc, char* argv[]) { CDeformationDriver driver(config_file_name, comm); - /*--- Preprocess the solver data. ---*/ - - driver.Preprocess(); - /*--- Launch the main external loop of the solver. ---*/ driver.Run(); diff --git a/SU2_DEF/src/drivers/CDeformationDriver.cpp b/SU2_DEF/src/drivers/CDeformationDriver.cpp index 7f40c2d8c9ce..914eae2f1c23 100644 --- a/SU2_DEF/src/drivers/CDeformationDriver.cpp +++ b/SU2_DEF/src/drivers/CDeformationDriver.cpp @@ -161,7 +161,7 @@ void CDeformationDriver::InitializeGeometry() { /*--- Computational grid preprocessing. ---*/ if (rank == MASTER_NODE) - cout << endl << "----------------------- Preprocessing computations ----------------------" << endl; + cout << "\n----------------------- Preprocessing computations ----------------------" << endl; /*--- Compute elements surrounding points, points surrounding points. ---*/ @@ -259,8 +259,6 @@ void CDeformationDriver::InitializeNumerics() { } } -void CDeformationDriver::Preprocess() {} - void CDeformationDriver::Run() { /* --- Start measuring computation time. ---*/ @@ -268,7 +266,7 @@ void CDeformationDriver::Run() { /*--- Surface grid deformation using design variables. ---*/ - Update(); + DeformMesh(); /*--- Synchronization point after a single solver iteration. Compute the wall clock time required. ---*/ @@ -286,11 +284,11 @@ void CDeformationDriver::Run() { /*--- Output the deformed mesh. ---*/ - Output(); + OutputFiles(); } -void CDeformationDriver::Update() { - if (!driver_config->GetDeform_Mesh()) return Update_Legacy(); +void CDeformationDriver::DeformMesh() { + if (!driver_config->GetDeform_Mesh()) return DeformLegacy(); for (iZone = 0; iZone < nZone; iZone++) { /*--- Set the stiffness of each element mesh into the mesh numerics. ---*/ @@ -309,7 +307,7 @@ void CDeformationDriver::Update() { } } -void CDeformationDriver::Update_Legacy() { +void CDeformationDriver::DeformLegacy() { for (iZone = 0; iZone < nZone; iZone++) { if (config_container[iZone]->GetDesign_Variable(0) != NO_DEFORMATION) { unsigned short nInst_Zone = nInst[iZone]; @@ -471,7 +469,7 @@ void CDeformationDriver::Update_Legacy() { } } -void CDeformationDriver::Output() { +void CDeformationDriver::OutputFiles() { /*--- Output deformed grid for visualization, if requested (surface and volumetric), in parallel requires to move all the data to the master node. ---*/ @@ -567,10 +565,3 @@ void CDeformationDriver::Finalize() { if (rank == MASTER_NODE) cout << "\n------------------------- Exit Success (SU2_DEF) ------------------------" << endl << endl; } - -void CDeformationDriver::CommunicateMeshDisplacements(void) { - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->InitiateComms(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], MESH_DISPLACEMENTS); - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->CompleteComms(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], MESH_DISPLACEMENTS); -} diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index fa58b5f901de..176f26c394f4 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -2660,7 +2660,6 @@ def UnsteadyFSI(self, FSI_config, FluidSolver, SolidSolver): ) self.MPIBarrier() if myid in self.fluidSolverProcessors: - FluidSolver.ResetConvergence() FluidSolver.Run() self.MPIBarrier() FluidSolver.Postprocess() @@ -2777,7 +2776,6 @@ def SteadyFSI(self, FSI_config, FluidSolver, SolidSolver): # --- Fluid solver call for FSI subiteration ---# if myid in self.fluidSolverProcessors: - FluidSolver.ResetConvergence() # This is setting to zero the convergence in the integrator, important to reset it. # The mesh will be deformed in the context of the preprocessor, there is no need to set the initial # mesh pushing back the solution to avoid spurious velocities, as the velocity is not computed at all self.MPIPrint("\nPerforming static mesh deformation...\n")